oracledba.help

<- DataGuard

RMAN Backup and File Copy

  1. Create RMAN Directories
  2. RMAN Backup Actions
  3. Extract Core Files
  4. Copy Files to SB

Create RMAN Directories

Perform on Both (Primary and SB).

 su - 
 mkdir /u01/rman
 chown -R oracle:oinstall /u01/rman
 chmod -R 765 /u01/rman

Change path to match your environment.

Primary System Actions

RMAN Backup Actions

Launch RMAN
oracle> rman target=/
Ensure ORACLE_SID set or you will get a connection error. For RAC that means the instance name (Ex: oradb1) .

RMAN Phase I

run {
    allocate channel c1  type disk format '/u01/rman/sb_%U';
    allocate channel c2  type disk format '/u01/rman/sb_%U';
    backup as compressed backupset database plus archivelog;
    backup current controlfile;
    backup spfile;
    release channel c1;
    release channel c2;
}

To increase speed more channels can be allocated.

RMAN Phase II

run {
configure channel device type disk format '/u01/rman/sb_%U';
BACKUP CURRENT CONTROLFILE FOR STANDBY;
BACKUP ARCHIVELOG ALL;
}

Extract Core Files

Create Control File for Standby

 oracle> sqlplus / as sysdba
 ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/u01/rman/oradb.ctl';

Create Pfile from Spfile

 oracle> sqlplus / as sysdba
 sqlplus> create pfile='/u01/rman/oradb_sb.pfile' from spfile;

Copy Password File

If Primary is Standalone

 oracle> cp $ORACLE_HOME/dbs/orapworadb /u01/rman/orapworadb

If Primary is RAC (per MOS 1984091.1)

    grid> asmcmd -p
    ASMCMD [+] > cd +DATA/ORADB/PASSWORD
    ASMCMD [+DATA/ORADB/PASSWORD] > ls
      pwdoradb.256.981186145
    ASMCMD [+] > pwcopy +DATA/ORADB/PASSWORD/pwdoradb.256.981186145 /tmp/orapworadb
    oracle> cp /tmp/orapworadb /u01/rman/orapworadb
  • The PW file is initially copied to /tmp because that is where grid can write to and other accounts read from.

Copy Files to SB

 oracle> scp -r /u01/rman oracle@lnxsb:/u01/

<- DataGuard