473,789 Members | 3,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dump of a schema in DB2 / Admin_Copy_Sche ma

Hi,

I am very new to DB2, so please explain in somwhat detail.

How can i (can i ?) take the dump of a schema in DB2 like i can do in
Oracle?

Also, if i have to create a replica of a schema, i can use the
sysproc.admin_c opy_schema procedure.
But the problem is that the procedures/functions/views are
interdependent and the most of the functions/procedures will not get
formed due to its dependency over a function that was created later.

In Oracle, it's not a problem since even if the proc/func is not
compiled, it'll be created and later we can compile all the procs to
remove circular dependencies.

But seems DB2 is strict enough to not allow this.

please tell how can i sort this out.

Thanks a lot.

Rahul

Aug 11 '07 #1
4 4803
Rahul B wrote:
On Aug 11, 4:12 pm, Serge Rielau <srie...@ca.ibm .comwrote:
I already have a schema where many funcs/proc call the other funcs/
procs and views use some procedures. Hence, when the new schema is
created, the Errortable in Errorschema shows that these object
creations have failed with the reason code and i have to manually see
due to which function/proc that view is failing and create the
corresponding proc/function first.

The routines have the linear dependencies(an d not the circular once as
i referred earlier..apolog ies for that) but the function
Admin_Copy_Sche ma is not able to find out, which ones to compile
first.
That is certainly not as advertised and should be looked at. Can you
open a PMR?

I have written an article on backup/restore and copy schema on
developerWorks. If you send me an email I'll ping you back the latest
version of the DDL. It's AS IS of course, but it has been broken in, so
to speak...

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Aug 12 '07 #2
"Serge Rielau" <sr*****@ca.ibm .comwrote in message
news:5i******** *****@mid.indiv idual.net...
Mark I added the -td option to db2look myself in DB2 V7.2 to support SQL
functions. If you don't use it db2look will actually append a -- to each
line with a semicolon at least for triggers and functions.
(That should be changed to --#SET TERMINATOR)

Cheers
Serge
Thanks for that tip. I never noticed that in the doc.
Aug 12 '07 #3
On Aug 12, 8:53 am, "Mark A" <nob...@nowhere .comwrote:
"Serge Rielau" <srie...@ca.ibm .comwrote in message

news:5i******** *****@mid.indiv idual.net...
Mark I added the -td option to db2look myself in DB2 V7.2 to support SQL
functions. If you don't use it db2look will actually append a -- to each
line with a semicolon at least for triggers and functions.
(That should be changed to --#SET TERMINATOR)
Cheers
Serge

Thanks for that tip. I never noticed that in the doc.
Hi,

Can we take a dump/backup of a schema with the following db2move
command.

db2move <DB_NAMEexpor t -tc <SCHEMA_NAME>

It gives the ixfs of all the tables and db2look for the other db
objects.

Since you didn't suggest it, i assume that this will miss something.

What could be the problem with taking a dump like this.

Thanks again

Rahul

Aug 14 '07 #4
Rahul B wrote:
On Aug 12, 8:53 am, "Mark A" <nob...@nowhere .comwrote:
>"Serge Rielau" <srie...@ca.ibm .comwrote in message

news:5i******* ******@mid.indi vidual.net...
>>Mark I added the -td option to db2look myself in DB2 V7.2 to support SQL
functions. If you don't use it db2look will actually append a -- to each
line with a semicolon at least for triggers and functions.
(That should be changed to --#SET TERMINATOR)
Cheers
Serge
Thanks for that tip. I never noticed that in the doc.

Hi,

Can we take a dump/backup of a schema with the following db2move
command.

db2move <DB_NAMEexpor t -tc <SCHEMA_NAME>

It gives the ixfs of all the tables and db2look for the other db
objects.

Since you didn't suggest it, i assume that this will miss something.
I didn't suggest it because I assumed you want only the DDL.
Also the db2move "copy schema" facility is online (live FTP connection),
which I didn't associate with "dump".

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Aug 14 '07 #5

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

Similar topics

4
13295
by: Hoang | last post by:
does anyone know how to dump the table structure and data from a mysql database? I am connected to the database externally so "SELECT * FROM database INTO OUTFILE file" doesn't work for me. However, external tools have been able to do it (Mascon). I presume this might be a common thing where people need to backup their databases programatically from MySQLdb. Hoang Do http://jotsite.com
6
11250
by: Patrick Hatcher | last post by:
I have a development server where I, well, do my development. Occasionally, I will create a new schema within an existing database that I would like to use on my production machine. I know that doing a pg_dump -s <database> > somefile.sql will dump the entire schema of the database, but is there a way to export only schema X from the database? TIA Patrick Hatcher
2
1354
by: Russ Schneider | last post by:
I need to transfer a dump from a psql 7.3 database to a 7.2 database. Is there any way to do this? -- http://www.sugapablo.com <--music ] http://www.sugapablo.net <--personal ] sugapablo@12jabber.com <--jabber IM ]
1
9763
by: Victor Spång Arthursson | last post by:
Hi! Have a problem, probably easy to solve... I want to dump a database which resides on my local server with another, and not existing, owner than the one who actually owns it locally. The beginning of the dump file looks like: ######## \connect - postgres
2
2565
by: D. Dante Lorenso | last post by:
First I created a function that selected the next available pin code from a table of pre-defined pin codes: CREATE FUNCTION "public"."get_next_pin_code" () RETURNS varchar AS' DECLARE my_pin_code VARCHAR; BEGIN ... /* this is the pincode we just fetched */ RETURN (my_pin_code);
0
1824
by: Glenn Davy | last post by:
Hi all Is there a command like backup ( or an option to backup) I can execute from osql to simply dump out a schema (a bit like pg_dump --schema-only in postgres). I'm sure there must be something, but its eluding me? Glenn
0
1299
by: Rahul B | last post by:
Hi, I have a table where one of the columns is automatically generated as a substring of values of some other column. When i create a copy of that schema using sysproc.admin_copy_schema, the table goes in pending state, because the data in the table was inserted fully and the column was not automatically generated(i think this is the reason). I tried to get it out of pending state by issuing "SET
0
1074
by: holdingbe | last post by:
Hi all, I have exported dump for one schema.the dump size is 1GB.now i want to spilt the dump and import into other schema.for example spilt into like 500 mb and 500mb.imported into first 500mb and then 500mb into other schema.i need time consumpation.....so that only i arise this question
2
7340
by: clearissues | last post by:
Hi All, I have a python script which takes dump of postgres and restores the same. When i take a dump there is no problem. command to take dump: pg_dump -b -c -C --format=c -d -h <<hostname>> -p 5432 -U postuser -f /tmp/april_23/abc.sql abc Restore command: pg_restore -c --format=c -h <<hostname>> -p 5432 -U postuser -d sfdb /tmp/april_23/abc.sql
0
9665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.