RHEL裝完oracle 11g後遇到的問題

來源:互聯網
上載者:User

1.運行sqlplus,提示

  1. sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

這個問題是由於SELINUX引起的。 解決辦法:

編輯/etc/sysconfig/selinux設定檔, 把SELINUX=enforcing 改為 SELINUX=disabled。

  1. # This file controls the state of SELinux on the system.
  2. # SELINUX= can take one of these three values:
  3. # enforcing - SELinux security policy is enforced.
  4. # permissive - SELinux prints warnings instead of enforcing.
  5. # disabled - SELinux is fully disabled.
  6.  
  7. #SELINUX=enforcing
  8. SELINUX=disabled
  9.  
  10. # SELINUXTYPE= type of policy in use. Possible values are:
  11. # targeted - Only targeted network daemons are protected.
  12. # strict - Full SELinux protection.
  13. SELINUXTYPE=targeted

儲存後重啟系統。

2.用sqlplus,輸入使用者名稱密碼後,提示:

  1. Enter user-name: system
  2. Enter password:
  3. ERROR:
  4. ORA-01034: ORACLE not available
  5. ORA-27101: shared memory realm does not exist
  6. Linux Error: 2: No such file or directory
  7. Process ID: 0
  8. Session ID: 0 Serial number: 0

原因竟然是oracle沒有啟動成功,用sqlplus '/as sysdba'命令,然後輸入startup來啟動oracle,但發現啟動oracle時報錯:

  1. [oracle@localhost dbs]$ sqlplus '/as sysdba'
  2.  
  3. SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 25 14:49:49 2012
  4.  
  5. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  6.  
  7. Connected to an idle instance.
  8.  
  9. SQL> startup
  10. ORA-01078: failure in processing system parameters
  11. LRM-00109: could not open parameter file '/u01/app/oracle/dbs/initliusuping.ora'

繼續baigoogledu,這次是百度給了答案:

  1. [oracle@localhost oracle]$ find /u01 -name pfile
  2. /u01/app/admin/orcl/pfile
  3. [oracle@localhost oracle]$ cd /u01/app/admin/orcl/pfile
  4. [oracle@localhost pfile]$ ls
  5. init.ora.5252012131333
  6. [oracle@localhost pfile]$ cp init.ora.5252012131333 /u01/app/oracle/dbs/initliusuping.ora

即找到另外一個ora檔案,然後把它複製到/u01/app/oracle/dbs下面,並重新命名為initliusuping.ora。靠,為什麼我的sid是liusuping?我裝oracle的時候貌似沒看到有設定sid的地方啊,怎麼給預設這個了。

再次startup,資料庫終於起來了:

  1. [oracle@localhost pfile]$ sqlplus '/as sysdba'
  2.  
  3. SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 25 15:13:00 2012
  4.  
  5. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  6.  
  7. Connected to an idle instance.
  8.  
  9. SQL> startup
  10. ORACLE instance started.
  11.  
  12. Total System Global Area 602619904 bytes
  13. Fixed Size 1338168 bytes
  14. Variable Size 360711368 bytes
  15. Database Buffers 234881024 bytes
  16. Redo Buffers 5689344 bytes
  17. Database mounted.
  18. Database opened.

不知道liusuping是怎麼來的,自己建一個庫吧。進入/u01/app/oracle/bin,輸入.dbca,開啟管理介面,在這裡可以刪除、建立資料庫。我們建立一個sid為test的資料庫:

 

3.用用戶端連它,連不上,"沒有監聽程式"。

開啟/u01/app/oracle/network/admin/listener.ora,它的內容如下:

  1. # listener.ora Network Configuration File: /u01/app/oracle/network/admin/listener.ora
  2. # Generated by Oracle configuration tools.
  3.  
  4. LISTENER =
  5.   (DESCRIPTION_LIST =
  6.     (DESCRIPTION =
  7.       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  8.       (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
  9.     )
  10.   )
  11.  
  12. ADR_BASE_LISTENER = /u01/app

把它改為:

  1. # listener.ora Network Configuration File: /u01/app/oracle/network/admin/listener.ora
  2. # Generated by Oracle configuration tools.
  3.  
  4. SID_LIST_LISTENER =
  5.   (SID_LIST =
  6.     (SID_DESC =
  7.       (GLOBAL_DBNAME = test)
  8.        (ORACLE_HOME = /u01/app/oracle)
  9.       (SID_NAME =test)
  10.     )
  11.    )
  12.  
  13. LISTENER =
  14.   (DESCRIPTION_LIST =
  15.     (DESCRIPTION =
  16.       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  17.       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.199)(PORT = 1521))
  18.     )
  19.   )
  20.  
  21. ADR_BASE_LISTENER = /u01/app

然後運行lsnrctl start,結果如下:

  1. [oracle@localhost admin]$ lsnrctl start
  2.  
  3. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-JUN-2012 18:04:25
  4.  
  5. Copyright (c) 1991, 2009, Oracle. All rights reserved.
  6.  
  7. Starting /u01/app/oracle/bin/tnslsnr: please wait...
  8.  
  9. TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  10. System parameter file is /u01/app/oracle/network/admin/listener.ora
  11. Log messages written to /u01/app/diag/tnslsnr/localhost/listener/alert/log.xml
  12. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  13. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.199)(PORT=1521)))
  14.  
  15. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  16. STATUS of the LISTENER
  17. ------------------------
  18. Alias LISTENER
  19. Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  20. Start Date 25-JUN-2012 18:04:25
  21. Uptime 0 days 0 hr. 0 min. 0 sec
  22. Trace Level off
  23. Security ON: Local OS Authentication
  24. SNMP OFF
  25. Listener Parameter File /u01/app/oracle/network/admin/listener.ora
  26. Listener Log File /u01/app/diag/tnslsnr/localhost/listener/alert/log.xml
  27. Listening Endpoints Summary...
  28.   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  29.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.199)(PORT=1521)))
  30. Services Summary...
  31. Service "test" has 1 instance(s).
  32.   Instance "test", status UNKNOWN, has 1 handler(s) for
    this service...
  33. The command completed successfully

然後在用用戶端連結一下:

終於連上去了。。。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.