1.正常安装Oracle 11,执行root脚本,等等。
2. 安装后重启服务器。
3. 重启后,用 su - oracle 命令后,检查oracle用户的环境变量:
- declare -x ORACLE_HOME="/home/oracle/app/oracle/product/11.2.0/dbhome_1"
- declare -x ORACLE_SID="orcl"
- [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,启动监听器:
- [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.
- 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>
- [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.
5. Centos7自带了SELINUX,关掉
6. Centos7自带了下一代防火墙firewalld,关掉,否则客户端连接过来会报TNS Timeout异常
- [root@oracle ~]# service firewalld stop
- Redirecting to /bin/systemctl stop firewalld.service
===============================================
现在其它机器就应该可以正常连接并使用Oracle了。
另:装Oracle最省事的还是在Oracle自己的Enterprise Linux上安装。那些依赖,系统参数,等等等都不需要设置了。