In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about the rac environment dg configuration duplicate way is how, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.
Create a physical repository
1 、
Modify tnsnames.ora
Vip can be used to transport in RAC environment
Main library
Pridb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.101) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD)
)
)
Stdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.11) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STPROD)-the global name of the static monitor
)
)
Prepare the library
Pridb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = rac1) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD)
)
)
Stdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STPROD)
)
)
2. Modify parameters of the main library
Modify spfile on the primary node
Alter system set log_archive_config='dg_config= (PROD,STPROD) 'scope=spfile sid='*'
Alter system set fal_server='STDB' scope=spfile sid='*';--TSN
Alter system set fal_client='PRIDB' scope=spfile sid='*';--TNS
Alter system set standby_file_management=auto scope=spfile sid='*'
Alter system set log_archive_dest_1='location=use_db_recovery_file_dest valid_for= (ALL_LOGFILES,ALL_ROLES) db_unique_name=PROD mandatory verify' scope=both sid='*'
Alter system set log_archive_dest_2='SERVICE=STDB LGWR async valid_for= (ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=STPROD' scope=both sid='*'
Alter system set log_archive_dest_state_2='ENABLE' scope=both sid='*'
Alter system set log_archive_dest_state_1='ENABLE' scope=both sid='*'
Alter system set db_file_name_convert='/u01/app/oracle/oradata/STPROD/','+DATA/prod/datafile/','/u01/app/oracle/oradata/STPROD/','+DATA/prod/tempfile/' scope=spfile;--- comes before each other and then himself.
Alter system set log_file_name_convert='/u01/app/oracle/oradata/STPROD/' scope=spfile
Open the mandatory day
Alter database force logging
Create a parameter file
Create pfile='/home/oracle/initSDPROD' from spfile
Alter system set log_archive_dest_2='SERVICE=PRIDB LGWR async valid_for= (ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=PROD' scope=both sid='*'
The standby library also requires parameter conversion. All password files must be consistent.
Tempfile also needs it.
Alter system set db_file_name_convert='+DATA/prod/datafile/','/u01/app/oracle/oradata/STPROD/','+DATA/prod/tempfile/','/u01/app/oracle/oradata/STPROD/' scope=spfile;--- comes before each other and then himself.
Alter system set log_file_name_convert='+DATA/prod/datafile/','/u01/app/oracle/oradata/STPROD/'' scope=spfile
3. Create adump directory and backup set storage directory and data file storage directory
Mkdir-p / u01/app/oracle/admin/STPROD/adump
Mkdir-p / u01/app/oracle/fast_recovery_area
Create a standby library control file
ALTER DATABASE CREATE STANDBY CONTROLFILE AS'/ u01amp appActionoracleUniverse 11.2.0Universe dbsUniverse control.ctl'
Boot to
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = STPROD)
(ORACLE_HOME = / u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = STPROD)-must be the same as the sid of the password file
)
)
Transfer the password file to the standby database, and the parameter file to the standby database and modify it.
Boot to mount state
Rman target sys/oracle@PRIDB auxiliary sys/oracle@STDB
Duplicate target database for standby from active database dorecover nofilenamecheck
Duplicate target database for standby from active database dorecover nofilenamecheck
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;-- needs to create a standy log
Alter database recover managed standby database disconnect from session
Alter database recover managed standby database cancel
View active and standby status
Select name,PROTECTION_MODE,DATABASE_ROLE, SWITCHOVER_STATUS from v$database
Select NAME,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database
-- check the process to see if there is a LNS process, if not
Select process,client_process,sequence#,status from v$managed_standby
Select dest_name,status,target,archiver,error,process from v$archive_dest
Select name,value,datum_time from v$dataguard_stats
There must be multithreaded logs-password files must be consistent
Single instance standby:
Alter database add standby logfile thread 1 group 11 ('/ u01 prime size size 50m)
Alter database add standby logfile thread 1 group 12 ('/ u01 prime size size 50m)
Alter database add standby logfile thread 1 group 13 ('/ u01 prime size size 50m)
Alter database add standby logfile thread 2 group 14 ('/ u01 prime size size 50m)
Alter database add standby logfile thread 2 group 15 ('/ u01 prime size size 50m)
Alter database add standby logfile thread 2 group 16 ('/ u01 prime size size 50m)
Alter database drop standby logfile group 8 ('/ u01 size size 50m)
Under primary rac:
Alter database add standby logfile thread 1 group 5 size 50M,group 6 size 50M,group 7 size 50M
Alter database add standby logfile thread 2 group 8 size 50M,group 9 size 50M,group 10 size 50M
THREAD#
SELECT GROUP#,THREAD#,BYTES/1024/1024 M FROM V$STANDBY_LOG
SELECT GROUP#,THREAD#,STATUS,BYTES/1024/1024 M FROM V$LOG
DATA Guard in maximum protection and maximum availability mode, the Standby database must be configured with Standby Redo Log
The standby library is created and configured for Standby Redo Log to receive logs from the main library for recovery.
The main library creates and configures Standby Redo Log so that it can receive logs from the original library (the master after switching) after the master / slave switch.
Note: in order to work properly after switching between master and slave, both master and slave libraries must create a standby redo log
Creation principle: it is recommended that the number of Standby Redologs log groups be determined based on the number of threads in the Primary database (the number of threads here can be understood as the number of nodes in the RAC environment).
There is a recommended formula for reference: (number of log groups per thread + 1) × maximum number of threads.
Nx+1
Using this formula can reduce the possibility that the LGWR process of the Primary database instance will be locked.
The creation principle is the same as the single instance, the size is the same, but the number of log groups is one more than that of the primary database. For example, in my environment, there are 2 nodes, each node has 4 sets of redo, so the number of standby redo log groups to be created now is: (4: 1) * 2: 10
Standby Redologs operates in almost the same way as Online Redologs, except that you need to specify an extra Standby keyword when creating or deleting
Standby database configuration monitoring
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = STPROD)-Database service name
(ORACLE_HOME = / u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = STPTOD)-- Database sid name
)
)
The parameters that need to be modified are:
Audit_file_dest
Control_files
Db_file_name_convert
Db_unique_name
Fal_client
Fal_server
Log_archive_config
Log_archive_dest_1
Log_archive_dest_2
Log_archive_dest_3
Log_file_name_convert
Need to modify
ALTER TABLESPACE TEMP ADD TEMPFILE'/ u01 size autoextend off
Alter database tempfile'+ DATA' drop
Common mistakes
Errors in file / u01/app/oracle/diag/rdbms/stprod/STPROD/trace/STPROD_dbw0_2593.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201-see DBWR trace file
ORA-01110: data file 201:'+ DATA'
File 201 not verified due to error ORA-01157
Delete after rebuilding
DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS
Alter tablespace TEMP add TEMPFILE'+ DATA' size 32G AUTOEXTEND OFF
CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE'+ DATA' SIZE 10m AUTOEXTEND OFF
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp1
Alter tablespace TEMP1 add TEMPFILE'/ u01 size AUTOEXTEND OFF
Select NAME,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database
Select dest_name,status,target,archiver,error,process from v$archive_dest
Select process,client_process,sequence#,status from v$managed_standby
Select * from v$archive_gap
Select name,value,datum_time from v$dataguard_stats
Normal active / standby handover
View the status of the main library
Select NAME,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database
The main library is cut as a standby library.
Alter database commit to switchover to standby
View standby status
Select NAME,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database
NAME OPEN_MODE PROTECTION_MODE DATABASE_ROLE
--
SWITCHOVER_STATUS
-
PROD READ ONLY WITH APPLY MAXIMUM PERFORMANCE PHYSICAL STANDBY
TO PRIMAR
Prepare the library and cut the main library
Alter database commit to switchover to primary
The new backup library starts to mount status application log
Startup nomount
Application log
Alter database recover managed standby database using current logfile disconnect from session
Alter database recover managed standby database cancel
Alter database open
View the status of the new master library
NAME OPEN_MODE PROTECTION_MODE DATABASE_ROLE
--
SWITCHOVER_STATUS
-
PROD READ WRITE MAXIMUM PERFORMANCE PRIMARY
SESSIONS ACTIVE
The above is how the dg configuration duplicate of the rac environment is, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.