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 deploy 11.2.0.4 DG for linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to carry out 11.2.0.4 DG for linux deployment, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

1. Schematic diagram of oracle database DB

2. The three working modes of oracle dg and its demand dependence on database.

3. The environment of this experiment

4. Work before oracle DG deployment

Deploy the Oracle 11.2.0.4 database software on the centdgpri machine and deploy the instance, and install only the Oracle database software on the centdgstd machine, which requires that the deployment path of the oracle environment on the centdgpri and centdgstd machines, that is, the database-related software, should be the same.

5. Deployment of oracle DG

Adjust the main library and start archiving

Archive log list

Shutdown immediate

Startup mount

Alter system set log_archive_dest_1='location=/opt/oracle/arch'

Alter database archivelog

Archive log list

Alter database open

Alter system archive log current

Main library adjustment, turn on flashback

Select force_logging, FLASHBACK_ON from v$database

Alter database force logging

Alter system set DB_RECOVERY_FILE_DEST_SIZE=10g

Alter system set db_recovery_file_dest='/opt/oracle/flash_recovery_area'

Alter database FLASHBACK ON

Select force_logging, FLASHBACK_ON from v$database

Adjust the main library and add standby logfile logs

Set linesize 1000

Col member for a50

Select * from v$logfile order by 1

Select GROUP#, BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log

Alter database add standby logfile group 6 ('/ opt/oracle/oradata/redo06.log') size 50m

Alter database add standby logfile group 7 ('/ opt/oracle/oradata/redo07.log') size 50m

Alter database add standby logfile group 8 ('/ opt/oracle/oradata/redo08.log') size 50m

Alter database add standby logfile group 9 ('/ opt/oracle/oradata/redo09.log') size 50m

Alter database add standby logfile group 10 ('/ opt/oracle/oradata/redo10.log') size 50m

Adjust the main library, modify the database startup pfile file

Orcl.__db_cache_size=327155712

Orcl.__java_pool_size=4194304

Orcl.__large_pool_size=8388608

Orcl.__oracle_base='/opt/oracle'#ORACLE_BASE set from environment

Orcl.__pga_aggregate_target=314572800

Orcl.__sga_target=469762048

Orcl.__shared_io_pool_size=0

Orcl.__shared_pool_size=117440512

Orcl.__streams_pool_size=0

* .audit_file_dest='/opt/oracle/admin/orcl/adump'

* .audit_trail='db'

* .compatible='11.2.0.4.0'

* .control_files='/opt/oracle/oradata/orcl/control01.ctl','/opt/oracle/oradata/orcl/control02.ctl'

* .db_block_size=8192

* .db_domain=''

* .db_name='orcl'

* .diagnostic_dest='/opt/oracle'

* .dispatchers=' (PROTOCOL=TCP) (SERVICE=orclXDB)'

* .log_archive_dest_1='location=/opt/arch'

* .memory_target=783286272

* .open_cursors=300

* .processes=150

* .remote_login_passwordfile='EXCLUSIVE'

* .undo_tablespace='UNDOTBS1'

DB_UNIQUE_NAME='orcl'

Log_archive_config='DG_CONFIG= (orcl,orcls)'

Log_archive_dest_1='LOCATION=/opt/oracle/arch VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'

LOG_ARCHIVE_DEST_2='SERVICE=dbstandby LGWR ASYNC VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcls'

LOG_ARCHIVE_DEST_STATE_1=ENABLE

LOG_ARCHIVE_DEST_STATE_2=ENABLE

FAL_SERVER=dbstandby

FAL_CLIENT=dbprimary

STANDBY_FILE_MANAGEMENT=AUTO

* .log_file_name_convert='/opt/oracle/oradata','/opt/oracle/oradata'

* .db_file_name_convert='/opt/oracle/oradata','/opt/oracle/oradata'

Adjust the main library and regenerate spfile

Startup pfile='$ORACLE_HOME/dbs/initorcl.ora'

Create spfile from memory

Shutdown immediate

Startup

Show parameter spfile

Adjust the main library and modify the listening configuration file listener.ora

LISTENER =

