Sunteți pe pagina 1din 21

Contents in this version

1.0 Basic rman architecture

1.0 a
2.0 Backup can be taken two ways:

rman uses channel to contact database which in turn create session to copy the target database into
backup which could be disk or tapes.

Directly using backup command and the other is through job command.

Job command: Using rman stored script

Learning: you can take backup through rman on the disk numbers. In this case the disk number 3 is

name=C:\APP\CMS\ORADATA\ORCL\UNDOTBS01.DBF.

Datafile 1 – system01 706568

Datafile 2 – undotbs1 56328

Datafile 3 – sysaux 542 728

Datafile 4 – user01 5128

Datafile 5 – example01 5 mb

There are two option of backup

Control file or through catalog


You can create a table space , create user, give recovery rights, create catalog and register with database

Configuring archive mode

Shutdown immediate

Startup mount

Alter database archivelog

Alter database open

In non archive
rman uses channel to contact database which in turn create session to copy the target database into
backup which could be disk or tapes.

Job command:using rman stored script

Learning: you can take backup through rman on the disk numbers. In this case the disk number 3 is

name=C:\APP\CMS\ORADATA\ORCL\UNDOTBS01.DBF.

run

Backup datafile 3;

There are two types of scripts: global or local. A local script is associated with target database in which
RMAN is connected when the script is created. A global stored script can be executed against any
database registered in recovery catalogue.
https://blogs.oracle.com/oraclemagazine/scripting-oracle-rman-commands

this talks about stored and command scripts

SQL> column client_info format a30

SQL> column sid format 999

SQL> column spid format 9999

SQL> select s.sid, p.spid, s.client_info from v$process p, v$session s

2 where p.addr = s.paddr

3 and client_info like ' rman%';

run

2> {

3> allocate channel c1 device type disk;

4> backup
5> incremental level = 0

6> (datafile 1 channel c1);

7> sql 'alter system archive log current';

8> }
Datafile 1 – system01 706568

Datafile 2 – undotbs1 56328

Datafile 3 – sysaux 542 728

Datafile 4 – user01 5128

Datafile 5 – example01 5 mb
Incremental backup 0 takes backup up to the spaces occupied by database which is afull backup of
database.

Incremental back 1 will only take the backup of incremental backup of modified data only.
Backup archivelog all delete all input

Recovery catalog:

Step1: configure recovery catalog database

Step2: create the recovery catalog owner

Step3: Create the recovery catalog

In sqlplus enter

sys/rkpaul as sysdba

create tablespace rcat_ts datafile 'e:/rkp/oracle_training/rmandatabase/rmandatabase.dbf' size 15 m;

SQL> create user rkpaul identified by rkpaul

2 temporary tablespace temp

3 default tablespace rcat_ts

4 quota unlimited on rcat_ts;

Grant recovery_catalog_owner to rkpaul


Now go to rman after assigning the gran privilege of recovery catalog.

Rman target sys/rkpaul

Connect catalog rkpaul/rkpaul….Note rkpaul as a user was created

Create catalog

Register database
Register database;

Catalog recovery area noprompt;


Resync catalog
Upgrade catalog
Duplex backup

Restore and recovery process:

Rman>Shutdown immediate

Startup nomount will not allow restore and recovery.

We have to use startup mount

Will give the following error:


Rman>startup mount

Both restore and recovery process. Please note the database rmandatabase.dbf was created in the
previous screen through creation of table space, creating user rkpaul/rkpaul and granting recovery
permission to rkpaul.
Restore database

In the screen below all the files are restored from backup done in rmandatabase.

It is created in separate directory. All the tables spaces have been recovered..
Show all shows the details of all the configurations

S-ar putea să vă placă și