在oracle 12C 的环境下开启和关闭数据库闪回(flashbackup)功能。以下是简单的操作过程,但是在生产环境下不建议开启该功能。
点击(此处)折叠或打开
- [oracle@localhost ~]$ sqlplus / as sysdba
- SQL*Plus: Release 12.1.0.1.0 Production on Mon Dec 14 15:15:35 2015
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
- Connected to:
- Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- SQL> set linesize 200
- SQL> set pagesize 999
- SQL> SELECT flashback_on, log_mode FROM v$database;
- FLASHBACK_ON LOG_MODE
- ------------------ ------------
- NO ARCHIVELOG
- SQL>
- SQL>
- SQL>
- SQL> shutdown immediate;
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup mount;
- ORACLE instance started.
- Total System Global Area 835104768 bytes
- Fixed Size 2293880 bytes
- Variable Size 562040712 bytes
- Database Buffers 264241152 bytes
- Redo Buffers 6529024 bytes
- Database mounted.
- SQL> alter database flashback on;
- Database altered.
- SQL> alter database open;
- Database altered.
- SQL>
- SQL>
- SQL> SELECT flashback_on, log_mode FROM v$database;
- FLASHBACK_ON LOG_MODE
- ------------------ ------------
- YES ARCHIVELOG
- SQL> show parameter recovery
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_recovery_file_dest string /u01/app/oracle/fast_recovery_
- area
- db_recovery_file_dest_size big integer 4800M
- recovery_parallelism integer 0
- SQL> show parameter flashback
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_flashback_retention_target integer 1440
-
- SQL> alter system set db_flashback_retention_target=2880;
- System altered.
-
- SQL> show parameter flashback
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_flashback_retention_target integer 2880
- SQL> shutdown immedaite
- SP2-0717: illegal SHUTDOWN option
- SQL> shutdown immediate;
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup mount;
- ORACLE instance started.
- Total System Global Area 835104768 bytes
- Fixed Size 2293880 bytes
- Variable Size 562040712 bytes
- Database Buffers 264241152 bytes
- Redo Buffers 6529024 bytes
- Database mounted.
- SQL> alter database flashback off;
- Database altered.
- SQL> alter database open;
- Database altered.
- SQL> SELECT flashback_on, log_mode FROM v$database;
- FLASHBACK_ON LOG_MODE
- ------------------ ------------
- NO ARCHIVELOG
- SQL> show parameter recovery
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_recovery_file_dest string /u01/app/oracle/fast_recovery_
- area
- db_recovery_file_dest_size big integer 4800M
- recovery_parallelism integer 0
- SQL> show parameter flashback
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_flashback_retention_target integer 2880
- SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27039319/viewspace-1871988/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27039319/viewspace-1871988/