Detailed steps for building DataGuard at Oracle11g (all physical standby operations)

Source: Internet
Author: User
DataGuard establishes a reference relationship by establishing a PRIMARY and STANDBY group. Once STANDBY is created, mongouard transfers the REDO of the PRIMARY database (PRIMARY)

DataGuard establishes a reference relationship by establishing a PRIMARY and STANDBY group. Once STANDBY is created, mongouard transfers the REDO of the PRIMARY database (PRIMARY)

Preface:

DataGuard establishes a reference relationship by establishing a PRIMARY and STANDBY group. Once STANDBY is created, DataGuard passes the REDO of the PRIMARY database (PRIMARY) to the STANDBY database, then, apply REDO in STANDBY to synchronize databases.

There are two types of STANDBY: Physical STANDBY and logical STANDBY

Physical STANDBY provides the same copy (Block-to-block) as the primary database, database SCHEMA, and indexes. It directly applies REDO to implement synchronization.

This is not true for logical STANDBY. In logical STANDBY, the logical information is the same, but the physical organization and data structure can be different, it is synchronized with the master database by converting the received REDO statements into SQL statements, and then executing SQL statements on STANDBY. In addition to disaster recovery, logical STANDBY has other functions, such as query and report.

1. installation environment

Set up database software in primary, establish lsnrctl listeners, use dbca to build instances, set up database software on standby, and set up listeners, but do not need to use dbca to create instances.

For how to build an Oracle database on Linux, refer to the previous article:

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

Important configuration parameters of Oracle Data Guard

Configure Oracle 11g Data Guard based on the same host

Explore Oracle 11g elastic uard

Oracle Data Guard (RAC + DG) archive deletion policies and scripts

Role conversion for Oracle Data Guard

FAL gap in Oracle Data Guard logs

Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby

2. Prepare for the operation on primary.
2.1 enable Forced Logging Mode
Check that the primary database is in archive mode.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 362
Next log sequence to archive 364
Current log sequence 364
SQL>


Forced Archiving
SQL> alter database force logging;

Database altered.


SQL>
Confirm that the primary database is in archive Mode


Add a standby File
Alter database add standby logfile group 4 ('/home/oradata/powerdes/redo_dg_021.log') size 20 M;
Alter database add standby logfile group 5 ('/home/oradata/powerdes/redo_dg_022.log') size 20 M;
Alter database add standby logfile group 6 ('/home/oradata/powerdes/redo_dg_023.log') size 20 M;
Alter database drop standby logfile group 4;
Alter database drop standby logfile group 5;
Alter database drop standby logfile group 6;

View the list of all redo files, select * from v $ logfile order by 1;
SQL> select * from v $ logfile order by 1;

1 ONLINE/home/oradata/powerdes/redo03.log NO
2 ONLINE/home/oradata/powerdes/redo02.log NO
3 ONLINE/home/oradata/powerdes/redo01.log NO
4 STANDBY/home/oradata/powerdes/redo_dg_021.log NO
5 STANDBY/home/oradata/powerdes/redo_dg_022.log NO
6 STANDBY/home/oradata/powerdes/redo_dg_023.log NO

6 rows selected.

SQL>


2.3 prepare the parameter file
2.3.1 generate pfile
Create pfile from spfile;
Shutdown immediate


2.3.2 modify pfile
Cp $ ORACLE_HOME/dbs/initpowerdes. ora $ ORACLE_HOME/dbs/initpowerdes. ora. bak
Vim $ ORACLE_HOME/dbs/initpowerdes. ora
*. Db_unique_name = pdunq
*. Diagnostic_dest = '/oracle/app/oracle'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = powerdesXDB )'
*. Fal_client = 'pdunq'
*. Fal_server = 'pdunq _ dg'
*. Standby_file_management = 'auto'
*. Db_file_name_convert = '/home/oradata/powerdes', '/home/oradata/pwerdes'
*. Log_file_name_convert = '/home/oradata/powerdes', '/home/oradata/powerdes'
*. Log_archive_config = 'dg _ CONFIG = (pdunq, pdunq_dg )'
*. Log_archive_dest_2 = 'service = pdunq_dg lgwr sync affrem VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = pdunq_dg'
*. Log_archive_dest_state_2 = 'enable'

2.3.3 generate spfile
Create spfile from pfile;
Startup # It can be started or not started here. If it is not started here, remember startup later to make the new parameter file take effect.


2.4 modify the listening File
[Oracle @ powerlong4 admin] $ vim listener. ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/oracle/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = powerdes)
(ORACLE_HOME =/oracle/app/oracle/product/11.2.0/dbhome_1)
)
)


LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.121.217) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0 ))
)
)


ADR_BASE_LISTENER =/oracle/app/oracle
INBOUND_CONNECT_TIMEOUT_listener = 10


2.5. Modify the tns configuration file
[Oracle @ powerlong4 admin] $ vim tnsnames. ora
PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.121.217) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = pdunq)
)
)

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.