CentOS 7上啟動Oracle 11.2.0.3
阿新 • • 發佈:2019-01-08
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"
- [[email protected] 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,啟動監聽器:
- [[email protected] 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>
- [[email protected] 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異常
- [[email protected] ~]# service firewalld stop
- Redirecting to /bin/systemctl stop firewalld.service
===============================================
現在其它機器就應該可以正常連線並使用Oracle了。
另:裝Oracle最省事的還是在Oracle自己的Enterprise Linux上安裝。那些依賴,系統引數,等等等都不需要設定了。