首页 > 数据库技术 > 详细

OCM 11g升级考试第二场搭建DataGuard遇到: prod - Physical standby database (disabled) 错误

时间:2015-02-28 21:40:27      阅读:740      评论:0      收藏:0      [点我收藏+]

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/43989607

1、**************************DGMGRL

DGMGRL> show configuration;

Configuration - c1

  Protection Mode: MaxPerformance
  Databases:
    orcl - Primary database
    prod - Physical standby database (disabled)

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database verbose orcl;

Database - orcl

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    orcl

  Properties:
    DGConnectIdentifier             = ‘orcl‘
    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          = ‘4‘
    LogArchiveMinSucceedDest        = ‘1‘
    DbFileNameConvert               = ‘/data/oradata/prod/, /data/oradata/orcl/‘
    LogFileNameConvert              = ‘/data/oradata/prod/, /data/oradata/orcl/‘
    FastStartFailoverTarget         = ‘‘
    StatusReport                    = ‘(monitor)‘
    InconsistentProperties          = ‘(monitor)‘
    InconsistentLogXptProps         = ‘(monitor)‘
    SendQEntries                    = ‘(monitor)‘
    LogXptStatus                    = ‘(monitor)‘
    RecvQEntries                    = ‘(monitor)‘
    HostName                        = ‘oracle2‘
    SidName                         = ‘orcl‘
    StaticConnectIdentifier         = ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl_DGMGRL)(INSTANCE_NAME=orcl)(SERVER=DEDICATED)))‘
    StandbyArchiveLocation          = ‘/data/oracle/product/11.2.0/db_1/archive‘
    AlternateLocation               = ‘‘
    LogArchiveTrace                 = ‘0‘
    LogArchiveFormat                = ‘%t_%s_%r.dbf‘
    TopWaitEvents                   = ‘(monitor)‘

Database Status:
SUCCESS

DGMGRL> show database verbose prod;

Database - prod

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   (unknown)
  Apply Lag:       (unknown)
  Real Time Query: OFF
  Instance(s):
    prod

  Properties:
    DGConnectIdentifier             = ‘prod‘
    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          = ‘4‘
    LogArchiveMinSucceedDest        = ‘1‘
    DbFileNameConvert               = ‘/data/oradata/orcl/, /data/oradata/prod/‘
    LogFileNameConvert              = ‘/data/oradata/orcl/, /data/oradata/prod/‘
    FastStartFailoverTarget         = ‘‘
    StatusReport                    = ‘(monitor)‘
    InconsistentProperties          = ‘(monitor)‘
    InconsistentLogXptProps         = ‘(monitor)‘
    SendQEntries                    = ‘(monitor)‘
    LogXptStatus                    = ‘(monitor)‘
    RecvQEntries                    = ‘(monitor)‘
    HostName                        = ‘oracle3‘
    SidName                         = ‘prod‘
    StaticConnectIdentifier         = ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle3)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PROD_DGMGRL)(INSTANCE_NAME=prod)(SERVER=DEDICATED)))‘
    StandbyArchiveLocation          = ‘/data/oracle/product/11.2.0/db_1/archive‘
    AlternateLocation               = ‘‘
    LogArchiveTrace                 = ‘0‘
    LogArchiveFormat                = ‘%t_%s_%r.dbf‘
    TopWaitEvents                   = ‘(monitor)‘

Database Status:
DISABLED


DGMGRL> ENABLE DATABASE PROD;


DGMGRL> show configuration;

Configuration - c1

  Protection Mode: MaxPerformance
  Databases:
    orcl - Primary database
    prod - Physical standby database
      Error: ORA-16766: Redo Apply is stopped

Fast-Start Failover: DISABLED

Configuration Status:
ERROR



2、********************主库
SQL> select dest_id,error from v$archive_dest;

   DEST_ID ERROR
---------- -----------------------------------------------------------------
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11

   DEST_ID ERROR
---------- -----------------------------------------------------------------
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

   DEST_ID ERROR
---------- -----------------------------------------------------------------
    23
    24
    25
    26
    27
    28
    29
    30
    31

31 rows selected.

SQL> select sequence#,applied from v$archived_log;

 SEQUENCE# APPLIED
---------- ---------
     5 YES
     6 YES
     7 YES
     8 YES
     9 YES
    10 YES
    11 YES
    12 YES
    13 YES
    14 YES
    15 YES

 SEQUENCE# APPLIED
---------- ---------
    16 YES
    17 YES
    18 YES
    19 YES
    20 YES
    21 YES
    22 YES
    23 YES
    24 YES
    25 YES
    26 YES

 SEQUENCE# APPLIED
---------- ---------
    27 YES
    28 YES
    28 YES
    27 YES
    29 YES
    29 YES
    30 YES
    30 YES
    31 YES
    31 YES
    32 YES

 SEQUENCE# APPLIED
---------- ---------
    32 YES
    33 YES
    33 YES
    34 YES
    34 YES
    35 YES
    35 YES
    36 YES
    36 YES
    37 YES
    37 YES

 SEQUENCE# APPLIED
---------- ---------
    38 YES
    38 YES
    39 YES
    39 YES
    41 YES
    40 YES
    42 YES
    43 YES
    44 YES
    45 YES
    46 YES

 SEQUENCE# APPLIED
