【DG】之dg broker工具

Data Guard broker是建立在Data Guard基础上的一个对Data Guard配置,集中管理操作的一个平台,因此在学习Data Guard broker之前必须对Data Guard要有充分的了解。

Data Guard为我们提供了一套高可用的解决方案,但是在实际的使用方面确实显得有一些过于复杂,特别是在需要配置的standby机器多的时候更是如此,一 个个机器去登陆配置显得特别的麻烦;在需要做switchover或者是failover的时候情况也是一样,需要操作一系列的命令才能完成一次 switchover/failover的操作。Data Guard broker的推出就是为了简化DG复杂的管理过程的,它最大的作用就是集中化的统一管理,下面列出来一些Data Guard broker优势所在:

       

比较项

使用dg broker

不使用dg broker

一般

primary数据库与全部standby数据库看成一个整体进行管理

必须对primary数据库和各个standby进行单独的操作。

创建standby

通过使用OEM可以轻松的建立一个新的standby

所有操作必须手工进行:拷贝数据/控制/日志文件,设置初始化参数等等

配置和管理

可以在一个地方对所有的数据库进行统一的配置和管理,这些配置会被自动同步到各个数据库中

必须手工的进行配置,然后对Primarystandby进行单独的管理

控制

- 使用一个简单的命令进行failoverswitchover的操作
- 通过配置可以自动的进行failover操作

- 必须使用多个SQLPLUS才能完成对数据库的管理

监控

- 自动持续对数据库配置,数据库状态以及其他参数进行自动管理
- 提供详细的数据库状态报告
- OEM Events集成

- 没有统一的视图进行管理,只能通过Fixed View一个个进行查看
自定义OEM Events管理



dg broker原理图:

https://i-blog.csdnimg.cn/blog_migrate/3b130b87b128f6da7f93306b56f068a5.jpeg


一:开启dg broker

前提:1.很重要,搭建dg broker 之前一定一定要使备库日志应用与主库一致;

          2.在搭建dg broker之前,一定一定要将主备库的tnsnames.ora里的连接字符串改成与db_unique_name的名字一样,同时修改参数 文件里的log_archive_dest_2='service的值;

 

搭建dg broker 需在主备库上都进行设置,步骤如下:

1.      在监听文件listener.ora中的静态监听内的global_dbname参数值加_DGMGRL 

2.      Reload 监听;

3.      查参数dg_broker_start,默认是false。修改:alter system set dg_broker_start = true;

 

1)配置备库dg broker

——配置监听:

[oracle@bing ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/

[oracle@bing admin]$ vi listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

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

    )

  )

 

ADR_BASE_LISTENER = /u01/app/oracle

 

sid_list_listener=

  (sid_list=

    (sid_desc=

      (global_dbname=OCMU_DGMGRL)

      (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

      (sid_name=OCMU))

   )

~

~

"listener.ora" 20L, 485C written

 

——reload监听

[oracle@bing admin]$ lsnrctl reload

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2016 22:23:31

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bing)(PORT=1521)))

The command completed successfully

[oracle@bing admin]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2016 22:23:47

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bing)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                20-OCT-2016 21:23:05

Uptime                    1 days 1 hr. 0 min. 42 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/bing/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bing)(PORT=1521)))

Services Summary...

Service "OCMU" has 1 instance(s).

  Instance "OCMU", status READY, has 1 handler(s) for this service...

Service "OCMUXDB" has 1 instance(s).

  Instance "OCMU", status READY, has 1 handler(s) for this service...

Service "OCMU_DGMGRL" has 1 instance(s).

  Instance "OCMU", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

[oracle@bing admin]$

 

——修改参数

SQL> show parameter dg_broker_start

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_start                      boolean     FALSE

 

SQL> alter system set dg_broker_start=true;

 

System altered.

 

SQL> show parameter dg_broker_start

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_start                      boolean     TRUE

SQL>

 

2)配置主库dg broker:

——配置监听

[oracle@wang ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/

[oracle@wang admin]$ vi listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

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

  )

 

sid_list_listener=

  (sid_list=

    (sid_desc=

      (global_dbname=ORA11GR2_DGMGRL)

      (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

      (sid_name=ORA11GR2))

   )

~

"listener.ora" 19L, 460C written

[oracle@wang admin]$

 

——reload监听:

[oracle@wang admin]$ lsnrctl reload

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2016 22:26:48

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wang)(PORT=1521)))

