Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2006
    Posts
    20

    Unanswered: 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?

  2. #2
    Join Date
    Aug 2006
    Posts
    4

    Wink Use Redirect Restore

    Use Sql commands to redirect restore DB2 database or Export import

    -kUmar

  3. #3
    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.

  4. #4
    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

  5. #5
    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.

  6. #6
    Join Date
    Jan 2003
    Posts
    35
    Can anyone specify how the sysproc.admin_cmd procedure is to be used for import/export ?

  7. #7
    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?

  8. #8
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.
    Last edited by Marcus_A; 10-07-06 at 13:16.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  9. #9
    Join Date
    Jan 2003
    Posts
    35
    Thanks Marcus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •