473,513 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting all Data in a DB

Hi,

I have a big DB2 database and I need this database without any Data in
it for testing something. I have made a backup of these db and restore
it on a testing system. My Problem is now how can I delete all Data
because there are more than 500 tables in the db, it’s impossible to
delete all by hand.
I thought theres is another way to do this: only copy the structure of
the database into another DB, here is my problem how can I copy the
complete structure without data in it?

Maybe somebody has an idea about that.

Thanks

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/DB2-Deleting...ict162854.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=545377
Nov 12 '05 #1
4 3533
Hi,

Fughal wrote:
I thought theres is another way to do this: only copy the structure of
the database into another DB, here is my problem how can I copy the
complete structure without data in it?


You say it. Try

db2look -d $DBNAME -e -o outfile.ddl

This will create the file outfile.ddl with the database structure of
database $DBNAME.

You might want to try db2look -h to get more options (or go to the
information-center)

regards,

Norbert
Nov 12 '05 #2
If you only want the structure of the database, use db2look to generate it,
and then use the ddl from db2look to create the required tablespaces/tables
etc in your new database.

Cheers,

"Fughal" <Us************@dbForumz.com> wrote in message
news:41**********@alt.athenanews.com...
Hi,

I have a big DB2 database and I need this database without any Data in
it for testing something. I have made a backup of these db and restore
it on a testing system. My Problem is now how can I delete all Data
because there are more than 500 tables in the db, it's impossible to
delete all by hand.
I thought theres is another way to do this: only copy the structure of
the database into another DB, here is my problem how can I copy the
complete structure without data in it?

Maybe somebody has an idea about that.

Thanks

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/DB2-Deleting...ict162854.html
Visit Topic URL to contact author (reg. req'd). Report abuse:

http://www.dbForumz.com/eform.php?p=545377
Nov 12 '05 #3
"Fred Nurk" wrote:
If you only want the structure of the database, use db2look to
generate it,
and then use the ddl from db2look to create the required
tablespaces/tables
etc in your new database.

Cheers,

"Fughal" <Us************@dbForumz.com> wrote in message
news:41**********@alt.athenanews.com...
Hi,

I have a big DB2 database and I need this database without

any Data in
it for testing something. I have made a backup of these db

and restore
it on a testing system. My Problem is now how can I delete

all Data
because there are more than 500 tables in the db, it's

impossible to
delete all by hand.
I thought theres is another way to do this: only copy the

structure of
the database into another DB, here is my problem how can I

copy the
complete structure without data in it?

Maybe somebody has an idea about that.

Thanks

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet

standards
Topic URL: http://www.dbForumz.com/DB2-Deleting...ict162854.html
Visit Topic URL to contact author (reg. req'd). Report

abuse:
http://www.dbForumz.com/eform.php?p=545377


Thanks for the quick answer.

I created the structure with db2look, this works very well, and then I
create the ddl for the tables spaces´with option -l.
I create the new empty DB.
Now there is a new problem when I use the ddl for the table spaces I
get an error like these:

SQL0976N The diskette drive door is open. SQLSTATE=57021

for all table spaces.
I look into the manual and searched for an solution but the only
solution I found at the IBMs Website is, I should close my diskette
drive door. This is a big problem because my "diskette drive" is an
80GB hardisk i cant found any doors to close.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/DB2-Deleting...ict162854.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=546703
Nov 12 '05 #4
In article <41**********@alt.athenanews.com>, Fughal
(Us************@dbForumz.com) says...

Thanks for the quick answer.

I created the structure with db2look, this works very well, and then I
create the ddl for the tables spaces?with option -l.
I create the new empty DB.
Now there is a new problem when I use the ddl for the table spaces I
get an error like these:

SQL0976N The diskette drive door is open. SQLSTATE=57021


Do you have the same 'logical' disks on both systems? Maybe the
source system has more disks then your target system.
If your tablespaces are on one of those disks which on your target
system is a CD or DVD disk you might get this kind of error.
Nov 12 '05 #5

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

Similar topics

15
3576
by: Rick | last post by:
Hi, Does deleting an object more than one times incur undefined behavior? I think it doesn't but just making sure... thanks Rick
1
2380
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
13
9477
by: Bob Darlington | last post by:
I have a repair and backup database routine which runs when a user closes down my application. It works fine in my development machine, but breaks on a client's at the following line: If...
6
4545
by: Martin Bischoff | last post by:
Hi, I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123) to allow users to upload files. When I later delete these directories (from the code behind), the application...
2
1704
by: SiouxieQ | last post by:
Hi there, I'm using the code below to try to delete a name from a list of names in a file. Unfortunately it doesn't quite do what I want it to. Instead of looking for the name in the...
1
3098
by: Pat | last post by:
Hi all, I have a really awkward situation that is causing memory leak problems. I'm passing data to a driver, and unfortunately, the driver code is not something I can change, and it is written...
5
1486
by: NaziaAkter | last post by:
Hi EveryOne, I am having problem with deleting data form database after anyone have close the site. or any one have click the cancel button after entering data. I know the code for deleting data...
11
3650
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
1
1697
by: Kyosuke18 | last post by:
Hi everyone, I have a problem in deleting a data that is connected on the database.. I tried this code but it shows me an error: Run-time error '-2147217900(80040e14)': Syntax error in string in...
0
7267
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,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7120
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...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3247
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...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
466
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...

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.