The command completed successfully

[oracle@wang admin]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2016 22:27:01

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wang)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                20-OCT-2016 21:16:55

Uptime                    1 days 1 hr. 10 min. 6 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/wang/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wang)(PORT=1521)))

Services Summary...

Service "ORA11GR2" has 1 instance(s).

  Instance "ORA11GR2", status READY, has 1 handler(s) for this service...

Service "ORA11GR2XDB" has 1 instance(s).

  Instance "ORA11GR2", status READY, has 1 handler(s) for this service...

Service "ORA11GR2_DGMGRL" has 1 instance(s).

  Instance "ORA11GR2", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

[oracle@wang admin]$

 

——修改参数:

SYS@ORA11GR2>show parameter dg_broker_start

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_start                      boolean     FALSE

 

SYS@ORA11GR2>alter system set dg_broker_start=true;

 

System altered.

 

SYS@ORA11GR2>show parameter dg_broker_start

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_start                      boolean     TRUE

SYS@ORA11GR2>

 

二:dg broker之维护DG

1)配置dg broker:(在主库操作)

 [oracle@wang admin]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle

Connected.

DGMGRL>  create configuration 'ORA11GR2' as primary database is 'ORA11GR2' connect identifier is ORA11GR2;

最后ORA11GR2是连接字符串,是备库的连接字符串,意思备库是通过这个连接字符串连接到主库的;
Configuration "ORA11GR2" created with primary database "ORA11GR2"

 

——查看配置信息:

DGMGRL> show configuration

 

Configuration - ORA11GR2

 

  Protection Mode: MaxPerformance

  Databases:

    ORA11GR2 - Primary database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

DISABLED

 

DGMGRL> add database 'OCMU' as connect identifier is OCMU;

最后一个OCMU是连接字符串,是主库的连接字符串,意思主库是通过这个连接字符串连接到备库的;

Database "OCMU" added

 

——查看配置信息:

DGMGRL>  show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxPerformance

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

DISABLED

 

——查看备库信息:

DGMGRL> show database verbose 'OCMU';

 

Database - OCMU

 

  Role:            PHYSICAL STANDBY

  Intended State:  OFFLINE

  Transport Lag:   (unknown)

  Apply Lag:       (unknown)

  Apply Rate:      (unknown)

  Real Time Query: OFF

  Instance(s):

    OCMU

 

  Properties:

    DGConnectIdentifier             = 'ocmu'

    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               = 'ORA11GR2, OCMU'

    LogFileNameConvert              = '/u01/app/oracle/oradata/ORA11GR2/, /u01/app/oracle/oradata/OCMU/'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'OCMU'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bing)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=OCMU_DGMGRL)(INSTANCE_NAME=OCMU)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/OCMU/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

DISABLED

 

——使配置生效:

DGMGRL> enable configuration;

Enabled.

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxPerformance

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

——使备库信息生效:

DGMGRL> enable database 'OCMU';

Enabled.

DGMGRL>

DGMGRL> show database 'OCMU';

 

Database - OCMU

 

  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: ON

  Instance(s):

    OCMU

 

Database Status:

SUCCESS

2)切换保护模式:(到最大可用模式

DGMGRL> edit database 'OCMU' set property 'LogXptMode'='SYNC';

Property "LogXptMode" updated

DGMGRL>

DGMGRL> edit database 'ORA11GR2' set property 'LogXptMode'='SYNC';

Property "LogXptMode" updated

 

——执行模式转换,转换到最大可用模式:

DGMGRL> edit configuration set protection mode as maxavailability;

Succeeded.

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

3fast start failover功能开启:一般保护模式置于最大可用)

主库与备库执行如下命令在备库开启应用日志进程:

——主库:

SYS@ORA11GR2>alter system set undo_retention=3600;

 

System altered.

 

SYS@ORA11GR2>alter system set db_flashback_retention_target=4320;

 

System altered.

 

SYS@ORA11GR2>alter database flashback on;

 

Database altered.

当然,还需要快速恢复区大小及位置,本实验先前已经设置好了快速恢复区

 

——备库:

SQL> alter system set undo_retention=3600;

 

System altered.

 

SQL> alter system set db_flashback_retention_target=4320;

 

System altered.

 

SQL> alter database flashback on;

alter database flashback on

*

ERROR at line 1:

ORA-01153: an incompatible media recovery is active

 

SQL> recover managed standby database cancel;

Media recovery complete.

SQL>

SQL> alter database flashback on;

 

Database altered.

(当然,还需要快速恢复区大小及位置,本实验先前已经设置好了快速恢复区)

 

——备库再次用于日志:

SQL> recover managed standby database using current logfile disconnect from session;

Media recovery complete.

 

——主库在DGMGRL工具下操作:

DGMGRL> edit database 'ORA11GR2' set property faststartfailovertarget='OCMU';

Property "faststartfailovertarget" updated

DGMGRL>

DGMGRL> edit database 'OCMU' set property faststartfailovertarget='ORA11GR2';

Property "faststartfailovertarget" updated

DGMGRL>

 

——主库执行开启observer进程:

DGMGRL> connect sys/oracle

Connected.

DGMGRL> start observer

Observer started

此时光标不停的闪,hang住了,正常现象。

 

——主库再开另一个窗口执行如下:(即开启fast_start failover 服务)

[oracle@wang ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle

Connected.

DGMGRL> enable fast_start failover;

Enabled.

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - (*) Physical standby database

 

Fast-Start Failover: ENABLED

 

Configuration Status:

SUCCESS

 

——显示fast_start failover信息:

DGMGRL> show fast_start failover

 

Fast-Start Failover: ENABLED

 

  Threshold:          30 seconds

  Target:             OCMU

  Observer:           wang

  Lag Limit:          30 seconds (not in use)

  Shutdown Primary:   TRUE

  Auto-reinstate:     TRUE

  Observer Reconnect: (none)

  Observer Override:  FALSE

 

Configurable Failover Conditions

  Health Conditions:

    Corrupted Controlfile          YES

    Corrupted Dictionary           YES

    Inaccessible Logfile            NO

    Stuck Archiver                  NO

    Datafile Offline               YES

 

  Oracle Error Conditions:

    (none)

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - (*) Physical standby database

 

Fast-Start Failover: ENABLED

 

Configuration Status:

SUCCESS

 

——验证dg broker搭建成功:

SYS@ORA11GR2>col FS_FAILOVER_OBSERVER_HOST for a20

SYS@ORA11GR2>select fs_failover_observer_present,fs_failover_observer_host,fs_failover_threshold from v$database;

 

FS_FAIL   FS_FAILOVER_OBSERVER   FS_FAILOVER_THRESHOLD

------- -------------------- ---------------------

YES       wang                        30

 

4)测试fast_start failover功能:

[oracle@bing admin]$ echo $ORACLE_SID

OCMU

[oracle@bing admin]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle

Connected.

  ——正式执行failover操作(在备库上执行)

DGMGRL> failover to 'OCMU';

Performing failover NOW, please wait...

Failover succeeded, new primary is "OCMU"

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    OCMU     - Primary database

      Warning: ORA-16817: unsynchronized fast-start failover configuration

 

    ORA11GR2 - (*) Physical standby database (disabled)

      ORA-16661: the standby database needs to be reinstated

 

Fast-Start Failover: ENABLED

 

Configuration Status:

WARNING

 

DGMGRL> show database 'OCMU';

 

Database - OCMU

 

  Role:            PRIMARY

  Intended State:  TRANSPORT-ON

  Instance(s):

    OCMU

 

  Database Warning(s):

    ORA-16817: unsynchronized fast-start failover configuration

 

Database Status:

WARNING

 

DGMGRL> show database 'ORA11GR2';

 

Database - ORA11GR2

 

  Role:            PHYSICAL STANDBY

  Intended State:  APPLY-ON

  Transport Lag:   (unknown)

  Apply Lag:       (unknown)

  Apply Rate:      (unknown)

  Real Time Query: ON

  Instance(s):

    ORA11GR2

 

  Database Warning(s):

    ORA-16817: unsynchronized fast-start failover configuration

Database Status:

WARNING

——查看切换后的备库情况:

SYS@ORA11GR2>conn  / as sysdba

Enter password:

Connected.

SYS@ORA11GR2>select database_role,switchover_status,open_mode from v$database;

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PHYSICAL STANDBY  RECOVERY NEEDED      READ ONLY WITH APPLY

 

——查看切换后的主库情况:

SQL> conn / as sysdba

Connected.

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PRIMARY          RESOLVABLE GAP       READ WRITE

 

——正在应用日志,过会再查看状态:(正常了)

SYS@ORA11GR2>select database_role,switchover_status,open_mode from v$database;

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PHYSICAL STANDBY  NOT ALLOWED          READ ONLY WITH APPLY

 

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PRIMARY          SESSIONS ACTIVE      READ WRITE

 

