creating new db using old control files, datafiles
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: creating new db using old control files, datafiles

  1. #1
    Join Date
    Oct 2006
    Posts
    175

    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
    gtcol

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,331
    yes, as long as you know the original location of all the files - if you dont, create a control file and use that

  3. #3
    Join Date
    Oct 2006
    Posts
    175
    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.

    Thanks
    gtcol

  4. #4
    Join Date
    Oct 2006
    Posts
    175
    Incase I confused you all,

    login as: oracle
    oracle@192.168.72.96's password:
    Last login: Thu Feb 12 21:48:46 2009 from 192.168.74.97
    [oracle@oradb1 ~]$ sqlplus / as sysdba;

    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 12 23:30:21 2009

    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

    ERROR:
    ORA-12547: TNS:lost contact


    Enter user-name:sys as sysdba
    Enter password:
    ERROR:
    ORA-12547: TNS:lost contact


    Enter user-name:


    Thanks

  5. #5
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    You do not attach datafiles to a database.

    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.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    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.

  6. #6
    Join Date
    Oct 2008
    Location
    Chandigarh, India
    Posts
    322
    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.

    do check tnsnames.ora and set oracle_sid.

    may be there r other things to consider as well.

  7. #7
    Join Date
    Oct 2006
    Posts
    175
    You do not attach datafiles to a database.

    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.

    Thanks
    gtcol

  8. #8
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    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.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    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.

  9. #9
    Join Date
    Oct 2006
    Posts
    175
    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

    SQL>

    Thanks
    gtcol
    Attached Files Attached Files

  10. #10
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Have you ever had an Oracle database of the same version running in that particular machine?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width