Today i need to post on flashback feature on oracle database (10g or later)
Version: 10.2.0.1
One of my friend needed step by step configuration of Flashback. Here we go..
Pre-Requisites:
1. Database should be on archivelog mode
Startup the database with mount option:
(Simple Example of the procedure)
connect as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Nov 19 14:40:28 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 3
Next log sequence to archive 5
Current log sequence 5
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 603979776 bytes
Fixed Size 1220796 bytes
Variable Size 184553284 bytes
Database Buffers 411041792 bytes
Redo Buffers 7163904 bytes
Database mounted.
Enable the Flashback:
SQL> alter database flashback on;
Database altered.
SQL> alter system set DB_FLASHBACK_RETENTION_TARGET=4320;
System altered.
SQL> alter system set DB_FLASHBACK_RETENTION_TARGET=4320;
System altered.
SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=1G;
System altered.
SQL> alter database open;
Now connect as a normal user who has default tablespace as someone other than SYSTEM
SQL> conn balaji/balaji
connected
SQL> create table test (id number(2), name varchar(30));
Table created.
SQL> insert into table test values (3, 'INDIA');
1 row inserted
SQL> insert into table test values(4,'SRILANKA');
1 row inserted
SQL> select * from test;
ID NAME
---------- --------------------
3 INDIA
4 SRILANKA
SQL> select tablespace_name from dba_segments where segment_name like 'TEST';
TABLESPACE_NAME
------------------------------
USERS
Note the user balaji has the default tablespace as USERS.
Drop the table test:
SQL> drop table test;
Table dropped.
SQL> select * from test;
ERROR at line 1:
ORA-00942: table or view does not exist
Using Flashback to get the table from recycle bin:
SQL> flashback table "TEST" to before drop;
Flashback complete.
SQL> select * from test;
ID NAME
---------- --------------------
3 INDIA
4 SRILANKA
SQL>
Points to remember:
Flashback option will not work for SYSTEM tablespace objects.
You will receive:
SQL> flashback table "TEST" to before drop;
flashback table "TEST" to before drop
*
ERROR at line 1:
ORA-38305: object not in RECYCLE BIN
This is not about SYS objects, this is about SYSTEM tablespace... I can create a sys.table (logged as sys) on USER tablespace and then recover it through flashback.
Recycle functionality is available only for non-system locally-managed tablespaces.
Hope it helps... Cheers!!!
Share the content if you found it is useful (You can share using 300 community websites) click "share" at the end of the post.
You are encouraged to leave a comment.
You are encouraged to leave a comment.
Friday, November 19, 2010
Subscribe to:
Post Comments (Atom)
Let us be Friends...
Popular Posts
-
This blog describes the process of re-creating an existing Applications Release 12 database instance using the export and import utilities....
-
Secure Sockets Layer (SSL) SSL is a technology that defines the essential functions of mutual authentication, data encryption, and data inte...
-
This blog speaks about the Login Page Issue on R12.1.1 instance. Suddenly the login page was throwing an error - 404 /OA_HTML/AppsLogin was ...
-
1. Installation of the Demantra Base Application or Patches Create a C:/Tmp folder on the machine where the setup.exe will be executed pri...
-
Memory Tuning The total available memory on a system should be configured in such a manner, that all components of the system functio...
-
Symptom: A MultiException has 6 exceptions. They are: 1. java.lang.AssertionError: Cannot export non clusterable object with jndiName:weblo...
-
The Following Error was detected while doing Cloning of DB Tier. The actual Fact was: The server was heavily loaded, so the control file cre...
-
Today, i need to blog out the configuration of SSL in R12 Environment. The process and steps are as follows. It contains both Middle Tier an...
-
Hi, everybody should come across, while during a clone, you might have experienced very poor performance while running txkWfClone.sh profil...
-
We will be unable to login using none of the seeded users nor custom users. Applications will not allow any user to be logged in. For a VISI...
No comments:
Post a Comment