Solved

Connection to a remote DB2 FILE (not server)

Posted on 2006-06-27
16
604 Views
Last Modified: 2008-02-01
Case:

Remote DB2 server owned by a vendor.  
They make a mirror copy of the .db file and place onto a share i have access to.
The share is remotely accessed over a T1, and the db size is 500MB.

I would prefer not to have to copy the database every day so is there a way to attach to the database file across the network to the share?

I am absolutely new to db2 as it is only needed for this connector but I do have a large background in SQL.

I do have a copy of DB2 Viper installed on a local machine and wish to use that machine as my data source (for web reporting via ColdFusion), so i will need the solution to not require a user to be logged into the local machine in order to make it work.  

If there are alternative ways to approach this, i am all ears.  But having no background with db2 I am leaving this up to you, the experts to lead me in the right direction.

0
Comment
Question by:RussoMA
  • 7
  • 6
  • 3
16 Comments
 
LVL 45

Accepted Solution

by:
Kdo earned 250 total points
ID: 16994430

Hi RussoMA,

You have a couple of options here.  (Moving 1/2 GB over a T1 is a pain, huh?)

1)  Do a redirected restore of the database into another instance on the vendor's system.  This simply creates a copy of the DB under another name.
2)  Create a Federated environment on your end and link to the new instance.  (IBM has lots of documentation on Federated Systems.  They are a lot like the Oracle LINKDB.)


Or, (and this is iffy, and probably a complete pain to implement):

1) You can create the instance on your system once to establish all of the proper names, links, permissions, grants, etc.
2) Use db2relocated to change the host directory of the instance to the directory on the vendor's system.


My preference would be option 1.  It's a lot less tenuous and offers greater down-the-road flexibility.


Good Luck,
Kent
0
 

Author Comment

by:RussoMA
ID: 16995296
ok, moving the file wasnt as big of a problem as what i originally imagined, takes < 20 minutes.  i was more concerned with moving it during business hours where excessive traffic wouldnt be allowed because the usage of bandwidth to that site is already at capacity most of the day.  so i'm just gonna write a script to copy the files to a local machine in the early morning hours while the site is not open.  here's where i'll need the assistance.

when i have the file, is there a way that i can automate the database process to stop, copy the new database, then when the file copy is complete, restart the database using the new database files.  

so questions are:  
will this cause permission issues, naming issues, etc that would need to be reset each day, or should the instance keep all the settings?

do the files need to be imported first in order to be used, or are they simply data files that will work upon restarting the database service?


i cannot install anything on the vendor machine, it was pulling teeth to even get a mirror copy of the db files available for our use.
0
 
LVL 45

Expert Comment

by:Kdo
ID: 16995401

Ok.  A third options arises.  :)  But it's a lot like the second.

At issue is what's in the .db file.  Does it contain only the tables and indexes for the target instance?  Only tables?  Does it contain the system tables?

Simply replacing a .db file with the one from the vendor runs the very real risk of a mismatch.  But the only way to know for sure is to try it.  :)  Dropping UDB, save the .db file, copy the vendor file over the .db file, and restart udb.


Then watch for fireworks.  :/

Kent
0
 

Author Comment

by:RussoMA
ID: 16995445
i guess i'd need to know how to import it first.

.db file (central.db) i have.

as i said earlier, i have an instance of DB2 Express-C (Viper) installed on the machine i want to act as the datasource (if i'm even doing this part right)

no databases defined.

so i need to know how to get that .db file to show up in the DB2 server.  (babysteps?)

0
 
LVL 45

Expert Comment

by:Kdo
ID: 16995581

This is beyond my actual experimentation so unless someone offers up a definitive solution we're going to learn together.  Except that my server isn't at risk.  ;)

This is a very unstable way to import a database.  My expectation is that the file contains either all of the system and user tables (the easiest) or just the user tables (most likely).

The user tables are defined in the system tables.  If this .db file contains only the user tables you'll need to define the database.  Can you get the DDL from the vendor?

Kent
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 16996029
What exactly is the .db file?  An table export?  A tablespace backup?  A database backup?  A datafile for a tablespace container?

- Keith
0
 

Author Comment

by:RussoMA
ID: 16996058
vendor = no help on supplying any info (took them 6 months just to create the share for the backup)  i am pretty sure though that it is the entire database backup.

i wont know till i try to import / mount the database what format it is... i just need directions on how to attempt any of these angles of approach
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 16997866
Hmph...

The name of the backup file (.db) is not something that I'm use to seeing to reference a backup file.  Usually it looks something like this:

dbname.0.instancename.NODE0000.CATN0000.20020331234149.001 (on linux, aix, etc)
   - or -
dbname.0\instancename\NODE0000\CATN0000\20020331\234149.001 (on windows)

The value of the number after dbname (0), would indicate what kind of backup it is (0 = full db, 3 = tablespace).  Based on the name, I don't think its a backup file.  So that leaves either an export or a datafile (container) for a DMS tablespace.  

An export file would be useful; we can just import (or load) that in.  But if it was a datafile, that may be a little tough (as Kdo indicated already).  But before we go that route, we should definitly try to find out more about this file.

- Keith
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:RussoMA
ID: 17000303
so if it is an export file, what would be the process?

like i said, i'm open to try anything since this is not an area of my expertise
0
 
LVL 45

Expert Comment

by:Kdo
ID: 17000344

Is your vendor cooperative enough to tell you what the file is and/or how it was generated?
0
 

Author Comment

by:RussoMA
ID: 17000362
no, you have to sit an hour on hold for their 'helpdesk' and then you talk to someone who knows nothing about the architecture, and then you never get a call back from a higher level engineer.
0
 
LVL 45

Expert Comment

by:Kdo
ID: 17000443

I'd skip the help desk and find someone important.

  :~}

But that's just me.
0
 

Author Comment

by:RussoMA
ID: 17000492
that's the problem we've had with this vendor for years... but their actual product is better than anything else on the market because it is so specialized.
0
 
LVL 45

Expert Comment

by:Kdo
ID: 17000647
Who's the vendor?
0
 
LVL 5

Assisted Solution

by:ocgstyles
ocgstyles earned 250 total points
ID: 17000649
Well, lets determine if its an export file...  

- Is the file readable in a text editor?  If so, what does it look like?  Is it a delimited file?
- If not readable, do you see anything like this on the first line?
      000051HIXF0002DB2
                  ^  I'm concerned with it saying IXF

If neither of those are true, its probably not a table export.  That leaves us with a data file.  And I don't think you can just attach a datafile to any old database.  There is metadata in a datafile that says what database it belongs to.  

- Keith
0
 

Author Comment

by:RussoMA
ID: 17050422
how about vendor giving misleading information... it's a Sybase 9.0.1.1751 database.  closing this issue, opening into sybase forum.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now