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
          主站蜘蛛池模板: 通州区| 永福县| 邳州市| 六枝特区| 平远县| 临朐县| 时尚| 磐安县| 攀枝花市| 兴安盟| 乡城县| 门源| 集贤县| 德江县| 唐山市| 阜新市| 新化县| 南溪县| 防城港市| 耿马| 元朗区| 威信县| 衡东县| 全南县| 宝应县| 台南市| 四会市| 天台县| 肃宁县| 宽城| 潞西市| 龙游县| 寻甸| 漯河市| 中超| 武宁县| 绵竹市| 宁晋县| 尤溪县| 宜宾市| 石屏县|