案例: 解決ORACLE ORA-27211的錯誤

kewin發表於2009-12-08

案例: 解決ORACLE ORA-27211的錯誤。

在一個AIX 6.1, Oracle 10.2.0.4的環境,連線帶庫。需要備份到帶庫上。 TSM for Oracle Driver是IBM工程師安裝的,DBA負責除錯TSM,RMAN 備份。開始執行RMAN時,系統報錯:

RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: =========================================================== 
RMAN-03009: failure of allocate command on t1 channel at 12/02/2009 13:45:33 
ORA-19554: error allocating device, device type: SBT_TAPE, device name: 
ORA-27211: Failed to load Media Management Library 

檢視: /usr/tivoli/tsm/client/oracle/bin64/tdpoerror.log 檔案,有如下資訊:
11/25/09   16:18:59 TID<2211946> ==> ANU2512E Could not open license file: /usr/tivoli/tsm/client/oracle/bin64/agent.lic
11/25/09   16:18:59 ANS1025E Session rejected: Authentication failure
11/25/09   16:18:59 ANS1025E Session rejected: Authentication failure
11/25/09   16:18:59 TID<2211946> ==> ANS1025E (RC137)  Session rejected: Authentication failure

認證失敗,估計是無法通過TSM的認證。檢視/usr/tivoli/tsm/client/oracle/bin64/ 目錄下的檔案:
-rw-rw-rw-    1 root     system          742 Nov 25 16:19 dsm.opt
-rw-r--r--    1 root     system            0 Nov 25 16:34 dsmerror.log
drwxr-xr-x    2 root     system          256 Nov 25 15:11 en_US
-rwxr-xr-x    1 bin      bin          914416 Jun  3 2009  libobk64.a
-rw-rw-rw-    1 bin      bin             690 Dec  3 12:30 tdpo.opt
-rwxr-xr-x    1 bin      bin             691 Jun  3 2009  tdpo.opt.smp64
-rwxr-xr-x    1 bin      bin          802518 Jun  3 2009  tdpoconf
-rw-r--r--    1 root     system          525 Nov 25 16:18 tdpoerror.log
缺失agent.lic, tdposync 兩個檔案。通過IBM 安裝上缺失的檔案。安裝完畢,再次執行RMAN 來驗證:
RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: =========================================================== 
RMAN-03009: failure of allocate command on t1 channel at 12/02/2009 13:45:33 
ORA-19554: error allocating device, device type: SBT_TAPE, device name: 
ORA-27211: Failed to load Media Management Library 
錯誤依然,但是具體的錯誤資訊已經變化了:
12/07/09 12:00:24 ANS1834S Unable to write to '/etc/security/adsm' for storing password 12/07/09 12:00:24 ANS1834S Unable to write to '/etc/security/adsm' for storing password 12/07/09 12:00:24 ANS0282E Password file is not available. 12/07/09 12:00:24 TID<671750> ==> ANS0282E (RC168) Password file is not available. 12/07/09 12:01:08 ANS1834S Unable to write to '/etc/security/adsm' for storing password 12/07/09 12:01:08 ANS1834S Unable to write to '/etc/security/adsm' for storing password 12/07/09 12:01:08 ANS0282E Password file is not available. 12/07/09 12:01:08 TID<1278070> ==> ANS0282E (RC168) Password file is not available. 12/07/09 12:10:43 ANS1834S Unable to write to '/etc/security/adsm' for storing password 12/07/09 12:10:44 ANS1834S Unable to write to '/etc/security/adsm' for storing password 12/07/09 12:10:44 ANS0282E Password file is not available. 12/07/09 12:10:44 TID<1069070> ==> ANS0282E (RC168) Password file is not available. 12/07/09 12:17:35 ANS1025E Session rejected: Authentication failure 12/07/09 12:21:02 TID<848014> ==> ANU2512E Could not open license file: /usr/tivoli/tsm/client/oracle/bin64/agent.lic
這次是缺失了agent.loc 檔案,還是要IBM去安裝缺失的檔案。要好好檢查IBM同志的工作!!
===> ls -l /usr/tivoli/tsm/client/oracle/bin64/
total 3400
-rw-rw-rw-    1 oracle   system           47 Dec  7 14:38 agent.lic
lrwxrwxrwx    1 root     system           37 Dec  7 12:00 dsm.opt -> /usr/tivoli/tsm/client/ba/bin/dsm.opt
lrwxrwxrwx    1 root     system           37 Dec  7 11:57 dsm.sys -> /usr/tivoli/tsm/client/ba/bin/dsm.sys
-rwxrwxrwx    1 root     system            0 Nov 25 16:34 dsmerror.log
drwxr-xr-x    2 root     system          256 Nov 25 15:11 en_US
-rwxr-xr-x    1 bin      bin          914416 Jun  3 2009  libobk64.a
-rwxrwxrwx    1 bin      bin             690 Dec  3 12:30 tdpo.opt
-rwxr-xr-x    1 bin      bin             691 Jun  3 2009  tdpo.opt.smp64
-rwxr-xr-x    1 bin      bin          802518 Jun  3 2009  tdpoconf
-rwxrwxrwx    1 root     system         2254 Dec  7 17:58 tdpoerror.log
和其他相同的伺服器上比對,不再缺少檔案的情況下,去驗證RMAN 和TSM,ORA-27211的錯誤再次出現。檔案已經齊全,但是錯誤依舊,是怎麼回事呢?檢視了ORA-27211的錯誤幫助,感覺是RMAN 無法載入到SBT_LIBRARY的驅動。可能是環境變數設定的不對導致的這個問題。 ORA-27211的錯誤幫助
===> oerr ora 27211
27211, 00000, "Failed to load Media Management Library"
// *Cause:  User-supplied SBT_LIBRARY or libobk.so could not be loaded. Call
//          to dlopen for media library returned error. See Additional
//          information for error code.
// *Action: Retry the command with proper media library. Or re-install
//          Media management module for Oracle.

經過一番摸索,找到了解決問題的辦法,問題解決:

1) 建立軟連線: cd $ORACLE_HOME/lib/ ln -s /usr/tivoli/tsm/client/oracle/bin64/libobk64.a libobk.a
2)檢查LIBPATH 和LD_LIBRARY_PATH 環境變數,$ORACLE_HOME/lib 排在/usr/lib 前;
3) 確定 沒有設定環境變數SBT_LIBRARY ;
4) 如果還是無效,可能需要重啟INSTANCE以釋放載入到記憶體中的環境變數 LIBPATH

 -THE END-

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/40239/viewspace-621986/,如需轉載,請註明出處,否則將追究法律責任。

相關文章