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 > RE: How to copy existing DB to new machine?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-05, 04:58
RobertD RobertD is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
RE: How to copy existing DB to new machine?

Hello,

we ( me and my partner ) are quite newbies to IBM UDB2. We are now on a threshold of launching / or better "copying" existing database from db server 1
to new db server 2. We successfully finished backup of db on server 1 and now we are facing problem how to launch ( "paste" ) db to server 2.

We put the database into a shared folder; then through IBM DB2 - Administration Tools - Control Center we created database from backup ( right mous-click on folder "Databases": Create - Database from Backup ).

Here we are not quite sure if this is right procedure. If it is Create - Database from Backup or Create - Database using Wizard ?????

Please give us a right idea on this. Basically we only want to "copy and paste" existing database to this new machine.

What is the procedure?

Thanx
Reply With Quote
  #2 (permalink)  
Old 02-15-05, 06:45
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Create database from backup: restore database (you need this).
Create database using Wizard: create new database (you don't need this).
Reply With Quote
  #3 (permalink)  
Old 02-16-05, 05:30
RobertD RobertD is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
Hey, thanks

maybe I should write this in more detail. I am really newbie to DB2 administration, have never put my finger on it really.

So, from an existing database on SERVER 1 on separate PC we have managed to create backup of database setting logging to archival ( instead of circular ). We placed this databese to D:\database_01. We shared this folder. This was without any major problems.

NOW, we want to restore ("paste") this database_01 to SERVER 2 on another separate PC. At this point I am absolutely puzzled what to really do ????
I use Control Center; here am I supposed firstly to Creat Database from Backup?? If yes, at first step titled: DEFINE THE LOCATION INFORMATION FOR YOUR NEW DATABASE these fields appear:

1. Database being restored ( Is this the database we have on shared folder D:\database_01 ? )

2. Name for new database ( This is rather explanatory )

3. Location of the database after restore

4. Location of the logs after restor ( Does this have to be a new blank folder? )
Reply With Quote
  #4 (permalink)  
Old 02-16-05, 07:41
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

I think you can't restore database from 'shared volume'. I think database image must be copied to 'local volume'.

1. yes this is the database you make a backup from. So put the database name into this field.
2. new database name: if you would like to rename your database you can put new name in this field if not just put the same name as in first step.
3. put this field empty to restore it to system volume (it is probably C: volume)
4. you can put this empy, it depends if you would like to have log files on different disk volume or not (from performance point of view it is better to have on different disk volume).

Hope this helps,
Grofaty
Reply With Quote
  #5 (permalink)  
Old 02-16-05, 09:12
RobertD RobertD is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
Hi, thanks

Yes, I sort of was considering this. So now I have copied the backup database to C:\DB2\NODE0000. Under this dir there are already these folders:
SQL00001
SQL00002
SQLDBDIR

( these folders were created after my partner finished instalation of DB2 application/client and created a default database from IBM DB Control Center tool )

The name of the database backup folder is 20050214 ( date format when this backup was made on another PC ). It contains a file of 1,5Mb named as 152037.001 ( I think it is a time of backup ). What would I do now? Rename the folder to e.g. SQL00003 ????

Thank you
Reply With Quote
  #6 (permalink)  
Old 02-16-05, 11:04
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
What you have is

====>>> a backup file in the form of

<database_name>.<0>.<instance_name>.<Node_name>.<c at_name>.<timestamp>.<file_no>

This image can be restored to any database under an instance as long as any instance can read it.

First try to get an offline backup because online backup is difficult to restore using

backup database <database_name>

No application should be connected.

You can use this command to find what application are connected

list applications

Then use

force application all // This will force all application under an instance(all databases).


2. The OS(Window) of both the server must be same.It doesn't matter whether they are on shared drive or not, as long as the db2 instance can read the image file.

3.
Use restore database <database_name> taken at <timestamp>

In window you need to create all the directory structure like database_name and put the image at that place, sorry I am not a very good window guy.


regards

Mujeeb
Reply With Quote
  #7 (permalink)  
Old 02-17-05, 06:06
RobertD RobertD is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
Thank you,

one more question: I am attempting to make a backup of db. What am I supposed to do before executing:

BACKUP DATABASE TEST1
TO D:\BACKUP_TEST1


Is the circular logging better to chose than archival logging? What is the best selection?

Thanx
Reply With Quote
  #8 (permalink)  
Old 02-17-05, 09:58
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
If you use circular logging then you can only take an offline backup, meaning there must be no connections to the database during the backup process.

Archive log mode allows you to take an online backup; in that case you have to copy the archived log files to the target system, in addition to the backup image itself, and roll forward the database.
Reply With Quote
  #9 (permalink)  
Old 02-17-05, 10:47
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
1. offline can be done , only when no application connected to the database.

use

db2 list applications.

2. If there are force the application out

db2 force application all // for all applications under the instance
or
db2 force application<appl_id> // specific application.

3. do the backup

db2 backup database <database_name>

You can also use the

db2 quiesce database <database_name> immediate force connections
db2 terminate.
db2 backup db <database>

regards

Mujeeb
Reply With Quote
  #10 (permalink)  
Old 02-18-05, 04:59
RobertD RobertD is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
Thank you, Guys

Your assistance was a great leap into my knowledge of administration of DB2.

I succeeded in cerating backup, choosing right Logging procedure then I succesfully restored the DB.

Thanks a lot.
Reply With Quote
  #11 (permalink)  
Old 02-18-05, 09:49
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
The db2 is lot more than backup/restore.Its a software that is really fun to
work. Welcome to the world of db2


mujeeb
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