這篇文章主要為大家展示了“Oracle如何使用備份控制文件”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Oracle如何使用備份控制文件”這篇文章吧。
創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)習(xí)水,十余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢(xún)建站服務(wù):18980820575
示例一:冷備份所有數(shù)據(jù)文件--->新建表空間--->備份控制文件(日志文件完好)
實(shí)驗(yàn)環(huán)境:
當(dāng)前的控制文件損壞,新創(chuàng)建的表空間損壞,冷備的數(shù)據(jù)文件中沒(méi)有該數(shù)據(jù)文件的備份,但是控制文件和聯(lián)機(jī)日志中有相關(guān)的記錄;由于控制文件損壞,只能使用備份的控制文件來(lái)做恢復(fù)。
--查看數(shù)據(jù)庫(kù)中已有的表空間
SYS@seiang11g>select * from v$tablespace;
TS# NAME INC BIG FLA ENC
---------- -------------------------------------------------- --- --- --- ---
0 SYSTEM YES NO YES
1 SYSAUX YES NO YES
2 UNDOTBS1 YES NO YES
4 USERS YES NO YES
3 TEMP NO NO YES
6 EXAMPLE YES NO YES
7 RMAN_CATALOG YES NO YES
8 SEIANG YES NO YES
9 WJQ YES NO YES
10 WJQBEST YES NO YES
--查看當(dāng)前日志的序列號(hào)為3
SYS@seiang11g>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
1 1 INACTIVE
2 2 INACTIVE
3 3 CURRENT
--新創(chuàng)建一個(gè)表空間test
SYS@seiang11g>create tablespace test datafile '/u01/app/oracle/oradata/OraDB11g/test01.dbf' size 5M;
Tablespace created.
--表空間創(chuàng)建完成之后,備份控制文件
SYS@seiang11g>alter database backup controlfile to '/u01/app/oracle/oradata/OraDB11g/control.bak';
Database altered.
--查看數(shù)據(jù)庫(kù)中控制文件的多元化路徑
SYS@seiang11g>show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 14
control_files string /u01/app/oracle/oradata/OraDB1
1g/control01.ctl, /u01/app/ora
cle/fast_recovery_area/OraDB11
g/control02.ctl
control_management_pack_access string DIAGNOSTIC+TUNING
--4在seiang用戶(hù)下創(chuàng)建一張表test4,隸屬于test表空間
SYS@seiang11g>create table seiang.test4(ID number,name varchar2(30)) tablespace test;
Table created.
--在test4表中插入兩條數(shù)據(jù),并提交
SYS@seiang11g>insert into seiang.test4 values(1001,'wjq');
1 row created.
SYS@seiang11g>insert into seiang.test4 values(1002,'seiang');
1 row created.
SYS@seiang11g>commit;
Commit complete.
--執(zhí)行日志切換,剛插入的表中的記錄信息已歸檔
SYS@seiang11g>alter system switch logfile;
System altered.
--查看當(dāng)前的日志序列號(hào)為4
SYS@seiang11g>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
1 4 CURRENT
2 2 INACTIVE
3 3 ACTIVE
--再在test4表中插入兩條數(shù)據(jù),但后兩條插入的數(shù)據(jù)記錄在當(dāng)前日志文件1中
SYS@seiang11g>insert into seiang.test4 values(1003,'wjqgood');
1 row created.
SYS@seiang11g>insert into seiang.test4 values(1004,'wjqbest');
1 row created.
SYS@seiang11g>commit;
Commit complete.
--查看test4表中數(shù)據(jù)的內(nèi)容
SYS@seiang11g>select * from seiang.test4;
ID NAME
---------- --------------------------------------------------
1001 wjq
1002 seiang
1003 wjqgood
1004 wjqbest
--模擬test表空間中數(shù)據(jù)文件損壞或丟失,以及控制文件損壞
SYS@seiang11g>host rm /u01/app/oracle/oradata/OraDB11g/test01.dbf
SYS@seiang11g>host rm /u01/app/oracle/oradata/OraDB11g/control01.ctl
SYS@seiang11g>host rm /u01/app/oracle/fast_recovery_area/OraDB11g/control02.ctl
--數(shù)據(jù)庫(kù)已經(jīng)宕機(jī),無(wú)法訪問(wèn)
SYS@seiang11g>select * from seiang.test4;
select * from seiang.test4
*
ERROR at line 1:
ORA-03135: connection lost contact
Process ID: 17679
Session ID: 34 Serial number: 531
--還原所有的數(shù)據(jù)文件和控制文件,準(zhǔn)備做不完全恢復(fù)
SYS@seiang11g>host cp /u01/app/oracle/UMAN_Backup/*.dbf /u01/app/oracle/oradata/OraDB11g/
SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak /u01/app/oracle/oradata/OraDB11g/control01.ctl
SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak /u01/app/oracle/fast_recovery_area/OraDB11g/control02.ctl
--查看控制文件和數(shù)據(jù)文件頭所記錄的SCN,發(fā)現(xiàn)test01.dbf數(shù)據(jù)文件頭沒(méi)有記錄
SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile;
FILE# CHECKPOINT_CHANGE# NAME
---------- ------------------ --------------------------------------------------
1 1981768 /u01/app/oracle/oradata/OraDB11g/system01.dbf
2 1981768 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf
3 1981768 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf
4 1981768 /u01/app/oracle/oradata/OraDB11g/users01.dbf
5 1981768 /u01/app/oracle/oradata/OraDB11g/example01.dbf
6 1981768 /u01/app/oracle/oradata/OraDB11g/rman01.dbf
7 1981768 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf
8 1981768 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf
9 1981768 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf
10 1986000 /u01/app/oracle/oradata/OraDB11g/test01.dbf
SYS@seiang11g>
SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header;
FILE# CHECKPOINT_CHANGE# NAME
---------- ------------------ --------------------------------------------------
1 1913765 /u01/app/oracle/oradata/OraDB11g/system01.dbf
2 1913765 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf
3 1913765 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf
4 1913765 /u01/app/oracle/oradata/OraDB11g/users01.dbf
5 1913765 /u01/app/oracle/oradata/OraDB11g/example01.dbf
6 1913765 /u01/app/oracle/oradata/OraDB11g/rman01.dbf
7 1913765 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf
8 1913765 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf
9 1913765 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf
10 0
可以看出:
① file10在控制文件里記錄是test01.dbf,而與之對(duì)應(yīng)的數(shù)據(jù)文件10是不存在的,
② 備份的數(shù)據(jù)備份的SCN比控制文件SCN還老。
--查看需要恢復(fù)的數(shù)據(jù)文件
SYS@seiang11g>select * from v$recover_file;
FILE# ONLINE ONLINE_ ERROR CHANGE# TIME
---------- ------- ------- ----------------------------------------------------------------- ---------- ---------
1 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
2 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
3 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
4 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
5 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
6 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
7 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
8 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
9 ONLINE ONLINE UNKNOWN ERROR 1913765 02-AUG-17
10 ONLINE ONLINE FILE NOT FOUND 0
--嘗試做完全恢復(fù),提示使用備份的控制文件來(lái)恢復(fù)
SYS@seiang11g>recover database;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
--使用備份的控制文件來(lái)做恢復(fù),出現(xiàn)報(bào)錯(cuò)
SYS@seiang11g>recover database using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 10: '/u01/app/oracle/oradata/OraDB11g/test01.dbf'
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
ORA-01110: data file 10: '/u01/app/oracle/oradata/OraDB11g/test01.dbf'
此錯(cuò)是因?yàn)槔蟼浞堇餂](méi)有abcd表空間,但只要控制文件里記錄了abcd就好辦,方法是建一個(gè)datafile的空文件,而其中內(nèi)容可由日志文件recover(前滾)時(shí)填補(bǔ)出來(lái)。
--新建一個(gè)數(shù)據(jù)文件
SYS@seiang11g>alter database create datafile '/u01/app/oracle/oradata/OraDB11g/test01.dbf';
Database altered.
--再次查看控制文件和數(shù)據(jù)文件頭中做記錄的SCN
SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile;
FILE# CHECKPOINT_CHANGE# NAME
---------- ------------------ --------------------------------------------------
1 1981768 /u01/app/oracle/oradata/OraDB11g/system01.dbf
2 1981768 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf
3 1981768 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf
4 1981768 /u01/app/oracle/oradata/OraDB11g/users01.dbf
5 1981768 /u01/app/oracle/oradata/OraDB11g/example01.dbf
6 1981768 /u01/app/oracle/oradata/OraDB11g/rman01.dbf
7 1981768 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf
8 1981768 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf
9 1981768 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf
10 1986000 /u01/app/oracle/oradata/OraDB11g/test01.dbf
10 rows selected.
SYS@seiang11g>
SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header;
FILE# CHECKPOINT_CHANGE# NAME
---------- ------------------ --------------------------------------------------
1 1913766 /u01/app/oracle/oradata/OraDB11g/system01.dbf
2 1913766 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf
3 1913766 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf
4 1913766 /u01/app/oracle/oradata/OraDB11g/users01.dbf
5 1913766 /u01/app/oracle/oradata/OraDB11g/example01.dbf
6 1913766 /u01/app/oracle/oradata/OraDB11g/rman01.dbf
7 1913766 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf
8 1913766 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf
9 1913766 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf
10 1985999 /u01/app/oracle/oradata/OraDB11g/test01.dbf
--再次使用備份的控制文件來(lái)做恢復(fù)
SYS@seiang11g>recover database using backup controlfile;
ORA-00279: change 1913766 generated at 08/02/2017 11:12:22 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_1.log
ORA-00280: change 1913766 for thread 1 is in sequence #1
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto (因?yàn)樾枰娜罩疽呀?jīng)歸檔,所以選擇auto)
ORA-00279: change 1914386 generated at 08/02/2017 14:48:59 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_2.log
ORA-00280: change 1914386 for thread 1 is in sequence #2
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950971495_1.log' no longer needed for this recovery
ORA-00279: change 1914402 generated at 08/02/2017 14:59:56 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_1.log
ORA-00280: change 1914402 for thread 1 is in sequence #1
ORA-00279: change 1936446 generated at 08/02/2017 15:39:52 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_2.log
ORA-00280: change 1936446 for thread 1 is in sequence #2
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_1.log' no longer needed for this recovery
ORA-00279: change 1937042 generated at 08/02/2017 15:49:42 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_3.log
ORA-00280: change 1937042 for thread 1 is in sequence #3
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_2.log' no longer needed for this recovery
ORA-00279: change 1937100 generated at 08/02/2017 15:51:34 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_4.log
ORA-00280: change 1937100 for thread 1 is in sequence #4
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_3.log' no longer needed for this recovery
ORA-00279: change 1937111 generated at 08/02/2017 16:23:53 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_1.log
ORA-00280: change 1937111 for thread 1 is in sequence #1
ORA-00279: change 1955524 generated at 08/02/2017 22:00:32 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_2.log
ORA-00280: change 1955524 for thread 1 is in sequence #2
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_1.log' no longer needed for this recovery
ORA-00279: change 1981768 generated at 08/03/2017 08:19:54 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_3.log
ORA-00280: change 1981768 for thread 1 is in sequence #3
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_2.log' no longer needed for this recovery
ORA-00279: change 1986580 generated at 08/03/2017 10:00:19 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_4.log
ORA-00280: change 1986580 for thread 1 is in sequence #4
ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_3.log' no longer needed for this recovery
ORA-00308: cannot open archived log '/u01/app/oracle/arch/arch_1_950977433_4.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
出現(xiàn)此錯(cuò)誤,因?yàn)楫?dāng)前的當(dāng)前的日志文件尚未歸檔,所以出現(xiàn)錯(cuò)誤,所以接下來(lái)使用當(dāng)前的日志文件來(lái)做恢復(fù)
SYS@seiang11g>recover database using backup controlfile;
ORA-00279: change 1986580 generated at 08/03/2017 10:00:19 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_4.log
ORA-00280: change 1986580 for thread 1 is in sequence #4
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/OraDB11g/redo01.log (當(dāng)前日志文件)
Log applied.
Media recovery complete.
SYS@seiang11g>
--恢復(fù)完成,使用resetlogs打開(kāi)數(shù)據(jù)庫(kù)
SYS@seiang11g>alter database open resetlogs;
Database altered.
--查看控制文件和數(shù)據(jù)文件頭記錄的SCN一致
SYS@seiang11g>select file#,checkpoint_change# from v$datafile;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 1986883
2 1986883
3 1986883
4 1986883
5 1986883
6 1986883
7 1986883
8 1986883
9 1986883
10 1986883
SYS@seiang11g>select file#,checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 1986883
2 1986883
3 1986883
4 1986883
5 1986883
6 1986883
7 1986883
8 1986883
9 1986883
10 1986883
--確認(rèn)test4表中的數(shù)據(jù)全部恢復(fù)成功
SYS@seiang11g>select * from seiang.test4;
ID NAME
---------- --------------------------------------------------
1001 wjq
1002 seiang
1003 wjqgood
1004 wjqbest
示例二:冷備份所有數(shù)據(jù)文件--->備份控制文件--->新建表空間(日志文件完好) 實(shí)驗(yàn)環(huán)境: 當(dāng)前的控制文件損壞,新創(chuàng)建的表空間損壞,冷備的數(shù)據(jù)文件中沒(méi)有該數(shù)據(jù)文件的備份,控制文件中也沒(méi)有該表空間的記錄,但是聯(lián)機(jī)日志中有相關(guān)的記錄;由于控制文件損壞,只能使用備份的控制文件來(lái)做恢復(fù)。 --查看數(shù)據(jù)庫(kù)中已存在的表空間 SYS@seiang11g>select * from v$tablespace; TS# NAME INC BIG FLA ENC ---------- -------------------------------------------------- --- --- --- --- 0 SYSTEM YES NO YES 1 SYSAUX YES NO YES 2 UNDOTBS1 YES NO YES 4 USERS YES NO YES 3 TEMP NO NO YES 6 EXAMPLE YES NO YES 7 RMAN_CATALOG YES NO YES 8 SEIANG YES NO YES 9 WJQ YES NO YES 10 WJQBEST YES NO YES --備份控制文件 SYS@seiang11g>alter database backup controlfile to '/u01/app/oracle/oradata/OraDB11g/control.bak1'; Database altered. -創(chuàng)建表空間comsys該表空間記錄在當(dāng)前的日志redo01.log中 SYS@seiang11g>create tablespace comsys datafile '/u01/app/oracle/oradata/OraDB11g/comsys01.dbf' size 5M; Tablespace created. --在seiang用戶(hù)下創(chuàng)建一張表test4,隸屬于comsys表空間 SYS@seiang11g>create table seiang.test4(age number,address varchar2(10)) tablespace comsys; Table created. --在test4表中插入兩條數(shù)據(jù),并提交 SYS@seiang11g>insert into seiang.test4 values(23,'beijing'); 1 row created. SYS@seiang11g>insert into seiang.test4 values(25,'shanghai'); 1 row created. SYS@seiang11g>commit; Commit complete. SYS@seiang11g>select * from seiang.test4; AGE ADDRESS ---------- ---------- 23 beijing 25 shanghai --查看當(dāng)前日志的序列號(hào)為1 SYS@seiang11g>select group#,sequence#,status from v$log; GROUP# SEQUENCE# STATUS ---------- ---------- ---------------- 1 1 CURRENT 2 0 UNUSED 3 0 UNUSED --模擬comsys01.dbf數(shù)據(jù)文件丟失或損壞,控制文件損壞 SYS@seiang11g>host rm /u01/app/oracle/oradata/OraDB11g/comsys01.dbf SYS@seiang11g>shutdown abort ORACLE instance shut down. --從備份的文件中還原控制文件和數(shù)據(jù)文件 SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak1 /u01/app/oracle/oradata/OraDB11g/control01.ctl SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak1 /u01/app/oracle/fast_recovery_area/OraDB11g/control02.ctl SYS@seiang11g>host cp
/u01/app/oracle/UMAN_Backup/*.dbf /u01/app/oracle/oradata/OraDB11g SYS@seiang11g>startup ORACLE instance started. Total System Global Area 1252663296 bytes Fixed Size 2252824 bytes Variable Size 788533224 bytes Database Buffers 452984832 bytes Redo Buffers 8892416 bytes Database mounted. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open --查看控制文件和數(shù)據(jù)文件頭,發(fā)現(xiàn)并沒(méi)有comsys表空間的相關(guān)記錄 SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile; FILE# CHECKPOINT_CHANGE# NAME ---------- ------------------ -------------------------------------------------- 1 1986883 /u01/app/oracle/oradata/OraDB11g/system01.dbf 2 1986883 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf 3 1986883 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf 4 1986883 /u01/app/oracle/oradata/OraDB11g/users01.dbf 5 1986883 /u01/app/oracle/oradata/OraDB11g/example01.dbf 6 1986883 /u01/app/oracle/oradata/OraDB11g/rman01.dbf 7 1986883 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf 8 1986883 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf 9 1986883 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header; FILE# CHECKPOINT_CHANGE# NAME ---------- ------------------ -------------------------------------------------- 1 1913765 /u01/app/oracle/oradata/OraDB11g/system01.dbf 2 1913765 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf 3 1913765 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf 4 1913765 /u01/app/oracle/oradata/OraDB11g/users01.dbf 5 1913765 /u01/app/oracle/oradata/OraDB11g/example01.dbf 6 1913765 /u01/app/oracle/oradata/OraDB11g/rman01.dbf 7 1913765 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf 8 1913765 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf 9 1913765 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf --嘗試完全恢復(fù),提示使用備份的控制文件做恢復(fù) SYS@seiang11g>recover database; ORA-00283: recovery session canceled due to errors ORA-01610: recovery using the BACKUP CONTROLFILE option must be done --使用備份的控制文件做恢復(fù) SYS@seiang11g>recover database using backup controlfile; ORA-00279: change 1913766 generated at 08/02/2017 11:12:22 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_1.log ORA-00280: change 1913766 for thread 1 is in sequence #1 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} auto (該日志已歸檔,所以選擇auto) ORA-00279: change 1914386 generated at 08/02/2017 14:48:59 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_2.log ORA-00280: change 1914386 for thread 1 is in sequence #2 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950971495_1.log' no longer needed for this recovery ORA-00279: change 1914402 generated at 08/02/2017 14:59:56 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_1.log ORA-00280: change 1914402 for thread 1 is in sequence #1 ORA-00279: change 1936446 generated at 08/02/2017 15:39:52 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_2.log ORA-00280: change 1936446 for thread 1 is in sequence #2 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_1.log' no longer needed for this recovery ORA-00279: change 1937042 generated at 08/02/2017 15:49:42 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_3.log ORA-00280: change 1937042 for thread 1 is in sequence #3 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_2.log' no longer needed for this recovery ORA-00279: change 1937100 generated at 08/02/2017 15:51:34 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_4.log ORA-00280: change 1937100 for thread 1 is in sequence #4 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_3.log' no longer needed for this recovery ORA-00279: change 1937111 generated at 08/02/2017 16:23:53 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_1.log ORA-00280: change 1937111 for thread 1 is in sequence #1 ORA-00279: change 1955524 generated at 08/02/2017 22:00:32 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_2.log ORA-00280: change 1955524 for thread 1 is in sequence #2 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_1.log' no longer needed for this recovery ORA-00279: change 1981768 generated at 08/03/2017 08:19:54 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_3.log ORA-00280: change 1981768 for thread 1 is in sequence #3 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_2.log' no longer needed for this recovery ORA-00279: change 1986580 generated at 08/03/2017 10:00:19 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_4.log ORA-00280: change 1986580 for thread 1 is in sequence #4 ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_3.log' no longer needed for this recovery ORA-00279: change 1986880 generated at 08/03/2017 10:33:47 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_951042827_1.log ORA-00280: change 1986880 for thread 1 is in sequence #1 ORA-00308: cannot open archived log '/u01/app/oracle/arch/arch_1_951042827_1.log' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3 出現(xiàn)此錯(cuò)誤,因?yàn)楫?dāng)前的日志文件尚未歸檔,所以出現(xiàn)錯(cuò)誤,所以接下來(lái)使用當(dāng)前的日志文件來(lái)做恢復(fù) SYS@seiang11g>recover database using backup controlfile; ORA-00279: change 1986880 generated at 08/03/2017 10:33:47 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_951042827_1.log ORA-00280: change 1986880 for thread 1 is in sequence #1 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /u01/app/oracle/oradata/OraDB11g/redo01.log (當(dāng)前的日志文件) ORA-00283: recovery session canceled due to errors ORA-01244: unnamed datafile(s) added to control file by media recovery ORA-01110: data file 10: '/u01/app/oracle/oradata/OraDB11g/comsys01.dbf' (從當(dāng)前的日志文件中,我們發(fā)現(xiàn)了關(guān)于comsys表空間的相關(guān)記錄) ORA-01112: media recovery not started 當(dāng)再次使用備份的控制文件做恢復(fù)時(shí),出現(xiàn)如下的錯(cuò)誤提示 SYS@seiang11g>recover database using backup controlfile; ORA-00283: recovery session canceled due to errors ORA-01111: name for data file 10 is unknown - rename to correct file ORA-01110: data file 10: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010' ORA-01157: cannot identify/lock data file 10 - see DBWR trace file ORA-01111: name for data file 10 is unknown - rename to correct file ORA-01110: data file 10: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010' --查看控制文件和數(shù)據(jù)文件頭,有了關(guān)于comsys表空間的相關(guān)記錄 SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile; FILE# CHECKPOINT_CHANGE# NAME ---------- ------------------ -------------------------------------------------- 1 1986883 /u01/app/oracle/oradata/OraDB11g/system01.dbf 2 1986883 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf 3 1986883 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf 4 1986883 /u01/app/oracle/oradata/OraDB11g/users01.dbf 5 1986883 /u01/app/oracle/oradata/OraDB11g/example01.dbf 6 1986883 /u01/app/oracle/oradata/OraDB11g/rman01.dbf 7 1986883 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf 8 1986883 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf 9 1986883 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf 10 1988334 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAME D00010 SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header; FILE# CHECKPOINT_CHANGE# NAME ---------- ------------------ -------------------------------------------------- 1 1988336 /u01/app/oracle/oradata/OraDB11g/system01.dbf 2 1988336 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf 3 1988336 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf 4 1988336 /u01/app/oracle/oradata/OraDB11g/users01.dbf 5 1988336 /u01/app/oracle/oradata/OraDB11g/example01.dbf 6 1988336 /u01/app/oracle/oradata/OraDB11g/rman01.dbf 7 1988336 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf 8 1988336 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf 9 1988336 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf 10 0 --創(chuàng)建數(shù)據(jù)文件,并對(duì)控制文件中記錄未知的數(shù)據(jù)文件重命名 SYS@seiang1
新聞名稱(chēng):Oracle如何使用備份控制文件
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、手機(jī)網(wǎng)站建設(shè)、微信公眾號(hào)、用戶(hù)體驗(yàn)、建站公司、網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源:
創(chuàng)新互聯(lián)
轉(zhuǎn)載來(lái)源:http://jinyejixie.com/article14/gpijde.html