8、清空备库日志组
SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1; 注:如果采用了standby log模式,不需要清空,如果清空会出现 SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1; ALTER DATABASE CLEAR LOGFILE GROUP 1 * ERROR at line 1: ORA-19527: physical standby redo log must be renamed ORA-00312: online log 1 thread 1: '/u01/oradata/xienfei/redo01.log' |
说明:如果没有采用standby log模式,有几组需要清空几组
SQL> recover managed standby database cancel;
Media recovery complete.
SQL> alter database drop logfile group 11;
Database altered.
SQL> alter database drop logfile group 12;
Database altered.
SQL> alter database drop logfile group 13;
Database altered.
SQL> alter database drop logfile group 14;
Database altered.
SQL> alter database add standby logfile group 11 ('/opt/oracle/oradata/orcl/dg/standby11.log') size 50M;
alter database add standby logfile group 11 ('/opt/oracle/oradata/orcl/dg/standby11.log') size 50M
*
ERROR at line 1:
ORA-00301: error in adding log file '/opt/oracle/oradata/orcl/dg/standby11.log' - file cannot be created
ORA-27038: created file already exists
Additional information: 1
SQL> alter database add standby logfile group 11 ('/opt/oracle/oradata/orcl/dg/standby11.log') size 50M;
Database altered.
SQL> alter database add standby logfile group 12 ('/opt/oracle/oradata/orcl/dg/standby12.log') size 50M;
Database altered.
SQL> alter database add standby logfile group 13 ('/opt/oracle/oradata/orcl/dg/standby13.log') size 50M;
Database altered.
SQL> alter database add standby logfile group 14 ('/opt/oracle/oradata/orcl/dg/standby14.log') size 50M;
Database altered.
SQL> exit
oracle@ZZ-SPJK-DB1:~/oradata/orcl/dg> ll
total 205040
-rw-r----- 1 oracle oinstall 52429312 Sep 28 20:20 standby11.log
-rw-r----- 1 oracle oinstall 52429312 Sep 29 13:45 standby12.log
-rw-r----- 1 oracle oinstall 52429312 Sep 29 11:57 standby13.log
-rw-r----- 1 oracle oinstall 52429312 Sep 29 13:45 standby14.log
oracle@ZZ-SPJK-DB1:~/oradata/orcl/dg> rm *
oracle@ZZ-SPJK-DB1:~/oradata/orcl/dg> ll
total 0
oracle@ZZ-SPJK-DB1:~/oradata/orcl/dg> ll
total 205040
-rw-r----- 1 oracle oinstall 52429312 Sep 29 14:31 standby11.log
-rw-r----- 1 oracle oinstall 52429312 Sep 29 14:32 standby12.log
-rw-r----- 1 oracle oinstall 52429312 Sep 29 14:32 standby13.log
-rw-r----- 1 oracle oinstall 52429312 Sep 29 14:32 standby14.log
oracle@ZZ-SPJK-DB1:~/oradata/orcl/dg> Connection to 10.50.101.154 closed by remote host.
Connection to 10.50.101.154 closed.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION
联系客服