In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to restore oracle control files, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
1 rebuild the control file
SYS@hyyk > alter database backup controlfile to'/ home/oracle/controlfile01.ctl'
two。 Delete the control file currently in use
SYS@hyyk > ho rm-rf / u01/app/oracle/oradata/hyyk/control01.ctl
3. Boot the database from
SYS@hyyk > startup force
ORACLE instance started.
Total System Global Area 776646656 bytes
Fixed Size 2217384 bytes
Variable Size 578816600 bytes
Database Buffers 188743680 bytes
Redo Buffers 6868992 bytes
ORA-00205: error in identifying control file, check alert log for more info
4. Copy backup controlled files
SYS@hyyk > ho cp / home/oracle/controlfile01.ctl / u01/app/oracle/oradata/hyyk/control01.ctl
SYS@hyyk > alter database mount
Database altered.
SYS@hyyk > alter database open
Alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SYS@hyyk > alter database open resetlogs
Alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1:'/ u01 *
SYS@hyyk > recover database using backup controlfile
ORA-00279: change 1324612 generated at 11/03/2017 11:03:43 needed for thread 1
ORA-00289: suggestion: / u01/app/oracle/archive/arch_1_943793507_23.log
ORA-00280: change 1324612 for thread 1 is in sequence # 23
Check here to see if / u01/app/oracle/archive/arch_1_943793507_23.log exists
If it doesn't exist, it's not archived.
Specify log: {= suggested | filename | AUTO | CANCEL}
/ u01/app/oracle/oradata/hyyk/redo02.log
Log applied.
Media recovery complete.
/ / start the database by RESETLOGS
SYS@hyyk > alter database open resetlogs
Database altered.
/ / back up the whole database in time
Experiment 2 discards all control files after modifying the database structure
Experimental ideas: 1. Back up the current control file
two。 Create a tablespace and table
3. Delete the current control file
4. Boot the database from
5. Found that the control file is inconsistent with the data file.
Backup control file
SYS@hyyk > alter database backup controlfile to'/ home/oracle/control01.ctl'
Create tablespaces and tables
SYS@hyyk > create tablespace T2 datafile'/ u01 size
SYS@hyyk > create table b (id number) tablespace T2
SYS@hyyk > insert into b values (2)
SYS@hyyk > commit
Delete the current control file
SYS@hyyk > ho cp / home/oracle/control01.ctl / u01/app/oracle/oradata/hyyk/control01.ctl
SYS@hyyk > ho cp / home/oracle/control01.ctl / u01/app/oracle/oradata/hyyk/control02.ctl
Change the database mount phase
SYS@hyyk > alter database mount
Open the database
SYS@hyyk > alter database open
Alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SYS@hyyk > alter database open resetlogs
Alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1:'/ u01 *
View logs that are currently in use
SYS@hyyk > select * from v$log
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
-
STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
--
1 1 1 52428800 512 1 YES
INACTIVE 1347611 05-NOV-17 1354710 05-NOV-17
3 1 3 52428800 512 1 NO
CURRENT 1358125 05-NOV-17 2.8147E+14
2 12 52428800 512 1 YES
INACTIVE 1354710 05-NOV-17 1358125 05-NOV-17
Restore the current database
SYS@hyyk > recover database using backup controlfile
ORA-00279: change 1358125 generated at 11/05/2017 12:37:33 needed for thread 1
ORA-00289: suggestion: / u01/app/oracle/archive/arch_1_959256089_3.log
ORA-00280: change 1358125 for thread 1 is in sequence # 3
/ / check here to see if the archive log exists. If so, select auto below, and enter the current rodo log if it does not exist.
Specify log: {= suggested | filename | AUTO | CANCEL}
/ u01/app/oracle/oradata/hyyk/redo03.log
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile (s) added to control file by media recovery
ORA-01110: data file 7:'/ u01 *
ORA-01112: media recovery not started
SYS@hyyk > select name from v$datafile
NAME
/ u01/app/oracle/oradata/hyyk/system01.dbf
/ u01/app/oracle/oradata/hyyk/sysaux01.dbf
/ u01/app/oracle/oradata/hyyk/undotbs01.dbf
/ u01/app/oracle/oradata/hyyk/users01.dbf
/ u01/app/oracle/oradata/hyyk/example01.dbf
/ u01/app/oracle/oradata/hyyk/t1.dbf
/ u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007
Rename the data file
SYS@hyyk > alter database create datafile'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007' as
2'/ u01qapp.oracle.oradata.hyykUniver t2.dbf'
9. Restore the database
SYS@hyyk > recover database using backup controlfile
ORA-00279: change 1364363 generated at 11/05/2017 13:51:22 needed for thread 1
ORA-00289: suggestion: / u01/app/oracle/archive/arch_1_959256089_3.log
ORA-00280: change 1364363 for thread 1 is in sequence # 3
Specify log: {= suggested | filename | AUTO | CANCEL}
/ u01/app/oracle/oradata/hyyk/redo03.log
Log applied.
Media recovery complete.
SYS@hyyk > alter database open resetlogs
Database altered.
View data files
SYS@hyyk > select name from v$datafile
NAME
/ u01/app/oracle/oradata/hyyk/system01.dbf
/ u01/app/oracle/oradata/hyyk/sysaux01.dbf
/ u01/app/oracle/oradata/hyyk/undotbs01.dbf
/ u01/app/oracle/oradata/hyyk/users01.dbf
/ u01/app/oracle/oradata/hyyk/example01.dbf
/ u01/app/oracle/oradata/hyyk/t1.dbf
/ u01/app/oracle/oradata/hyyk/t2.dbf
7 rows selected.
SYS@hyyk > select * from b
ID
-
On how to carry out the recovery of oracle control files to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.