本文主要是介绍[DGMGRL]Dgmgrl管理Dataguard(2),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.通过SQLPLUS关闭Dataguard数据库,查看DGMGRL中备库的状态
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
--发现备库状态为disabled
DGMGRL> show configuration
Configuration - orcl
Protection Mode: MaxPerformance
Databases:
orcl - Primary database
dg - Physical standby database (disabled)
--发现状备库态为OFFLINE和SHUTDOWN
DGMGRL> show database dg
Database - dg
Role: PHYSICAL STANDBY
Intended State: OFFLINE
Transport Lag: (unknown)
Apply Lag: (unknown)
Apply Rate: (unknown)
Real Time Query: OFF
Instance(s):
dg
Database Status:
SHUTDOWN
2.启动备库Dataguard到mount状态
--发现备库已经正常
DGMGRL> show configuration
Configuration - orcl
Protection Mode: MaxPerformance
Databases:
orcl - Primary database
dg - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
--这时可以发现备库已经自动应用redo日志,不需要在sqlplus中输入alter database recover managed standby database ...类似的语句
DGMGRL> show database dg
Database - dg
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Apply Rate: 0 Byte/s
Real Time Query: OFF
Instance(s):
dg
Database Status:
SUCCESS
--通过如下语句也可以查看redo日志正在传输中
SQL> select process, status, thread#, sequence#, block#, blocks from v$managed_standby;
PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
--------- ------------ ---------- ---------- ---------- ----------
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CLOSING 1 95 16384 1610
RFS IDLE 0 0 0 0
RFS ID
这篇关于[DGMGRL]Dgmgrl管理Dataguard(2)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!