creating new db using old control files, datafiles
Hi all
I've got copies of all necessary files, including control files, redo logfiles, datafiles. I don't have one for spfile. Is there any way I could create a database out of it and use the data there? I am doing this just for test purpose.
I appreciate any advice/suggestion.
Thanks Davey.
Yes I have the location for all files, I need to know how we attach them to new database. I ran 'relink all' as it gives me:
ERROR:
ORA-12547: TNS:lost contact
while trying to connect as sys. But it doesn't seem to help.
Please suggest.
You are cloning -cloning as in creating- a database based on "all necessary files, including control files, redo logfiles, datafiles" you have gotten from other one.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
well in case of emergency i wud have tried as follows:
Since i dont have an spfile.So first create one and give the path of controlfiles as controlfiles will be opend in the mount stage. Then wud have checked whether the datafiles have been restored to the correct location. iF i m going to restore them to a diff location, then wud have registered this change in the controlfile using rename command.
if clean shutdown is made, then no recovery is reqd.
but i wont be able to open the database as i dont have redologs that r registered in the controfile i.e log sequence number.
so, recover database until cancel n open using resetlogs.
You are cloning -cloning as in creating- a database based on "all necessary files, including control files, redo logfiles, datafiles" you have gotten from other one.
Thanks PAVB.
I have just got the files of a database for which instance files were 'deleted', with rm command. From what I read about cloning is ,database needs to be cleanly shut down to perform a cold cloning. I have installed Oracle software with the same sid, port and home directories, but when I try to connect as sys, it gives the error that I've already posted.
Any help/suggestion is appreciated.
Make sure datafiles, archivelogs, etc. are available and in the right location as described in controlfile -from now on your_control_file.sql
Edit your controlfile:
Make sure the first line of your control file reads like...
CREATE CONTROLFILE REUSE SET DATABASE "your_db_name" RESETLOGS ARCHIVELOG
Make sure to comment out anything you may have after DATAFILES description like startup, alter database, etc.
Startup/recover your database:
sqlplus /nolog
conn sys as sysdba
--hit enter--
STARTUP NOMOUNT
@/your_path/your_control_file.sql
RECOVER DATABASE USING BACKUP CONTROLFILE until cancel
--apply your logs--
alter database open resetlogs;
Once your database is up, bounce it and be sure your alertlog is clean.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Hi PAVB
I understand what you're saying. But Oracle won't let me connect even as sysdba, in the first place. I tried relink all; attached is its output. (I had to break them down to 2, as they exceeded 100K size limit.) And after relinking, 'env | grep ORA' gives me correct paths. But still I am getting following error.
[oracle@oradb1 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Feb 13 14:50:15 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn sys as sysdba
Enter password:
ERROR:
ORA-12547: TNS:lost contact
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.