Disaster recovery:-
database(prod) Side:-
Loss
of all files (spfile, datafile, and controlfiles, online redo logs)
prod]$
sqlplus / as sysdba
SQL> exit
]$ cd prod
prod]$ rm
-rvf *.log *.ctl *.dbf
prod]$ cd
/u01/azhar/app/product/11.2.0/dbhome_1/dbs/
dbs]$ rm -rvf
spfileprod.ora
dbs]$ rm -rvf
initprod.ora
dbs]$ sqlplus
/ as sysdba
SQL> shut
immediate (got a error)
SQL> shut
abort
SQL> exit
Find
database id (from catalog) and set that dbid from rman
Catalog
database(test) Side:-
SQL>
select * from rc_database;
Target
database(prod) Side:-
dbs]$ rman
target / catalog vcat1/vcat1@tocat
RMAN> set
dbid 318949225; (id no
example=318949225)
RMAN>
startup nomount
RMAN>
restore spfile;
RMAN>
startup force nomount
RMAN>
restore controlfile;
RMAN> sql
'alter database mount';
RMAN> exit
dbs]$ sqlplus
/ as sysdba
SQL>
archive log list
SQL> exit
dbs]$ rman
target / catalog vcat1/vcat1@tocat
RMAN>
run
2> {
3> set until logseq 2;
4> } (now Current log sequence 2 so put here 2)
RMAN>
restore database;
RMAN>
recover database until logseq 2; (now Current log sequence 2 so put here 2)
RMAN> sql
'alter database open resetlogs';
Note:-
take full database backup (recommended)
Delete
old backup----
RMAN>
delete backup;
Take
new backup----
RMAN>
run
2> {
3> backup database;
4> backup spfile;
5> backup current controlfile;
6> backup archivelog all;
7> }
VIEWS:-
dba_data_files;
v$logfile;
v$controlfile;
No comments:
Post a Comment