My Experiments with Oracle

By Sriram Sanka -The AUAA

Archive for December, 2010

Put the Database in ARCHIVE mode and enable flashback mode

Posted by sriram on December 11, 2010


SQL> select banner from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO

SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

SQL> alter system set db_recovery_file_dest_size=2g;

System altered.

SQL> alter system set db_recovery_file_dest='d:\oracle\product\10.2.0\flash_recovery_area';

System altered.

.

SQL> alter system set log_archive_dest_1='location=d:\archive\sriram';

System altered.

SQL> alter system set log_archive_dest_10='location=use_db_recovery_file_dest';

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 272629760 bytes
Fixed Size 1248504 bytes
Variable Size 117441288 bytes
Database Buffers 150994944 bytes
Redo Buffers 2945024 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> select log_mode from v$database;

LOG_MODE
------------
ARCHIVELOG

SQL> alter database flashback on;

Database altered.

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES

SQL>
SQL> alter database open;

Database altered.

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE 0 0 0
ONLINELOG 0 0 0
ARCHIVELOG 67.58 0 87
BACKUPPIECE 31.95 0 2
IMAGECOPY 0 0 0
FLASHBACKLOG .38 0 1

6 rows selected.

Advertisements

Posted in Oracle Server Administration | Leave a Comment »

 
%d bloggers like this: