Oracle tablespace recovery makes you no longer worry about database errors

Source: Internet
Author: User

When studying Oracle, you may encounter oracle tablespace recovery problems. Here we will introduce the solutions to Oracle tablespace recovery problems. Here we will share with you.

Oracle tablespace recovery plan

1. User tablespace
Error:
A ora-01157, ora-01110, or operating system-level error, such as a ora-07360, occurs when you shut down the database (using shutdown normal or shutdown immediate), causing errors ora-01116, ora-01110, and operating system-level error ora-07368

There are two solutions:

1. the user's tablespace can be easily rebuilt, that is, the recently exported objects are available or the objects in the tablespace can be easily rebuilt. in this case, the easiest way is to offline and delete the data file, delete the tablespace, and recreate the tablespace and all objects.
Svrmgrl> startup mount
Svrmgrl> alter database datafile filename offline drop;
Svrmgrl> alter database open;
Svrmgrl> drop tablespace tablespace_name including contents;
Recreate the tablespace and all objects.

2. the user's tablespace cannot be easily rebuilt. In most cases, it is impossible to recreate the tablespace. the method is back up and restore the media. if your system runs in noarchivelog mode, only the lost data in the online redo log can be recovered.
The procedure is as follows:
1) restore the lost datafile from a backup
2) svrmgrl> startup mount
3) svrmgrl> select v1.group #, member, sequence #, first_change #> from v $ log v1, v $ logfile v2> where v1.group # = v2.group #;
4) if the database runs in noarchivelog mode, select file #, change # from v $ recover_file;
If change # is greater than first_change #, the data file can be restored. If change # is smaller than first_change #, the data file cannot be recovered. Recover the last full backup or adopt solution 1.
5) svrmgrl> recover datafile filename;
6) Confirm that the Oracle tablespace is restored successfully.
7) svrmgrl> alter database open resetlogs;

3. Read-Only tablespaces do not require media restoration. You only need to restore the backup. The only exception is:
The tablespace is changed to read-write mode after the last backup.
The tablespace is changed to read-only mode after the last backup.
In this case, media recovery is required.

Ii. Temporary tablespace
The temporary tablespace does not contain real data. The restoration method is to delete the temporary tablespace and recreate it.

Iii. System tablespace
If the backup is unavailable, you can only rebuild the database.

4. Roll Back tablespaces
There are two scenarios:

1. The database has been completely shut down (use the shutdown immediate or shutdown command)
1) Confirm that the database is completely closed
2) modify the init. ora file and comment "rollback-segment"
3) svrmgrl> startup restrict mount
4) svrmgrl> alter database datafile filename offline drop;
5) svrmgrl> alter database open;
Based on the result:
"Statement processed"
"Ora-00604, ora-00376, ora-01110"
6) svrmgrl> shutdown immediate modify the init. ora file and add the following line: _ uploupted_rollback_segments = (,...) svrmgrl> startup restrict
7) svrmgrl> drop tablespace tablespace_name including contents;
8) recreate the tablespace and rollback segments.
9) svrmgrl> alter system disable restricted session;
10) modify the init. ora File

2. The database is not completely closed (the database crashes or the database is shut down using the shutdown abort command)
1) Oracle tablespace Recovery Backup
2) svrmgrl> startup mount
3) svrmgrl> select file #, name, status from v $ datafile; svrmgrl> alter database datafile filename online;
4) svrmgrl> select v1.group #, member, sequence #, first_change #> from v $ log v1, v $ logfile v2> where v1.group # = v2.group #;
5) svrmgrl> select file #, change # from v $ recover_file;
6) svrmgrl> recover datafile filename;
7) svrmgrl> alter database open;

3. The database is open.
1) Delete rollback segments and tablespaces
2) recreate the tablespace and rollback segments.

5. control file recovery
1. All control files are damaged
Copy the backup control file to the original directory for raw device, then:
Dd if = ''con. Bak' of = ''/dev/rdrd/drd1'' seek = 128
2. Not all control files are damaged
Start the database with other control files

  1. Summary about the tablespace transmitted by VB. NET
  2. Oracle Financial Management System: Accounting Business Cycle
  3. Away from theory, touch NoSQL: distributed scalable non-relational database focus
  4. Step 4: Change the Oracle user name
  5. Five-minute master of Oracle tablespace

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.