oracle 12.2.0.1 dataguard 的 physical standby 启动时报错 ORA-10458: standby database requires recovery

数据库人生 2019-01-30 10:36:20
4883
收藏 2
分类专栏: # oracle ha data guard 文章标签: ORA-10458 ORA-01196 ORA-01110
版权
¥9.90
os: centos 7.4
db: oracle 12.1.0.2
本地虚拟机直接掉电,再启动 physical standby 时提示错误
启动报错
1SQL> startup 2ORACLE instance started. 3 4Total System Global Area 1644167168 bytes 5Fixed Size 2925024 bytes 6Variable Size 1073745440 bytes 7Database Buffers 553648128 bytes 8Redo Buffers 13848576 bytes 9Database mounted. 10ORA-10458: standby database requires recovery 11ORA-01196: file 1 is inconsistent due to a failed media recovery session 12ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf' 13
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
SQL> set lines 500; SQL> set pages 500;
SQL> select instance_name,status,database_status,instance_role from v$instance;
INSTANCE_NAME STATUS DATABASE_STATUS INSTANCE_ROLE
orcl MOUNTED ACTIVE PRIMARY_INSTANCE
SQL> select name,open_mode,database_role,dataguard_broker,guard_status,switchover_status from v$database;
NAME OPEN_MODE DATABASE_ROLE DATAGUAR GUARD_S SWITCHOVER_STATUS
ORCL MOUNTED PHYSICAL STANDBY ENABLED NONE NOT ALLOWED
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
解决方法1 重做 physical standby
这个比较简单,粗暴,不适用数据库偏大的情况.
解决方法2 恢复 physical standby
这个比较通用,也比较简单
从库上操作,启动到mount状态,启动恢复
1SQL> shutdown immediate; 2SQL> startup mount; 3SQL> recover managed standby database using current logfile disconnect from session; 4
- 1
- 2
- 3
- 4
主库上操作,产生几个归档
1SQL> alter system archive log current; 2SQL> alter system checkpoint; 3SQL> alter system archive log current; 4SQL> select * from v$archive_dest where destination is not null; 5
- 1
- 2
- 3
- 4
- 5
一定要求确保 v$archive_dest 的 status 列为 ‘VALID’
在主库上查询一下归档情况:
1SQL> select name,sequence#,archived,applied from v$archived_log order by sequence#; 2
- 1
- 2
如果返回结果 ‘APPLIED’ 都是 ‘YES’ 或者只有最后一个是 'NO’的话,说明全部归档日志全部已经归档完了.
备库上操作
1SQL> alter database recover managed standby database cancel; 2SQL> alter database open; 3
- 1
- 2
- 3
此时,如果数据库正常打开了,且如果是通过 sqlplus 手动配置的 dataguard,就执行如下命令
1SQL> alter database recover managed standby database using current logfile disconnect from session; 2
- 1
- 2
如果是通过 dataguard broker 配置的,就直接进入 dgmgrl 操作.
1DGMGRL> show configuration ; 2 3Configuration - dgconf 4 5 Protection Mode: MaxPerformance 6 Members: 7 orclp - Primary database 8 orcls1 - Physical standby database 9 Error: ORA-16766: Redo Apply is stopped 10 11Fast-Start Failover: DISABLED 12 13Configuration Status: 14ERROR (status updated 50 seconds ago) 15DGMGRL> 16DGMGRL> enable configuration;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
参考:
