Solution to accidental deletion of Oracle Database Files

Source: Internet
Author: User

We all know that the rollback segment is a part of the database, and its main function is to record the change information of the Oracle database. This information enables read consistency and restoration of Oracle databases. If the rollback segment fails, the database cannot be started normally, resulting in database paralysis and the user cannot read or write data.

If the rollback segment can be eliminated, the actual data of the user will not be affected. I recently encountered a problem in my practical work:

The user deletes the Oracle database file (rbs01.dbf) of the tablespace (rbs) in the rollback segment by mistake, so that the database cannot run properly. Next I will exclude the processing steps of this method.

Steps:

1. First, modify the parameter file init. ora so that the Oracle database can be mounted.

There is a system rollback segment in the system tablespace, which is required by the database on the rollback segment. When the database is created for the first time, it is created accordingly, and automatically online as the database is opened. We usually use a public rollback segment instead of a system rollback segment. If a public rollback segment fails, we can replace the system rollback segment temporarily, enables the Oracle database to be mounted.

 
 
  1. svrmgrl >Shutdown abort   
  2. $ vi $ORACLE_HOME/dbs/init< sid >.ora   
  3. rollback_segments=(system)   
  4. _corrupted_rollback_segments=(r01,r02,r03,r04)   
  5. svrmgrl >Startup mount  

2. Restore the database and open it again.

Remove the rbs data file rbs01.dbf In the rollback segment from the control file of the Oracle database.

 
 
  1. svrmgrl >alter database datafile   
  2. ‘##/##/rbs01.dbf’ offline drop;  

Restore the database.

 
 
  1. svrmgrl >recover database using backup controlfile;  

At this time, the screen may appear:

 
 
  1. ORA_00280 Change #### for thread# is in sequence#   
  2. specify log:[< RET > for suggested|AUTO|from   
  3. logsource|cancel] 

You can find the online log file you need based on the sequence # And enter the log file (including the full path ), when searching online log files, you can use svrmgrl> select * from v $ log. At this time, the Oracle database is restored. Then open the database.

 
 
  1. svrmgrl >alter database open resetlogs;  

3. recreate a rollback segment

Delete the old rollback segment and the rollback tablespace.

 
 
  1. svrmgrl >alter rollback_segment r01 offline drop;   
  2. svrmgrl >alter rollback_segment r02 offline drop;   
  3. svrmgrl >alter rollback_segment r03 offline drop;   
  4. svrmgrl >alter rollback_segment r04 offline drop;   
  5. svrmgrl >drop tablespace rbs including contents;  

Create a new table space and rollback segment.

 
 
  1. svrmgrl >connect internal   
  2. svrmgrl >create rollback segment ro tablespace system;   
  3. svrmgrl >alter rollback segment ro online;   
  4. svrmgrl >create tablespace rbs datafile   
  5. ‘##/##/rbs01.dbf’ size ##k;   
  6. svrmgrl >create rollback segment r01 tablespace rbs;   
  7. svrmgrl >create rollback segment r02 tablespace rbs;   
  8. svrmgrl >create rollback segment r03 tablespace rbs;   
  9. svrmgrl >create rollback segment r04 tablespace rbs;   
  10. svrmgrl >alter rollback segment r01 online;   
  11. svrmgrl >alter rollback segment r02 online;   
  12. svrmgrl >alter rollback segment r03 online;   
  13. svrmgrl >alter rollback segment r04 online;  

4. Use the new rollback segment to start the database

 
 
  1. Svrmgrl> Shutdown abort
  2. $ Vi $ ORACLE_HOME/dbs/init <sid>. ora
  3. Rollback_segments = (r01, r02, r03, r04)
  4. Remove the parameter _ uploupted_rollback_segment.
  5. Svrmgrl> Startup normal

Conclusion:

The Troubleshooting of this fault is performed by Oracle Database in archive mode, which has been successfully passed through on HP-UX 10.20 and Solaris2.5.

Article by: http://www.programbbs.com/doc/class10-3.htm

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.