Please send your Questions & Answers or Feedback to "dvmadhavreddy@javabook.org"

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

RMAN in nocatalog mode


root> su - oracle
oracle> export ORACLE_SID=venu
oracle> sqlplus / as sysdba
SQL> startup
SQL> select open_mode,name,log_mode from v$database;
SQL> select instance_name,status from v$instance;
SQL> select name from v$tablespace;
SQL> select name from v$datafile;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;

FIrst way :
oracle> export ORACLE_SID=venu
oracle> rman target /
RMAN> exit

Second way :
oracle> rman nocatalog target /
RMAN> exit

THird way :
oracle> rman
RMAN> connect target /

RMAN> shut immediate
RMAN> shutdown immediate
RMAN> exit

oracle> rman target /
RMAN> startup
RMAN> host 'clear'; --> to clear the screen
RMAN> shutdown immediate

RMAN> startup nomount
RMAN> alter database mount;
RMAN> alter database open;
RMAN> show all; --> shows all the RMAN configuration parameters.
Note : We can make obsolete backup as valid backup but we cannot make expired backup as valid backup.
RMAN performs restore and recovery based on snapshot controlfile.
SQL> select * from v$rman_configuration;
Lists the rows regarding to RMAN configuration parameters what we set.
RMAN> configure retention policy to redundancy 2;
RMAN> show all;
SQL> select * from v$rman_configuration;
RMAN> spool log to rman.log
RMAN> show all;
RMAN> spool off;
RMAN> host 'pwd';
RMAN> exit;
oracle> pwd
oracle> ls

By default backup sets will be backuped into FRA(Flash_Recovery_Area) and controlfile into oraclehome/dbs.

oracle> vi rman.log

2.configure backup optimization on;
4.configure controlfile autobackup on;
5.configure controlfile autobackup format for device type disk to '/u03/rmanbkp/%f';
6.configure device type disk parallelism 2 backup type to backupset;
15.configure channel 1 device type disk format '/u03/app/rmanbkp/%u';
16.configure channel 2 device type disk format '/u03/app/rmanbkp/%u';

%u --> backup to some other backup destination.
%c --> follows the naming convention as it is while taking backup.

root> mkdir -p /u03/rmanbkp
root> mkdir -R oracle:oinstall /u03/rmanbkp
root> mkdir -R 775 /u03/rmanbkp
root> su - oracle
oracle> export ORACLE_SID=venu
oracle> rman target /
RMAN> @rman.log
RMAN> show all;

SQL> select * from v$rman_configuration;
RMAN> host 'clear';
RMAN> list backup; --> to see the existing backups
RMAN>  report schema; --> lists tablespaces, datafiles and all.
RMAN> report need backup;
oracle> cd /u03/rmanbkp
oracle rmanbkp> ls
RMAN> backup datafile 4;
oracle rmanbkp> ls
Oracel generates backup sets in default directory(FRA). If we specify other backup destination it generates backup pieces not backup sets.
RMAN> report need backup;
RMAN> backup datafile 4;

oracle rmanbkp> ls
RMAN> report need backup;

If we reach the redundancy it deletes/removes the file from report need backup list.

RMAN> report obsolete;
RMAN> backup datafile 4;
oracle rmanbkp> ls
RMAN> report obsolete;
RMAN> show retention policy;
RMAN> configure retention policy to redundancy 3;
RMAN> report obsolete;
RMAN> configure retention policy to redundancy 2;
RMAN> report obsolete;
RMAN> delete obsolete;
RMAN> report obsolete;

RMAN> backup tablespace users,undots1; --> here it uses 2 channels.
RMAN> backup datafile 4,3;
RMAN> backup current controlfile;
RMAN> backup spfile;

RMAN> list backup;
RMAN> host 'clear';
oracle rmanbkp> ls
RMAN> delete backupset 16; --> backupset key
RMAN> list backup;
oracle rmanbkp> ls
RMAN> backup datafile 4 tag='USERS';
RMAN> list backup;
By tag name we can identify the backup.
RMAN> list archivelog all; --> lists archive logs

SQL> alter system switch logfile;

RMAN> list archivelog all;
RMAN> backup archivelog all;
RMAN> backup archivelog sequence 2;
RMAN> delete archivelog sequence 2;
RMAN> list archivelog all;
RMAN> restore archivelog sequence 2;
RMAN> list archivelog all;
RMAN> list backup;

oracle rmanbkp> ls
oralce rmanbkp> rm -rf*
oracle rmanbkp> ls

RMAN> list backup;
RMAN> crosscheck backup;
RMAN> list backup;
RMAN> delete noprompt expired backup;
noprompt means it do not ask for confirmation.
RMAN> list backup;

Related Posts Plugin for WordPress, Blogger...

Flag Counter