Oracle 11g闪回flashback(9)

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival            Enabled
Archive destination            /u01/app/oracle/archive/archive02/--归档区,默认是在闪回区
Oldest online log sequence    362
Next log sequence to archive  365
Current log sequence          365
SQL> show parameter db_rec

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery
--闪回区配置                                                _area
db_recovery_file_dest_size          big integer 3882M
db_recycle_cache_size                big integer 0
SQL> show parameter db_flashback_retent

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target        integer    1440--闪回保留时间默认是24小时,也就是1440分钟
SQL> !ls /u01/app/oracle/flash_recovery_area
jiagulun  JIAGULUN——里面是空的

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 flashback on;--启动数据库闪回

Database altered.

SQL> !ls /u01/app/oracle/flash_recovery_area
jiagulun  JIAGULUN

[oracle@localhost flashback]$ pwd
/u01/app/oracle/flash_recovery_area/JIAGULUN/flashback
[oracle@localhost JIAGULUN]$ cd flashback/
[oracle@localhost flashback]$ ls
o1_mf_bd97qnhk_.flb  o1_mf_bd987hyb_.flb
SQL> alter database open;

Database altered.

SQL> select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;

TO_CHAR(SYSDATE,'
-----------------
20150124 23:47:01

SQL> select name from v$tablespace;

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

11 rows selected.

SQL> create tablespace test_flashback_database datafile '/u01/app/oracle/oradata/jiagulun/test_flashback_database.dbf' size 10m;

Tablespace created.

SQL>  select name from v$tablespace;

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

NAME
------------------------------
TEST_FLASHBACK_DATABASE

12 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>  flashback database to timestamp to_date('20150124 23:47:01','yyyymmdd hh24:mi:ss');

Flashback complete.

SQL> startup force
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

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

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