If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Schema Backup & Restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-07, 18:57
ajikjose ajikjose is offline
Registered User
 
Join Date: Jan 2007
Posts: 6
Schema Backup & Restore

Platform : DB2 v9.1.0.356/ Windows 2000 Server

To backup Schema
db2look -d <Databasename> -e -o <outputfile.ddl>

To Restore

Run the outputfile.ddl in command editor.
Reply With Quote
  #2 (permalink)  
Old 01-31-07, 01:13
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
??
question or solution!!

with db2look you can generate ddl not the data
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 01-31-07, 08:21
jdey jdey is offline
Registered User
 
Join Date: Jan 2007
Posts: 1
Schema backup/restore

You can do this in 2 ways:-

Backup
=====
1. db2look -d $database -z $schema -e > schema.ddl
2. Export all of the tables to .del files

Restore
=====
1. db2 -tvf schema.ddl
2. Load nonrecoverable all of the .del files saved in step 2 above

or

1. Put all of the tables associated with the schema in to their own tablespace and use standard online tablespace backup and restores.

Method 2 is a lot quicker to restore the data to a previous state.
Reply With Quote
  #4 (permalink)  
Old 01-31-07, 09:56
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Not sure what your exact requirment is ...
But if you want to make a copy of all data and objects in a schema to another schema (say schema1 to schema1_bak) then ADMIN_COPY_SCHEMA procedure may help

http://publib.boulder.ibm.com/infoce...c/r0022035.htm

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 02-07-07, 09:58
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Good tech article on :
Backup and restore SQL schemas for DB2 Universal Database

http://www-128.ibm.com/developerwork...dm-0602rielau/
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On