Oracle control file recovery

Source: Internet
Author: User

If the Oracle control file is recovered from the backup, the following describes how to restore the Oracle control file for your reference.

What will happen to the database during the open process?

First, back up the Oracle control file, open the database, and enhance the checkpoint:

 
 
  1. [oracle@jumper eygle]$ cp control01.ctl control01.ctl.bak  
  2. [oracle@jumper eygle]$ sqlplus "/ as sysdba"  
  3.  
  4. SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:46:05 2006  
  5.  
  6. Copyright (c) 1982, 2002, Oracle Corporation.   All rights reserved.  
  7.  
  8. Connected to an idle instance.  
  9.  
  10. SQL> startup  
  11. ORACLE instance started.  
  12.  
  13. Total System Global Area   139531744 bytes  
  14. Fixed Size                    452064 bytes  
  15. Variable Size              121634816 bytes  
  16. Database Buffers            16777216 bytes  
  17. Redo Buffers                  667648 bytes  
  18. Database mounted.  
  19. Database opened.  
  20. SQL> alter system checkpoint;  
  21.  
  22. System altered.  
  23.  
  24. SQL> shutdown immediate;  
  25. Database closed.  
  26. Database dismounted.  
  27. ORACLE instance shut down.  
  28. SQL> exit  
  29. Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production  
  30. With the Partitioning option  
  31. JServer Release 9.2.0.4.0 - Production  
  32.  

Then restore the old control file, mount the database, and dump the data file header:

 
 
  1. [oracle@jumper eygle]$ mv control01.ctl control01.ctl.n  
  2. [oracle@jumper eygle]$ mv control01.ctl.bak control01.ctl   
  3. [oracle@jumper eygle]$ sqlplus "/ as sysdba"  
  4.  
  5. SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:46:50 2006  
  6.  
  7. Copyright (c) 1982, 2002, Oracle Corporation.   All rights reserved.  
  8.  
  9. Connected to an idle instance.  
  10.  
  11. SQL> startup mount;  
  12. ORACLE instance started.  
  13.  
  14. Total System Global Area   139531744 bytes  
  15. Fixed Size                    452064 bytes  
  16. Variable Size              121634816 bytes  
  17. Database Buffers            16777216 bytes  
  18. Redo Buffers                  667648 bytes  
  19. Database mounted.  
  20. SQL> alter session set events 'immediate trace name file_hdrs level 10';  
  21.  
  22. Session altered.  
  23.  
  24. SQL> !  
  25.  

Let's take a look at the information of the Oracle control file and select a file ):

 
 
  1. DATA FILE #4:   
  2.    (name #4) /opt/oracle/oradata/eygle/eygle01.dbf  
  3. creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1 
  4. tablespace 4, index=4 krfil=4 prev_file=0 
  5. unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00  
  6. Checkpoint cnt:61 scn: 0x0000.002acb1e 08/11/2006 10:44:38  
  7. Stop scn: 0x0000.002acb1e 08/11/2006 10:44:38  
  8. Creation Checkpointed at scn:   0x0000.0015078d 06/06/2006 09:41:54  
  9.  

Check the data file header information again:

 
 
  1. FILE HEADER:  
  2.          Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000  
  3.          Db ID=1407686520=0x53e79778, Db Name='EYGLE' 
  4.          Activation ID=0=0x0  
  5.          Control Seq=989=0x3dd, File size=1280=0x500  
  6.          File Number=4, Blksiz=8192, File Type=3 DATA  
  7. Tablespace #4 - EYGLE   rel_fn:4   
  8. Creation    at    scn: 0x0000.0015078d 06/06/2006 09:41:54  
  9. Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0  
  10. reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/11/2006 10:11:26  
  11. status:0x0 root dba:0x00000000 chkpt cnt: 64 ctl cnt:63  
  12. begin-hot-backup file size: 0  
  13. Checkpointed at scn:   0x0000.002acb98 08/11/2006 10:46:24  
  14.  

We noticed that the chkpt cnt: 64 of the data file requires the Checkpoint cnt: 61 of the control file, that is, the control file is old.

The following error occurs when you try to open the database:

 
 
  1. [oracle@jumper udump]$ sqlplus "/ as sysdba"  
  2.  
  3. SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:51:20 2006  
  4.  
  5. Copyright (c) 1982, 2002, Oracle Corporation.   All rights reserved.  
  6.  
  7. Connected to:  
  8. Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production  
  9. With the Partitioning option  
  10. JServer Release 9.2.0.4.0 - Production  
  11.  
  12. SQL> alter database open;  
  13. alter database open  
  14. *  
  15. ERROR at line 1:  
  16. ORA-01122: database file 1 failed verification check  
  17. ORA-01110: data file 1: '/opt/oracle/oradata/eygle/system01.dbf'  
  18. ORA-01207: file is more recent than controlfile - old controlfile  
  19.  

Oracle tells us that the control file is old. In this case, we can restore the data by recreating the control file or starting from the backup of the old data.
 

Oracle single row date functions

Introduction to Oracle bitand () Functions

Use of oracle Aggregate functions

Oracle Pipeline Function usage

Use of oracle custom functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.