(DESCRIPTION_LIST=

(DESCRIPTION =

(ADDRESS= (PROTOCOL=tcp) (HOST=centdgpri) (PORT=1521))

(ADDRESS= (PROTOCOL=ipc) (KEY= EXTPROC1521)

)

SID_LIST_LISTENER =

(SID_LIST=

(SID_DESC=

(GLOBAL_DBNAME=orcl)

(SID_NAME=orcl)

(ORACLE_HOME=/opt/oracle/product/11.2.0.4/db)

)

(SID_DESC =

(GLOBAL_DBNAME = orcl_DGMGRL)

(ORACLE_HOME = / opt/oracle/product/11.2.0.4/db)

(SID_NAME= orcl)

)

)

ADR_BASE_LISTENER = / opt/oracle

Adjust the main library and modify the TNS service profile tnsnames.ora

DBPRIMARY=

(DESCRIPTION=

(ADDRESS_LIST=

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

)

(CONNECT_DATA= (SID=orcl) (SERVER=DEDICATED))

)

ORCL=

(DESCRIPTION=

(ADDRESS_LIST=

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

)

(CONNECT_DATA= (SID=orcl) (SERVER=DEDICATED))

)

DBSTANDBY=

(DESCRIPTION=

(ADDRESS_LIST=

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

)

(CONNECT_DATA= (SID=orcl) (SERVER=DEDICATED))

)

Prepare the database for adjustment, edit the database and start pfile

* .audit_file_dest='/opt/oracle/diag/rdbms/orcl/orcl/adump'

* .compatible='11.2.0.4.0'

* .control_files='/opt/oracle/oradata/control01.ctl','/opt/oracle/oradata/control02.ctl'

* .core_dump_dest='/opt/oracle/diag/rdbms/orcl/orcl/cdump'

* .db_block_size=8192

* .db_create_file_dest='/opt/oracle/oradata'

* .db_file_multiblock_read_count=16

* .db_name='orcl'

* .db_recovery_file_dest='/opt/oracle/flash_recovery_area'

* .db_recovery_file_dest_size=10G

* .diagnostic_dest='/opt/oracle/diag/rdbms/orcl/orcl/trace'

* .dispatchers=' (PROTOCOL=TCP) (SERVICE=orcl)'

* .job_queue_processes=10

* .log_archive_dest_1='LOCATION=/opt/oracle/arch'

* .log_buffer=7356416 # log buffer update

* .open_cursors=300

* .optimizer_dynamic_sampling=2

* .optimizer_mode='ALL_ROWS'

* .pga_aggregate_target=186M

* .plsql_warnings='DISABLE:ALL' # PL/SQL warnings at init.ora

* .processes=150

* .query_rewrite_enabled='TRUE'

* .remote_login_passwordfile='EXCLUSIVE'

* .result_cache_max_size=2880K

* .sga_target=560M

* .skip_unusable_indexes=TRUE

* .undo_management='AUTO'

* .undo_tablespace='UNDOTBS1'

DB_UNIQUE_NAME='orcls'

Log_archive_config='DG_CONFIG= (orcls,orcl)'

Log_archive_dest_1='LOCATION=/opt/oracle/arch VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcls'

LOG_ARCHIVE_DEST_2='SERVICE=dbprimary LGWR ASYNC VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'

LOG_ARCHIVE_DEST_STATE_1=ENABLE

LOG_ARCHIVE_DEST_STATE_2=ENABLE

FAL_SERVER=dbprimary

FAL_CLIENT=dbstandby

STANDBY_FILE_MANAGEMENT=AUTO

* .log_file_name_convert='/opt/oracle/oradata','/opt/oracle/oradata'

* .db_file_name_convert='/opt/oracle/oradata','/opt/oracle/oradata'

Prepare library adjustment, edit listening configuration file listener.ora

LISTENER =

(DESCRIPTION_LIST=

(DESCRIPTION =

(ADDRESS= (PROTOCOL=tcp) (HOST=centdgstd) (PORT=1521))

(ADDRESS= (PROTOCOL=ipc) (KEY= EXTPROC1521)

)

SID_LIST_LISTENER =

(SID_LIST=

(SID_DESC=

(GLOBAL_DBNAME=orcl)

(SID_NAME=orcl)

(ORACLE_HOME=/opt/oracle/product/11.2.0.4/db)

)

(SID_DESC =

(GLOBAL_DBNAME = orcls_DGMGRL)

(ORACLE_HOME = / opt/oracle/product/11.2.0.4/db)

(SID_NAME= orcl)

)

)

ADR_BASE_LISTENER = / opt/oracle

Adjust the standby database and modify the TNS service configuration file tnsnames.ora

DBPRIMARY=

(DESCRIPTION=

(ADDRESS_LIST=

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

)

(CONNECT_DATA= (SID=orcl) (SERVER=DEDICATED))

)

ORCLS=

(DESCRIPTION=

(ADDRESS_LIST=

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

)

(CONNECT_DATA= (SID=orcl) (SERVER=DEDICATED))

)

DBSTANDBY=

(DESCRIPTION=

(ADDRESS_LIST=

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

)

(CONNECT_DATA= (SID=orcl) (SERVER=DEDICATED))

)

6. Main Library Clone Island Reserve Library

The main library creates the sys password file and transfers it to the slave library dbs directory

Orapwd file=$ORACLE_HOME/dbs/PWDorcl.ora password=WaterH2o entries=40 force=y

The standby library creates an audit directory consistent with the main database

Main library:

Cd $ORACLE_BASE

Tar-cvf diag.tar diag/

Scp diag.tar centdgstd:/opt/oracle

Prepare the library:

Mv diag $ORACLE_BASE/

Cd $ORACLE_BASE

Tar-xvf diag.tar

Mkdir-p $ORACLE_BASE/flash_recovery_area

Mkdir-p $ORACLE_BASE/oradata

Test the TNS service before cloning the main library. Be sure to test it in both the master and backup libraries.

Tnsping dbprimary

Tnsping dbstandby

Sqlplus sys/WaterH2o@dbprimary as sysdba

Sqlplus sys/WaterH2o@dbstndby as sysdba

Clone the main library to the standby machine

Rman target sys/WaterH2o@dbprimary auxiliary sys/WaterH2o@dbstandby

Duplicate target database for standby from active database nofilenamecheck

7. Start the log synchronization process of the slave database

Alter database recover managed standby database disconnect from session

8. View the roles of master and slave libraries

Select db_unique_name,database_role,switchover_status,open_mode from v$database

9. Verify the data synchronization of the physical DG

Select switchover_status from vault database;-- check to see if there is an archive log of gap

Main library:

Select STATUS, GAP_STATUS from V$ARCHIVE_DEST_STATUS where DEST_ID = 2

Main library:

SQL > select STATUS, GAP_STATUS from V$ARCHIVE_DEST_STATUS where DEST_ID = 2

STATUS GAP_STATUS

-

VALID RESOLVABLE GAP

Prepare the library:

SQL > select STATUS, GAP_STATUS from V$ARCHIVE_DEST_STATUS where DEST_ID = 2

STATUS GAP_STATUS

-

VALID NO GAP

View the roles and status of master and slave libraries

Select open_mode,database_role,db_unique_name from vault database-

Main library:

SQL > select open_mode,database_role,db_unique_name from v$database

OPEN_MODE DATABASE_ROLE DB_UNIQUE_NAME

READ WRITE PRIMARY orcl

SQL >

Prepare the library:

SQL > select open_mode,database_role,db_unique_name from v$database

OPEN_MODE DATABASE_ROLE DB_UNIQUE_NAME

READ ONLY WITH APPLY PHYSICAL STANDBY orcl

SQL >

View the serial number of the master and slave libraries

Select max (sequence#) from v$archived_log

Archive log list

Main library:

SQL > select max (sequence#) from v$archived_log

MAX (SEQUENCE#)

-

twenty-five

SQL > archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination / opt/arch

Oldest online log sequence 24

Next log sequence to archive 26

Current log sequence 26

SQL >

Prepare the library:

SQL > select max (sequence#) from v$archived_log

MAX (SEQUENCE#)

-

twenty-five

SQL > archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination / opt/arch

Oldest online log sequence 17

Next log sequence to archive 0

Current log sequence 25

SQL >

10. DG Broker manages the configuration manually

The main library before DG deployment confirms that flashback is enabled.

Select flashback_on from v$database

Dg_broker_start is enabled in the master and standby database.

Show parameter dg_broker_start

Alter system set dg_broker_start=true

Show parameter dg_broker_start

The main library logs in to the dgmrl client

Dgmgrl sys/WaterH2o@dbprimary

Create a dgb control file (be sure to test the tnsping TNS service name)

Create configuration my_dgb as primary database is orcl connect identifier is dgb_p

DGMGRL > create configuration my_dgb as primary database is orcl connect identifier is dbprimary

Configuration "my_dgb" created with primary database "orcl"

Add standby library

DGMGRL > add database orcls as connect identifier is dbstandby maintained as physical

Database "orcls" added

Enable profile

DGMGRL > enable configuration

Enabled.

DGMGRL >

Verify the configuration startup status

DGMGRL > show configuration

Configuration-my_dgb

Protection Mode: MaxPerformance

Databases:

Orcl-Primary database

Orcls-Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

DGMGRL >

Open the main and standby library StandbyFileManagement and synchronize to DGB

SQL > alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both

DGMGRL > edit database orcl set property StandbyFileManagement='AUTO'

DGMGRL > edit database orcls set property StandbyFileManagement='AUTO'

DGMGRL > EDIT DATABASE orcl SET PROPERTY LogXptMode='async'

DGMGRL > EDIT DATABASE orcls SET PROPERTY LogXptMode='async'

Cancel two parameters of physical DG

Alter system set fal_server='' scope=both sid='*'

Alter system set fal_client='' scope=both sid='*'

11. Physical DG manually switches roles between master and slave libraries through Broker

Role check before switching between active and standby libraries

Main library:

SQL > select database_role,switchover_status,open_mode from v$database

DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE

PRIMARY TO STANDBY READ WRITE

Prepare the library:

SQL > select database_role,switchover_status,open_mode from v$database

DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE

PHYSICAL STANDBY NOT ALLOWED MOUNTED

DGMGRIL console switches between active and standby libraries

DGMGRL > show configuration

Configuration-my_dgb

Protection Mode: MaxPerformance

Databases:

Orcl-Primary database

Orcls-Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

DGMGRL > switchover to orcls

Performing switchover NOW, please wait...

Operation requires a connection to instance "orcl" on database "orcls"

Connecting to instance "orcl"...

Connected.

New primary database "orcls" is opening...

Operation requires startup of instance "orcl" on database "orcl"

Starting instance "orcl"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "orcls"

DGMGRL >

DGMGRL > show configuration

Configuration-my_dgb

Protection Mode: MaxPerformance

Databases:

Orcls-Primary database

Orcl-Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

DGMGRL >

Check the result of manually switching between master and slave libraries in the DGMGRIL console

New main library:

SQL > select db_unique_name,database_role,switchover_status,open_mode from v$database

DB_UNIQUE_NAME DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE

Orcls PRIMARY TO STANDBY READ WRITE

New library:

SQL > select db_unique_name,database_role,switchover_status,open_mode from v$database

DB_UNIQUE_NAME DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE

Orcl PHYSICAL STANDBY NOT ALLOWED MOUNTED

12. Start Failvoer Fast Start when you start DG FFS

Conditions that must be met to enable FFS

The main and standby database log synchronization mode is automatic synchronization.

LogXptMode='async'

EDIT DATABASE orcl SET PROPERTY LogXptMode='async'

EDIT DATABASE orcls SET PROPERTY LogXptMode='async'

Flashback is enabled for both master and standby databases in order to start fast and automatic database recovery

Select name,db_unique_name,flashback_on from v$database

Handle standby standby library open flashback

Alter database open read only

Alter database flashback on

twelve。 Enable FFS for DG

Enable FFS for primary and secondary libraries

Edit database orcl set property FastStartFailoverTarget=orcls

Edit database orcls set property FastStartFailoverTarget=orcl

Enable fast_start failover

Enable result

13. DG Broker FFS function test

Fault Simulation of shutdown abort in main Library

Log in to the main library to initiate shutdown abort

Prepare the library alarm log to prompt the standby library to take over the main library successfully.

Observer prompts for automatic role switching

Confirm the result of automatic role switching

Start after the main library is restored

Observer log prompts for the assignment of active and standby roles

View the roles of the primary and standby libraries after the original primary database is restored

Original main database view

Original database view

After reading the above, have you mastered how to deploy 11.2.0.4 DG for linux? 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

Wechat

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

12
Report