当前位置:网站首页>Oracle EBS DataGuard setup
Oracle EBS DataGuard setup
2022-07-02 07:12:00 【Virtuous time】
One . environmental information
The database software has been installed
primary
Database version :11.2.0.3
whether RAC:N
Instance name :pri
standby
Database version :11.2.0.3
whether RAC:N
Instance name :std
db_name Generally, it is consistent with the main database
modify hosts file
At two nodes /etc/hosts Add the host names of both parties and IP Mapping .
Two . Main warehouse operation
Check the online log
SELECT thread#, group#, bytes / 1024 / 1024
FROM v$log;
SELECT *
FROM v$logfile;
Ensure that log archiving is turned on
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /data/ebs/pri/db/apps_st/data/archive
Oldest online log sequence 5738
Current log sequence 5739
-- If not, close the data and start to mount Later, the mode starts archiving
SQL> alter database archivelog;
-- Open database
SQL> alter database open;
The main database is configured to force archiving
alter database force logging;
increase standby Log group
ALTER DATABASE add standby logfile GROUP 3 ('/data/ebs/pri/db/apps_st/data/log03a_std.dbf','/data/ebs/pri/db/apps_st/data/log03b_std.dbf') size 1000m;
ALTER DATABASE add standby logfile GROUP 4 ('/data/ebs/pri/db/apps_st/data/log04a_std.dbf','/data/ebs/pri/db/apps_st/data/log04b_std.dbf') size 1000m;
ALTER DATABASE add standby logfile GROUP 5 ('/data/ebs/pri/db/apps_st/data/log05a_std.dbf','/data/ebs/pri/db/apps_st/data/log05b_std.dbf') size 1000m;
Create a password file in the main library
# Be careful ORACLE_SID Case write
orapwd file=orapwpri password=oracle force=y
scp orapwPRI [email protected]:/data/ebs/std/db/tech_st/11.2.0/dbs/orapwSTD
# Guarantee remote_login_passwordfile Parameters = EXCLUSIVE .
adopt sqlplus sys/[email protected] as sysdba To verify that you can log in to each other
Check whether the main library is enabled spfile
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /data/ebs/pri/db/tech_st/11.2.
0/dbs/spfilePRI.ora
Set main library parameters
alter system set log_archive_config='dg_config=(pri,std)' scope=spfile;#pri、std The main database and the standby database sid
SQL> alter system set log_archive_dest_1='LOCATION=/data/ebs/pri/db/apps_st/data/archive valid_for=(all_logfiles,all_roles) db_unique_name=pri' scope=spfile;
System altered.# This parameter is set , Both mean the file path and db_unique_name Agreement
SQL> alter system set log_archive_dest_2='SERVICE=std ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=std' scope=spfile;# This parameter is set , Both mean the file path and db_unique_name Agreement
System altered.
SQL> alter system set log_archive_dest_state_1=enable scope=spfile;
System altered.
SQL> alter system set log_archive_dest_state_2=enable scope=spfile;
System altered.
SQL> alter system set log_archive_max_processes=30 scope=both;
System altered.
SQL> alter system set standby_file_management=auto scope=spfile;
System altered.
SQL> show parameter db_create_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string
# The above parameter can be set without
SQL> alter system set db_file_name_convert='/data/ebs/std/db/apps_st/data','/data/ebs/pri/db/apps_st/data' scope=spfile; #( The second parameter is the local path )
System altered.
SQL> alter system set log_file_name_convert='/data/ebs/std/db/apps_st/data','/data/ebs/pri/db/apps_st/data' scope=spfile; #( The second parameter is the local path )
System altered.
SQL> create pfile from spfile;
File created.
modify tnsnames.ora and listener.ora
# stay tnsnames.ora Finally add
IFILE=/data/ebs/pri/db/tech_st/11.2.0/network/admin/dg_std_ifile.ora
# And then in dg_std_ifile.ora This file is filled in the end-to-end database tns
STD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xx.xx.xx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = std)
)
)
#listener.ora
SID_LIST_PRI =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = pri_DGMGRL)# This line is new , among pri yes db_unique_name
(ORACLE_HOME= /data/ebs/pri/db/tech_st/11.2.0)
(SID_NAME = PRI)
)
)
3、 ... and . Standby database settings
Set standby database parameters
– Pass in the standby depot spfile establish pfile, Then modify the following parameters
*.db_name='std'
*.db_unique_name='std' DG Main and standby db_name It has to be consistent ,db_unique_name atypism
*.log_archive_config='dg_config=(pri,std)' pri Master database SID,std Backup database SID
*.log_archive_dest_1='location=/u01/app/oracle/arch valid_for=(all_logfiles,all_roles) db_unique_name=pri' # Current node path
*.log_archive_dest_2='service=pri valid_for=(online_logfiles,primary_role) db_unique_name=pri' # Information of the peer main database
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_max_processes=4
*.fal_server='std' # Of the opposite end main database SID
*.fal_client='pri' # Current node information
*.db_file_name_convert='/u01/app/oracle/oradata/std','/u01/app/oracle/oradata/pri' # The first directory is the path of the peer-to-peer main library , The second is the current node path
*.log_file_name_convert='/u01/app/oracle/oradata/std','/u01/app/oracle/oradata/pri' # The first directory is the backup database data file path ( This directory exists on the backup server ), The second is the main database data file path
*.standby_file_management='auto'
Start in the standby database to nomount
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1.0689E+10 bytes
Fixed Size 2237776 bytes
Variable Size 4798286512 bytes
Database Buffers 5872025600 bytes
Redo Buffers 16924672 bytes
SQL> show parameter db_unique_name
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
db_unique_name string
std
SQL> create spfile from pfile;
File created.
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1.0689E+10 bytes
Fixed Size 2237776 bytes
Variable Size 4798286512 bytes
Database Buffers 5872025600 bytes
Redo Buffers 16924672 bytes
SQL> exit
modify tnsnames.ora and listener.ora
# stay tnsnames.ora Finally add
IFILE=/data/ebs/std/db/tech_st/11.2.0/network/admin/dg_pri_ifile.ora
# And then in dg_std_ifile.ora This file is filled in the end-to-end database tns
PRI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xx.xx.xx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pri)
)
)
# modify listener.ora
SID_LIST_PRI =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = std_DGMGRL)# Only this line is new , among pri yes db_unique_name, This is for db_broker With
(ORACLE_HOME= /data/ebs/pri/db/tech_st/11.2.0)
(SID_NAME = PRI)
)
)
Four . use tnsping Verify configuration
Use tnsping db_unique_name To verify interoperability
5、 ... and . Transfer in the standby database segment
[[email protected] archive]$ rman target sys/[email protected] auxiliary sys/[email protected]
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 20 20:39:24 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRI (DBID=269162849)
connected to auxiliary database: PRI (not mounted)
RMAN> duplicate target database for standby from active database nofilenamecheck;
# After completion , Boot to startup state
alter database open;
Then verify , Configuration to this step has OK 了 , The next step is to configure db_broker, This tool is equivalent to a management tool , One line of command can be used to switch between active and standby , Parameter configuration . Don't knock every node again .
6、 ... and . To verify
-- Switch log test , If it is always stated that OK Of
-- Main library
SQL> alter system switch logfile;
SQL>select SEQUENCE#, FIRST_TIME, NEXT_TIME, APPLIED, ARCHIVED from V$ARCHIVED_LOG;
-- For the library
SQL> select SEQUENCE#, FIRST_TIME, NEXT_TIME, APPLIED, ARCHIVED from V$ARCHIVED_LOG;
7、 ... and . To configure dg broker
Modify the parameters
# Both nodes execute
alter system set dg_broker_start=true;
# Next, select any node to execute
create configuration dg as primary database is pri connect identifier is pri;
add database std as connect identifier is std;
The test switch
DGMGRL> show configuration
Configuration - dg
Protection Mode: MaxPerformance
Databases:
pri - Primary database
std - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
# The following command is used when the standby database is the primary node
DGMGRL> switchover to std
Performing switchover NOW, please wait...
New primary database "std" is opening...
Operation requires shutdown of instance "PRI" on database "pri"
Shutting down instance "PRI"...
ORACLE instance shut down.
Operation requires startup of instance "PRI" on database "pri"
Starting instance "PRI"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "std"
DGMGRL> show configuration
Configuration - dg
Protection Mode: MaxPerformance
Databases:
std - Primary database
pri - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
An error occurred while switching back :
DGMGRL> switchover to pri
Performing switchover NOW, please wait...
New primary database "pri" is opening...
Operation requires shutdown of instance "STD" on database "std"
Shutting down instance "STD"...
ORACLE instance shut down.
Operation requires startup of instance "STD" on database "std"
Starting instance "STD"...
Unable to connect to database
ORA-12545: Connect failed because target host or object does not exist
Failed.
Warning: You are no longer connected to ORACLE.
Please complete the following steps to finish switchover:
start up instance "STD" of database "std"
View the corresponding alert journal
I didn't see the problem .
Look at the configuration information of the database , It happened in StaticConnectIdentifier Are the configured hostname , Check out the main library's /etc/hosts file , It is found that the host name is not configured in , And after , Just switch again .
DGMGRL> show database verbose std
Database - std
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s):
STD
Properties:
DGConnectIdentifier = 'std'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/data/ebs/pri/db/apps_st/data, /data/ebs/std/db/apps_st/data'
LogFileNameConvert = '/data/ebs/pri/db/apps_st/data, /data/ebs/std/db/apps_st/data'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'STD'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ifeng-ebs-test-db)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=std_DGMGRL)(INSTANCE_NAME=STD)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/data/ebs/std/db/apps_st/data/archive'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL>
Reference documents
https://www.modb.pro/doc/39007?xzs=
https://www.modb.pro/doc/38709?xzs=
https://www.modb.pro/doc/514
https://www.cnblogs.com/yhfssp/p/7815078.html
边栏推荐
- ORACLE EBS ADI 开发步骤
- [Zhang San learns C language] - deeply understand data storage
- [daily question] - Huawei machine test 01
- Redis -- cache breakdown, penetration, avalanche
- js判断数组中对象是否存在某个值
- Queue (linear structure)
- CSRF攻击
- Principle analysis of spark
- Sqli-labs customs clearance (less6-less14)
- Tool grass welfare post
猜你喜欢
微信小程序基础
Ceaspectuss shipping company shipping artificial intelligence products, anytime, anywhere container inspection and reporting to achieve cloud yard, shipping company intelligent digital container contr
PHP Session原理简析
DNS攻击详解
UEditor .Net版本任意文件上传漏洞复现
解决微信小程序swiper组件bindchange事件抖动问题
sqli-labs通关汇总-page1
SQLI-LABS通关(less18-less20)
Basic knowledge of software testing
Yolov5 practice: teach object detection by hand
随机推荐
sqli-labs通关汇总-page4
Differences between ts and JS
ORACLE 11G利用 ORDS+pljson来实现json_table 效果
Solve the problem of bindchange event jitter of swiper component of wechat applet
Sqli labs customs clearance summary-page3
Oracle RMAN semi automatic recovery script restore phase
Build FRP for intranet penetration
php中时间戳转换为毫秒以及格式化时间
js把一个数组分割成每三个一组
SQLI-LABS通关(less15-less17)
Use of interrupt()
JS judge whether the object is empty
ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
pySpark构建临时表报错
IDEA2020中PySpark的两表关联(字段名相同)
Oracle apex 21.2 installation and one click deployment
js数组的常用的原型方法
DNS攻击详解
Common prototype methods of JS array