Oracle資料庫還原恢復后,執行alter database open resetlogs時遇到下面錯誤,如下所示:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00603: ORACLE server session terminated by fatal error
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-00904: "I"."UNUSABLEBEGINNING#": invalid identifier
Process ID: 19288
Session ID: 2 Serial number: 4441
剛開始有點懵的,第一次遇到這種情形,不過搜索了一下metalink相關資料后,大致了解到是因為環境變數設定有誤導致這些錯誤出現的,這里先介紹一下這個案例的復雜背景:
當前機器為一個測驗服務器(UAT環境),作業系統版本為HP-UX,資料庫版本Oracle 19c,然后因為Support人員要查找歷史資料,需要還原一個2020年時間點的資料庫備份,但是生產環境(PROD)在2020年是Oracle 11g,然后在2021年升級為了Oracle 19c,現在測驗服務器(UAT環境)的資料庫版本也是Oracle 19c,于是從其它測驗服務器拷貝了一個Oracle 11g版本的掛載帶點/opt/oracle11g到當前測驗服務器(為了方便省事,如果重新安裝搭建Oracle 11g環境還麻煩一些),然后設定了一下/etc/oratab,如下所示:(xxx表示ORACLE_SID)
#xxx:/opt/oracle19c/product/19.3.0/db_1:N
xxx:/opt/oracle11g/product/11.2:N
退出當前SecureCRT視窗,重新登陸,提示修改成功,如下所示
ORACLE_SID = [xxx] ? xxx
Oracle SID = xxx
Oracle BASE = /opt/oracle11g
Oracle HOME = /opt/oracle11g/product/11.2
SQL*Net TNS = /etc
ORA_NLS10 = /opt/oracle11g/product/11.2/nls/data
由于忙著檢查/修改pfile檔案中的引數,當時沒有仔細檢查環境變數,匆匆忙忙就開始了資料庫實體的還原恢復,但是當前的ORACLE_HOME環境變數確實還是Oracle 19c的環境變數
>echo $ORACLE_BASE
/opt/oracle19c
>echo $ORACLE_HOME
/opt/oracle19c/product/19.3.0/db_1
修改環境變數~/.profile后,執行. ~/.profile設定生效,然后重新登陸SecureCRT后,重新還原資料庫就不會遇到這個問題,另外,如果不重新還原,關閉資料庫后,重新OPEN資料庫亦可以,測驗沒有什么問題,

官方檔案Database Startup Failure After RMAN Restore with ORA-00704, ORA-00604, ORA-00904 (Doc ID 2540757.1)的具體內容如下:
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.
SYMPTOMS
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 2
ORA-00904: "I"."UNUSABLEBEGINNING#": invalid identifier
Process ID: 23346
Session ID: 680 Serial number: 51933
CHANGES
After restoring the database to another server by RMAN, it is failed to startup.
After upgrade or post upgrade
CAUSE
>>>>>ORA-00904: "I"."UNUSABLEBEGINNING#": invalid identifier
This error appears due to using the incorrect sqlplus environment. For example., By default SQLPLUS will connect to the default ORACLE_HOME, say 12C Home but if you are duplicating the 11g database on same host the it must be Oracle 11g Environment in order to complete the process.
1 - This issue happens when we have installed multiple Oracle Homes in a single system.
2 - We need to make sure that we are in the right environment when we are restoring it.
SOLUTION
You need to set all the required Environment Variables first as per your need like ORACLE_SID, ORACLE_BASE, ORACLE_HOME, TNS_ADMIN, PATH with proper values
(OR)
Simply work by going to the bin directory of your required ORACLE_HOME
SET ORACLE_HOME=Your_Oracle_Home
CD ORACLE_HOME\bin
Even if you set all the environment parameter properly, then need to investigate further to verify the rman backup set which used to restore or verify the upgrade logs, component, dba_registry etc.
Provide the details requested in below Notes based on the post restore or post upgrade
Note 1905616.1 SRDC - Startup Issues: Checklist of Evidence to Supply (Doc ID 1905616.1)
Note 1906468.1 SRDC - Startup Shutdown - Oracle Binary and OS Resources: Checklist of Evidence to Supply (Doc ID 1906468.1)
Note:1672387.1 SRDC - Data Collection for Upgrade Issues
Note 753041.1 How to Diagnose Components with NON VALID Status in DBA_REGISTRY after an Upgrade (Doc ID 753041.1)
Note 1965956.1 SRDC - Data Collection for Datapatch issues (Doc ID 1965956.1)
Note 1671416.1 SRDC - Required diagnostic data collection for RMAN Restore and Recover Using TFA Collector (Recommended) or Manual Steps (Doc ID 1671416.1)
掃描上面二維碼關注我
如果你真心覺得文章寫得不錯,而且對你有所幫助,那就不妨幫忙“推薦"一下,您的“推薦”和”打賞“將是我最大的寫作動力!
本文著作權歸作者所有,歡迎轉載,但未經作者同意必須保留此段宣告,且在文章頁面明顯位置給出原文連接.
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/550068.html
標籤:其他
上一篇:redis 工具類
