I want to restore database to new oracle server from cold backup . As I understand I need to restore copy of init.ora, control files, redo logs to new server under exactly same stucture as old one. Do I need to copy archived logs too.
Printable View
I want to restore database to new oracle server from cold backup . As I understand I need to restore copy of init.ora, control files, redo logs to new server under exactly same stucture as old one. Do I need to copy archived logs too.
no
may be very dumb question but I am going to ask anyway....
when database is shutdown,all transactions are written to datafiles then why is it necessary to copy redo log files, aren't data files sufficiant to open database on new server?
you dont NEED to, but it asves you havign to recreate them with open resetlogs - its just less typing
Thanks. So essentially steps I need to follow are
1.shutdown database on old server and take copy of init.ora, contolfiles, datafiles and redo log files to new server in the same directory strucure.
2. On new server set up oracle sid same as old one
startup instance using copied init.ora file
3. mount and open database.
yep,
make sure the bdump udump directories exist as well
have an oratab entry (if you use it) password file etc ..
Tried it, When tried to open it by giving
Alter database open command , it prompted to use restlogs option. so did
alter database open resetlogs ;
Got error
ORA-01194 File1 needs more recovery to be consistent
ORA-01110 Data File1:'/usr2/oracle/product/10g/oradata/.../system01.dbf'
thats the most common error u can get if all the files are not in sync,
maybe u haven't shut it down cleanly. or u can startup mount
and recover database....and copy the archive logs it asked for you
Have you coppied the redo logs as well? If so, try
alter database open ( without resetlogs)
If not, try
Recover database until cancel
and enter CANCEL immediately when asked
(if not asked at all do not worry about that)
When that's finished, go for
alter database open resetlogs;
I hope that works ( one never knows with that ;-))
I am writing all the steps required for database cloning.
Source:
Use alter system switch logfile;
This will forcibly do database wide checkpoint ( which is also equivalent to shutdown normal).
Alter database backup controlfile to trace resetlogs;
Show parameter user_dump will give you the path where trace(.trc) file of control file is placed.
The .trc will contain the create controlfile …. Statement
Scoop out everything from it leaving the create contol file Reuse database ……. Statement
Copy all the database files (including Init.ora file) (With database as shutdown normal) as mentioned in create controlfile statement from source to target destination.
Target :
Install Oracle10g software without creating the sample database.
Since I used a new database name in the target server modify entries in init.ora like db_name as well as the directory structures as where you will place the control files , redo files and datafiles.
Modify the .trc file for control file as CREATE CONTROLFILE REUSE SET DATABASERESETLOGS ARCHIVELOG with all the new directory structures and save the file as ctrl .sql ( could be any name only extn should be .sql).
Create an instance in target server using oradim utility for eg
Oradim –new –sid-syspwd -startmode auto –pfile file=’ give the path for init .ora’
After creating the instance say instance is Test and sys password is oracle log in as
Sqlplus sys/oracle as sysdba
SQL> startup nomount
SQL> @c:\ ctrl.sql
Control file created.
SQL> Alter database open resetlogs;
If any recovery is required use the following
SQL>Recover Database using backup controlfile;
apply the online redo log file which were current
select group#, sequence#, status from V$log;
GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
1 1 CURRENT <== this redo needs to be applied
And then
SQL> Alter database open resetlogs;