Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    10

    Unanswered: Rename Without restore

    DB2 7.1 FP10
    TEST Environment
    Is it possible to rename a database without having to restore it. ??

    Cam

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Will an alias do? If so you can just catalog it again with the new name.
    --
    Jonathan Petruk
    DB2 Database Consultant

  3. #3
    Join Date
    Feb 2004
    Posts
    10
    I would prefer a proper rename ..

    We have 2 development machines both each running previous restores of our Production database.

    When the restores were done, no one though of giving them a new name. Now we have 3 servers each running a database of the same name.

    It becomes very confusing to know which database you are actually working on

    I can change them next time I need to restore.. was just wondering if there a simple was to rename, as there is with many other DB products

    Cam

  4. #4
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Originally posted by JDCam
    I would prefer a proper rename ..

    We have 2 development machines both each running previous restores of our Production database.

    When the restores were done, no one though of giving them a new name. Now we have 3 servers each running a database of the same name.

    It becomes very confusing to know which database you are actually working on

    I can change them next time I need to restore.. was just wondering if there a simple was to rename, as there is with many other DB products

    Cam
    I don't think DB2 has this yet... getting close, though, they've added RENAME TABLE and RENAME TABLESPACE, it's got to be next!
    --
    Jonathan Petruk
    DB2 Database Consultant

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Just remembered the command, db2relocatedb ..

    Have not tried renaming a database, but renaming/moving tablespace containers has worked with no hassle ...

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  6. #6
    Join Date
    Jan 2004
    Location
    Tallahassee, FL, USA
    Posts
    96
    as shayam told , U can rename DB by using db2relocatedb


    Here is syntax & example for rename DB is as below.


    To change the name of the database TESTDB to PRODDB in the instance db2inst1 that resides on the path /home/db2inst1, create the |following configuration file:


    DB_NAME=TESTDB,PRODDB
    DB_PATH=/home/db2inst1
    INSTANCE=db2inst1
    NODENUM=0



    Save the configuration file as relocate.cfg and use the following command to make the changes to the database files:

    db2relocatedb -f relocate.cfg


    Hope it may help.

    Lekharaju Ennam
    Certified Oracle8i & DB2 UDB DBA
    Florida A&M University

Posting Permissions

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