DBA 管理技巧

    Tables 管理

    執行 SQL 時顯示開始與結束時間
    reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)
    快速產生所有資料表的 runstats 腳本
    db2 -x "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,35),'with distribution and detailed indexes all allow write access;'from syscat.tables where type = 'T' and tabschema not in ('SYSIBM','ASN')" > runstats_all.sql
    
    大量匯出/匯入資料表

    Tablespace = TB1

    reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)
    reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)
    取得所有 Tables Name
    reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)

    TIP:

    已排除系統相關的 Tables。

    統計 Table 的使用容量
    reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)

    TIP:

    Table 必須先經過 runstats 後,統計後的數值才會正確。

    已排除系統用的 Table。

    Tablespaces 管理

    新增多個 auto resized Tablespace
    CREATE REGULAR TABLESPACE RPTTBS9 IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 8192 MANAGED BY DATABASE
             USING (FILE '/home/STORAGE/devrpt/DEVRPTDB/rpttbs9-c1' 1024 M,
                    FILE '/home/STORAGE/devrpt/DEVRPTDB/rpttbs9-c2' 1024 M)
             AUTORESIZE YES MAXSIZE 51200 M
             EXTENTSIZE 32
             PREFETCHSIZE AUTOMATIC
             BUFFERPOOL RPT8KBP1
             OVERHEAD 12.670000
             TRANSFERRATE 0.180000
             FILE SYSTEM CACHING
             DROPPED TABLE RECOVERY ON;
    

    TIP:

    AUTORESIZE YES MAXSIZE 51200 M ,每個 data file 可以自動擴充至 50GB

    用戶端連線設定(Catalog)的匯出/匯入

    • db2cfexp 匯出
    • db2cfimp 匯入
    標籤 (Edit tags)
    • No tags
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core