Large Oracle database recovery (caused by misoperation)

Source: Internet
Author: User

The following articles mainly introduce the large recovery of the Oracle database caused by an incorrect operation. I checked dbms_backup_restore.zerodbid (0) in the script for creating a 10 Gb manual database in Oracle two days ago, the main function is to modify the dbid of the Oracle database.

Therefore, you want to use this storage to directly modify the dbid in sqlplus.

Record its dbid before modification

Reference

 
 
  1. SQL> select dbid from v$database;  
  2. DBID  
  3. 1488207495  

Modify dbid

Reference

 
 
  1. SQL> exec dbms_backup_restore.zerodbid(0);  
  2. PL/SQL procedure successfully completed.  

It seems that the execution is successful, but then the alert log shows that the ckpt process terminated the data instance.

Reference

 
 
  1. Tue Mar 9 01:43:22 2010  
  2. CKPT: terminating instance due to error 1242  
  3. Instance terminated by CKPT, pid = 16653 
  4. Tue Mar 9 01:43:53 2010  

An error is reported when Oracle database is started again.

Reference

 
 
  1. Tue Mar 9 01:56:09 2010  
  2. Errors in file /ora10g/app/admin/ldbra/udump/ldbra_ora_12275.trc:  
  3. ORA-01221: data file 1 is not the same file to a background process  
  4. ORA-1221 signalled during: ALTER DATABASE OPEN...  

Dump Oracle Data File Header

Reference

 
 
  1. SQL> ALTER SESSION SET EVENTS 'immediate trace name file_hdrs level 3'; 

The trace file shows that dbid is reset to 0.

Reference

 
 
  1. V10 STYLE FILE HEADER:  
  2. Compatibility Vsn = 169870080=0xa200300  
  3. Db ID=0=0x0, Db Name='LDBRA' 
  4. Activation ID=0=0x0  
  5. Control Seq=8122=0x1fba, File size=65280=0xff00  
  6. File Number=1, Blksiz=8192, File Type=3 DATA  

Another way is to use the bbed tool to observe

Reference

 
 
  1. struct kcvfhhdr, 76 bytes @20  
  2. ub4 kccfhswv @20 0x00000000  
  3. ub4 kccfhcvn @24 0x0a200300  
  4. ub4 kccfhdbi @28 0x00000000  

Of course, the first response is to re-create the control file to see if it can be restored successfully.

Reference

 
 
  1. SQL> alter database backup controlfile to trace;  
  2. Database altered.  
  3. STARTUP NOMOUNT  
  4. CREATE CONTROLFILE REUSE DATABASE "LDBRA" RESETLOGS ARCHIVELOG  
  5. MAXLOGFILES 16  
  6. MAXLOGMEMBERS 3  
  7. MAXDATAFILES 100  
  8. MAXINSTANCES 8  
  9. MAXLOGHISTORY 292  
  10. LOGFILE  
  11. GROUP 1 '/ora10g/app/oradata/ldbra/redo01.log' SIZE 50M,  
  12. GROUP 2 '/ora10g/app/oradata/ldbra/redo02.log' SIZE 50M,  
  13. GROUP 3 '/ora10g/app/oradata/ldbra/redo03.log' SIZE 50M  
  14. -- STANDBY LOGFILE  
  15. DATAFILE  
  16. '/ora10g/app/oradata/ldbra/system01.dbf',  
  17. '/ora10g/app/oradata/ldbra/undotbs01.dbf',  
  18. '/ora10g/app/oradata/ldbra/sysaux01.dbf',  
  19. '/ora10g/app/oradata/ldbra/users01.dbf',  
  20. '/ora10g/app/oradata/ldbra/example01.dbf',  
  21. '/ora10g/app/product/10.2.0/db_1/dbs/company.dbf',  
  22. '/ora10g/app/product/10.2.0/db_1/dbs/streams.dbf'  
  23. CHARACTER SET ZHS16GBK  

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.