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 閱讀(258) 評論(0)  編輯  收藏 所屬分類: Database
          主站蜘蛛池模板: 怀来县| 临泽县| 青神县| 桑植县| 四子王旗| 涟源市| 共和县| 丹凤县| 曲麻莱县| 阳曲县| 宕昌县| 聂拉木县| 库尔勒市| 德江县| 定安县| 锡林浩特市| 连城县| 云南省| 辉县市| 台北县| 阳朔县| 富蕴县| 金溪县| 公安县| 镇赉县| 永春县| 湘阴县| 岗巴县| 怀仁县| 大洼县| 郎溪县| 阜南县| 定陶县| 东莞市| 茶陵县| 莒南县| 满洲里市| 磴口县| 赫章县| 梧州市| 松原市|