Wednesday, May 5, 2010

RMAN answer of any Backup/Restore/Copy DB

'rman target=/ ' is every thing we need. I would like to just put some useful command here to remember spelling and fine for review (explanation is not require but if you want, request).

Configure retention policy to redundancy 2;
Configure device type disk backup to compressed backupst;
sql ' Alter database enable block change tracking' ;
backup as compressed backupset database plus archivelog delete input;
backup as compressed backupset incremental level 1 database plus archivelog delete input;
restore validate [database|controlfile|archivelog];
sql 'create pfile from memory';
Restore controlfile from autobackup;
Restore spfile from autobackup;
Recover corruption list;
restore database ;
recover database ;
recover database until time '29/12/2009 22:00:00'; (before rman, set NLS_DATE_FORMAT)
recover database until sequence 12162;
reset database to incarnation 2;

show all; ( show all RMAN configuration)
list backup of database summary;
Crosscheck archivelog all; (check archivelogs exist on storage to mark them as expired)
Crosscheck backup; (check backups exist on storage or somebody already has deleted them)
report obsolete ; (list all backup that do not need any more ( out of retention policy))
list expired backup of database ;
report need backup days 3;
list incarnation;

Clean and housekeeping
delete expired
delete obsolete

[rman target=/ auxiliary=sys/pass@DB2]
duplicate target database to DB2 nofilenamecheck spfile ;
duplicate target database to DB2 from active database nofilenamecheck
> spfile set control_files 'C:\db\oradata\control01.ctl' , 'D:\db\oradata\control02.ctl'
> set db_filename_convert 'C:\db', C:\db2' set log_file_name_convert 'C:\db' , 'C:\db2' ;

No comments:

Post a Comment