ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Physical Standby所涉及到的管理命令

Physical Standby所涉及到的管理命令

原创 Linux操作系统 作者:果酱o 时间:2012-07-23 15:26:37 0 删除 编辑
1. 查看当前的保护模式
select DATABASE_ROLE,PROTECTION_MODE,PROTECTION_LEVEL from v$database;

DATABASE_ROLE PROTECTION_MODE PROTECTION_LEVEL
---------------- -------------------- --------------------
PHYSICAL STANDBY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE

2. 查看日志的传送方式;
select dest_name,archiver from v$archive_dest;

3. 停止standby的自动恢复状态
alter database recover manager standby database finish;

4. 添加standby logfile
alter database add standby logfile group 4('/oracle/product/10.2.0/db_1/oradata/sjh10g/redo04.log') size 50m;

5. 更改保护模式
alter database set standby database to maximize protextion;
alter database set standby database to maximize availability;
alter database set standby database to maximize performancen;

6. 更改传输方式
alter system setlog_archive_dest_2='SERVICE=orcldg LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldg';


7. 解决方式:将主备库的flash back 打开
启动到mount
select FLASHBACK_ON from v$database;
alter database flashback on;

8. 取消自动恢复模式
alter database recover managed standby database cancel;
alter database recover managed standby database finish;
alter database recover managerd standby database finish force;

desc v$archived_log

---===============================================

SQL> select INSTANCE_ROLE , database_status from v$instance;

INSTANCE_ROLE DATABASE_STATUS
------------------ -----------------
PRIMARY_INSTANCE ACTIVE

不正常
SQL> select SWITCHOVER_STATUS,ARCHIVELOG_COMPRESSION,DATAGUARD_BROKER,GUARD_STATUS from v$database;

SWITCHOVER_STATUS ARCHIVEL DATAGUAR GUARD_S
-------------------- -------- -------- -------
FAILED DESTINATION DISABLED DISABLED NONE

正常
SQL> select SWITCHOVER_STATUS,ARCHIVELOG_COMPRESSION,DATAGUARD_BROKER,GUARD_STATUS from v$database;

SWITCHOVER_STATUS ARCHIVEL DATAGUAR GUARD_S
-------------------- -------- -------- -------
TO STANDBY DISABLED DISABLED NONE



不正常
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;

PROCESS STATUS
--------- ------------
ARCH CONNECTED
ARCH CLOSING
ARCH CONNECTED
ARCH CLOSING

正常
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;

PROCESS STATUS
--------- ------------
ARCH OPENING
ARCH CLOSING
ARCH CLOSING
ARCH CLOSING
LNS WRITING



DG配置错误信息
SQL> select message from v$dataguard_status;

MESSAGE
--------------------------------------------------------------------------------
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
Error 12514 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 12514.
ARC2: Beginning to archive thread 1 sequence 54 (1013976-1019767)
ARC2: Completed archiving thread 1 sequence 54 (1013976-1019767)
ARC3: Archival started
ARC4: Archival started
ARCH shutting down
ARC4: Archival stopped
ARC3: Beginning to archive thread 1 sequence 55 (1019767-1019866)
ARC3: Completed archiving thread 1 sequence 55 (1019767-1019866)
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.
Error 1017 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'ora2'. Error is 16191.

32 rows selected.



ON STANDBY DATABASE
非正常时:
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;

PROCESS STATUS
--------- ------------
ARCH CONNECTED
ARCH CONNECTED
ARCH CONNECTED
ARCH CONNECTED
MRP0 WAIT_FOR_GAP

启动正常时:
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;

PROCESS STATUS
--------- ------------
ARCH CLOSING
ARCH CONNECTED
ARCH CLOSING
ARCH CONNECTED
MRP0 WAIT_FOR_LOG
RFS IDLE
RFS IDLE
RFS IDLE

SQL> select * from v$archive_gap;

no rows selected


SQL> select STATUS,SEQUENCE# from v$standby_log;

STATUS SEQUENCE#
---------- ----------
UNASSIGNED 0
UNASSIGNED 0
UNASSIGNED 0

SQL> select STATUS,SEQUENCE# from v$standby_log;

STATUS SEQUENCE#
---------- ----------
ACTIVE 61
UNASSIGNED 0
UNASSIGNED 0

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13304800/viewspace-736400/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-09-14

  • 博文量
    14
  • 访问量
    28094