RMAN helpful for their orders
RMAN command simple solution1 provides a counterpart
RMAN> list incarnation;
2 shows an overview of available Backup 2.1 backup RMAN> list backup summary;
B said backup
F expressed FULL
A said that archive log
0 1 that the incremental backup
S indicate the backup status (A AVAILABLE X EXPIRED)
2.2 by a backup type backup RMAN> list backup by file;
In accordance with the data file backup, archive log backup, the backup control file, server parameter file backup 2.3 sets out the detailed list backup RMAN> list backup;
2.4 list expired backup RMAN> list expired backup;
2.5 are listed in table space and data file backup list backup of tablespace and list backup of datafile output and a similar list backup, such as: list backup of tablespace user_tbs;
list backup of datafile 3;
2.6 are listed in archive log backup RMAN> list archivelog all; summary information RMAN> list backup of archivelog all; detailed information set out in 2.7 control file and server parameter file RMAN> list backup of controlfile;
RMAN> list backup of spfile;
================================================== ===
================================================== ===
RMAN command 1 of the report. The report has not been recently backed up data files RMAN> report need backup days = 3;
2. Report of the backup or restore window redundancy RMAN> report need backup redundancy = 2;
RMAN> report need backup recovery window of 2 days;
3. Report of data files can not resume operation of the RMAN> report unrecoverable;
4. Report of database schema RMAN> report schema;
5. Report of discarded backup strategy if you are using the save, backup would be marked as abandoned state RMAN> report obsolete; delete discarded state backup RMAN> delete obsolete;
================================================== ===
================================================== ===
1 of crosscheck command RMAN backup set, there are two state A (Available, RMAN backup that exists in the medium) X (Expired, exist in the control file backup or restore the directory, but there was no physical presence in the backup media)
2 crosscheck the purpose is to examine the RMAN catalog, as well as physical file, if the physical file does not exist in the media will be marked as Expired. If the physical file exists, will remain Available. If the original tag for the backup set again Expired exist in the backup media (such as the restoration of a damaged disk drive), crosscheck will re-state back from Expired tag Available.
3 crosscheck the output in two parts. Set out to determine the existence of the first part of the backup media in a backup set of all films are listed in the second part of the backup media does not exist in the backup set piece, and marked as Expired. When a backup retention policy settings, a backup expired, crosscheck Marked as discarded after the backup is still the state for availabel, you want to remove discarded backup delete obsolete.
4 Example:
crosscheck backup
crosscheck backup of datafile 1;
crosscheck backup of tablespace users;
crosscheck backup of controfile;
crosscheck backup of controlfile;
crosscheck backup tag = 'SAT_BACKUP';
crosscheck backup completed after 'sysdate - 2'
crosscheck backup completed between 'sysdate - 5' and 'sysdate -2'
crosscheck backup device type sbt;
crosscheck archivelog all;
crosscheck archivelog like '% ARC00012.001'
crosscheck archivelog from sequence 12;
crosscheck archivelog until sequence 522;
================================================== ===
================================================== ===
RMAN command 1 validate the validate command to verify whether backup sets can be restored films 2 list backup summary; by the winner of the backup set key ID, such as 40, and then validate backupset 40;
================================================== ===
================================================== ===
RMAN backup retention policy, as well as change, delete command 0. With the change order parameter delete the backup set to delete from the backup media, and from the control file and restore the directory to delete.
change backupset 117,118 delete;
change backuppiece 1304 delete;
change archivelog until logseq = 544 delete;
1. Types of strategies: preservation strategies to restore the window back up (recovery windows backup retension policy) time-based backup retention policy backup redundancy (backup redundancy backup retension policy) based on the number of two types of backup strategies mutually exclusive 2. Even if the use of a backup retention policy , does not delete expired backup, RMAN only directory marked as discarded, the state is still seen as available;
To view the backup Marked as discarded report obsolete, the only truly delete obsolete the use of physical deleted.
3.configure retension policy to recovery window of 7 days;
configure retension policy to redundancy 3;
Show results show all;
4. See discarded due to back up, you may need to preserve some of the backup manually, you can keep using the change command with parameters, use this command after the backup of those changes would be considered a long-term backup, is not affected by the impact of preservation strategies That is to say not to delete delete obsolete.
5. To make the backup time from the impact of the preservation strategy, the use of the backup band keep order parameter backup database keep forever;
backup database keep 5 days;
6.change command backup functions can be modified for permanent preservation as well as the backup and related saved log to ensure that the overall backup and recovery to the current point in time change backupset 31 keep forever logs;
Discarded can set a new date backup will back up seven days in a multi-preservation, will be deleted 7 days after the change backupset 32 keep until time 'sysdata + 7' logs;
7.change backup set can be set to unavailable
change backupset 33 unavailable;
Marked as state unavailable to participate in the backup set does not crosscheck;
================================================== ===
================================================== ===
To restore the directory to delete the record of 1. $ ORACLE_HOME / rdbms / admin / prgrmanc.sql script to restore a regular basis to delete the directory records with DELETED status 2. You want to delete the old record of counterpart incarnation. Must be deleted from the table DBINC these counterparts, the use of view to RC_DATABASE_INCARNATION sure you want to delete the corresponding objects. Records you want to delete the corresponding objects in each DBINC_KEY
Then start SQL * Plus, the implementation of delete from dbinc where dbinc_key = 2;
================================================== ===
================================================== ===
Manual directory synchronization to restore resync catalog;
Oracle directory synchronization to resume, it should first create a snapshot control file, and then compare the files and directories to restore is completed, Oracle update to restore the directory, so that the restoration of the directory and control file synchronization ============= ========================================
================================================== ===
RMAN script stored in 1, to connect to the target database and recovery catalog rman target / catalog rman / rman @ rman9i
2, create script RMAN> create script my_bk_script
2> (backup database plus archivelog;)
create script my_bk_script
3, print script RMAN> print script my_bk_script;
printing stored scipt: my_bk_script
(backup database plus archivelog;)
4, run the script, backup the target database RMAN> run (execute scipt my_bk_script;)
5 delete script RMAN> delete script my_bk_script;
================================================== ===
================================================== ===
archivelog mode to restore the complete step1: set oracle_sid = recover
rman target rman_backup / password
configure controlfile autobackup on;
step2: backup database plus archivelog delete input;
step3: shutdown immediate;
step4: Rename all the data files and control files, do not rename online redo log.
step5: startup nomount;
set DBID =****
restore controlfile from autobackup;
alter database mount;
step6: restore database;
recover database;
alter database open resetlogs;
Table space to restore sql "alter tablespace users offline";
sql "alter tablespace tools offline";
restore tablespace users, tools;
recover tablespace users, tools;
sql "alter tablespace users online";
sql "alter tablespace tools online";
The restoration of data files sql "alter database datafile 3 offline";
sql "alter database datafile 'd: oracleoradatausers01.dbf' offline";
restore datafile 3
restore datafile 'd: oracleoradatausers01.dbf';
recover datafile 3
recover datafile 'd: oracleoradatausers01.dbf';
sql "alter database datafile 3 online";
sql "alter database datafile 'd: oracleoradatausers01.dbf' online";
================================================== ===
================================================== ===
Switch back to the current incarnation of resetlogs before RESET DATABASE TO INCARNATION inc_key
================================================== ===
================================================== ===
RMAN Advanced Recovery 1 point in time based on the recovery run
(
set until time "to_date ('07 / 01/02 15:00:00 ',' mm / dd / yy hh24: mi: ss')" '
restore database;
recover database;
alter database open resetlogs;
)
2 based on the SCN of the restoration of startup mount;
restore database UNTIL SCN 10000;
recover database UNTIL SCN 10000;
alter database open resetlogs;
3 Based on the log sequence to restore the startup mount;
restore database UNTIL SEQUENCE 100 thread 1;
recover database UNTIL SEQUENCE 100 thread 1;
alter database open resetlogs;
Tags: backup set, table space, file server, database schema, incarnation 2, backup strategy, backup recovery, redundancy, counterpart, simple solution
Permalink: http://www.kods.netwww.kods.net/rman-helpful-for-their-orders/
















