Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to recover control files through Snapshot Control File

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to restore control files through Snapshot Control File. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

What AningDBA shares with you today is how to restore control files through rman snapshot control files:

The oracle version I tested today is 10.2.01. Due to version problems, the experimental results may be different.

1.1. View Snapshot Control File location RMAN > SHOW SNAPSHOT CONTROLFILE NAME

Using target database control file instead of recovery catalog

RMAN configuration parameters are:

CONFIGURE SNAPSHOT CONTROLFILE NAME TO'/ u01qapplash oracleandproductAction10.2.0Uniplicationdbroom1anddbsAccordsSnapcfscratch PROD.fect; # default

RMAN >

1.2. Check for the presence of [oracle@secdb1 dbs] $in Snapshot Control File

[oracle@secdb1 dbs] $cd / u01/app/oracle/product/10.2.0/db_1/dbs

[oracle@secdb1 dbs] $ll-h snapcf_PROD.f

-rw-r- 1 oracle oinstall 6.6m Jan 8 23:21 snapcf_PROD.f

[oracle@secdb1 dbs] $

1.3. The official explanation of Snapshot Control File, When RMAN needs to resynchronize from a read-consistent version of the control file, it creates a temporary snapshot control file. RMAN needs a snapshot control file only when resynchronizing with the recovery catalog or when making a backup of the current control file.

When RMAN needs to be resynchronized and the version control file is read consistent, it creates a temporary snapshot control file. RMAN needs a snapshot control file only when resynchronizing the recovery directory or backing up the current control file.

1.4. Simulation control file missing 1.4.1 View control file location SQL > show parameter control_files

NAME TYPE VALUE

-

Control_files string / u01/app/oracle/oradata/PROD/d

Isk1/control01.ctl, / u01/app/o

Racle/oradata/PROD/disk2/contr

Ol02.ctl, / u01/app/oracle/orad

Ata/PROD/disk3/control03.ctl

SQL >

1.4.2 Delete the current control file SQL >! rm-rf / u01/app/oracle/oradata/PROD/disk1/control01.ctl

SQL >! rm-rf / u01/app/oracle/oradata/PROD/disk2/control02.ctl

SQL >! rm-rf / u01/app/oracle/oradata/PROD/disk3/control03.ctl

Here we deal with it separately in two cases. The first case is the recovery after the restart of the control file loss database, and the second is the control file loss database without restart recovery.

1.5 Control file loss after database restart recovery 1.5.1 shutdown of the database we found that it could not be closed normally, using abort to shut down

SQL > shutdown immediate

ORA-00210: cannot open the specified control file

ORA-00202: control file:'/ u01OnOnOnAccord oradataUniple PRODUniverse disk1andcontrol01.ctl'

ORA-27041: unable to open file

Linux Error: 2: No such file or directory

Additional information: 3

SQL > shutdown abort

ORACLE instance shut down.

SQL >

1.5.2 start the database SQL > startup

ORACLE instance started.

Total System Global Area 314572800 bytes

Fixed Size 1219184 bytes

Variable Size 75498896 bytes

Database Buffers 234881024 bytes

Redo Buffers 2973696 bytes

ORA-00205: error in identifying control file, check alert log for more info

SQL >

1.5.3 check the alert log file. No control file is reported here.

Wed Jan 23 17:16:22 2013

ORA-00202: control file:'/ u01OnOnOnAccord oradataUniple PRODUniverse disk1andcontrol01.ctl'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

Wed Jan 23 17:16:22 2013

ORA-205 signalled during: ALTER DATABASE MOUNT...

1.5.4 copy Snapshot Control File to the control file directory [oracle@secdb1 ~] $cd / u01/app/oracle/product/10.2.0/db_1/dbs

[oracle@secdb1 dbs] $cp snapcf_PROD.f / u01/app/oracle/oradata/PROD/disk1/control01.ctl

[oracle@secdb1 dbs] $cp snapcf_PROD.f / u01/app/oracle/oradata/PROD/disk2/control02.ctl

[oracle@secdb1 dbs] $cp snapcf_PROD.f / u01/app/oracle/oradata/PROD/disk3/control03.ctl

