centos7上怎么安装oracle
2个回答
2016-01-09 · 做真实的自己 用良心做教育
千锋教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
关注
展开全部
CentOS 7 的环境为
$ uname -a
Linux oracle 3.10.0-123.13.1.el7.x86_64 #1 SMP Tue Dec 9 23:06:09 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
注意安装的时候需要安装一个桌面系统(X-Windows + KDE 或者 Gnome),否则安装程序无法运行。
然后根据需要修改共享内存等等系统参数。这个也不写了,网上有很多。不过据我的测试,CentOS7貌似不需要修改也是可以的,Oracle在进行安装检查的时候没有报告问题(和以前的不一样)。当然为了调优数据库的性能,还是修改的好。
安装gcc,因为后面Oracle link的时候会用到
yum install gcc
安装结果为
[plain] view plaincopy
gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(这里注意,因为Oracle需要的3.4和安装的4.8的参数的区别,后面link会失败,解决方法见后)
1. 下载,需要下载两个文件
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
2. 解压缩,把这两个文件解压到同一个目录下
3. 运行installer。中间依赖检查那一步,可以Skip。因为Oracle要检查是否安装了gcc,glibc等等比较老的版本(3.4)
4. 前面一切顺利。到了Link那一步,出错了。Log显示
error in invoking target 'agent nmhs'
在网上查到了解决方案:
[plain] view plaincopy
vi $ORACLE_HOME/sysman/lib/ins_emagent.mk
Search for the line
$(MK_EMAGENT_NMECTL)
Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11
5. Retry重试。这就OK了。
6. 之后就没啥问题了。正常安装,执行root脚本,等等。
7. 安装后重启服务器。
8. 重启后,检查oracle用户的环境变量:
[plain] view plaincopy
declare -x ORACLE_HOME="/home/oracle/app/oracle/product/11.2.0/dbhome_1"
declare -x ORACLE_SID="orcl"
9. 进入$ORACLE_HOME/network/admin,检查listener.ora:
[plain] view plaincopy
[oracle@oracle admin]$ cat listener.ora
# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.33.212)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /home/oracle/app/oracle
重点检查其中的SID,HOST,PORT,ORACLE_HOME是否正确。如果不正确客户端会报告ERROR-ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务 错误。
如果没有问题,进入$ORACLE_HOME/bin,启动监听器:
[plain] view plaincopy
[oracle@oracle bin]$ ./lsnrctl
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 16-DEC-2014 11:22:03
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
[plain] view plaincopy
LSNRCTL> start
Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.16.33.212)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.16.33.212)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 16-DEC-2014 11:22:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.16.33.212)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
启动正常,使用sqlplus启动数据库:
[plain] view plaincopy
[oracle@oracle bin]$ ./sqlplus '/ as sysdba'
SQL> startup
ORACLE instance started.
Total System Global Area 960372736 bytes
Fixed Size 2234160 bytes
Variable Size 557844688 bytes
Database Buffers 394264576 bytes
Redo Buffers 6029312 bytes
Database mounted.
Database opened.
10. Centos7自带了SELINUX,关掉
11. Centos7自带了下一代防火墙firewalld,关掉,否则客户端连接过来会报TNS Timeout异常
[plain] view plaincopy
[root@oracle ~]# service firewalld stop
Redirecting to /bin/systemctl stop firewalld.service
现在其它机器就应该可以正常连接并使用Oracle了。
另:装Oracle最省事的还是在Oracle自己的Enterprise Linux上安装。那些依赖,系统参数,等等等都不需要设置了。
$ uname -a
Linux oracle 3.10.0-123.13.1.el7.x86_64 #1 SMP Tue Dec 9 23:06:09 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
注意安装的时候需要安装一个桌面系统(X-Windows + KDE 或者 Gnome),否则安装程序无法运行。
然后根据需要修改共享内存等等系统参数。这个也不写了,网上有很多。不过据我的测试,CentOS7貌似不需要修改也是可以的,Oracle在进行安装检查的时候没有报告问题(和以前的不一样)。当然为了调优数据库的性能,还是修改的好。
安装gcc,因为后面Oracle link的时候会用到
yum install gcc
安装结果为
[plain] view plaincopy
gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(这里注意,因为Oracle需要的3.4和安装的4.8的参数的区别,后面link会失败,解决方法见后)
1. 下载,需要下载两个文件
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
2. 解压缩,把这两个文件解压到同一个目录下
3. 运行installer。中间依赖检查那一步,可以Skip。因为Oracle要检查是否安装了gcc,glibc等等比较老的版本(3.4)
4. 前面一切顺利。到了Link那一步,出错了。Log显示
error in invoking target 'agent nmhs'
在网上查到了解决方案:
[plain] view plaincopy
vi $ORACLE_HOME/sysman/lib/ins_emagent.mk
Search for the line
$(MK_EMAGENT_NMECTL)
Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11
5. Retry重试。这就OK了。
6. 之后就没啥问题了。正常安装,执行root脚本,等等。
7. 安装后重启服务器。
8. 重启后,检查oracle用户的环境变量:
[plain] view plaincopy
declare -x ORACLE_HOME="/home/oracle/app/oracle/product/11.2.0/dbhome_1"
declare -x ORACLE_SID="orcl"
9. 进入$ORACLE_HOME/network/admin,检查listener.ora:
[plain] view plaincopy
[oracle@oracle admin]$ cat listener.ora
# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.33.212)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /home/oracle/app/oracle
重点检查其中的SID,HOST,PORT,ORACLE_HOME是否正确。如果不正确客户端会报告ERROR-ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务 错误。
如果没有问题,进入$ORACLE_HOME/bin,启动监听器:
[plain] view plaincopy
[oracle@oracle bin]$ ./lsnrctl
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 16-DEC-2014 11:22:03
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
[plain] view plaincopy
LSNRCTL> start
Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.16.33.212)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.16.33.212)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 16-DEC-2014 11:22:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.16.33.212)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
启动正常,使用sqlplus启动数据库:
[plain] view plaincopy
[oracle@oracle bin]$ ./sqlplus '/ as sysdba'
SQL> startup
ORACLE instance started.
Total System Global Area 960372736 bytes
Fixed Size 2234160 bytes
Variable Size 557844688 bytes
Database Buffers 394264576 bytes
Redo Buffers 6029312 bytes
Database mounted.
Database opened.
10. Centos7自带了SELINUX,关掉
11. Centos7自带了下一代防火墙firewalld,关掉,否则客户端连接过来会报TNS Timeout异常
[plain] view plaincopy
[root@oracle ~]# service firewalld stop
Redirecting to /bin/systemctl stop firewalld.service
现在其它机器就应该可以正常连接并使用Oracle了。
另:装Oracle最省事的还是在Oracle自己的Enterprise Linux上安装。那些依赖,系统参数,等等等都不需要设置了。
推荐于2016-10-15
展开全部
安装 jdk
1.下载 jdk-7u65-linux-x64.rpm
2. su 切换到 root 权限
3. rpm -ivh jdk-7u65-linux-x64.rpm,默认安装路径为 /usr/java/jdk1.7.0_65
4. vi /etc/profile
5. 在 profile 最后追加:
export JAVA_HOME=/usr/java/jdk1.7.0_65
export
CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
注意中间的链接符号是冒号不是分号!
6. source /etc/profile
7. 安装 update-alternatives
update-alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_65/bin/java 60
配置 jdk
update-alternatives --config java
1.下载 jdk-7u65-linux-x64.rpm
2. su 切换到 root 权限
3. rpm -ivh jdk-7u65-linux-x64.rpm,默认安装路径为 /usr/java/jdk1.7.0_65
4. vi /etc/profile
5. 在 profile 最后追加:
export JAVA_HOME=/usr/java/jdk1.7.0_65
export
CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
注意中间的链接符号是冒号不是分号!
6. source /etc/profile
7. 安装 update-alternatives
update-alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_65/bin/java 60
配置 jdk
update-alternatives --config java
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询