自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

DB2數(shù)據(jù)庫在實(shí)際操作中的一些實(shí)際應(yīng)用經(jīng)驗(yàn)總結(jié)

數(shù)據(jù)庫
以下的文章主要向大家描述的是DB2數(shù)據(jù)庫在實(shí)際操作中的一些實(shí)際應(yīng)用經(jīng)驗(yàn),以及對其在實(shí)際操作中的具體操作代碼的介紹。

我們今天主要向大家講述的是DB2數(shù)據(jù)庫在實(shí)際操作中的一些實(shí)際應(yīng)用經(jīng)驗(yàn),以及對其在實(shí)際操作中涉及到實(shí)際操作代碼的介紹,假如你對DB2數(shù)據(jù)庫在實(shí)際操作中的一些實(shí)際應(yīng)用經(jīng)驗(yàn)有興趣了解的話,你就可以通過以下的文章對其進(jìn)行了解。

 

建立數(shù)據(jù)庫DB2_GCB

 

  1. CREATEDATABASEDB2_GCBONG:ALIASDB2_GCB  
  2. USINGCODESETGBKTERRITORYCNCOLLATEUSINGSYSTEMDFT_EXTENT_SZ32  

 

連接數(shù)據(jù)庫

 

  1. connecttosample1userdb2adminusing8301206 

建立別名

 

  1. createaliasdb2admin.tablesforsysstat.tables;  
  2.  
  3. CREATEALIASDB2ADMIN.VIEWSFORSYSCAT.VIEWS  
  4.  
  5. createaliasdb2admin.columnsforsyscat.columns;  
  6.  
  7. createaliasguest.columnsforsyscat.columns;  

 

建立表

 

  1. createtablezjt_tablesas  
  2. (select*fromtables)definitiononly;  
  3. createtablezjt_viewsas  
  4. (select*fromviews)definitiononly;  

 

插入記錄

 

  1. insertintozjt_tablesselect*fromtables;  
  2. insertintozjt_viewsselect*fromviews;  

 

建立視圖

 

  1. createviewV_zjt_tablesasselecttabschema,tabnamefromzjt_tables; 

建立觸發(fā)器

 

  1. CREATETRIGGERzjt_tables_del  
  2. AFTERDELETEONzjt_tables  
  3. REFERENCINGOLDASO  
  4. FOREACHROWMODEDB2SQL  
  5. Insertintozjt_tables1values(substr(o.tabschema,1,8),substr(o.tabname,1,10))  

 

建立***性索引

 

  1. CREATEUNIQUEINDEXI_ztables_tabname  
  2. ONzjt_tables(tabname);  

 

查看表

 

  1. selecttabnamefromtables  
  2. wheretabname='ZJT_TABLES';  

 

查看列

 

  1. selectSUBSTR(COLNAME,1,20)as列名,TYPENAMEas類型,LENGTHas長度  
  2. fromcolumns  
  3. wheretabname='ZJT_TABLES';  

 

DB2數(shù)據(jù)庫查看表結(jié)構(gòu)下#p#

DB2數(shù)據(jù)庫查看表結(jié)構(gòu)接上

 

  1. db2describetableuser1.department  
  2. db2describeselect*fromuser.tables  

 

查看表的索引

 

  1. db2describeindexesfortableuser1.department 

查看視圖

 

  1. selectviewnamefromviews  
  2. whereviewname='V_ZJT_TABLES';  

 

查看索引

 

  1. selectindnamefromindexes  
  2. whereindname='I_ZTABLES_TABNAME';  

 

查看存貯過程

 

  1. SELECTSUBSTR(PROCSCHEMA,1,15),SUBSTR(PROCNAME,1,15)  
  2. FROMSYSCAT.PROCEDURES;  

 

類型轉(zhuǎn)換(cast)

 

  1. ipdatatype:varchar  
  2. selectcast(ipasinteger)+50fromlog_comm_failed  

 

重新連接

 

  1. connectreset 

DB2數(shù)據(jù)庫中斷數(shù)據(jù)庫連接

 

  1. disconnectdb2_gcb  
  2. viewapplication  
  3. LISTAPPLICATION;  
  4. killapplication  
  5. FORCEAPPLICATION(0);  

 

DB2forceapplicationsall(強(qiáng)迫所有應(yīng)用程序從數(shù)據(jù)庫斷開)

locktable

獨(dú)占

locktabletestinexclusivemode

共享

locktabletestinsharemode

顯示當(dāng)前用戶所有表

listtables

列出所有的系統(tǒng)表

listtablesforsystem

顯示當(dāng)前活動數(shù)據(jù)庫

listactivedatabases

查看命令選項(xiàng)

listcommandoptions

系統(tǒng)數(shù)據(jù)庫目錄

LISTDATABASEDIRECTORY

表空間

listtablespaces

表空間容器

 

  1. LISTTABLESPACECONTAINERSFOR  
  2. Example:LISTTABLESPACECONTAINERSFOR1  

 

顯示DB2數(shù)據(jù)庫用戶數(shù)據(jù)庫的存取權(quán)限

GETAUTHORIZATIONS

啟動實(shí)例

DB2START

停止實(shí)例

db2stop

表或視圖特權(quán)

 

  1. grantselect,delete,insert,updateontablestouser  
  2. grantallontablestouserWITHGRANTOPTION  

 

程序包特權(quán)

 

  1. GRANTEXECUTE  
  2. ONPACKAGEPACKAGE-name  
  3. TOPUBLIC  

 

以上的相關(guān)內(nèi)容就是對DB2數(shù)據(jù)庫的一些實(shí)際應(yīng)用經(jīng)驗(yàn)的介紹,望你能有所收獲。

【編輯推薦】

  1. DB2V8升級到DB2V95在AIX平臺上很簡單
  2. IBM DB2 Content Manager V83安裝與SQL0818
  3. DB2 For z/OS or OS/390性能如何正確管理?
  4. DB2 CMO安裝7.1.2.6補(bǔ)丁之后會出現(xiàn)什么?
  5. DB2 9.5分區(qū)管理以及其應(yīng)用實(shí)踐的詳細(xì)描述
     

 

責(zé)任編輯:佚名 來源: itmop
相關(guān)推薦

2010-08-12 09:41:06

DB2數(shù)據(jù)庫恢復(fù)

2010-08-03 13:56:11

DB2表復(fù)制

2010-08-12 09:25:22

DB2數(shù)據(jù)庫復(fù)原

2010-08-11 14:47:23

DB2數(shù)據(jù)庫

2010-08-03 09:49:58

DB2恢復(fù)數(shù)據(jù)庫

2010-08-12 09:06:30

DB2數(shù)據(jù)庫自動備份

2010-09-07 13:04:20

DB2數(shù)據(jù)庫

2010-07-29 08:40:16

DB2數(shù)據(jù)庫

2010-08-02 09:10:45

JDBC連接DB2

2010-08-03 09:32:19

DB2在線備份

2010-08-13 13:21:04

DB2數(shù)據(jù)庫臨時表

2010-08-05 09:33:31

DB2數(shù)據(jù)庫卸載

2010-08-18 09:18:10

DB2求剩余數(shù)據(jù)庫空間

2010-08-03 17:00:29

DB2 batch u

2010-08-05 13:10:11

DB2代碼

2010-07-30 14:38:25

DB2數(shù)據(jù)庫

2010-07-30 14:21:10

DB2數(shù)據(jù)集

2010-08-03 14:55:54

IBM DB2數(shù)據(jù)庫

2010-08-17 13:19:39

DB2數(shù)據(jù)庫備份

2010-07-27 09:59:32

DB2設(shè)計(jì)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號