在 DB2 中清除效能側寫資料

您可以清除效能側寫資料,以還原 DB2® 資料庫上的可用磁碟空間。

開始之前

您必須先在 IBM® Product Master中取消啟動側寫,然後才能清除效能側寫資料。

程序

  1. 執行下列指令來關閉系統:
    cd $TOP/bin/go
    ./abort_local.sh
    
  2. 執行下列指令,以資料庫使用者身分連接至 DB2 資料庫:
    db2 connect to db_Service_Name user db_userName using db_password
    其中 db_Service_Namedb_url 參數的最後一個值,而 db_userNamedb_passwordcommon.properties 檔案中的個別 db_userNamedb_password 參數。
  3. 執行 ddl_pfm_performance.sql SQL 指令,以捨棄並重建效能表格:
    db2 -tvf $TOP/src/db/schema/gen/ddl_pfm_performance.sql
  4. 執行 idx_pfm_performance.sql SQL 指令,以捨棄並重建效能表格上的索引:
    db2 -tvf $TOP/src/db/schema/gen/idx_pfm_performance.sql
  5. 執行下列指令來收集 runstats :
    cd $TOP/src/bin/db/
    ./analyze_schema.sh
    
  6. 執行下列指令來重新啟動系統:
    cd $TOP/bin/go
    ./start_local.sh