DataGuard - Physical Standby Confidential Configuration Steps

zhaozj2021-02-16  89

Physical Standby configuration

Modify the control file, modify the maximum log group 10

Alter Database Backup ControlFile to TRACE;

Oracle_home is / OPT / ORACLE / APP / ORACLE / PRODUCT /

9.2.0

190 as a Primary, 185 as Standby

Create Standby's Oracle Software

Oracle software on PRIMARY

CD / OPT / ORACLE / APP / ORACLE / PRODUCT

TAR CVF DB.TAR

9.2.0

FTP to the Standby server corresponding directory

Create the Oracle Software Directory Structure on Standby

MKDIR -P / OPT / ORACLE / APP / ORACLE / PRODUCT

CD / OPT / ORACLE / APP / ORACLE / PRODUCT

TAR XVF DB.TAR

CD / OPT / ORACLE / APP / ORACLE

MKDIR -P admin / CTSDB / BDUMP

Mkdir -P admin / CTSDB / CDUMP

MKDIR -P admin / CTSDB / UDUMP

Create a DBA group on Standby, Oracle users, modify the environment variables of Oracle users, modify / etc / system files

1. Set primary to force logging

Alter Database Force Logging;

2. Set primary as archiving mode

3. Check all data files in Primary

4. Turn off Primary, turn off the application server, stop listening

5. CP all data files to local backup paths

6. Start Primary, keep the listening and application server in the stop state

7. Generate Standby Control Files

Alter Database Create Standby ControlFile As '/TMP/stdby.ctl';

8. Generate initialization parameter file

Create Pfile = '/ TMP / INITCTSDB.ORA' from SPFILE;

9. All files generated in 5, 7, 8 and password file CP to STANDBY server

10. Modify Standby's initialization parameter file

Add the following row:

* .standby_archive_dest = '/ export / spare / oradata / ctsdb / archive'

* .fal_server = 'ctsdb.primary'

* .fal_client = 'ctsdb.standby'

* .standby_file_management = auto

* .remote_archive_enable = true

11. Modify the Lisner.ora and Tnsnames.ora files of Primary and Standby

# Listener.ora network configuration file: / OPT / ORACLE / APP / ORACLE / PRODUCT /

9.2.0

/

Network / admin / listener.ora

#Enerated by Oracle Configuration Tools.

SID_LIST_LISTENER_DG =

(SID_LIST =

(SID_DESC =

(Global_dbname = ctsdb)

(Oracle_Home = / OPT / ORACLE / APP / ORACLE / PRODUCT /

9.2.0

)

(SID_NAME = CTSDB)

)

)

Listener_dg =

(Description =

(Address = (Protocol = TCP) (Host = 129.200.9.190) (port = 1522)))))))

# TNSNAMES.ORA NETWORK Configuration File: / OPT / ORACLE / APP / ORACLE / PRODUCT /

9.2.0

/

Network / admin / tnsnames.ora

#Enerated by Oracle Configuration Tools.

CTSDB.Standby =

(Description =

(Address_list =

(Address = (protocol = TCP) (Host = 129.200.9.185) (port = 1522)))

)

(Connect_data =

(Server = DEDICATED)

(SID = CTSDB)

)

)

CTSDB.Primary =

(Description =

(Address_list =

(Address = (Protocol = TCP) (Host = 129.200.9.190) (port = 1522))))

)

(Connect_data =

(Server = DEDICATED)

(SID = CTSDB)

)

)

12. Set STANDBY SQLNET.ORA file

Add SQLNET.EXPIRE_TIME = 2, which means that in STANDBY is unavailable due to faults, Primary will continue to detect 2 minutes, and if it is still not available, return to network connection errors.

13. Create SPFILE with Standby

Create SPFile from Pfile = '/ TMP / INITCTSDB.ORA';

14. Start STANDBY

Startup nomount;

Alter Database

Mount

STANDBY

Database;

Add Standby Redolog

Alter Database Add Standby Logfile Group 4 ('/export/spare/roadata/ctsdb/stdby_redo04.log') Size 10240K;

Alter Database Add Standby Logfile Group 5 ('/export/spare/oradata/ctsdb/stdby_redo05.log') size 10240k;

Alter Database Add Standby Logfile Group 6 ('/export/spare/roadata/ctsdb/stdby_redo06.log') Size 10240K;

Alter Database Add Standby Logfile Group 7 ('/export/spare/oradata/ctsdb/stdby_redo07.log') Size 10240K;

Alter Database Recover Managed Standby Database Disconnect from Session;

In order to prevent Primary and Standby switching, it can also establish corresponding Standby Redolog on PRIMARY.

15. Set up Primary archive

Alter system set log_archive_dest_2 = 'service = ctsdb.standby lgwr' scope = Both;

ALTER system set log_archive_dest_state_2 = enable scope = Both; 16. Test whether PRIMARY archives can be applied to Standby

Alter System Archive Log Current;

17. Stop STANDBY

Alter Database Recover Managed Standby Database Finish;

Shutdown immediate;

18. Switch to read mode

Alter Database Recover Managed Standby Database Cancel;

Alter Database Open Read Only;

19. Switch back management recovery mode

Alter Database Recover Managed Standby Database Disconnect from Session;

DataGuard for Max Performance mode

If you want to change to max availability, do the following:

Check the current Primary library protection mode

SELECT Protection_Mode from V $ Database;

Conversion:

Shutdown immediate;

Startup mount;

Alter Database Set Standby Database to Maximize Availability;

ALTER DATABASE OPEN

If you want to force Primary to make an archive once, set the initialization parameter Archive_LAG_TARGET for PRIMARY:

ALTER system set archive_lag_target = 60 scope = Both;

If you want to automatically create data files in the primary on Standby, you need to set up on Standby:

ALTER system set standby_file_management = auto scope = Both;

转载请注明原文地址:https://www.9cbs.com/read-12084.html

New Post(0)