DataGuard-full parsing of creating a physical standby Database

Source: Internet
Author: User

This article mainly records the complete process of creating a physical standby database for reference in practice. this experiment is designed to build two databases TEST and STD_ASSG on the local machine. TEST is the master database and STD_ASSG is the slave database. Finally, after the log switching of the master database is realized, all apply to physical standby Databases

-------------------------------------- Split line --------------------------------------

 

References:

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

-------------------------------------- Split line --------------------------------------

1. Directory required for creating a physical standby Database
[Oracle @ dbsv admin] $ cd std_assg/
[Oracle @ dbsv std_assg] $ ls
[Oracle @ dbsv std_assg] $ mkdir arch
[Oracle @ dbsv std_assg] $ mkdir adump
[Oracle @ dbsv std_assg] $ mkdir bdump
[Oracle @ dbsv std_assg] $ mkdir cdump
[Oracle @ dbsv std_assg] $ mkdir udump
[Oracle @ dbsv std_assg] $ mkdir flash
[Oracle @ dbsv std_assg] $ cd $ ORACLE_BASE/oradata
[Oracle @ dbsv oradata] $ mkdir STD_ASSG
2. Create the password file required by the sys user
[Oracle @ dbsv dbs] $ ls orapw *
OrapwdBAKDB. pwd orapwdorcl orapworcl orapwstdby orapwTEST
[Oracle @ dbsv dbs] $ cp orapwTEST orapwSTD_ASSG
3. Create a log file for the standby Database
1. Start an existing master database
[Oracle @ dbsv ~] $ Export ORACLE_SID = TEST
[Oracle @ dbsv ~] $ Sqlplus/as sysdba
2. View slave database logs
SQL> SELECT GROUP #, THREAD #, SEQUENCE #, ARCHIVED, STATUS FROM V $ STANDBY_LOG;
GROUP # THREAD # SEQUENCE # ARC STATUS
-------------------------------------------
4 0 0 YES UNASSIGNED
5 0 0 YES UNASSIGNED
6 0 0 YES UNASSIGNED
3. Create backup database logs
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 7'/u01/app/oracle/oradata/STD_ASSG/std. redo 'SIZE 50 M;
 
Database altered.

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 8'/u01/app/oracle/oradata/STD_ASSG/std2.redo 'SIZE 50 M;
 
Database altered.

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 9'/u01/app/oracle/oradata/STD_ASSG/std3.redo 'SIZE 50 M;
 
Database altered.

4. Modify the initialization parameters and configure the information required by the physical standby database.
Vi initTEST. ora
# For primary role
DB_NAME = TEST
DB_UNIQUE_NAME = TEST
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (TEST, STD_ASSG )'
# CONTROL_FILES = '/u01/app/oracle/oradata/TEST/control1.ctl', '/u01/app/oracle/oradata/TEST/control2.ctl ', '/u01/app/oracle/oradata/TEST/control3.ctl'
LOG_ARCHIVE_DEST_1 =
'Location =/u01/app/oracle/admin/TEST/arch/
VALID_FOR = (ALL_LOGFILES, ALL_ROLES)
DB_UNIQUE_NAME = Test'
LOG_ARCHIVE_DEST_2 =
'Service = STD_ASSG LGWR ASYNC
VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE)
DB_UNIQUE_NAME = STD_ASSG'
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

# For standby role
FAL_SERVER = STD_ASSG
FAL_CLIENT = TEST
DB_FILE_NAME_CONVERT = '/u01/app/oracle/oradata/STD_ASSG/', '/u01/app/oracle/oradata/TEST /'
LOG_FILE_NAME_CONVERT =
'/U01/app/oracle/oradata/STD_ASSG/', '/u01/app/oracle/oradata/TEST /'
STANDBY_FILE_MANAGEMENT = AUTO

Copy and modify the parameter file of the master database to the available parameter file of the slave database.
1, $ s/TEST/STD_ASSG/g
# For primary role
DB_NAME = TEST
DB_UNIQUE_NAME = STD_ASSG
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (STD_ASSG, TEST )'
# CONTROL_FILES = '/u01/app/oracle/oradata/STD_ASSG/control1.ctl', '/u01/app/oracle/oradata/STD_ASSG/control2.ctl ', '/u01/app/oracle/oradata/STD_ASSG/control3.ctl'
LOG_ARCHIVE_DEST_1 =
'Location =/u01/app/oracle/admin/STD_ASSG/arch/
VALID_FOR = (ALL_LOGFILES, ALL_ROLES)
DB_UNIQUE_NAME = STD_ASSG'
LOG_ARCHIVE_DEST_2 =
'Service = TEST LGWR ASYNC
VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE)
DB_UNIQUE_NAME = Test'
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

# For standby role
FAL_SERVER = TEST
FAL_CLIENT = STD_ASSG
DB_FILE_NAME_CONVERT = '/u01/app/oracle/oradata/TEST/', '/u01/app/oracle/oradata/STD_ASSG /'
LOG_FILE_NAME_CONVERT =
'/U01/app/oracle/oradata/TEST/', '/u01/app/oracle/oradata/STD_ASSG /'
STANDBY_FILE_MANAGEMENT = AUTO

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.