——再次查看dg broker配置情况:(正常了)

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    OCMU     - Primary database

    ORA11GR2 - (*) Physical standby database

 

Fast-Start Failover: ENABLED

 

Configuration Status:

SUCCESS

 

——再次测试将主库切换回ORA11GR2:

先检查主备状态均正常,在主库上执行:

DGMGRL> show database verbose 'OCMU';

 

Database - OCMU

 

  Role:            PRIMARY

  Intended State:  TRANSPORT-ON

  Instance(s):

    OCMU

 

  Properties:

    DGConnectIdentifier             = 'ocmu'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'ORA11GR2, OCMU'

    LogFileNameConvert              = '/u01/app/oracle/oradata/ORA11GR2/, /u01/app/oracle/oradata/OCMU/'

    FastStartFailoverTarget         = 'ORA11GR2'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'OCMU'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bing)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=OCMU_DGMGRL)(INSTANCE_NAME=OCMU)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/OCMU/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

SUCCESS

 

DGMGRL> show database verbose 'ORA11GR2';

 

Database - ORA11GR2

 

  Role:            PHYSICAL STANDBY

  Intended State:  APPLY-ON

  Transport Lag:   0 seconds (computed 1 second ago)

  Apply Lag:       0 seconds (computed 1 second ago)

  Apply Rate:      0 Byte/s

  Real Time Query: ON

  Instance(s):

    ORA11GR2

 

  Database Error(s):

    ORA-16820: fast-start failover observer is no longer observing this database

 

  Properties:

    DGConnectIdentifier             = 'ora11gr2'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'OCMU, ORA11GR2'

    LogFileNameConvert              = '/u01/app/oracle/oradata/OCMU/, /u01/app/oracle/oradata/ORA11GR2/'

    FastStartFailoverTarget         = 'OCMU'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'ORA11GR2'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wang)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORA11GR2_DGMGRL)(INSTANCE_NAME=ORA11GR2)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/ORA11GR2/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

ERROR

——解决:(在备库上执行)

DGMGRL> stop observer

然后再次开启observer进程:

[oracle@wang ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle

Connected.

DGMGRL> start observer

Observer started

 

——最后再在主库上查看备库信息:(正常了)

DGMGRL> show database verbose 'ORA11GR2';

 

Database - ORA11GR2

 

  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: ON

  Instance(s):

    ORA11GR2

 

  Properties:

    DGConnectIdentifier             = 'ora11gr2'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'OCMU, ORA11GR2'

    LogFileNameConvert              = '/u01/app/oracle/oradata/OCMU/, /u01/app/oracle/oradata/ORA11GR2/'

    FastStartFailoverTarget         = 'OCMU'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'ORA11GR2'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wang)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORA11GR2_DGMGRL)(INSTANCE_NAME=ORA11GR2)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/ORA11GR2/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

SUCCESS

 

——正式执行failover操作(在备库上执行)

[oracle@wang ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle

Connected.

DGMGRL> switchover to 'ORA11GR2';

Performing switchover NOW, please wait...

New primary database "ORA11GR2" is opening...

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

Starting instance "OCMU"...

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 "OCMU" of database "OCMU"

 

——解决:(因为转换后的库停了)

SQL> connect / as sysdba

Connected to an idle instance.

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area  830930944 bytes

Fixed Size                  2257800 bytes

Variable Size             503319672 bytes

Database Buffers          322961408 bytes

Redo Buffers                2392064 bytes

Database mounted.

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PHYSICAL STANDBY  RECOVERY NEEDED      MOUNTED

 

SQL> alter database open;

 

Database altered.

 

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PHYSICAL STANDBY  NOT ALLOWED          READ ONLY

 

——查看配置情况:(正常了)

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - (*) Physical standby database

 

Fast-Start Failover: ENABLED

 

Configuration Status:

SUCCESS

 

——查看主库情况:

SYS@ORA11GR2>conn / as sysdba

Connected.

SYS@ORA11GR2>select database_role,switchover_status,open_mode from v$database;

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PRIMARY          SESSIONS ACTIVE      READ WRITE

 

再次查看备库情况(正常):

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PHYSICAL STANDBY  NOT ALLOWED          READ ONLY WITH APPLY

 

5)再次保护模式切换:

DGMGRL> disable fast_start failover;