---------- ---------
    47 NO
    48 NO
    49 NO
    49 YES
    47 YES
    50 NO
    48 YES
    50 YES
    51 YES
    51 NO
    52 NO

 SEQUENCE# APPLIED
---------- ---------
    53 NO
    53 YES
    52 YES
    54 NO
    54 NO
    55 NO
    55 NO
    56 NO
    56 NO

75 rows selected.


3、****************************备库
SQL>  select database_role,open_mode from v$database;

DATABASE_ROLE     OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY

SQL> select sequence#,status from v$standby_log;

 SEQUENCE# STATUS
---------- ----------
    57 ACTIVE
     0 UNASSIGNED
     0 UNASSIGNED
     0 UNASSIGNED

SQL>  select process,status from v$managed_standby;

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

6 rows selected.



备库被禁用了   prod - Physical standby database (disabled),但可以PHYSICAL STANDBY READ ONLY

分析并解决:

1、查防火墙
 vi /etc/seLinux/config
 service iptables stop
chkconfig iptables off
chkconfig --list iptables

2、检查参数

*.log_archive_dest_1=‘location="/u01/app/oracle/oradata/PROD1/archive"‘,‘MANDATORY valid_for=(ALL_LOGFILES,ALL_ROLES)‘

*.log_archive_dest_2=‘service="sbdb1"‘,‘   LGWR ASYNC NOAFFIRM delay=0 OPTIONAL compression=DISABLE max_failure=0 max_connections=1   reopen=300 db_unique_name="sbdb1" net_timeout=30  valid_for=(online_logfile,primary_role)‘

dg_config=(SBDB1,prod1)

fal_client=sbdb1
fal_server=prod1

SQL> alter database open read only;
alter database open read only
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: ‘/data/oradata/prod/system01.dbf‘

Completed standby crash recovery.
Errors in file /data/oracle/diag/rdbms/prod/prod/trace/prod_ora_13021.trc:
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: ‘/data/oradata/prod/system01.dbf‘
ORA-10458 signalled during: alter database open read only...
Tue Jan 04 17:59:34 2011
Data Guard: Database open failed; restarting redo-apply ...
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  USING CURRENT LOGFILE
Attempt to start background Managed Standby Recovery process (prod)
Tue Jan 04 17:59:34 2011
MRP0 started with pid=32, OS id=13081
MRP0: Background Managed Standby Recovery process started (prod)
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Warning: Datafile 1 (/data/oradata/prod/system01.dbf) is infinitely media recovery fuzzy
Standby database will not open with this datafile online!
Warning: Datafile 2 (/data/oradata/prod/sysaux01.dbf) is infinitely media recovery fuzzy
Standby database will not open with this datafile online!
Warning: Datafile 3 (/data/oradata/prod/undotbs01.dbf) is infinitely media recovery fuzzy
Standby database will not open with this datafile online!
Warning: Datafile 4 (/data/oradata/prod/users01.dbf) is infinitely media recovery fuzzy
Standby database will not open with this datafile online!
Warning: Datafile 5 (/data/oradata/prod/haha.dbf) is infinitely media recovery fuzzy
Standby database will not open with this datafile online!
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 82 (in transit)
Recovery of Online Redo Log: Thread 1 Group 4 Seq 82 Reading mem 0
  Mem# 0: /data/oradata/prod/redo04.log
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  USING CURRENT LOGFILE

SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             624955224 bytes
Database Buffers          436207616 bytes
Redo Buffers                5554176 bytes

DGMGRL> remove database prod;
Warning: ORA-16620: one or more databases could not be reached for a delete operation

Removed database "prod" from the configuration
DGMGRL> remove database orcl;
Primary database cannot be removed
DGMGRL> remove configuration;
Removed configuration
DGMGRL>

SQL> alter system set dg_broker_start=false;

System altered.

SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             624955224 bytes
Database Buffers          436207616 bytes
Redo Buffers                5554176 bytes

SQL> alter system set dg_broker_start=false;

System altered.

SQL> shutdown immediate;

SQL>Database closed.
SQL>Database dismounted.
SQL>ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             624955224 bytes
Database Buffers          436207616 bytes
Redo Buffers                5554176 bytes
Database mounted.
Database opened.
SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             624955224 bytes
Database Buffers          436207616 bytes
Redo Buffers                5554176 bytes
Database mounted.
Database opened.
SQL>

删除BROKER:
  (1) REMOVE DATABASE PROD1
  (2) REMOVE DATABASE SBDB1
  (3) REMOVE CONFIGURATION
  (4)ALTER SYSTEM SET DG_BROKER_START=FALSE;
  (5)shutdown immediate;
  (6)startup
  (7)alter system switch logfile;
    /
   /
  (8)duplicate target database for standby from active database;
  (9)recover managed standby database using current logfile disconnect from session;
  (10) 开始配broker
       create
       add
       enable

   (11) shutdown immediate;
        startup open read only;

   (12)startup mount;
       alter database flashback on;
   (13) alter database open;



OCM 11g升级考试第二场搭建DataGuard遇到: prod - Physical standby database (disabled) 错误

原文:http://blog.csdn.net/guoyjoe/article/details/43989607

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!