SQL> set linesize 500
SQL> select open_mode,database_role,switchover_status from v$database;
OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
READ WRITE PRIMARY RESOLVABLE GAP
是因为之前备库密码文件有问题导致了gap
把redolog刷新到备库
主库是rac,需要把其他节点关闭,把操作的这个节点启动到mount状态
执行完毕后,要先关闭此实例,再启动所有实例,否则在打开此实例,再打开其它实例会报如下报错
ORA-01183: cannot mount database in SHARED mode
SQL> ALTER SYSTEM FLUSH REDO TO 'orcl';
ALTER SYSTEM FLUSH REDO TO 'orcl'
*
ERROR at line 1:
ORA-01105: mount is incompatible with mounts by other instances
SQL> ALTER SYSTEM FLUSH REDO TO 'orcl';
ALTER SYSTEM FLUSH REDO TO 'orcl'
*
ERROR at line 1:
ORA-01105: mount is incompatible with mounts by other instances
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 2421825536 bytes
Fixed Size 2255632 bytes
Variable Size 654312688 bytes
Database Buffers 1744830464 bytes
Redo Buffers 20426752 bytes
Database mounted.
这里报错是因为备库没有开启同步
SQL> ALTER SYSTEM FLUSH REDO TO 'orcl';
ALTER SYSTEM FLUSH REDO TO 'orcl'
*
ERROR at line 1:
ORA-16447: Redo apply was not active at the target standby database
备库开启同步
SQL> alter database recover managed standby database disconnect from session;
Database altered.
重新刷新
SQL> ALTER SYSTEM FLUSH REDO TO 'orcl';
System altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2421825536 bytes
Fixed Size 2255632 bytes
Variable Size 654312688 bytes
Database Buffers 1744830464 bytes
Redo Buffers 20426752 bytes
Database mounted.
Database opened.
刷新后,主库先关闭,在开启,
发表评论