Steps for the Standby Server
Step 10. Create the directories
1 2 3 4 5 |
mkdir -p /oracle/app/oracle/admin/stdmx/adump mkdir +DATA/STDMX/ mkdir +DATA/MX/ mkdir +FRA/STDMX/ mkdir +FRA/MX/ |
Step 11. Adjusting the init.ora parameters for the DataGuard. (making the necessary changes in the primaryinit.ora_for_std.ora file for the standby).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
*.DB_UNIQUE_NAME='stdmx'*.log_archive_config='dg_config=(mx,stdmx)' *.log_archive_dest_1='LOCATION=+FRA valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=stdmx' *.log_archive_dest_2='service=mx LGWR AFFIRM SYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) 1 db_unique_name=mx' *.LOG_ARCHIVE_DEST_STATE_1='ENABLE' *.LOG_ARCHIVE_DEST_STATE_2='ENABLE' *.LOG_ARCHIVE_FORMAT='log%t_%s_%r.arc' *.db_file_name_convert='+DATA/MX/','+DATA/STDMX/' *.log_file_name_convert='+DATA/MX/','+DATA/STDMX/','+FRA/MX/','+FRA/STDMX/' *.remote_login_passwordfile='exclusive' *.STANDBY_FILE_MANAGEMENT='AUTO' *.fal_client='STDMX *.fal_server='MX' *.sec_case_sensitive_logon=FALSE |
Step 12. Creating the password files (orapw$instance_name)
(There’s no need to do this if the file has already been created as shown in Step 4. of the Steps for the Primary Database)
1 |
$orapwd file=$ORACLE_HOME/dbs/orapwstdmx password=0racle ignorecase=y force=y |
1 2 3 |
SQL>select * from v$pwfile_users;USERNAME SYSDB SYSOP SYSAS ----------------------- SYS TRUE TRUE FALSE |
Step 13. Entering the SID information in the listener.ora
Note 1: The tests were carried out successfully before making any changes, however listener entries were made as shown in these articles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# listener.ora Network Configuration File: /u01/11.2.0/grid/network/admin/listener.ora# Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = stddbk.sysdba.org)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON stdmx = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = stddbk.sysdba.org)(PORT = 1521)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = mx.sysdba.org) (ORACLE_HOME = /u01/11.2.0/grid) (SID_NAME = mx) ) (SID_DESC = (GLOBAL_DBNAME = stdmx.sysdba.org) (ORACLE_HOME= /u01/11.2.0/grid) (SID_NAME = stdmx) ) (SID_DESC = (GLOBAL_DBNAME = mx_DGMGRL) (ORACLE_HOME= /grid/11.2.0/grid) (SID_NAME = mx) ) (SID_DESC = (GLOBAL_DBNAME = stdmx_DGMGRL) (ORACLE_HOME= /u01/11.2.0/grid) (SID_NAME = stdmx) ) ) |
Note 2: Saving the listener.ora file without leaving a space character at the beginning of each line results in a syntax error.
Step 14. Enter the Primary RAC Data into tnsnamas.ora (making it the same as the primary).
All need to be the same. Check using $tnsping
Step 15. Creating the StandBY database
1 |
create SPFILE='+DATA/stdmx/spfilemx.ora' from pfile='/opt/oracle/stage/primaryinit.ora_for_std.ora';startup nomount |
In the StandBY
1 2 |
rman target sys/***password_password***@mx auxiliary / rman>duplicate target database for standby nofilenamecheck dorecover; |
alternatively
1 |
rman>duplicate target database for standby dorecover; |
Ceate the standby redologs when opened in mount mode.
1 2 3 |
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1GROUP 5 SIZE 100M, GROUP 6 SIZE 100M, GROUP 7 SIZE 100M; |
1 2 3 4 |
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 8 SIZE 100M, GROUP 9 SIZE 100M, GROUP 10SIZE 100M; |
1 2 3 4 5 6 7 |
shutdown immediate startup shutdown immediate startup nomount alter database mount standby database; alter database recover managed standby database using current logfile disconnect; |
alternatively
1 |
alter database recover managed standby database disconnect; |
Using RMAN for...
12 March 2019