Monday, December 14, 2009

RMAN CONFIGURACTION

===================================
R-M-A-N =
===================================
Connect:
$rman target /
$rman nocatalog target /
$rman nocatalog target sys/aziz@JKTDB2
$rman target sys/aziz@JKTDB2
RMAN> shutdown;
RMAN> shutdown immediate;
RMAN> startup mount; >>startup an instance and mounting database
RMAN> startup nomout; >>startup an instance without mounting database
RMAN> startup restrict; >>restricting access to an instance at startup
RMAN> ALTER SYSTEM DISABLE RESTRICTED SESSION; >>disable the restricted session
RMAN> STARTUP FORCE; >>forcing an instance to start
RMAN> STARTUP OPEN RECOVER >>Starting an Instance, Mounting a Database,
and Starting Complete Media Recovery
RMAN> connect target sys/aziz@jktdb2;
RMAN> startup mount;
RMAN> register database; >>register target database to recovery catalog
RMAN> reset database; >>create new database incarnation record in the
recovery catalog
RMAN> backup database;
RMAN> backup current controlfile;
RMAN> backup database plus archivelog;
RMAN> backup archivelog all;
RMAN> list backup; >>list all file that was backed up
RMAN> list backup summary;
RMAN> restore database;
RMAN> restore archivelog all;
RMAN> recover database;
RMAN> restore datafile ‘C:\ORACLE\ORADATA\JKTDB2\USERS01.DBF’;
RMAN> recover datafile ‘C:\ORACLE\ORADATA\JKTDB2\USERS01.DBF’;
RMAN> Recover database until cancel using backup controlfile;
RMAN> Alter database open resetlogs;
RMAN> allocate channel for maintenance type disk;
RMAN> crosscheck backup of database;
RMAN> delete expired backup of database;
RMAN> crosscheck backup of archivelog all;
RMAN> delete expired backup of archivelog all;
RMAN> change archivelog all crosscheck;
RMAN> resync catalog;
RMAN> crosscheck backup of archivelog all;
RMAN> sql ‘alter tablespace USERS offline immediate’;
RMAN> recover tablespace USERS;
RMAN> sql ‘alter tablespace USERS online’;
—————————————————————
configure =
—————————————————————
RMAN>configure default device type to ’sbt_tape’; >>to tape
RMAN>configure default device type to DISK; >>to disk
rman>configure controlfile autobackup format for device type ’sbt_tape’ to ‘%F’;
RMAN>configure controlfile autobackup on;
RMAN>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN>CONFIGURE RETENTION POLICY TO REDUNDANCY 3; >>Retain three backups of each datafile:
RMAN> resync catalog;
—————————————————————
Restore & Recover The Whole Database=
—————————————————————
run {
shutdown immediate; # use abort if this fails
startup mount;
restore database;
recover database;
alter database open;
}
—————————————————————-

1 comment: