CentOS 7上启动Oracle 11.2.0.3

来源:互联网 发布:路老膏方 诈骗让网络 编辑:程序博客网 时间:2024/06/06 17:43

1.正常安装Oracle 11,执行root脚本,等等。

2. 安装后重启服务器。

3. 重启后,用 su - oracle   命令后,检查oracle用户的环境变量:

[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. declare -x ORACLE_HOME="/home/oracle/app/oracle/product/11.2.0/dbhome_1"  
  2. declare -x ORACLE_SID="orcl"  
4. 进入 cd $ORACLE_HOME/network/admin,检查listener.ora:


[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. [oracle@oracle admin]$ cat listener.ora   
  2. # listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora  
  3. # Generated by Oracle configuration tools.  
  4.   
  5. SID_LIST_LISTENER =   
  6. (SID_LIST =   
  7.   (SID_DESC =   
  8.     (SID_NAME = orcl)      
  9.     (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)   
  10.   )   
  11. )  
  12.   
  13. LISTENER =  
  14.   (DESCRIPTION_LIST =  
  15.     (DESCRIPTION =  
  16.       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.33.212)(PORT = 1521))  
  17.     )  
  18.   )  
  19.   
  20. ADR_BASE_LISTENER = /home/oracle/app/oracle  

重点检查其中的SID,HOST,PORT,ORACLE_HOME是否正确。如果不正确客户端会报告ERROR-ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务 错误。

如果没有问题,进入$ORACLE_HOME/bin,启动监听器:

[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. [oracle@oracle bin]$ ./lsnrctl  
  2.   
  3. LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 16-DEC-2014 11:22:03  
  4.   
  5. Copyright (c) 1991, 2011, Oracle.  All rights reserved.  
  6.   
  7. Welcome to LSNRCTL, type "help" for information.  
[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. LSNRCTL> start  
  2. Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...  
  3.   
  4.   
  5. TNSLSNR for Linux: Version 11.2.0.3.0 - Production  
  6. System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora  
  7. Log messages written to /home/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml  
  8. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.16.33.212)(PORT=1521)))  
  9.   
  10.   
  11. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.16.33.212)(PORT=1521)))  
  12. STATUS of the LISTENER  
  13. ------------------------  
  14. Alias                     LISTENER  
  15. Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production  
  16. Start Date                16-DEC-2014 11:22:07  
  17. Uptime                    0 days 0 hr. 0 min. 0 sec  
  18. Trace Level               off  
  19. Security                  ON: Local OS Authentication  
  20. SNMP                      OFF  
  21. Listener Parameter File   /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora  
  22. Listener Log File         /home/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml  
  23. Listening Endpoints Summary...  
  24.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.16.33.212)(PORT=1521)))  
  25. Services Summary...  
  26. Service "orcl" has 1 instance(s).  
  27.   Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...  
  28. The command completed successfully  
  29. LSNRCTL>   
启动正常,使用sqlplus启动数据库:

[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. [oracle@oracle bin]$ ./sqlplus '/ as sysdba'  
  2. SQL> startup  
  3. ORACLE instance started.  
  4.   
  5.   
  6. Total System Global Area  960372736 bytes  
  7. Fixed Size                  2234160 bytes  
  8. Variable Size             557844688 bytes  
  9. Database Buffers          394264576 bytes  
  10. Redo Buffers                6029312 bytes  
  11. Database mounted.  
  12. Database opened.  

5. Centos7自带了SELINUX,关掉

6. Centos7自带了下一代防火墙firewalld,关掉,否则客户端连接过来会报TNS Timeout异常

[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. [root@oracle ~]# service firewalld stop  
  2. Redirecting to /bin/systemctl stop  firewalld.service  


===============================================

现在其它机器就应该可以正常连接并使用Oracle了。

另:装Oracle最省事的还是在Oracle自己的Enterprise Linux上安装。那些依赖,系统参数,等等等都不需要设置了。


0 0
原创粉丝点击