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 > Copy from one db to another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-06, 09:37
dhuygu dhuygu is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
Copy from one db to another

I have dbX on a server.I want to create a new database dbY in my local and I want to copy tables from dbX to my new database dbX with sql commands from a .net application. I couldnt write the sql command.Can anyone help me please?
Reply With Quote
  #2 (permalink)  
Old 09-19-06, 00:25
edeva001 edeva001 is offline
Registered User
 
Join Date: Aug 2006
Posts: 4
Wink Use Redirect Restore

Use Sql commands to redirect restore DB2 database or Export import

-kUmar
Reply With Quote
  #3 (permalink)  
Old 09-19-06, 02:14
dhuygu dhuygu is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
but backup and export commands are db2 commands.
I need standart sql commands to copy a tables of a database from .net application.
Reply With Quote
  #4 (permalink)  
Old 09-19-06, 04:17
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
if u are using v9,
u can use sysproc.admin_cmd procedure to export,import/load.
in v8, i think only export is available . plz check it

Rahul Singh
Reply With Quote
  #5 (permalink)  
Old 09-19-06, 08:01
dhuygu dhuygu is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
thank you.I'm using v8 and I can only use export.is it possible to use import in v8? or is there any other way to copy tables from exported files.
Reply With Quote
  #6 (permalink)  
Old 10-07-06, 00:15
manish21 manish21 is offline
Registered User
 
Join Date: Jan 2003
Posts: 35
Can anyone specify how the sysproc.admin_cmd procedure is to be used for import/export ?
Reply With Quote
  #7 (permalink)  
Old 10-07-06, 00:51
manish21 manish21 is offline
Registered User
 
Join Date: Jan 2003
Posts: 35
Got the execution of sysibm.admin_cmd proc at
http://publib.boulder.ibm.com/infoce...n/r0012547.htm

But I dont understand one thing. Why do we need to call this procedure with the entire syntaxof export , reorg, runstats or update db config when when we can run this commands directly at the db2 command prompt?
Reply With Quote
  #8 (permalink)  
Old 10-07-06, 02:52
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by manish21
Got the execution of sysibm.admin_cmd proc at
http://publib.boulder.ibm.com/infoce...n/r0012547.htm

But I dont understand one thing. Why do we need to call this procedure with the entire syntaxof export , reorg, runstats or update db config when when we can run this commands directly at the db2 command prompt?
The proc allows the DB2 commands (which are not SQL statements) to be run from inside an application program, stored proc, etc.

If you want to run the commands from the OS command prompt or a shell script, then the proc is obviously not necessary.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 10-07-06 at 12:16.
Reply With Quote
  #9 (permalink)  
Old 10-07-06, 06:38
manish21 manish21 is offline
Registered User
 
Join Date: Jan 2003
Posts: 35
Thanks Marcus
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