Oracle 11g闪回flashback(10)

Total System Global Area  400846848 bytes
Fixed Size                  2213776 bytes
Variable Size            276826224 bytes
Database Buffers          117440512 bytes
Redo Buffers                4366336 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;--为什么会要求open为resetlog?
因为:数据库被闪回了,那么从闪回前在到闪回点的重做日志对于数据库来说已经是无效的了。所以要求重设日志。
SQL> alter database open read only;--有两种模式:read only、read write;之所以为这种状态,因为数据库在闪回后,就不是现在的数据库了

数据库的状态发生了改变,不希望其他用户登录进来防止出现问题

Database altered.

SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
EXAMPLE
TESTTS
TEMP2
TEMP3
UNDOTBS2
TEST_TRAN_TS

TEST_FLASHBACK_DATABASE--已经不存在了,被闪回了
11 rows selected.

SQL>

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area  400846848 bytes
Fixed Size                  2213776 bytes
Variable Size            276826224 bytes
Database Buffers          117440512 bytes
Redo Buffers                4366336 bytes
Database mounted.
SQL> alter database archivelog
  2  ;

Database altered.

SQL>
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival            Enabled
Archive destination            /u01/app/oracle/archive/archive02/
Oldest online log sequence    1
Next log sequence to archive  1
Current log sequence          1
SQL>  alter database noarchivelog;--归档变成非归档
alter database noarchivelog
*
ERROR at line 1:
ORA-38774: cannot disable media recovery - flashback database is enabled

--表示在flashback状态不能变成非归档

SQL> alter database flashback off;--关闭flashback

Database altered.

SQL>  alter database noarchivelog;--再进行归档到非归档的切换

Database altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival            Disabled
Archive destination            /u01/app/oracle/archive/archive02/
Oldest online log sequence    1
Current log sequence          1

SQL> alter database open;

Database altered.

SQL>

相关阅读:

Oracle 11g flashback Data Archive(闪回数据归档)

Oracle flashback闪回机制

flashback table快速恢复误删除的数据

Oracle 备份恢复:flashback闪回

[Oracle]闪回flashback功能的使用

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/647f086b6eb914738c7dda51df50b04b.html