ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Physical Standby Switchover_status Showing Not Allowed

2020-07-01 13:53:23  阅读:677  来源: 互联网

标签:Switchover status SWITCHOVER database Standby Database standby SQL switchover


状态列表:

In Oracle documentation explain SWITCHOVER_STATUS column of v$database can have the following values:

NOT ALLOWED – Either this is a standby database and the primary database has not been switched first, or this is a primary database and there are no standby databases.

SESSIONS ACTIVE – Indicates that there are active SQL sessions attached to the primary or standby database that need to be disconnected before the switchover operation is permitted.

SWITCHOVER PENDING – This is a standby database and the primary database switchover request has been received but not processed.

SWITCHOVER LATENT – The switchover was in pending mode, but did not complete and went back to the primary database.

TO PRIMARY – This is a standby database, with no active sessions, that is allowed to switch over to a primary database.

TO STANDBY – This is a primary database, with no active sessions, that is allowed to switch over to a standby database.

RECOVERY NEEDED – This is a standby database that has not received the switchover request.

解决:

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

NAME                        DATABASE_ROLE                                    SWITCHOVER_STATUS
--------------------------- ------------------------------------------------ ------------------------------------------------------------
MTXDB                       PHYSICAL STANDBY                                 NOT ALLOWED

SQL>  select PROCESS, STATUS, GROUP#, SEQUENCE#, BLOCK#, BLOCKS from v$managed_standby;

PROCESS                     STATUS                               GROUP#                                                                                                                    SEQUENCE#     BLOCK#     BLOCKS
--------------------------- ------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ---------- ---------- ----------
ARCH                        CONNECTED                            N/A                                                                                                                               0          0          0
DGRD                        ALLOCATED                            N/A                                                                                                                               0          0          0
DGRD                        ALLOCATED                            N/A                                                                                                                               0          0          0
ARCH                        CONNECTED                            N/A                                                                                                                               0          0          0
ARCH                        CONNECTED                            N/A                                                                                                                               0          0          0
ARCH                        CONNECTED                            N/A                                                                                                                               0          0          0
MRP0                        APPLYING_LOG                         N/A                                                                                                                              57       2346     409600
RFS                         IDLE                                 N/A                                                                                                                               0          0          0
RFS                         IDLE                                 2                                                                                                                                57       2346          1

9 rows selected.

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE                                    SWITCHOVER_STATUS
------------------------------------------------ ------------------------------------------------------------
PHYSICAL STANDBY                                 NOT ALLOWED

SQL> alter database recover managed standby database finish force;

Database altered.

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE                                    SWITCHOVER_STATUS
------------------------------------------------ ------------------------------------------------------------
PHYSICAL STANDBY                                 TO PRIMARY

SQL> shutdown immediate;
ORA-01109: database not open


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

Total System Global Area 2466250400 bytes
Fixed Size                  9137824 bytes
Variable Size             536870912 bytes
Database Buffers         1912602624 bytes
Redo Buffers                7639040 bytes
Database mounted.
Database opened.
SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE                                    SWITCHOVER_STATUS
------------------------------------------------ ------------------------------------------------------------
PHYSICAL STANDBY                                 TO PRIMARY

 产生DataGuard ora-16157故障:

关于这个问题,oracle 官方的回答是要重装DG,考虑实际情况,alter database recover managed standby database finish force 之后,系统没有更改,只需要在nomount 备库之后,在主库产生standby backup control file,然后在备机用些控制文件加载就可以了,测试通过.

在主库

SQL> alter system archive log current;

System altered.

SQL> alter system checkpoint;

System altered.

SQL> SELECT UNIQUE THREAD#, MAX(SEQUENCE#) OVER(PARTITION BY THREAD#) LAST FROM v$archived_log;

   THREAD#       LAST
---------- ----------
         1         66
SQL> ALTER DATABASE CREATE standby CONTROLFILE AS '/tmp/controlfs01.ctl';

 Database altered.

--scp到备库
 

在备库:

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

 

标签:Switchover,status,SWITCHOVER,database,Standby,Database,standby,SQL,switchover
来源: https://www.cnblogs.com/tingxin/p/13200857.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有