[oracle@secdb1 dbs] $

1.5.5 mount Database SQL > alter database mount

Database altered.

SQL >

1.5.6 open database open database error, you need to restore the database

SQL > alter database open

Alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL > 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 *

SQL >

1.5.7 restore database SQL > recover database using backup controlfile

ORA-00279: change 185863 generated at 01/08/2013 23:21:15 needed for thread 1

ORA-00289: suggestion:

/ home/oracle/flash/PROD/archivelog/2013_01_23/o1_mf_1_11_%u_.arc

ORA-00280: change 185863 for thread 1 is in sequence # 11

Specify log: {= suggested | filename | AUTO | CANCEL}

/ u01/app/oracle/oradata/PROD/disk1/redo04_a.log

ORA-00328: archived log ends at change 185845, need later change 185863

ORA-00334: archived log:'/ u01AccessUniverse oradataUniqr PRODUniver disk1andredo04accouna.log'

SQL > recover database using backup controlfile

ORA-00279: change 185863 generated at 01/08/2013 23:21:15 needed for thread 1

ORA-00289: suggestion:

/ home/oracle/flash/PROD/archivelog/2013_01_23/o1_mf_1_11_%u_.arc

ORA-00280: change 185863 for thread 1 is in sequence # 11

Specify log: {= suggested | filename | AUTO | CANCEL}

/ u01/app/oracle/oradata/PROD/disk1/redo05_a.log

Log applied.

Media recovery complete.

SQL >

1.5.8 re-open database SQL > alter database open resetlogs

Database altered.

SQL > SQL > SQL >

1.6Control File loss Database did not restart recovery 1.6.1 execute 1.4Simulation Control File loss SQL >! rm-rf / u01/app/oracle/oradata/PROD/disk1/control01.ctl

SQL >! rm-rf / u01/app/oracle/oradata/PROD/disk2/control02.ctl

SQL >! rm-rf / u01/app/oracle/oradata/PROD/disk3/control03.ctl

SQL >

1.6.2 check if the control file exists [oracle@secdb1 dbs] $ll / u01/app/oracle/oradata/PROD/disk1/control01.ctl

Ls: / u01/app/oracle/oradata/PROD/disk1/control01.ctl: No such file or directory

[oracle@secdb1 dbs] $ll / u01/app/oracle/oradata/PROD/disk2/control02.ctl

Ls: / u01/app/oracle/oradata/PROD/disk2/control02.ctl: No such file or directory

[oracle@secdb1 dbs] $ll / u01/app/oracle/oradata/PROD/disk3/control03.ctl

Ls: / u01/app/oracle/oradata/PROD/disk3/control03.ctl: No such file or directory

[oracle@secdb1 dbs] $

1.6.3 insert test data to control the loss of files and insert data

SQL > select * from test

No rows selected

SQL > insert into test values (1)

1 row created.

SQL > select * from test

ID

-

one

SQL > commit

Commit complete.

1.6.4 copy Snapshot Control File to the control file directory [oracle@secdb1 dbs] $cd / u01/app/oracle/product/10.2.0/db_1/dbs

[oracle@secdb1 dbs] $cp snapcf_PROD.f / u01/app/oracle/oradata/PROD/disk1/control01.ctl

[oracle@secdb1 dbs] $cp snapcf_PROD.f / u01/app/oracle/oradata/PROD/disk2/control02.ctl

[oracle@secdb1 dbs] $cp snapcf_PROD.f / u01/app/oracle/oradata/PROD/disk3/control03.ctl

1.6.5 check the recovery status of control files [oracle@secdb1 dbs] $ll / u01/app/oracle/oradata/PROD/disk1/control01.ctl

-rw-r- 1 oracle oinstall 6832128 Jan 23 17:42 / u01/app/oracle/oradata/PROD/disk1/control01.ctl

[oracle@secdb1 dbs] $ll / u01/app/oracle/oradata/PROD/disk2/control02.ctl

-rw-r- 1 oracle oinstall 6832128 Jan 23 17:42 / u01/app/oracle/oradata/PROD/disk2/control02.ctl

