Posts Tagged ‘ rman backup ’

rman backup on disk script oracle database

Following is the content of offshore_rman.sh for taking rman level 0 backup on sever disk.


mkdir -p /software/rmantemp/offshore_`date +%d-%m-%y`
chmod g+w /software/rmantemp/offshore_`date +%d-%m-%y`

export ORACLE_HOME=/oracle/app/product/11.2.0/db_1
export ORACLE_SID=offshore

$ORACLE_HOME/bin/rman target / <<!

CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/software/rmantemp/offshore_`date +%d-%m-%y`/OFFSHORE_DB_CTL_%F'; 
RUN { 
SQL 'ALTER SYSTEM SWITCH LOGFILE'; 
BACKUP INCREMENTAL LEVEL 0 DATABASE FORMAT '/software/rmantemp/offshore_`date +%d-%m-%y`/OFFSHORE_DB_DATAFILE_%u_%s_%p.DBF' TAG 'DATAFILE_BACKUP'; 
BACKUP ARCHIVELOG ALL FORMAT '/software/rmantemp/offshore_`date +%d-%m-%y`/OFFSHORE_DB_ARCHIVELOG_%u_%s_%p.DBF' TAG 'ARCHIVELOG_BACKUP'; 
DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE -5'; 
} 
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;


Thanks
A Rahim Khan

Advertisements

rman catalog in Oracle Database

Let’s start with Catalog Database, connect to your desired catalog database as sysdba. Create Tablespace, user and grant appropriate privelleges as shown.



SQL> create tablespace cat_tablespace datafile 'G:\oracle\product\10.2.0\oradata\catdb\cat_datafile.dbf' size 200M autoextend on;

Tablespace created.

SQL> create user rcat identified by rcat default tablespace cat_tablespace temporary tablespace temp quota unlimited on cat_tablespace;

User created.

SQL> grant connect, create session, resource, recovery_catalog_owner to rcat;

Grant succeeded.

SQL> conn rcat/rcat@catdb;
Connected.

When we use rman without catalog Database, it uses target Database’s Control File as rman repository. But if we use rman with catalog Database, it uses catalog database along with target database control file as rman repository. Those following step by step command shows how to register a target Database in catalog. Continue reading

Advertisements