溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》
  • 首頁 > 
  • 教程 > 
  • 開發(fā)技術(shù) > 
  • Oracle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決

Oracle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決

發(fā)布時(shí)間:2023-04-17 10:43:07 來源:億速云 閱讀:108 作者:iii 欄目:開發(fā)技術(shù)

這篇文章主要介紹“Oracle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決”,在日常操作中,相信很多人在Oracle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”O(jiān)racle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

Oracle數(shù)據(jù)庫還原恢復(fù)后,執(zhí)行alter database open resetlogs時(shí)遇到下面錯(cuò)誤。如下所示:

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

剛開始有點(diǎn)懵的,第一次遇到這種情形。不過搜索了一下metalink相關(guān)資料后,大致了解到是因?yàn)榄h(huán)境變量設(shè)置有誤導(dǎo)致這些錯(cuò)誤出現(xiàn)的。這里先介紹一下這個(gè)案例的復(fù)雜背景:

當(dāng)前機(jī)器為一個(gè)測(cè)試服務(wù)器(UAT環(huán)境),操作系統(tǒng)版本為HP-UX,數(shù)據(jù)庫版本Oracle 19c,然后因?yàn)镾upport人員要查找歷史數(shù)據(jù),需要還原一個(gè)2020年時(shí)間點(diǎn)的數(shù)據(jù)庫備份。但是生產(chǎn)環(huán)境(PROD)在2020年是Oracle 11g,然后在2021年升級(jí)為了Oracle 19c,現(xiàn)在測(cè)試服務(wù)器(UAT環(huán)境)的數(shù)據(jù)庫版本也是Oracle 19c,于是從其它測(cè)試服務(wù)器拷貝了一個(gè)Oracle 11g版本的掛載帶點(diǎn)/opt/oracle11g到當(dāng)前測(cè)試服務(wù)器(為了方便省事,如果重新安裝搭建Oracle 11g環(huán)境還麻煩一些),然后設(shè)置了一下/etc/oratab,如下所示:(xxx表示ORACLE_SID)

#xxx:/opt/oracle19c/product/19.3.0/db_1:N
xxx:/opt/oracle11g/product/11.2:N

退出當(dāng)前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文件中的參數(shù),當(dāng)時(shí)沒有仔細(xì)檢查環(huán)境變量,匆匆忙忙就開始了數(shù)據(jù)庫實(shí)例的還原恢復(fù),但是當(dāng)前的和ORACLE_HOME環(huán)境變量確實(shí)還是Oracle 19c的環(huán)境變量

>echo $ORACLE_BASE
/opt/oracle19c
>echo $ORACLE_HOME
/opt/oracle19c/product/19.3.0/db_1

修改環(huán)境變量~/.profile后,執(zhí)行. ~/.profile設(shè)置生效。然后重新登陸SecureCRT后,重新還原數(shù)據(jù)庫就不會(huì)遇到這個(gè)問題。另外,如果不重新還原,關(guān)閉數(shù)據(jù)庫后,重新OPEN數(shù)據(jù)庫亦可以,測(cè)試沒有什么問題。

Oracle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決

官方文檔Database Startup Failure After RMAN Restore with ORA-00704, ORA-00604, ORA-00904 (Doc ID 2540757.1)的具體內(nèi)容如下:

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)

到此,關(guān)于“Oracle還原恢復(fù)啟動(dòng)時(shí)數(shù)據(jù)庫報(bào)ORA-00704、ORA-00604、ORA-00904怎么解決”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI