Professional Documents
Culture Documents
Demo Setup
CATALOG
DATABASE
L
TARGET DATABASE
RMAN
L Listener
IN CATALOG DATABASE
Create a catalog user(cat)
Before creating a catalog user we have to create a catalog tablespace
to hold the catalog.
steps to create catalog tablespace(cat_tbs) and catalog user(cat)
step1:sql> Create tablespace cat_tbs
Datafile /home/oracle/product/10.2.0/oradata/cat_tbs.dbf
size 100m
step2: sql> Create user cat identified by cat
Default tablespace cat_tbs
Temporary tablespace temp
Quota unlimited on cat_tbs
step3: sql> Grant connect,resource to cat
step4: sql> Grant recovery_catalog_owner to cat
CONTINUED
Create a listener(catalog2) in catalog
database.
step1: Go to netmgr, create a
listener(catalog2).
step2: save and exit
step3: start the listener(catalog2)
IN TARGET DATABASE
CREATING PASSWORD FILE FOR TARGET DATABASE
> Startup
> Show parameter spfile
> Alter system set remote_login_passwordfile=exclusive
scope=spfile
> shut immediate
cd $ ORACLE_HOME / dbs
$ orapwd file = orapwtarget password = sys
$ cd network/admin
$ vi sqlnet.ora
sqlnet.authentication_services = none
names.directory_path = (tnsnames)
CONTINUED
Creating listener and connect descriptor
Step1: Go to netmgr create a listener
(target1) and create a connect
descriptor(con_tar) for this listener and one
more connect descriptor(con_cat) for
catalog listener(catalog2).
Step2: save and exit.
Step3: Start the listener
Connecting to RMAN
$ RMAN
RMAN > Connect target
sys/sys@con_tar
Continued
Continued
Backing up tablespace
RMAN>backup tablespace <tbsname>;
(will backup tablespace DB should be in
archivelog mode)
Backing up datafile:
RMAN>backup datafile <pathname>/<datafile
name>;
It will backup datafile in Flash Recovery
Area/we can specify a path
Incremental Backup
Level 0 backup
RMAN > backup incremental level 0
database;
Demo Scenarios
Scenario 1 - Recover full database
Need to recover full database including controlfile, If we have
backup then we can start recovery.
Scenario
Scenario 2 - Recover lost datafile
RMAN> RUN
{
sql alter tablespace sysaux offline;
restore datafile;
/home/oracle10g/data/sysaux1.dbf';
recover datafile;
/home/oracle10g/data/sysaux1.dbf';
sql alter tablespace sysaux online;
}
Scenario
Scenario 3 - Recover lost tablespace
RMAN> run
{
sql alter tablespace sysaux offline;
restore tablespace sysaux;
recover tablespace sysaux;
sql alter tablespace sysaux online;
}
Scenario
Scenario 4 - Recover Lost controlfile
Target database
Shut abort
Startup nomount
Connect to rman catalog and target database
RUN
{
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT
c:/oracle/product/10.2.0/dbbackup/%U;
BACKUP DATABASE plus archivelog;
}
THANK YOU