Jcat
          寵辱不驚,閑看庭前花開花落~~
          posts - 173,comments - 67,trackbacks - 0
          列出所有實例
          [db2inst1@dcm ~]$ db2ilist
          db2inst1

          列出當前實例下的所有數據庫

          [db2inst1@dcm ~]$ db2 list db directory

          ?System Database Directory

          ?Number of entries in the directory = 1

          Database 1 entry:

          ?Database alias?????????????????????? = SAMPLE
          ?Database name??????????????????????? = SAMPLE
          ?Local database directory???????????? = /home/db2inst1
          ?Database release level?????????????? = d.00
          ?Comment????????????????????????????? =
          ?Directory entry type???????????????? = Indirect
          ?Catalog database partition number??? = 0
          ?Alternate server hostname??????????? =
          ?Alternate server port number???????? =

          啟動實例
          [db2inst1@dcm ~]$ db2start
          07/09/2010 14:24:36???? 0?? 0?? SQL1063N? DB2START processing was successful.
          SQL1063N? DB2START processing was successful.

          連接到數據庫
          [db2inst1@dcm ~]$ db2 connect to sample

          ?? Database Connection Information

          ?Database server??????? = DB2/LINUX 9.7.1
          ?SQL authorization ID?? = DB2INST1
          ?Local database alias?? = SAMPLE

          執行SQL
          [db2inst1@dcm ~]$ db2
          db2 => select * from staff where dept=20

          ID???? NAME????? DEPT?? JOB?? YEARS? SALARY??? COMM??? ?
          ------ --------- ------ ----- ------ --------- ---------
          ??? 10 Sanders?????? 20 Mgr??????? 7? 98357.50???????? -
          ??? 20 Pernal??????? 20 Sales????? 8? 78171.25??? 612.45
          ??? 80 James???????? 20 Clerk????? -? 43504.60??? 128.20
          ?? 190 Sneider?????? 20 Clerk????? 8? 34252.75??? 126.50

          ? 4 record(s) selected.

          退出
          db2 => quit
          DB20000I? The QUIT command completed successfully.

          斷開連接(不斷開就不能db2stop)
          [db2inst1@dcm ~]$ db2 connect reset
          DB20000I? The SQL command completed successfully.

          關閉實例
          [db2inst1@dcm ~]$ db2stop
          07/09/2010 14:29:32???? 0?? 0?? SQL1064N? DB2STOP processing was successful.
          SQL1064N? DB2STOP processing was successful.

          posted on 2010-07-09 14:32 Jcat 閱讀(260) 評論(0)  編輯  收藏 所屬分類: Database
          主站蜘蛛池模板: 宜兰市| 江北区| 丽水市| 长阳| 贵定县| 丰镇市| 东兰县| 苗栗市| 东至县| 信阳市| 城固县| 衡水市| 崇阳县| 于都县| 铅山县| 敦化市| 武夷山市| 台州市| 阿拉尔市| 峨眉山市| 修文县| 团风县| 保定市| 阿坝| 南康市| 调兵山市| 华亭县| 柳州市| 天台县| 盐津县| 阳城县| 孟州市| 马关县| 赞皇县| 友谊县| 莱西市| 大丰市| 柘荣县| 逊克县| 龙泉市| 南靖县|