oracledba.help

File Actions: ASM

Get File Paths

You will use these paths when you create the directories for the SB and edit the pfile. Generally changing them to match the DB_UNIQUE_NAME on the SB.

From the Primary as oracle user:

 show parameter control_files
    +DATA/ORADB/CONTROLFILE/current.256.957691805,
    +FRA/ORADB/CONTROLFILE/current.256.957691805
 SELECT file_name FROM dba_data_files;
    +DATA/ORADB/DATAFILE/system.261.957691825
    ...
 SELECT name FROM v$tempfile;
    +DATA/ORADB/TEMPFILE/temp.264.957691835
 SELECT member FROM V$LOGFILE;
     +DATA/ORADB/ONLINELOG/group_8.271.957705245
     +FRA/ORADB/ONLINELOG/group_8.264.957705249
     ...
 ARCHIVE LOG LIST
     Database log mode            Archive Mode
     Automatic archival           Enabled
     Archive destination          +FRA

Extract Files from ASM to Local Dir

Edit scripts to match your environment. Run as grid user.

 1. Edit and run: asm2os.sh
 2. Edit and run: asm2os.arclogs.sh

Create Files for SB

 -- Create Pfile from Spfile
 sqlplus / as sysdba
 sqlplus> create pfile='/u01/xfer/sb_files/oradb.pfile' from spfile;

 -- Create a SB Control File
 alter database create standby controlfile as '/u01/xfer/sb_files/control.stdby';

 -- Create Password File (ASM to OS)
 su - grid
 asmcmd
 ASMCMD> cd +DATA/oradb/PASSWORD
 ASMCMD> ls (to get PW file name)
 ASMCMD> pwcopy '+DATA/oradb/PASSWORD/pwdoradb.267.957704207' /u01/xfer/sb_files/orapworadb_sb

Copy Files to SB

Run as oracle user.

 -- Copy Password File
 scp /u01/xfer/sb_files/orapworadb_sb oracle@lnx02:$ORACLE_HOME/dbs/orapworadb_sb

 -- Copy ASM, Control and Parameter Files
 scp -r /u01/xfer/sb_files  oracle@lnx02:/u01/xfer/

Things to Note

  • The password file name is created to reflect the SB's DB_UNIQUE_NAME (orapworadb_sb).
  • All the required directories are created on the SB in the scp operation.

From SB, Copy Files from Local Dir to ASM

Run as grid user.

 1. Edit and run: os2asm.sh
 2. Edit and run: dir2asm.sh

Run dir2asm.sh for each ...ARCHIVELOG/<date> directory.