Disabled.

DGMGRL>

DGMGRL> edit configuration set protection mode as maxprotection;

Succeeded.

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxProtection

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

DGMGRL> edit configuration set protection mode as maxperformance;

Succeeded.

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxPerformance

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

DGMGRL> edit configuration set protection mode as maxavailability;

Succeeded.

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

      Warning: ORA-16629: database reports a different protection level from the protection mode

 

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

WARNING

(报错,表示主备应用不一致导致,应备库一直是开启应用日志的,过会就好了)

——验证:

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

5switchover,主备切换:

DGMGRL> show database verbose 'ORA11GR2';

 

Database - ORA11GR2

 

  Role:            PRIMARY

  Intended State:  TRANSPORT-ON

  Instance(s):

    ORA11GR2

 

  Properties:

    DGConnectIdentifier             = 'ora11gr2'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'OCMU, ORA11GR2'

    LogFileNameConvert              = '/u01/app/oracle/oradata/OCMU/, /u01/app/oracle/oradata/ORA11GR2/'

    FastStartFailoverTarget         = 'OCMU'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'ORA11GR2'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wang)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORA11GR2_DGMGRL)(INSTANCE_NAME=ORA11GR2)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/ORA11GR2/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

SUCCESS

 

DGMGRL> show database verbose 'OCMU';

 

Database - OCMU

 

  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: ON

  Instance(s):

    OCMU

 

  Properties:

    DGConnectIdentifier             = 'ocmu'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'ORA11GR2, OCMU'

    LogFileNameConvert              = '/u01/app/oracle/oradata/ORA11GR2/, /u01/app/oracle/oradata/OCMU/'

    FastStartFailoverTarget         = 'ORA11GR2'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'OCMU'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bing)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=OCMU_DGMGRL)(INSTANCE_NAME=OCMU)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/OCMU/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

SUCCESS

 

——开启切换主备操作:

DGMGRL> swtichover to 'OCMU';

Unrecognized command "swtichover", try "help"

DGMGRL> switchover to 'OCMU';

Performing switchover NOW, please wait...

Operation requires a connection to instance "OCMU" on database "OCMU"

Connecting to instance "OCMU"...

Connected.

New primary database "OCMU" is opening...

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

Starting instance "ORA11GR2"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "OCMU"

——验证:

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    OCMU     - Primary database

    ORA11GR2 - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

——反切操作:

DGMGRL> show database verbose 'OCMU';

 

Database - OCMU

 

  Role:            PRIMARY

  Intended State:  TRANSPORT-ON

  Instance(s):

    OCMU

 

  Properties:

    DGConnectIdentifier             = 'ocmu'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'ORA11GR2, OCMU'

    LogFileNameConvert              = '/u01/app/oracle/oradata/ORA11GR2/, /u01/app/oracle/oradata/OCMU/'

    FastStartFailoverTarget         = 'ORA11GR2'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'OCMU'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bing)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=OCMU_DGMGRL)(INSTANCE_NAME=OCMU)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/OCMU/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

SUCCESS

 

DGMGRL> show database verbose 'ORA11GR2';

 

Database - ORA11GR2

 

  Role:            PHYSICAL STANDBY

  Intended State:  APPLY-ON

  Transport Lag:   0 seconds (computed 1 second ago)

  Apply Lag:       0 seconds (computed 1 second ago)

  Apply Rate:      0 Byte/s

  Real Time Query: ON

  Instance(s):

    ORA11GR2

 

  Properties:

    DGConnectIdentifier             = 'ora11gr2'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'SYNC'

    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               = 'OCMU, ORA11GR2'

    LogFileNameConvert              = '/u01/app/oracle/oradata/OCMU/, /u01/app/oracle/oradata/ORA11GR2/'

    FastStartFailoverTarget         = 'OCMU'

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    ApplyLagThreshold               = '0'

    TransportLagThreshold           = '0'

    TransportDisconnectedThreshold  = '30'

    SidName                         = 'ORA11GR2'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wang)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORA11GR2_DGMGRL)(INSTANCE_NAME=ORA11GR2)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/arch1/ORA11GR2/'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = '%t_%s_%r.arc'

    TopWaitEvents                   = '(monitor)'

 

Database Status:

SUCCESS

 

DGMGRL> switchover to 'ORA11GR2';

Performing switchover NOW, please wait...

Operation requires a connection to instance "ORA11GR2" on database "ORA11GR2"

Connecting to instance "ORA11GR2"...

Connected.

New primary database "ORA11GR2" is opening...

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

Starting instance "OCMU"...

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 "OCMU" of database "OCMU"

——解决:

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

 

Total System Global Area  830930944 bytes

Fixed Size                  2257800 bytes

Variable Size             503319672 bytes

Database Buffers          322961408 bytes

Redo Buffers                2392064 bytes

Database mounted.

Database opened.

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

 

NAME      DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

--------- ---------------- -------------------- --------------------

ORA11GR2  PHYSICAL STANDBY NOT ALLOWED          READ ONLY WITH APPLY

 

——最后验证:

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

 

6snapshot standby操作:

DGMGRL> disable fast_start failover;

Disabled.

DGMGRL> 

DGMGRL> convert database 'OCMU' to snapshot standby;

Converting database "OCMU" to a Snapshot Standby database, please wait...

Database "OCMU" converted successfully

DGMGRL>

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Snapshot standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

验证:

SQL> conn / as sysdba

Connected.

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

SNAPSHOT STANDBY NOT ALLOWED          READ WRITE

 

切回physical standby

DGMGRL> convert database 'OCMU' to physical standby;

Converting database "OCMU" to a Physical Standby database, please wait...

Operation requires shutdown of instance "OCMU" on database "OCMU"

Shutting down instance "OCMU"...

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 and reissue the CONVERT command:

        shut down instance "OCMU" of database "OCMU"

        start up and mount instance "OCMU" of database "OCMU"

 

解决:

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area  830930944 bytes

Fixed Size                  2257800 bytes

Variable Size             503319672 bytes

Database Buffers          322961408 bytes

Redo Buffers                2392064 bytes

Database mounted.

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

SNAPSHOT STANDBY NOT ALLOWED          MOUNTED

 

再次执行:

DGMGRL> convert database 'OCMU' to physical standby;

Converting database "OCMU" to a Physical Standby database, please wait...

Operation requires shutdown of instance "OCMU" on database "OCMU"

Shutting down instance "OCMU"...

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 the convert command:

        shut down instance "OCMU" of database "OCMU"

        start up and mount instance "OCMU" of database "OCMU"

 

——查看备库状态:

[oracle@bing trace]$ ps -ef |grep OCMU

oracle   10685     1  0 09:25 ?        00:00:02 ora_pmon_OCMU

oracle   10689     1  0 09:25 ?        00:00:01 ora_psp0_OCMU

oracle   10693     1  1 09:25 ?        00:00:44 ora_vktm_OCMU

oracle   10699     1  0 09:25 ?        00:00:00 ora_gen0_OCMU

oracle   10703     1  0 09:25 ?        00:00:00 ora_diag_OCMU

oracle   10707     1  0 09:25 ?        00:00:00 ora_dbrm_OCMU

oracle   10711     1  0 09:25 ?        00:00:02 ora_dia0_OCMU

oracle   10715     1  0 09:25 ?        00:00:00 ora_mman_OCMU

oracle   10719     1  0 09:25 ?        00:00:00 ora_dbw0_OCMU

oracle   10723     1  0 09:25 ?        00:00:00 ora_lgwr_OCMU

oracle   10727     1  0 09:25 ?        00:00:02 ora_ckpt_OCMU

oracle   10731     1  0 09:25 ?        00:00:00 ora_smon_OCMU

oracle   10735     1  0 09:25 ?        00:00:00 ora_reco_OCMU

oracle   10747     1  0 09:25 ?        00:00:00 ora_d000_OCMU

oracle   10751     1  0 09:25 ?        00:00:00 ora_s000_OCMU

oracle   10755     1  0 09:25 ?        00:00:00 ora_dmon_OCMU

oracle   10770     1  0 09:25 ?        00:00:00 ora_nss2_OCMU

oracle   10774     1  0 09:25 ?        00:00:00 ora_arc0_OCMU

oracle   10780     1  0 09:25 ?        00:00:00 ora_arc1_OCMU

oracle   10784     1  0 09:25 ?        00:00:00 ora_rvwr_OCMU

oracle   10788     1  0 09:25 ?        00:00:00 ora_arc2_OCMU

oracle   10792     1  0 09:25 ?        00:00:00 ora_arc3_OCMU

oracle   10796     1  0 09:25 ?        00:00:00 ora_arc4_OCMU

oracle   10800     1  0 09:25 ?        00:00:00 ora_arc5_OCMU