[oracle@secdb1 dbs] $ll / u01/app/oracle/oradata/PROD/disk3/control03.ctl

-rw-r- 1 oracle oinstall 6832128 Jan 23 17:42 / u01/app/oracle/oradata/PROD/disk3/control03.ctl

[oracle@secdb1 dbs] $

1.6.6 Test whether the current control file is available query view control file is available, but alert reports an error

SQL > select status from v$instance

STATUS

-

OPEN

SQL > select dbid from v$database

DBID

-

215959243

1.6.7 stop database SQL > shutdown immediate

ORA-00600: internal error code, arguments: [2141], [217309148], [0], []

SQL >

View alert information:

Wed Jan 23 21:22:11 2013

Error: Controlfile was changed externally while mounted

Please check if another Oracle database is running

And accessing the same controlfile

Wed Jan 23 21:22:11 2013

Errors in file / u01/app/oracle/admin/PROD/udump/prod_ora_5636.trc:

ORA-00600: internal error code, arguments: [2141], [217309148], [0], []

Wed Jan 23 21:22:12 2013

Errors in file / u01/app/oracle/admin/PROD/udump/prod_ora_5636.trc:

ORA-00600: internal error code, arguments: [2141], [217309148], [0], []

Wed Jan 23 21:22:12 2013

Errors in file / u01/app/oracle/admin/PROD/udump/prod_ora_5636.trc:

ORA-00600: internal error code, arguments: [2141], [217309148], [0], []

Wed Jan 23 21:22:12 2013

Errors in file / u01/app/oracle/admin/PROD/udump/prod_ora_5636.trc:

ORA-00600: internal error code, arguments: [2141], [217309148], [0], []

1.6.8 Force stop database SQL > shutdown abort

ORACLE instance shut down.

SQL >

1.6.9 start the database SQL > startup

ORACLE instance started.

Total System Global Area 314572800 bytes

Fixed Size 1219184 bytes

Variable Size 79693200 bytes

Database Buffers 230686720 bytes

Redo Buffers 2973696 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL >

1.6.10 start the database SQL > alter database open resetlogs using 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 *

1.6.11 recovery Database SQL > recover database using backup controlfile

ORA-00279: change 185863 generated at 01/08/2013 23:21:15 needed for thread 1

ORA-00289: suggestion: / home/oracle/flash/PROD/archivelog/2013_01_23/o1_mf_1_11_%u_.arc

ORA-00280: change 185863 for thread 1 is in sequence # 11

Specify log: {= suggested | filename | AUTO | CANCEL}

/ u01/app/oracle/oradata/PROD/disk1/redo05_a.log

ORA-00279: change 207533 generated at 01/08/2013 23:42:43 needed for thread 1

ORA-00289: suggestion: / home/oracle/flash/PROD/archivelog/2013_01_23/o1_mf_1_12_%u_.arc

ORA-00280: change 207533 for thread 1 is in sequence # 12

ORA-00278: log file'/ u01 no longer needed for this recovery

Specify log: {= suggested | filename | AUTO | CANCEL}

/ u01/app/oracle/oradata/PROD/disk1/redo01.log

ORA-00310: archived log contains sequence 9; sequence 12 required

ORA-00334: archived log:'/ u01OnOnOnAccord oradataPlacement PRODUniverse disk1andredo01.log'

SQL > recover database using backup controlfile

ORA-00279: change 207533 generated at 01/08/2013 23:42:43 needed for thread 1

ORA-00289: suggestion: / home/oracle/flash/PROD/archivelog/2013_01_23/o1_mf_1_12_%u_.arc

ORA-00280: change 207533 for thread 1 is in sequence # 12

Specify log: {= suggested | filename | AUTO | CANCEL}

/ u01/app/oracle/oradata/PROD/disk1/redo02.log

Log applied.

Media recovery complete.

SQL >

1.6.12 re-open database SQL > alter database open resetlogs

Database altered.

SQL >

After reading the above, do you have any further understanding of how to recover control files through Snapshot Control File? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report