oracledba.help

Copy Files to SB: OMF (Manually)

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:

 -- Get Paths to Files
 col NAME_COL_PLUS_SHOW_PARAM  format A15
 col TYPE                      format A6
 col VALUE_COL_PLUS_SHOW_PARAM format A150

 show parameter control_files
    /u01/oradata/ORADB/controlfile/o1_mf_dxhfnkb9_.ctl,
    /u02/oradata/ORADB/controlfile/o1_mf_dxhfnkch_.ctl
 SELECT file_name FROM dba_data_files;
    /u01/oradata/ORADB/datafile/o1_mf_system_dxf0bbsg_.dbf
    ...
 SELECT name FROM v$tempfile;
    /u01/oradata/ORADB/datafile/o1_mf_temp_dxf0bw8d_.tmp
 SELECT member FROM V$LOGFILE;
     /u01/oradata/ORADB/onlinelog/o1_mf_1_dxt66ylr_.log
     /u02/oradata/ORADB/onlinelog/o1_mf_1_dxt66yvc_.log
     ...
 ARCHIVE LOG LIST
     Database log mode            Archive Mode
     Automatic archival           Enabled
     Archive destination          /u01/oradata/ORADB/onlinelog/

Create\Xfer Files for SB

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

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

 -- Copy Pfile, Password, Data and Log Files
 sqlplus> shutdown immediate

 scp /tmp/oradb.pfile               oracle@lnx02:/tmp/
 scp $ORACLE_HOME/dbs/orapworadb    oracle@lnx02:$ORACLE_HOME/dbs/orapworadb_sb
 scp /u01/oradata/ORADB/datafile/*  oracle@lnx02:/u01/oradata/ORADB_SB/datafile/
 scp /u01/oradata/ORADB/onlinelog/* oracle@lnx02:/u01/oradata/ORADB_SB/onlinelog/
 scp /u02/oradata/ORADB/onlinelog/* oracle@lnx02:/u02/oradata/ORADB_SB/onlinelog/

 -- Copy SB Ctrl File to Names\Locations Matching Primary
 scp /tmp/control.stdby oracle@lnx02:/u01/oradata/ORADB_SB/controlfile/xxx.ctl
 scp /tmp/control.stdby oracle@lnx02:/u02/oradata/ORADB_SB/controlfile/xxx.ctl

 sqlplus> startup

Things to Note

  • Files are copied to directories on the SB matching the DB_UNIQUE_NAME (ORADB_SB).
  • The password file is renamed to reflect the SB's DB_UNIQUE_NAME in the copy.
  • The standby control files destination name needs to match the Primary (xxx.ctl).
  • Both onlinelog locations are copied over.