Monday, February 6, 2012

COMPLETE RECOVERY IN ARCHIVE LOG


COMPLETE RECOVERY IN ARCHIVE LOG

=>datafiles are in open
=>database in open mode
=>no backup
=>create tablespace abc datafile’d:\app\oracle\oradata\orcl\abc.dbf’ size 50m;
=>create user prabu identified by prabu default tablespace abc quota unlimited on abc account unlock;
=>archived log list
=>select tablespace_name ,file_name from dba_data_files where tablespace_name=’ABC’;
=>select username ,default_tablespace from dba_users;
=>grant create session ,create any table,select any table to prabu;
=>conn prabu/prabu
=>create table test tablespace abc as select * from scott.emp;
=>desc dba_tables
=>select table_name ,table space_name from dba_tables where tablespace_name=’ABC’; =>select name from v$datafile;
=>select * from v$recover_file;
=>alter system switch logfile;
=>/ press enter key
=>/ press enter key
=>select * from v$recover_file;
=>alter database datafile 5 offline;
=>alter database create datafile’d:\app\oracle\oradata\orcl\abc.dbf’ size 50m;
=>select * from v$recover_file;
=>select * from v$recover_log;
=>recover automatic datafile 5;
=>select * from v$recover_file;
=>alter database datafile 5 online;
=>alter database open resetlogs;
commit and uncommitted statements can be recover.

No comments:

Post a Comment