Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002

    Thumbs up Unanswered: Db2 - Linux/390 Shell Scripts

    Dear Friends -
    I am an Oracle guy and working with DB2 UDB 7.2 on Linux/390 in NY and Windows NT 4.0 workstation with DB2 Admin client in LA from where i am doing the Administration. Can any one tell me how to use/execute DB2 and SQL Scripts from Linux shell prompt? I am doing these from DB2 Control Center...but was asked to do thru Shell scripts. Where can i get some sample shell scripts for general DB2 activities like BACKUP, RESTORE, Generate DDL, DB2Move, EXPLAIN etc. I refered IBM manuals already....!!!
    Your help is highly appreciated

  2. #2
    Join Date
    May 2002
    Pune, India
    $ db2 "connect to sample"

    $ db2 "select * from syscat.tables"

    $ db2 "backup db sample "

    $ db2 "load from abc.del of del insert into abctab"

    All the above statements(and more!!) work when run from a command prompt(hence from shell script). Now I do not know how Linux looks on M/F (do you have a prompt interface or still using JCLs for your jobs ??)
    Here is small sample script. If you get the drift then you can add to it.

    db2 "connect to <db> user <username> using <password"
    db2 "select * from <schema>.<table>


Posting Permissions

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