Oracle的常見錯誤及解決辦法

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   使用   os   io   

ORA-12528:
TNS:listener: all appropriate instances are blocking new connections

    ORA-12528問題是因為監聽中的服務使用了動態服務,執行個體雖然啟動,但沒有註冊到監聽。執行個體是通過PMON進程註冊到監聽上的,而PMON進程需要在MOUNT狀態下才會啟動。所以造成了上面的錯誤。

解決這個問題,有三種方法
1、把監聽設定為靜態;
2、在tnsnames.ora中追加(UR=A);
3、重新啟動服務;


方法1、通過修改listener.ora的參數,把listener.ora動態註冊設定為靜態註冊,然後重新啟動監聽

# listener.ora Network Configuration File: $ORACLE_HOME\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = [DBNAME])
      (ORACLE_HOME = [$ORACLE_HOME])
      (SID_NAME = [SID])
    )
  )
    靜態註冊的風險:如果在instance運行中,lisener重新啟動,就找不到instance了。靜態註冊需要先啟動lisener,再啟動instance。且靜態模式下,lisener status顯示的是unknown

方法2、啟動到nomount狀態,通過修改tnsnames.ora的參數
# tnsnames.ora Network Configuration File: $ORACLE_HOME\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
SYK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SYK)
      (UR=A)
    )
  )
    然後串連上資料庫
    SQL>alter database mount;
    SQL>alter database open;

方法3、重啟ORACLE或者重啟ORACLE服務
 在oracle帳戶下依序執行如下命令:
sqlplus / as sysdba;//在其它帳戶(如root)下執行可能會報錯(ORA-01031)因為這些帳戶沒有在dba組中

shutdown immediate;
startup;

http://blog.sina.com.cn/s/blog_636415010100x3lc.html

oracle執行個體名: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory

是環境變數LD_LIBRARY_PATH的問題。

在10g以後,一般情況下環境變數中沒有必要設定LD_LIBRARY_PATH,但是一旦將ORACLE_HOME遷移到其他目錄,則環境變數中還需要添加這個變數。

Linux和Unix支援TAR方式遷移ORACLE_HOME,如果有需要將ORACLE_HOME放到其他路徑下,那麼一般都會使用tar的方式將整個路徑拷貝到目標目錄。
但是遷移後,如果直接嘗試sqlplus啟動,可能報錯:
[[email protected] ~]$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
而設定LD_LIBRARY_PATH後,問題解決:
[[email protected] ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Mar 18 16:10:57 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
還有一種類似的錯誤:
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Mar 18 16:12:03 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[[email protected] ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Mar 18 16:12:18 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
錯誤的表相雖然不同,但是解決方案是相同的。

http://blog.itpub.net/4227/viewspace-718879/

ORA-00204:ORA-00202:ORA-27091

Oracle資料庫啟動報如下錯誤:
ORA-00204: error in reading (block 3, # blocks 8) of controlfile
ORA-00202: controlfile:‘/app/oracle/OraHome1/database/datafiles/control1.ctl‘
ORA-27091: skgfqio: unable to queue I/O
SVR4 Error: 25: Inappropriate ioctl for device
Additional information: 3

說明control1.ctl檔案有問題啦!
想把這個檔案mv到別的目錄做個備份,但I/O error,果然是壞了!
一般控制檔案有3個,除非3個都壞了,不然可以用好的替換壞的:
rm control1.ctl
cp control2.ctl control1.ctl
再重新啟動Oracle就OK啦!

http://blog.sina.com.cn/s/blog_49c1dffa0100teu5.html

ORA-01031: insufficient privileges

出錯的情境:

(1)用sqlplus "/ as sysdba"登陸
(2)登陸成功後在執行相關操作

第二種情況沒什麼說的,沒許可權,賦經即可

第一情況的解決辦法:
要sqlplus "/ as sysdba"進行登陸必須滿足如下條件:
(1)linux/unix下有環境變數ORACLE_SID,windows不要求
(2)配置環境變數ORACLE_HOME
(3)linux/unix下$ORACLE_HOME/bin/oracle檔案在u,g下有s許可權(讓非oracle使用者可以擁有相當於oracle帳戶 的,賦值方法chmod u+s,g+s $ORACLE_HOME/bin/oracle)
(4)執行此操作的使用者必須在dba使用者組中

Tips:

Linux/unix下非oracle使用者下不建議使用sqlplus "/ as sysdba"登陸,建議使用sqlplus /nolog後使用conn 命令或sqlplus username[@sid]登陸

 http://blog.sina.com.cn/s/blog_622a00690100zklx.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.