Search This Blog

Tuesday, July 26, 2011

Creating a Standby Database with RMAN

Tips:
Oracle Certification - Tips

DBA Preparation - Tips

Practical DBA - Tips


Database : 10.2.0.1.0
OS Linux
Archive log : ENABLE

Primary Database OR Standby Database on SOME HOST

Step :
1. Create Recoverable backup of PRIMARY DATABASE



[oracle@alwarid-taj ~]$ rman target=sys


Recovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 5 20:30:02 2007


Copyright (c) 1982, 2005, Oracle. All rights reserved.


target database Password:
connected to target database: ORACLE (DBID=1488579947)


RMAN> configure controlfile autobackup on;


using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored


RMAN> run
2> {
3> backup database;
4> sql 'alter system switch logfile';
5> backup database archivelog all;
6> }


[output cut]


2.Creating the Standby Control File with RMAN

1.connect to primary database.
[oracle@alwarid-taj ~]$ export ORACLE_SID=oracle
[oracle@alwarid-taj ~]$ rman target=sys

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 5 20:39:40 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

target database Password:
connected to target database: ORACLE (DBID=1488579947)

RMAN> startup mount;

database is already started

RMAN> shutdown immediate;

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 281018368 bytes

Fixed Size 1218944 bytes
Variable Size 83887744 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes

RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY;

Starting backup at 05-APR-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including standby control file in backupset
channel ORA_DISK_1: starting piece 1 at 05-APR-07
channel ORA_DISK_1: finished piece 1 at 05-APR-07
piece handle=/home/oracle/oracle/ORACLE/backupset/2007_04_05/o1_mf_ncnnf_TAG20070405T204434_31b9vlws_.bkp tag=TAG20070405T204434 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-APR-07

Starting Control File and SPFILE Autobackup at 05-APR-07
piece handle=/home/oracle/oracle/ORACLE/autobackup/2007_04_05/o1_mf_s_619130563_31b9vnj3_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 05-APR-07

RMAN> run
2> {
3> sql 'alter database open';
4> sql 'alter system archive log current';
5> }

sql statement: alter database open

sql statement: alter system archive log current

No comments: