I tried it out on the database on my laptop and it works like jiffy. Below is what I did.
create user flashtest identified by flashtest ;
grant connect,resource,dba to flashtest;
conn flashtest/flashtest;
create table emp(ename varchar2(20),city varchar2(20));
insert into emp values('azar','riyadh');
insert into emp values('kareem','dubai');
insert into emp values('azmi','chennai');
insert into emp values('idress','riyadh');
insert into emp values('ajmal','chennai');
commit;
select current_timestamp from dual;
conn / as sysdba
drop user flashtest cascade;
shutdown immediate
startup mount
flashback database to timestamp to_date('22-DEC-10 09.25.30','DD-MM-YY HH24:MI:SS');
alter database open read only;
conn flashtest/flashtest;
select * from emp;
host exp flashtest/flashtest file=emp.dmp log=emp.log direct=y consistent=y statistics='none';
conn / as sysdba
shutdown immediate
startup mount
recover database;
alter database open;
conn sys as sysdba
create user flashtest identified by flashtest;
grant connect,resource,dba to flashtest;
host imp flashtest/flashtest file=emp.dmp log=emp.log full=y
This seem to be perfect if we can shutdown and startup the data base so easily. How do we recover if the database can not be shutdown and still the user need to be recovered. I know if it is asking for too much. But since I am a developer and not a DBA down time is still a taboo for me. I am eager to know how this is done traditionally.
No comments:
Post a Comment