Oracle DBA Tips and Techniques

By Arjun Raja

TESTING FLASHBACK

Posted by Arjun Raja on August 25, 2009

SQL> select count(*) from test;

COUNT(*)
———-
50000

At 09:02

SQL> @loop
18 /

PL/SQL procedure successfully completed.

SQL> select count(*) from test;

COUNT(*)
———-
100000

At 09:10

SQL> select name from v$database;

NAME
———
BOZO

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 478150656 bytes
Fixed Size 2084944 bytes
Variable Size 436211632 bytes
Database Buffers 33554432 bytes
Redo Buffers 6299648 bytes
Database mounted.
SQL> FLASHBACK DATABASE TO TIMESTAMP to_timestamp(‘2009-01-15 09:00:00’, ‘YYYY-MM-DD HH24:MI:SS’);

Flashback complete.

SQL> ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> ALTER DATABASE OPEN NORESETLOGS;
ALTER DATABASE OPEN NORESETLOGS
*
ERROR at line 1:
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

SQL> ALTER DATABASE OPEN RESETLOGS;

Database altered.

SQL> select count(*) from test;

COUNT(*)
———-
50000

SQL> exit

_______________________________________________________________________________ Unencrypted electronic mail is not secure and may not be authentic. If you have any doubts as to the contents please telephone to confirm.

This electronic transmission including any attachments is intended only for those to whom it is addressed. It may contain copyright material or information that is confidential, privileged or exempt from disclosure by law. Any claim to privilege is not waived or lost by reason of mistaken transmission of this information. If you are not the intended recipient you must not distribute or copy this transmission and should please notify the sender. Your costs for doing this will be reimbursed by the sender.

We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment. _______________________________________________________________________________

______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: