Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement physical Data Guard configuration and installation on the same host

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

It is believed that many inexperienced people are at a loss about how to implement physical Data Guard configuration and installation on the same host. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

I. Primary database configuration

1. Verify that the primary library is in archive mode

Export ORACLE_SID=ocmdb

[oracle@ocmdb1 ~] $sqlplus / as sysdba

Sys@ocmdb > archive log list

two。 Set the primary library to FORCE LOGGING mode

Sys@ocmdb > alter database force logging

3. Create a standby database control file in the primary library

Sys@ocmdb >! mkdir-p / home/oracle/backup

Sys@ocmdb > alter database create standby controlfile as'/ home/oracle/backup/ocmdg.ctl'

4. Create a primary library client initialization parameter file

1)。 Create a pfile in the main library

Sys@ocmdb > create pfile from spfile

2)。 Backup to the backup directory, which is used to create the pfile of the standby library

Sys@ocmdb >! Cp / u01/app/oracle/product/10.2.0/db_1/dbs/initocmdb.ora / home/oracle/backup/initocmdg.ora

3)。 After modification, the contents of the main library pfile are as follows:

[oracle@ocmdb1 ~] $mkdir / home/oracle/ocmdb_arch

Vi $ORACLE_HOME/dbs/initocmdb.ora

The following is appended to the tail of the pfile

#

# Parameters for Primary Database.

#

* .DB_NAME='ocmdb'

* .DB_UNIQUE_NAME=ocmdb

* .LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc

* .LOG_ARCHIVE_CONFIG='DG_CONFIG= (ocmdb,ocmdg)'

* .LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/oradata/ocmdb VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ocmdb'

* .LOG_ARCHIVE_DEST_2='SERVICE=ocmdg LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ocmdg'

* .LOG_ARCHIVE_DEST_STATE_1=ENABLE

* .LOG_ARCHIVE_DEST_STATE_2=ENABLE

* .REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

#

# Parameters which using for switch over from Primary to Standby.

#

* .FAL_SERVER=ocmdg

* .FAL_CLIENT=ocmdb

* .DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/ocmdg','/u01/app/oracle/oradata/ocmdb'

* .LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/ocmdg','/u01/app/oracle/oradata/ocmdb'

* .STANDBY_FILE_MANAGEMENT=AUTO

* .STANDBY_ARCHIVE_DEST='/home/oracle/ocmdb_arch'

4)。 Rebuilding spfile through pfile

Sys@ocmdb > shutdown immediate

NotConnected@ > create spfile from pfile='initocmdb.ora'

5. Configure listener

Vi $ORACLE_HOME/network/admin/tnsnames.ora

OCMDB =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = ocmdb1.localdomain) (PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = ocmdb)

)

)

OCMDG =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = ocmdb1.localdomain) (PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = ocmdg)

)

)

Verify snooping

Tnsping ocmdb

Tnsping ocmdg

II. Standby database configuration

1. Create a password file and be careful to keep the sys password consistent with the primary database

Cd $ORACLE_HOME/dbs

Orapwd file=orapwocmdg password=oracle1 entries=20

two。 Create the required directory (note the files managed by OMF)

Cd $ORACLE_BASE/admin

Mkdir-p ocmdg/adump

Mkdir-p ocmdg/bdump

Mkdir-p ocmdg/cdump

Mkdir-p ocmdg/dpdump

Mkdir-p ocmdg/udump

Mkdir-p ocmdg/pfile

Mkdir-p oradata/ocmdg

Mkdir-p oradata/ocmdg

Mkdir-p oradata/ocmdg

3. Copy the data file to the directory corresponding to the standby library (datafile,log,controlfiles)

Close the main library

Export ORACLE_SID=ocmdb

Sqlplus / as sysdba

Shutdown immediate

1)。 Copy data file

Cp / u01 u01/app/oracle/oradata/ocmdg * / u01/app/oracle/oradata/ocmdg

2)。 Copy the generated standby control file

Cp / home/oracle/backup/ocmdg.ctl / u01/app/oracle/oradata/ocmdg/control01.ctl

Cp / home/oracle/backup/ocmdg.ctl / u01/app/oracle/oradata/ocmdg/control02.ctl

Cp / home/oracle/backup/ocmdg.ctl / u01/app/oracle/oradata/ocmdg/control03.ctl

4. Modify standby initialization parameter file

[oracle@ocmdb1 ~] $mkdir / home/oracle/ocmdg_arch

1). The initialization parameters of standby are as follows

Cp / home/oracle/backup/initocmdg.ora / u01/app/oracle/product/10.2.0/db_1/dbs/initocmdg.ora

Note that all path-related parameters need to be adjusted correctly

Vi $ORACLE_HOME/dbs/initocmdg.ora

Ocmdb.__db_cache_size=125829120

Ocmdb.__java_pool_size=4194304

Ocmdb.__large_pool_size=4194304

Ocmdb.__shared_pool_size=96468992

Ocmdb.__streams_pool_size=8388608

* .audit_file_dest='/u01/app/oracle/admin/ocmdg/adump'

* .background_dump_dest='/u01/app/oracle/admin/ocmdg/bdump'

* .compatible='10.2.0.1.0'

* .control_files='/u01/app/oracle/oradata/ocmdg/control01.ctl','/u01/app/oracle/oradata/ocmdg/control02.ctl','/u01/app/oracle/oradata/ocmdg/control03.ctl'

* .core_dump_dest='/u01/app/oracle/admin/ocmdg/cdump'

* .db_16k_cache_size=33554432

* .db_block_size=8192

* .db_create_file_dest='/u01/app/oracle/oradata/ocmdg/'

* .db_domain=''

* .db_file_multiblock_read_count=16

* .db_keep_cache_size=33554432

* .db_name='ocmdb'

* .db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'

* .db_recovery_file_dest_size=21474836480

* .dispatchers=' (protocol=TCP) (serv=ocmdg) (list=ocmdg) (poo=on) (disp=6) (con=36) (sess=100)'

* .job_queue_processes=10

* .log_archive_format='%t_%s_%r.dbf'

* .max_dispatchers=0

* .max_shared_servers=0

* .open_cursors=300

* .pga_aggregate_target=62914560

* .processes=150

* .remote_login_passwordfile='EXCLUSIVE'

Ocmdg.resource_manager_plan='WEEKDAYS'

* .sga_target=314572800

* .shared_servers=0

* .undo_management='AUTO'

* .undo_tablespace='UNDOTBS1'

* .user_dump_dest='/u01/app/oracle/admin/ocmdg/udump'

#

# Parameters for Standby Database.

#

* .DB_NAME='ocmdb'

* .DB_UNIQUE_NAME=ocmdg

* .LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc

* .LOG_ARCHIVE_CONFIG='DG_CONFIG= (ocmdb,ocmdg)'

* .DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/ocmdb','/u01/app/oracle/oradata/ocmdg'

* .LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/ocmdb','/u01/app/oracle/oradata/ocmdg'

* .STANDBY_ARCHIVE_DEST='/home/oracle/ocmdg_arch'

* .FAL_SERVER=ocmdb

* .FAL_CLIENT=ocmdg

* .STANDBY_FILE_MANAGEMENT=AUTO

#

# Parameters which using for switch over from Standby to Primary.

#

* .LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/oradata/ocmdg VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ocmdg'

* .LOG_ARCHIVE_DEST_2='SERVICE=ocmdb LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ocmdb'

* .LOG_ARCHIVE_DEST_STATE_1=ENABLE

* .LOG_ARCHIVE_DEST_STATE_2=ENABLE

* .REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

2)。 Create a spfile through this pfile

Export ORACLE_SID=ocmdg

Create spfile from pfile

5. Start the main library instance

Export ORACLE_SID=ocmdb

Sqlplus / as sysdba

Startup

6. Start standby to mount

Export ORACLE_SID=ocmdg

Sqlplus / as sysdba

NotConnected@ > startup mount

7. Start the redo application

NotConnected@ > alter database recover managed standby database disconnect from session

At this point, the task of creating a physical standby on the same host is complete.

For testing the effectiveness of DG, please refer to "[DG] physical Data Guard configuration installation on the same host" (http://space.itpub.net/?uid-519536-action-viewspace-itemid-578181).

The configuration method of GD under non-OMF management is described here, because the file directory is relatively fixed and the configuration is more or less the same.

After reading the above, have you mastered how to install the physical Data Guard configuration on the same host? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report