oracle| Recovery | data | database
First, user table space
Error: ORA-01157,ORA-01110 or operating system-level errors such as ORA-07360 when you start the database will cause an error immediate when you close the database (using shutdown normal or shutdown ORA-01116). ORA-01110 and operating system-level errors ORA-07368
There are two solutions to this problem:
1. User's table space can be easily rebuilt
That is, the most recently exported object is available or the objects in the tablespace can be easily rebuilt, and so on. In this case, the easiest way to do this is to offline and delete the data file, delete the table space, and rebuild the table space and all the objects.
Svrmgrl> Startup Mount
svrmgrl> ALTER DATABASE datafile filename offline drop;
svrmgrl> ALTER DATABASE open;
Svrmgrl> drop tablespace tablespace_name including contents;
Rebuilds the table space and all objects.
2. User's table space cannot be easily rebuilt
In most cases, rebuilding tablespaces is impossible and too hard work. The method is to back up and do media recovery. If your system is running in Noarchivelog mode, only the missing data is available. On the online redo log The Chinese can be restored, 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 is running in Noarchivelog mode:
Svrmgrl> select file#,change# from V$recover_file;
If the change# is greater than the smallest first_change# the data file can be restored.
If the change# is less than the smallest first_change# the data file is not recoverable. Restore the most recent full backup or adopt a scenario
5) svrmgrl> recover datafile filename;
6) Confirm the successful recovery
7) svrmgrl> ALTER DATABASE open resetlogs;
3. read-only table space does not require media recovery, as long as the backup can be restored. The only exception is:
Tablespace is changed to Read-write mode after last backup
Tablespace is changed to read-only mode after last backup
In this case, media recovery is required
Second, temporary table space
The temporary tablespace does not contain real data, and the method of recovery is to delete the temporary table space and rebuild it.
Third, system table space
If backup is not available, you can only use the method of rebuilding the database
Four, roll back the table space
There are two kinds of situations:
1, the database has been completely closed (using shutdown immediate or shutdown command)
1 Confirm that the database is completely closed
2) Modify Init.ora file, comment "Rollback-segment"
3) svrmgrl> startup restrict mount
4) svrmgrl> ALTER DATABASE datafile filename offline drop;
5) svrmgrl> ALTER DATABASE open;
Based on the results of the occurrence:
"Statement processed" (7)
"Ora-00604,ora-00376,ora-01110" Turn (6)
6) svrmgrl> shutdown immediate
Modify the Init.ora file to add the following line:
_corrupted_rollback_segments = (,...)
Svrmgrl> startup Restrict
7) svrmgrl> drop tablespace tablespace_name including contents;
Rebuilding table spaces and rollback segments
9) svrmgrl> Alter system disable restricted session;
10) Modify Init.ora file
2, the database is not completely shut down (database crashes or use the Shutdown Abort command to close the database)
1) Restore 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;
See a programme 2-4
6) svrmgrl> recover datafile filename;
7) svrmgrl> ALTER DATABASE open;
3, the database is in the open state
1 Delete rollback segment and table space
2 reconstruction of table space and rollback segment
Five control File Recovery
1. All control files are corrupted and the backup control files are copied to the original directory. For Raw DEVICE, then:
DD if= ' con.bak ' of= '/dev/rdrd/drd1 ' seek=128
2. Not all control files are corrupted: The database is started with other control files.