oracle   10801     1  0 09:25 ?        00:00:00 oracleOCMU (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

oracle   10807     1  0 09:25 ?        00:00:00 ora_arc6_OCMU

oracle   10811     1  0 09:25 ?        00:00:00 ora_arc7_OCMU

oracle   10815     1  0 09:25 ?        00:00:00 ora_arc8_OCMU

oracle   10819     1  0 09:25 ?        00:00:00 ora_arc9_OCMU

oracle   10823     1  0 09:25 ?        00:00:00 ora_arca_OCMU

oracle   10827     1  0 09:25 ?        00:00:00 ora_arcb_OCMU

oracle   10831     1  0 09:25 ?        00:00:00 ora_arcc_OCMU

oracle   10835     1  0 09:25 ?        00:00:00 ora_arcd_OCMU

oracle   10839     1  0 09:25 ?        00:00:00 ora_arce_OCMU

oracle   10843     1  0 09:25 ?        00:00:00 ora_arcf_OCMU

oracle   10847     1  0 09:25 ?        00:00:00 ora_arcg_OCMU

oracle   10851     1  0 09:25 ?        00:00:00 ora_arch_OCMU

oracle   10855     1  0 09:25 ?        00:00:00 ora_arci_OCMU

oracle   10859     1  0 09:25 ?        00:00:00 ora_arcj_OCMU

oracle   10863     1  0 09:25 ?        00:00:00 ora_arck_OCMU

oracle   10867     1  0 09:25 ?        00:00:00 ora_arcl_OCMU

oracle   10871     1  0 09:25 ?        00:00:00 ora_arcm_OCMU

oracle   10875     1  0 09:25 ?        00:00:00 ora_arcn_OCMU

oracle   10879     1  0 09:25 ?        00:00:00 ora_arco_OCMU

oracle   10883     1  0 09:25 ?        00:00:00 ora_arcp_OCMU

oracle   10887     1  0 09:25 ?        00:00:00 ora_arcq_OCMU

oracle   10891     1  0 09:25 ?        00:00:00 ora_arcr_OCMU

oracle   10895     1  0 09:25 ?        00:00:00 ora_arcs_OCMU

oracle   10899     1  0 09:25 ?        00:00:00 ora_arct_OCMU

oracle   10911     1  0 09:25 ?        00:00:00 ora_insv_OCMU

oracle   10927     1  0 09:25 ?        00:00:00 ora_nsv0_OCMU

oracle   10931     1  0 09:25 ?        00:00:02 ora_rsm0_OCMU

oracle   10939     1  0 09:26 ?        00:00:00 oracleOCMU (LOCAL=NO)

oracle   10947     1  0 09:26 ?        00:00:00 oracleOCMU (LOCAL=NO)

oracle   11010     1  0 09:31 ?        00:00:00 oracleOCMU (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

oracle   11440 11434  0 09:35 ?        00:00:00 oracleOCMU (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

oracle   11712 11692  0 10:04 ?        00:00:00 oracleOCMU (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

oracle   11716 11586  0 10:05 pts/4    00:00:00 grep OCMU

[oracle@bing trace]$ kill -9 10731

[oracle@bing trace]$

[oracle@bing trace]$

[oracle@bing trace]$ ps -ef |grep OCMU

oracle   11440 11434  0 09:35 ?        00:00:00 oracleOCMU (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

oracle   11712 11692  0 10:04 ?        00:00:00 oracleOCMU (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

oracle   11720 11586  0 10:05 pts/4    00:00:00 grep OCMU

[oracle@bing trace]$

 

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

 

Total System Global Area  830930944 bytes

Fixed Size                  2257800 bytes

Variable Size             503319672 bytes

Database Buffers          322961408 bytes

Redo Buffers                2392064 bytes

Database mounted.

Database opened.

 

——验证:

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

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PHYSICAL STANDBY  NOT ALLOWED          READ ONLY WITH APPLY

 

SYS@ORA11GR2>select database_role,switchover_status,open_mode from v$database;

 

DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

---------------- -------------------- --------------------

PRIMARY          SESSIONS ACTIVE      READ WRITE

 

DGMGRL> show configuration;

 

Configuration - ORA11GR2

 

  Protection Mode: MaxAvailability

  Databases:

    ORA11GR2 - Primary database

    OCMU     - Physical standby database

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 


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

转载于:http://blog.itpub.net/31397003/viewspace-2126917/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值