473,215 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,215 software developers and data experts.

Restoring a database to a test system, handling schema differences

I've got a database backup from another system which I'd like to restore
to a test system. Both the backup and restore systems are Solaris 8. I
don't recall the DB2 version, but I do know that the backup and restore
versions match. If it matters, I'm only accessing this db via the UNIX
command line, and then programmatically via JDBC (by an app that does
all the actual queries and updates).

I do not have access to the original system.

The problem I'm having is that the tables are being created attached to
a schema that does not exist on my test system. This is probably due to
the fact that the instance names are different. That is, the table is
started and altered by a "userid1" user, so table foo is accessed via
USERID1.FOO. Of course, the default instance or userid I'm testing with
is something like "clvrmnky", so the default tables are never found.

Is there a way to change the problem table schema to something else on
restore? Can this be changed in the backup image?

Should I just create a new instance name that matches the schema?

Should I just alter every single table so that it is essentially moved
to the a new schema I create?

I looked a bit into a redirected restore, but this seems to concern
itself more with the locations of tablespaces. This does not seem to be
my problem.

--
cm
Nov 12 '05 #1
6 3606
On 19/04/2004 6:00 PM, clvrmnky wrote:
I've got a database backup from another system which I'd like to restore
to a test system. Both the backup and restore systems are Solaris 8. I
don't recall the DB2 version, but I do know that the backup and restore
versions match. If it matters, I'm only accessing this db via the UNIX
command line, and then programmatically via JDBC (by an app that does
all the actual queries and updates).

I do not have access to the original system.

The problem I'm having is that the tables are being created attached to
a schema that does not exist on my test system. This is probably due to
the fact that the instance names are different. That is, the table is
started and altered by a "userid1" user, so table foo is accessed via
USERID1.FOO. Of course, the default instance or userid I'm testing with
is something like "clvrmnky", so the default tables are never found.

[...]
Note to self: just create aliases to the tables in question with the
"correct" schema name. Feeding "db2 create alias ..." a list of tables
in a shell script loop did the trick.
Nov 12 '05 #2
On 19/04/2004 6:00 PM, clvrmnky wrote:
I've got a database backup from another system which I'd like to restore
to a test system. Both the backup and restore systems are Solaris 8. I
don't recall the DB2 version, but I do know that the backup and restore
versions match. If it matters, I'm only accessing this db via the UNIX
command line, and then programmatically via JDBC (by an app that does
all the actual queries and updates).

I do not have access to the original system.

The problem I'm having is that the tables are being created attached to
a schema that does not exist on my test system. This is probably due to
the fact that the instance names are different. That is, the table is
started and altered by a "userid1" user, so table foo is accessed via
USERID1.FOO. Of course, the default instance or userid I'm testing with
is something like "clvrmnky", so the default tables are never found.

[...]
Note to self: just create aliases to the tables in question with the
"correct" schema name. Feeding "db2 create alias ..." a list of tables
in a shell script loop did the trick.
Nov 12 '05 #3
Ian
clvrmnky wrote:
On 19/04/2004 6:00 PM, clvrmnky wrote:
I've got a database backup from another system which I'd like to
restore to a test system. Both the backup and restore systems are
Solaris 8. I don't recall the DB2 version, but I do know that the
backup and restore versions match. If it matters, I'm only accessing
this db via the UNIX command line, and then programmatically via JDBC
(by an app that does all the actual queries and updates).

I do not have access to the original system.

The problem I'm having is that the tables are being created attached
to a schema that does not exist on my test system. This is probably
due to the fact that the instance names are different. That is, the
table is started and altered by a "userid1" user, so table foo is
accessed via USERID1.FOO. Of course, the default instance or userid
I'm testing with is something like "clvrmnky", so the default tables
are never found.

[...]
Note to self: just create aliases to the tables in question with the
"correct" schema name. Feeding "db2 create alias ..." a list of tables
in a shell script loop did the trick.


Or, write your queries to use fully qualified table names. As in,
'select * from userid1.foo' instead of 'select * from foo'

Good luck,


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #4
Ian
clvrmnky wrote:
On 19/04/2004 6:00 PM, clvrmnky wrote:
I've got a database backup from another system which I'd like to
restore to a test system. Both the backup and restore systems are
Solaris 8. I don't recall the DB2 version, but I do know that the
backup and restore versions match. If it matters, I'm only accessing
this db via the UNIX command line, and then programmatically via JDBC
(by an app that does all the actual queries and updates).

I do not have access to the original system.

The problem I'm having is that the tables are being created attached
to a schema that does not exist on my test system. This is probably
due to the fact that the instance names are different. That is, the
table is started and altered by a "userid1" user, so table foo is
accessed via USERID1.FOO. Of course, the default instance or userid
I'm testing with is something like "clvrmnky", so the default tables
are never found.

[...]
Note to self: just create aliases to the tables in question with the
"correct" schema name. Feeding "db2 create alias ..." a list of tables
in a shell script loop did the trick.


Or, write your queries to use fully qualified table names. As in,
'select * from userid1.foo' instead of 'select * from foo'

Good luck,


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #5
Another option, which works in the CLP ('db2') at least: After connecting
to the db, issue the following command:

[ db2 ] set schema userid1

Regards,
-steve p.
-------------------
Steve Pearson
DB2 UDB Development
Portland, OR, USA
Nov 12 '05 #6
Another option, which works in the CLP ('db2') at least: After connecting
to the db, issue the following command:

[ db2 ] set schema userid1

Regards,
-steve p.
-------------------
Steve Pearson
DB2 UDB Development
Portland, OR, USA
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin Hart | last post by:
Hi, postgresql 7.4beta4 on linux and postgresql 7.3.4 on linux We have a database that we routinely backup using "pg_dump -a" We have to do this (dump the data only) because of various...
0
by: clvrmnky | last post by:
I've got a database backup from another system which I'd like to restore to a test system. Both the backup and restore systems are Solaris 8. I don't recall the DB2 version, but I do know that...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
4
by: m96 | last post by:
hi, i'm trying to make a query to a ldap server (version v2 or v3 doen't matter) with c#. the query works just fine but the problem is that i can't read the custom attributes/fields, since .net...
2
by: Fischer Ulrich | last post by:
Hi I have a problem with the restoring of a database which uses tsearch2. I made a backup as discribed in 'tsearch-v2-intro' on the tsearch2 page. Now i'm trying to restore it into a...
1
by: Robbert van Geldrop | last post by:
Hello, I have a problem restoring Exchange 2000 files. Our software has an interface to ESEBCLI2.dll for online backup and restore features. Everything works fine with Exchange 2003 and also...
1
by: aj | last post by:
DB2 LUW 8.2 FP14 Red Hat AS 2.1 I went to restore a backup of my production DB on my test/developmental server. The backup on the prod system was taken /before/ alt_obj() was used there to do...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
17
by: darien.watkins | last post by:
Kindof a poll, kindof curiosity... What is your favorite python - database combination? I'm looking to make an app that has a local DB and a server side DB. I'm looking at python and sqlite...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.