• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 653
  • Last Modified:

Connection to a remote DB2 FILE (not server)

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
RussoMA
Asked:
RussoMA
  • 7
  • 6
  • 3
2 Solutions
 
Kent OlsenData Warehouse Architect / DBACommented:

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
 
RussoMAAuthor Commented:
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
 
Kent OlsenData Warehouse Architect / DBACommented:

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
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
RussoMAAuthor Commented:
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
 
Kent OlsenData Warehouse Architect / DBACommented:

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
 
ocgstylesCommented:
What exactly is the .db file?  An table export?  A tablespace backup?  A database backup?  A datafile for a tablespace container?

- Keith
0
 
RussoMAAuthor Commented:
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
 
ocgstylesCommented:
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
 
RussoMAAuthor Commented:
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
 
Kent OlsenData Warehouse Architect / DBACommented:

Is your vendor cooperative enough to tell you what the file is and/or how it was generated?
0
 
RussoMAAuthor Commented:
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
 
Kent OlsenData Warehouse Architect / DBACommented:

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

  :~}

But that's just me.
0
 
RussoMAAuthor Commented:
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
 
Kent OlsenData Warehouse Architect / DBACommented:
Who's the vendor?
0
 
ocgstylesCommented:
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
 
RussoMAAuthor Commented:
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

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 7
  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now