Oracle Database rman recovery-system tablespace recovery

Source: Internet
Author: User

OracleDatabaseRman recoveryOfSystem tablespace recoveryIs what we will introduce in this article. The system tablespace stores the data dictionary information. When the database is in the open state and the data file corresponding to the system tablespace fails, the database will automatically shut down when I/O operations are performed on the data file; when the database is closed, if the data file corresponding to the system tablespace fails, the database cannot be opened. Restoring the system tablespace must be in the mount state.

Example 1: the data file in the system tablespace is accidentally deleted from the backup database.

Delete the data file corresponding to the system tablespace. Start the database to the mount status. Use restore datafile to dump data files, use the recover datafile command to apply archive logs, and finally use alter database open to open the database.

-- Backup database omitted)

-- Delete the data file corresponding to the system tablespace

 
 
  1. RMAN> host rm $ORACLE_BASE/product/10.2.0/oradatabak/system01.dbf    
  2. RMAN> startup    
  3. connected to target database (not started)    
  4. Oracle instance started    
  5. database mounted    
  6. RMAN-00571: ===========================================================    
  7. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============    
  8. RMAN-00571: ===========================================================    
  9. RMAN-03002: failure of startup command at 08/22/2011 21:56:39    
  10. ORA-01157: cannot identify/lock data file 1 - see DBWR trace file    
  11. ORA-01110: data file 1: '/oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf'    
  12. SQL> select file#,error from v$recover_file;    
  13. FILE# ERROR    
  14. ---------- -----------------------------------------------------------------     
  15. 1 FILE NOT FOUND    
  16. SQL> select file#,name from v$datafile where file#=1;    
  17. FILE# NAME    
  18. ---------- ------------------------------------------------------------------------------------------------------------------------     
  19. 1 /oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf   

-- Start the database to the mount status and restore it

 
 
  1. RMAN> run {    
  2. 2> startup force mount;    
  3. 3> restore datafile 1;    
  4. 4> recover datafile 1;    
  5. 5> sql 'alter database open';    
  6. 6> }   

Example 2: the disk where the system tablespace data file is located is faulty

The backup database (Omitted) deletes the data files corresponding to the system tablespace. Start the database to the mount status. Before restore database, run set newname to specify a new location for the data file. After the restore database, Run switch datafile to change the location and name of the data file in the control file. Then, archive logs by executing the recover database application. Finally, execute alter database open to open the database.

-- Backup database omitted)

-- Delete the data file corresponding to the system tablespace

 
 
  1. RMAN> host 'rm /oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf'    
  2. 2> ;   

-- Start the database to the mount state and restore it to a new location for the data file, dump the data file, restore the data file, and open the database)

 
 
  1. RMAN> run {    
  2. 2> startup force mount;    
  3. 3> set newname for datafile 1 to '/oracle/10g/oracle/product/10.2.0/oradata/oralife/system01.dbf';    
  4. 4> restore datafile 1;    
  5. 5> switch datafile 1;    
  6. 6> recover datafile 1;    
  7. 7> sql 'alter database open';    
  8. 8> }   

This article describes how to recover the system tablespace in Oracle Database rman recovery!

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.