Friday, July 7, 2017

Oracle Database Restoration

Read the full doc once before do anything first

1.
. oraenv
-- enter dbname and the oracle home location
2.
startup nomount pfile='/asd.ora';
-- include only below in the above asd.ora file
*.db_name='fortedev'
*.compatible='11.2.0.4.0'

--------------------------
sql --> create spfile from pfile='/vol5/backup/forte_pfile.ora';
----------------------------
** compatible parameter uses only if you get the error like below
ORA-00201: control file version 11.2.0.4.0 incompatible with ORACLE version 11.2.0.0.0
ORA-00202: control file: '/vol0/app/oracle/product/11.2.0/db_1/dbs/cntrlfortedev.dbf'
3.
RMAN> restore controlfile from '/vol5/backup/c-3948522858-20141028-01';
4.
RMAN> startup mount;

RMAN> REPORT SCHEMA;

---------------------
Use Below script if the paths are same

run {
set until sequence 1+latest THREAD 1;
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
}
-------------------

run {
SET UNTIL SEQUENCE 1694 THREAD 1;
set newname for datafile 1 to '/vol0/app/oracle/oradata/system01.dbf';
set newname for datafile 2 to '/vol0/app/oracle/oradata/sysaux01.dbf';
set newname for datafile 3 to '/vol0/app/oracle/oradata/undotbs01.dbf';
set newname for datafile 4 to '/vol0/app/oracle/oradata/users01.dbf';
set newname for datafile 5 to '/vol0/app/oracle/oradata/sicl01.dbf';
restore database;
switch datafile all;
recover database;
}

SQL> select * from v$logfile;

SQL> ALTER DATABASE RENAME FILE '/vol1/app/oracle/oradata/fortedev/redo01.log' TO '/vol0/app/oracle/oradata/redo01.log';

RMAN> alter database open resetlogs;
SQL> shu immediate;
startup

create the temp file http://techblogbyh.blogspot.com/2017/07/add-or-drop-temp-tablespaces.html






No comments:

Post a Comment