Discussion:
Schema name to be changed
(too old to reply)
v***@in.ibm.com
2007-10-11 10:21:23 UTC
Permalink
HI all,

I have a database with name qpdb and there are four tables under it.
All the four tables have instance as db2ins.

Now i want to take the backup of the database qpdb and restore the same database in another machine.

I am running the backup and restore scripts to do the job. But the restore script is restoring the database with the same instance as db2ins.
But as per the requirement i need to update the instance name to qpricer.

As per my thinking if i can update the instance of the tables before taking the backup, may help me to resolve the issue.
Can any one suggest how to update the instance of all the four table in one shot.Some sample script will help me to understand

If you can suggest some other solution then, it will be appreciated.

Thanks in advance.
Knut Stolze
2007-10-11 12:23:38 UTC
Permalink
Post by v***@in.ibm.com
HI all,
I have a database with name qpdb and there are four tables under it.
All the four tables have instance as db2ins.
Now i want to take the backup of the database qpdb and restore the same
database in another machine.
I am running the backup and restore scripts to do the job. But the restore
script is restoring the database with the same instance as db2ins. But as
per the requirement i need to update the instance name to qpricer.
As per my thinking if i can update the instance of the tables before
taking the backup, may help me to resolve the issue. Can any one suggest
how to update the instance of all the four table in one shot.Some sample
script will help me to understand
Backups just copy the physical database content and don't look at any
logical constructs like schema (I think that's what you refer to
with "instance"?).

What you can do is:
(1) Create a view over the tables in the desired schema.
(2) Create an alias for the tables in the new schema.
(3) Create the tables in the new schema and copy the data.
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
v***@in.ibm.com
2007-10-12 08:49:10 UTC
Permalink
Thanks for the reply.

Is there any command that can change the schema name of the table?
So that i can change the schema name of the tables before taking the backup.

Thanks in advance.
Knut Stolze
2007-10-12 15:50:37 UTC
Permalink
Post by v***@in.ibm.com
Thanks for the reply.
Is there any command that can change the schema name of the table?
So that i can change the schema name of the tables before taking the backup.
I gave the options you have to change the schema name of a table. Is there
anything else you expect?
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Loading...