[Oracle] Data Guard-Create physical Standby

Source: Internet
Author: User

[Oracle] Data Guard-Create physical Standby experiment environment Primary: Host: jabdw1241SID: O01DMS0DB_UNIQUE_NAME: O01DMS0Standby: Host: jabdw1242SID: O01DMS0DB_UNIQUE_NAME: O01DMS0DR 1. primary configuration and operations 1) confirm that primary is in archive mode PRIMARY> Archive log list; Database log mode archive ModeAutomatic archival EnabledArchive destination H: \ INTEL_ARCH \ O01DMS0Oldest online log sequence 468 Next log sequence to archive 470 Current log sequence 4702) Confirm pri Mary is in force logging mode PRIMARY> select force_logging from v $ database; FOR---NO, the result is NO. Use the following statement to Set primary to force logging: PRIMARY> alter database force logging; database altered. 3) Add the following required parameters for configuring primary :*. db_unique_name = O01DMS0 *. log_archive_config = 'dg _ CONFIG = (O01DMS0, O01DMS0DR )'*. log_archive_dest_2 = 'service = O01DMS0DR ARCH VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = O01DMS0DR '*. log_archive_dest_sta Although te_2 = defer is not a required parameter, it is useful in Role Switching. We recommend that you configure the following parameters :*. fal_server = O01DMS0DR *. fal_client = O01DMS0 *. standby_file_management = auto re-create spfile start primary: PRIMARY> shutdown immediate; PRIMARY> create spfile from pfile; File created. PRIMARY> startup4) create the standby control file PRIMARY> alter database create standby controlfile as 'H: \ control01.o01dms0'; Database altered. 5) Create password fileC: \ Documents ents and Settings \ a105024> orapwd file = G: \ Orac Le \ Ora102 \ database \ PWDO01DMS0. ora password = oracle entries = 30 6) copy the data file to the standby server to find all the data files on the primary end: PRIMARY> select name from v $ datafile; NAME ----------------------------------- I: \ INTEL_DATA \ Alibaba: \ INTEL_DATA \ O01DMS0 \ Alibaba: \ INTEL_DATA \ O01DMS0 \ Alibaba: \ INTEL_DATA \ O01DMS0 \ Alibaba: \ INTEL_INDEX \ Alibaba: \ INTEL_DATA \ O01 DMS0 \ Alibaba: \ INTEL_DATA \ O01DMS0 \ STREAMS_TBS.DBFI: \ INTEL_DATA \ O01DMS0 \ Alibaba: \ INTEL_DATA \ O01DMS0 \ Alibaba close the database: PRIMARY> shutdown immediate; copy all the above data files to the directory corresponding to the standby server. Copy the generated control file to the directory corresponding to the standby server. Note that the control file must be copied in three copies and the file name must be modified. Finally, copy the pfile and password file to the directory corresponding to the standby server. Note: online and archived redo logs do not need to be copied. Start Database: PRIMARY> startup 2. standby configuration and operation 1) Create OracleServiceC: \ Documents and Settings \ a105024> oradim-new-sid O01DMS0Instance created.2) modify the standby parameter to open the pfile just copied from primary, modify the following parameters :*. db_unique_name = O01DMS0DR *. log_archive_dest_2 = 'service = O01DMS0 ARCH VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = O01DMS0 '*. log_archive_dest_state_2 = enable *. fal_server = O01DMS0 *. fal_client = O01DMS0DR create spfile: STANDBY> Create spfile from pfile; File created. 3) Start the database to the mount status. Note: Before starting the database to the mount status, you must carefully check that the specified directories and files in the parameter files and control files already exist on the standby server. STANDBY> startup mount; ORACLE instance started. total System Global Area 629145600 bytesFixed Size 1296652 bytesVariable Size 339740404 bytesDatabase Buffers 251658240 bytesRedo Buffers 36450304 bytesDatabase mounted. 3. configure communication between primary and standby 1) Configure DRO01DMS0 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = JABDW1242) (PORT = 1521) for standby listener ))) SID_LIST_DRO01DMS0 = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = O01DMS0) (ORACLE_HOME = G: \ Oracle \ ora102) (SID_NAME = O01DMS0) Start listener2 through lsnrctl) primary tnsnames configuration O01DMS0DR = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = jabdw1242) (PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = O01DMS0) test whether the primary can connect to standby: C: \ Documents and Settings \ a105024> tnsping O01DMS0DR TNS Ping Utility for 32-bit Windows: version 10.2.0.4.0-Production on 18---2011 02:49:47 Copyright (c) 1997,200 7, Oracle. all rights reserved. used parameter files: G: \ Oracle \ Ora102 \ network \ admin \ sqlnet. ora Used TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = jabdw1242) (PORT = 1521 ))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = O01DMS0) OK (40 msec) 3) standby tnsnames configure O01DMS0 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = jabdw1241) (PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = O01DMS0) test whether standby can connect to primary: C: \ Documents and Settings \ a105024> tnsping O01DMS0 TNS Ping Utility for 32-bit Windows: version 10.2.0.4.0-Production on 18---2011 02:54:32 Copyright (c) 1997,200 7, Oracle. all rights reserved. used parameter files: G: \ oracle \ ora102 \ network \ admin \ sqlnet. ora Used TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = jabdw1241) (PORT = 1521 ))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = O01DMS0) OK (50 msec) 4. verify synchronization 1) receive archiving logs query the largest archive log at the primary end: PRIMARY> select max (sequence #) from v $ archived_log; MAX (SEQUENCE #) -------------- 475 query uploaded archive logs on the standby end: STANDBY> select sequence #, applied from v $ archived_log; SEQUENCE # APP ---------- --- 470 NO 471 NO 472 NO 473 NO 474 NO 475 NO2) Start redo applySTANDBY> alter database recover managed standby database disconnect from session; Database altered. STANDBY> select sequence #, applied from v $ archived_log; SEQUENCE # APP ---------- --- 470 YES 471 YES 472 YES 473 YES 474 YES 475 YES

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.