DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: copy DBs from one server to another with different directory structure

  1. #1
    Join Date
    Apr 2001
    Posts
    257

    copy DBs from one server to another with different directory structure

    Both servers are 8.1.7.3 running Win2k. I need to copy two databases currently running on one server to another server. However, the source DB server has different directory structure from the destination.

    The source has everything on c:\oracle except the data files, which are located under D:\oracle\oradata.

    The destination has everything on d:\oracle (all standard default locations).

    How easy is it to copy the databases directly over? I am thinking to copy datafiles, init.ora, control files, password file, and archived logs over. Do I need to copy redo logs if I shut down the source server cleanly before copying the above files?

    After copying to the destination server, Init.ora files need to be modified for control file locations and archiving locations for sure. Possibly need to recreate control files themselves? Are there anything I should look after?

    Thanks,
    Last edited by a128; 01-29-2003 at 07:13 PM.

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    No need to recreate the controlfile. Just mount the database with the coppied controlfiles (after editing your init.ora for controlfile locations), then isue
    Code:
    ALTER DATABASE RENAME FILE old_file TO new_file;
    for all the datafiles and redo logfiles.

    You need not to copy archived logfiles to new server unless you think you would need them for any kind of media recovery later. In any case, you should perform full database backup immediately after the cloning is done, so there is not much point in keeping them, I guess.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    May 2002
    Location
    California, USA
    Posts
    175

    Smile

    Do I need to copy redo logs if I shut down the source server cleanly before copying the above files?
    Technically, you don't need the contents of the redo logs since you are going to shutdown immediate or normal, so the checkpoint will occur. The datafile's headers will be updates as well. But, you will need the files to be there, because they exists in the control file, and you won't be able to open the database until Oracle makes sure the headers in the control file match these in the redo logs.

    Bottom line, you have to bring them over.


    Hope that helps,

    clio_usa

    OCP 8/8i/9i DBA

    Visit our Web Site

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by clio_usa
    Bottom line, you have to bring them over.
    No, not at all. Open the database with RESTLOGS and Oracle will create a brand new set of redo logs for you.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by jmodic
    No, not at all. Open the database with RESTLOGS and Oracle will create a brand new set of redo logs for you.
    But if the database is consistent. will it allow opening database with resetlogs option... If im not mistaken for that you need to give

    1. recover database until cancel;
    2. cancel it
    3. alter database open restlogs.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  6. #6
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    in fact you need a consistent backup (i.e cold backup) to open a database with resetlogs not having redologs

    if it´s consistent you dont need anything from redologs therefore no need to issue any recover command

  7. #7
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    yep point noted.....
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  8. #8
    Join Date
    Apr 2001
    Posts
    257
    Since I have all the redo logs copied over and the source DB was shutdown cleanly. Is there any difference whether I do resetlogs or not? I thought I don't have to.

    Thanks,
    Last edited by a128; 04-11-2003 at 08:24 PM.

  9. #9
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    You are correct, you don't have to use RESETLOGS in your situation.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

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