Detailed configuration methods and steps for Oracle 10 Gb physical DG

Source: Internet
Author: User

-- Test environment:
OS: RedHat linux (64)
Primary:
IP: 192.168.94.198
SID: dgdb1
Hostname: dg1
DB_UNIQUE_NAME: dgdb1
Database: 10.2.0.1 (64)

Standby:
IP: 192.168.94.199
SID: dgdb1
Hostname: dg2
DB_UNIQUE_NAME: dgdb1_s
Database: 10.2.0.1 (64)
 

-- Preparations before implementing DG
-- Enable database logging and database archivelog
-- Enable database logging
SQL> alter database force logging;
-- Check whether archivelog is enabled for the database
SQL> archive log list;
-- If archivelog is not enabled for the database, you must enable archivelog.
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
-- Check whether archivelog is enabled for the database
SQL> archive log list;
 

-- Create a directory (based on the actual situation, the primary and standby terminals must be consistent)
-- Standby:
Mkdir-p/export/home/Oracle/product/10.2.0/oradata/dgdb1
Mkdir-p/export/home/oracle/product/10.2.0/admin/dgdb1/adump
Mkdir-p/export/home/oracle/product/10.2.0/admin/dgdb1/bdump
Mkdir-p/export/home/oracle/product/10.2.0/admin/dgdb1/cdump
Mkdir-p/export/home/oracle/product/10.2.0/admin/dgdb1/udump
Mkdir-p/export/home/oracle/product/10.2.0/admin/dgdb1/dpdump
Mkdir-p/export/home/oracle/product/10.2.0/admin/dgdb1/pfile
Mkdir-p/export/home/oracle/archive
Mkdir-p/export/home/oracle/bak
-- Primary:
Mkdir-p/export/home/oracle/archive
Mkdir-p/export/home/oracle/bak
 

-- Modify or add listener. ora and tnsnames. ora (or use a GUI tool to configure)
-- Note: The added parts in listener. ora are in brackets rather than out of brackets.
-- Primary end:
-- Listener. ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/export/home/oracle/product/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = dgdb1)
(ORACLE_HOME =/export/home/oracle/product/10.2.0)
(SID_NAME = dgdb1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = dg1) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0 ))
)
)
 

-- Tnsnames. ora
Dgdb1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.94.198) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dgdb1)
)
)

Dgdb1_s =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.94.199) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dgdb1)
)
)
 

-- Standby end:
-- Listener. ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/export/home/oracle/product/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = dgdb1)
(ORACLE_HOME =/export/home/oracle/product/10.2.0)
(SID_NAME = dgdb1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = dg2) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0 ))
)
)
-- Tnsnames. ora
Dgdb1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.94.198) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dgdb1)
)
)
Dgdb1_s =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.94.199) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dgdb1)
)
)
 

-- Specific steps for implementing DG:
-- Generate pfile on primary and add corresponding parameters to generate the pfile required by standby.
-- Primary end:
Oracle $> sqlplus/as sysdba
SQL> CREATE PFILE = '/export/home/oracle/standby. ora' FROM SPFILE;
-- Edit the generated pfile ('/export/home/oracle/standby. ora') and add the following parameters:
*. Db_unique_name = 'dgdb _ s'
*. Fal_server = 'dgdb1'
*. Fal_client = 'dgdb _ s'
*. LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (dgdb1, dgdb_s )'
*. Log_archive_dest_1 = 'location =/export/home/oracle/archive VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = dgdb_s'
*. LOG_ARCHIVE_DEST_2 = 'service = dgdb1 lgwr async = 40960 VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = dgdb1'
*. LOG_ARCHIVE_DEST_STATE_1 = 'enable'
*. LOG_ARCHIVE_DEST_STATE_2 = 'enable'
*. Standby_archive_dest = '/export/home/oracle/archive'
*. Standby_file_management = 'auto'
-- Copy the modification to the standby end.
Oracle $ Scp/export/home/oracle/standby. ora oracle@192.168.94.199:/export/home/oracle/
-- Start an instance using pfile on standby
-- Use commands on the primary side to create a database password file and copy it to the same path on the standby side (if it already exists, you can copy it directly)
-- Manually create a database password file on the primary side
Oracle $ orapwd file =... password =...
-- Copy the Database Password File to standby on the primary side.
Oracle $ Scp/export/home/oracle/product/10.2.0/database/PWDdgdb1.ora oracle@192.168.94.199:/export/home/oracle/product/10.2.0/database
-- Standby end:
Oracle $ set oracle_sid = dgdb1
Oracle $ sqlplus/as sysdba
SQL> startup nomount pfile = '/export/home/oracle/standby. ora'
SQL> CREATE SPFILE FROM PFILE = '/export/home/oracle/standby. ora ';
-- Modify parameters on the primary side
-- Primary end:
Oracle $ sqlplus/as sysdba
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT = AUTO scope = both;
SQL> ALTER SYSTEM SET fal_server = 'dgdb1 _ s' scope = both;
SQL> ALTER SYSTEM SET fal_client = 'dgdb1 'scope = both;
SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (dgdb1_s, dgdb1) 'scope = both;
SQL> ALTER SYSTEM SET log_archive_dest_1 = 'location =/export/home/oracle/archive VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = dgdb1 'scope = both;
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2 = 'service = dgdb1_s LGWR ASYNC = 40960 VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = dgdb1_s 'scope = both;
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1 = 'enable' scope = both;
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2 = 'enable' scope = both;
SQL> ALTER SYSTEM SET standby_archive_dest = '/export/home/oracle/archive' scope = both;

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.