Create physical DG on a single machine (Oracle 10 Gb Single Instance)

Source: Internet
Author: User

1. Configuration Planning

Name IP Listeners End Port SID Db_name Db_unique_name Service name  
Host

127.0.0.1

Listener1

1521 Test1 Test1 Test1 Test1  
Slave

127.0.0.1

Listener12

1522 Test2 Test1 Test1 Test1  

Step 2

1. master database operations

--- Confirm that the master database is in archive Mode

SQL> archive log list

Change:

SQL> startup mount

SQL> Alter database archive log

--- Set to force logging Mode

SQL> alter database force logging;

--- Create a master Database Password File

Orapwd file = 'd: \ Oracle \ product \ 10.2.0 \ db_1 \ database \ pwdtest1.ora 'password = entries = 5

--- Create a slave Database Control File

SQL> alter database create standby controlfile as 'd: \ oracle \ product \ 10.2.0 \ db_1 \ oradata \ test2 \ control01.ctl ';

--- Create the binary parameter file of the master database

SQL> create pfile = 'd: \ inittest1.ora 'from spfile;

--- Modify the binary parameter file of the master database

Add

DB_NAME = test1

DB_UNIQUE_NAME = test1

LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (test1, test2 )'

*. Compatible = '10. 2.0.1.0'

*. Control_files = 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \ control01.ctl ', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \ control02.ctl', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \ control03.ctl'

 

LOG_ARCHIVE_DEST_1 = 'location = D: \ oracle \ product \ 10.2.0 \ oradata \ test1 \ archive1 VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = test1'

# LOG_ARCHIVE_DEST_2 = 'service = test2 lgwr async VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = test2'

LOG_ARCHIVE_DEST_2 = 'service = test2 DB_UNIQUE_NAME = test2'

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

FAL_SERVER = test2

FAL_CLIENT = test1

DB_FILE_NAME_CONVERT = 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \ ', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \'

LOG_FILE_NAME_CONVERT = 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \ ', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \'

STANDBY_FILE_MANAGEMENT = AUTO

--- Use inittest1.ora to generate spfiletest1.ora

SQL> shutdown immediate

SQL> startup pfile = 'd: \ inittest1.ora'

SQL> create spfile = 'd: \ oracle \ product \ 10.2.0 \ db_1 \ dbs \ spfiletest1.ora 'from pfile

2 slave database operations

--- Create a service

Oradim-NEW-SID test2

--- Create a password file

Orapwd file = 'd: \ oracle \ product \ 10.2.0 \ db_1 \ database \ pwdtest2.ora password = entries = 5

---- Copy Related Files

A $ ORACLEBASE \ oradata \ test1 \ Copy to $ ORACLEBASE \ oradata \ test \ 2

Log Files, control files, except archive files

The control file is copied to the other two files generated in the master database operation.

B $ ORACLEBASE \ admin \ test1 \ Copy to $ ORACLEBASE \ admin \ test2 \

---- COPY inittest1.ora inittest2.ora

---- Change inittest2.ora

DB_NAME = test1

DB_UNIQUE_NAME = test2

LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (test1, test2 )'

*. Compatible = '10. 2.0.1.0'

*. Control_files = 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \ control01.ctl ', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \ control02.ctl', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \ control03.ctl'

 

LOG_ARCHIVE_DEST_1 = 'location = D: \ oracle \ product \ 10.2.0 \ oradata \ test2 \ archive2 VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = test2'

# LOG_ARCHIVE_DEST_2 = 'service = test2 lgwr async VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = test1'

LOG_ARCHIVE_DEST_2 = 'service = test1 DB_UNIQUE_NAME = test1'

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

FAL_SERVER = test1

FAL_CLIENT = test2

DB_FILE_NAME_CONVERT = 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \ ', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \'

LOG_FILE_NAME_CONVERT = 'd: \ oracle \ product \ 10.2.0 \ oradata \ test1 \ ', 'd: \ oracle \ product \ 10.2.0 \ oradata \ test2 \'

STANDBY_FILE_MANAGEMENT = AUTO

 

3. configure a master-slave listener

LISTENER2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.69) (PORT = 1522 ))

)

 

LISTENER1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.69) (PORT = 1521 ))

)

 

SID_LIST_LISTENER2 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = test2)

(ORACLE_HOME = D: \ oracle \ product \ 10.2.0 \ db_1)

(SID_NAME = test2)

)

)

 

SID_LIST_LISTENER1 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = test1)

(ORACLE_HOME = D: \ oracle \ product \ 10.2.0 \ db_1)

(SID_NAME = test1)

)

)

4. Configure Master/Slave TNSNAMES. ORA

TEST1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = ltan.epoa.com) (PORT = 1521 ))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = test1)

)

)

TEST2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = ltan.epoa.com) (PORT = 1522 ))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = test2)

)

)

 

5. Enable redo Application

SQL> startup mount pfile = 'd: \ inittest2.ora'

SQL> alter database recover managed standby database disconnect from session;

 

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.