Continuation to the Data Guard Physical standby creation
ORACLE – Creating a Data Guard Physical Standby environment – PART1
Enable Archiving
On 10g you can enable archive log mode by mounting the database and executing the archivelog command:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
SQL> startup mount; ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 75499088 bytes Database Buffers 205520896 bytes Redo Buffers 2973696 bytes Database mounted. SQL> alter database archivelog; Database altered. SQL> alter database open; Database altered. SQL> archive log list Archive Mode Database log mode Automatic archival Enabled Archive destination /test/PRIMARYDB/archdest/arch Oldest online log sequence 92 Next log sequence to archive 94 Current log sequence 94 |
Set Primary Database Initialization Parameters
Data Guard must use spfile, in order to configure it we create and configure the standby parameters on a regular pfile, and once it is ready we convert it to an spfile.
Several init.ora parameters control the behavior of a Data Guard environment. In this example the Primary database init.ora is configured so that it can hold both roles, as Primary or Standby.
1 2 3 4 |
SQL> create pfile='$ORACLE_HOME/dbs/initPRIMARYDB.ora' from spfile; OR SQL> create pfile='$ORACLE_HOME/dbs/init$ORACLE_SID.ora' from spfile; File created. |
Edit the pfile to add the standby parameters, here shown highlighted:
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
db_name='PRIMARYDB' db_unique_name='PRIMARYDB' LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRIMARYDB,blackowl)' control_files='/test/db/PRIMARYDB/controlfile/o1_mf_310n1xf0_.ctl' LOG_ARCHIVE_DEST_1= 'LOCATION=/test/PRIMARYDB/archdest/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRIMARYDB' LOG_ARCHIVE_DEST_2= 'SERVICE=blackowl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=blackowl' LOG_ARCHIVE_DEST_STATE_1=ENABLE LOG_ARCHIVE_DEST_STATE_2=ENABLE REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE LOG_ARCHIVE_FORMAT=%t_%s_%r.arc LOG_ARCHIVE_MAX_PROCESSES=30 # Standby role parameters -------------------------------------------------------------------- *.fal_server=blackowl *.fal_client=PRIMARYDB *.standby_file_management=auto *.db_file_name_convert='BLACKOWL/BLACKOWL','PRIMARYDB/PRIMARYDB' *.log_file_name_convert='/test/od01/BLACKOWL/BLACKOWL/','/test/db/PRIMARYDB/' # --------------------------------------------------------------------------------------------- audit_file_dest='/DB/oracle/admin/PRIMARYDB/adump' background_dump_dest='/DB/oracle/admin/PRIMARYDB/bdump' core_dump_dest='/DB/oracle/admin/PRIMARYDB/cdump' user_dump_dest='/DB/oracle/admin/PRIMARYDB/udump' compatible='10.2.0.1.0' db_block_size=8192 db_create_file_dest='/test/od01/PRIMARYDB' db_domain='' db_file_multiblock_read_count=16 job_queue_processes=10 open_cursors=300 pga_aggregate_target=94371840 processes=150 remote_login_passwordfile='EXCLUSIVE' sga_target=283115520 undo_management='AUTO' undo_tablespace='UNDOTBS1' |
Once the new parameter file is ready we create from it the spfile.
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 |
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup nomount pfile='$ORACLE_HOME/dbs/init$ORACLE_SID.ora'; ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 92276304 bytes Database Buffers 188743680 bytes Redo Buffers 2973696 bytes SQL> create spfile from pfile='$ORACLE_HOME/dbs/init$ORACLE_SID.ora'; File created. SQL> shutdown immediate; ORA-01507: database not mounted ORACLE instance shut down. SQL> startup; ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 92276304 bytes Database Buffers 188743680 bytes Redo Buffers 2973696 bytes Database Mounted. Database Opened. |
Continued in the Next Article………