If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Rename Without restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-05-04, 11:18
JDCam JDCam is offline
Registered User
 
Join Date: Feb 2004
Posts: 9
Rename Without restore

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

Cam
Reply With Quote
  #2 (permalink)  
Old 04-05-04, 12:21
J Petruk J Petruk is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 04-05-04, 12:28
JDCam JDCam is offline
Registered User
 
Join Date: Feb 2004
Posts: 9
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
Reply With Quote
  #4 (permalink)  
Old 04-05-04, 13:15
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
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
Reply With Quote
  #5 (permalink)  
Old 04-16-04, 16:14
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #6 (permalink)  
Old 04-17-04, 10:39
famudba famudba is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On