Build a replicuard Environment

Source: Internet
Author: User
1. Ensure that the source database is in the archive mode and the logging mode is mandatory. Shutdownimmediate; startupmount; alterdatabasearchivelog; alterda

1. Ensure that the source database is in the archive mode and the logging mode is mandatory. Shutdown immediate; startup mount; alter database archivelog; alter da

1. Ensure that the source database is in the archive mode and the logging mode is mandatory.
Shutdown immediate;
Startup mount;
Alter database archivelog;
Alter database force logging;
Alter database open;
2. Make sure that you have created a password file. (Ensure remote login (@ xxx as sysdba)
Cd $ Oracle_HOME/dbs/
Check whether passwordfile has been created.
If no, run the following command.
Note that the oracle password files are stored in the $ ORACLE_HOME/dbs directory. By default, the password file in the format of orapw $ ORACLE_SID file name will be searched in the directory. For example, if your database name is dex, use the following command.
Orapwd file = orapwdex password = xiaojun entries = 20
Finally, verify that the listening service name is configured in tnsnames. ora, for example, dex70 and then run
Sqlplus sys/xiaojun @ dex70 as sysdba
3. Create a standby logfile
Alter database add standby logfile group 4
('/Dhome/orcl/oradata/dex/standby1.log') SIZE 50 M;
Alter database add standby logfile group 5
('/Dhome/orcl/oradata/dex/standby2.log') SIZE 50 M;
Alter database add standby logfile group 6
('/Dhome/orcl/oradata/dex/standby2.log') SIZE 50 M;


Verify:
Sys @ DEX> 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
4. Modify the parameter file of the source database
Create a pfile first
Create pfile from spfile;
In $ ORACLE_HOME/dbs/admin/init $ ORACLE_SID.ora
Add the following content

DB_NAME = dex
DB_UNIQUE_NAME = dex
# Master/Slave database settings
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (dex, dex_hell )'
# Control File Location
CONTROL_FILES = '/dhome/orcl/oradata/dex/control01.ctl', '/dhome/orcl/oradata/dex/control02'
# Archive directory 1
LOG_ARCHIVE_DEST_1 = 'location =/dhome/arch1/VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = dex'
# Archive directory 2, used for remote log file synchronization
LOG_ARCHIVE_DEST_2 = 'service = dex_hell lgwr async VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = dex_hell'
# Enable
LOG_ARCHIVE_DEST_STATE_1 = ENABLE
LOG_ARCHIVE_DEST_STATE_2 = ENABLE
# Remote @ as sysdba login allowed
REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
LOG_ARCHIVE_FORMAT = % t _ % s _ % r. arc
LOG_ARCHIVE_MAX_PROCESSES = 30

# Fail configuration when the target database fails, use the service name in tnsnames to use the local service.
FAL_SERVER = dex_hell
FAL_CLIENT = dex
# Replace file name, which can be a directory or a word. The purpose of replacement is to find the local copy of The datafile and log file of the target data when the target database fails.
DB_FILE_NAME_CONVERT = 'dex _ hell ', 'dex'
# The configuration here must match the actual library. If dex_hell fail cannot be accessed, replace the location of the logfile.
LOG_FILE_NAME_CONVERT = '/arch1/dex/', '/arch1/dex_hell /'
STANDBY_FILE_MANAGEMENT = AUTO

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.