<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    飛舞的幻想

    常用鏈接

    統計

    Google Adsense

    Zanox FWHX

    花個明白

    最新評論

    2010年1月29日 #

    DB2 時間轉換

    create function ts_fmt(TS timestamp, fmt varchar(20)) returns varchar(50) return with tmp (dd,mm,yyyy,hh,mi,ss,nnnnnn) as ( select substr( digits (day(TS)),9), substr( digits (month(TS)),9) , rtrim(char(year(TS))) , substr( digits (hour(TS)),9), substr( digits (minute(TS)),9), substr( digits (second(TS)),9), rtrim(char(microsecond(TS))) from sysibm.sysdummy1 ) select case fmt when 'yyyymmdd' then yyyy || mm || dd when 'mm/dd/yyyy' then mm || '/' || dd || '/' || yyyy when 'yyyy/dd/mm hh:mi:ss' then yyyy || '/' || mm || '/' || dd || ' ' || hh || ':' || mi || ':' || ss when 'nnnnnn' then nnnnnn else 'date format ' || coalesce(fmt,' ') || ' not recognized.' end from tmp 使用例句: update t_attachment as a set a.attach_path=(select '/'||rtrim(char(apply_com_id))||'/'||rtrim(char(ts_fmt(apply_date,'yyyymmdd')))||'/' from t_rmbs_claim as c where a.claim_id=c.claim_id)||rtrim(a.attach_path) where exists (select 1 from t_rmbs_claim as tc where tc.claim_id=a.claim_id);

    posted @ 2010-03-05 18:18 飛舞的幻想 閱讀(276) | 評論 (0)編輯 收藏

    DB2 restore Redirect

    (1)db2 restore db EFINANCE incremental from /db2/eFinance091228  taken at 200912282115 on /db2/eFinanceWJ28 into EFINAN28 logtarget /db2/eFinanceWJ28 redirect generate script  restore.clp
    說明:EFINANCE 為備份前的數據庫名稱  EFINAN28 為回復后的數據庫名稱 /db2/eFinance091228備份文件存放的路徑  /db2/eFinanceWJ28為還原后日志存放路徑以及還原后數據庫文件路徑。

    (2)db2 -tvf  restore.clp
    如果需要重新指定表空間的路徑請修改該文件
    該文件內容如下:
    -- *****************************************************************************
    -- ** automatically created redirect restore script
    -- *****************************************************************************
    UPDATE COMMAND OPTIONS USING S ON Z ON EFINANCE_NODE0000.out V ON;
    SET CLIENT ATTACH_DBPARTITIONNUM  0;
    SET CLIENT CONNECT_DBPARTITIONNUM 0;
    -- *****************************************************************************
    -- ** automatically created redirect restore script
    -- *****************************************************************************
    RESTORE DATABASE EFINANCE
    -- USER  <username>
    -- USING '<password>'
    FROM '/db2/eFinance091228'
    TAKEN AT 20091228211504
    ON '/db2/eFinanceWJ28'
    DBPATH ON '/db2/eFinanceWJ28'
    INTO EFINAN28
    LOGTARGET '/db2/eFinanceWJ28/'
    -- NEWLOGPATH '/ef/appinst/appinst/NODE0000/SQL00002/SQLOGDIR/'
    -- WITH <num-buff> BUFFERS
    -- BUFFER <buffer-size>
    -- REPLACE HISTORY FILE
    -- REPLACE EXISTING
    REDIRECT
    -- PARALLELISM <n>
    -- WITHOUT ROLLING FORWARD
    -- WITHOUT PROMPTING
    ;
    -- *****************************************************************************
    -- ** table space definition
    -- *****************************************************************************
    -- *****************************************************************************
    -- ** Tablespace name                            = SYSCATSPACE
    -- **   Tablespace ID                            = 0
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Regular table space.   
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 4
    -- **   Using automatic storage                  = Yes    
    -- **   Auto-resize enabled                      = Yes    
    -- **   Total number of pages                    = 24576
    -- **   Number of usable pages                   = 24572
    -- **   High water mark (pages)                  = 21080
    -- *****************************************************************************
    -- *****************************************************************************
    -- ** Tablespace name                            = TEMPSPACE1
    -- **   Tablespace ID                            = 1
    -- **   Tablespace Type                          = System managed space                       
    -- **   Tablespace Content Type                  = System Temporary data                      
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = Yes    
    -- **   Total number of pages                    = 1
    -- *****************************************************************************
    -- *****************************************************************************
    -- ** Tablespace name                            = USERSPACE1
    -- **   Tablespace ID                            = 2
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 16384
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 1310720
    -- **   Number of usable pages                   = 1310688
    -- **   High water mark (pages)                  = 886976
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 2
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/USERSPACE1'                                 1310720
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = TBS_DATA32K
    -- **   Tablespace ID                            = 3
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 32768
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 327680
    -- **   Number of usable pages                   = 327648
    -- **   High water mark (pages)                  = 9856
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 3
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/TBS_DATA32K'                                 327680
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = TBS_DATA4K
    -- **   Tablespace ID                            = 4
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 2621440
    -- **   Number of usable pages                   = 2621408
    -- **   High water mark (pages)                  = 25440
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 4
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/TBS_DATA4K'                                 2621440
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = TBS_IDX4K
    -- **   Tablespace ID                            = 5
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 2621440
    -- **   Number of usable pages                   = 2621408
    -- **   High water mark (pages)                  = 96
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 5
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/TBS_IDX4K'                                  2621440
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = CMCC_DATA
    -- **   Tablespace ID                            = 6
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 16384
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 655360
    -- **   Number of usable pages                   = 655328
    -- **   High water mark (pages)                  = 32736
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 6
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/CMCC_DATA'                                   655360
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = CMCC_DATA32
    -- **   Tablespace ID                            = 7
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 32768
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 327680
    -- **   Number of usable pages                   = 327648
    -- **   High water mark (pages)                  = 22496
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 7
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/CMCC_DATA32'                                 327680
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = TBS_IDX01
    -- **   Tablespace ID                            = 8
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 2621440
    -- **   Number of usable pages                   = 2621408
    -- **   High water mark (pages)                  = 274176
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 8
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/TBS_IDX01'                                  2621440
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = DMS_TMP_32K
    -- **   Tablespace ID                            = 9
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = System Temporary data                      
    -- **   Tablespace Page size (bytes)             = 32768
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 327680
    -- **   Number of usable pages                   = 327648
    -- **   High water mark (pages)                  = 64
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 9
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/DMS_TMP_32K'                                 327680
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = SYSTOOLSPACE
    -- **   Tablespace ID                            = 10
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 4
    -- **   Using automatic storage                  = Yes    
    -- **   Auto-resize enabled                      = Yes    
    -- **   Total number of pages                    = 8192
    -- **   Number of usable pages                   = 8188
    -- **   High water mark (pages)                  = 1512
    -- *****************************************************************************
    -- *****************************************************************************
    -- ** Tablespace name                            = SYSTOOLSTMPSPACE
    -- **   Tablespace ID                            = 11
    -- **   Tablespace Type                          = System managed space                       
    -- **   Tablespace Content Type                  = User Temporary data                        
    -- **   Tablespace Page size (bytes)             = 4096
    -- **   Tablespace Extent size (pages)           = 4
    -- **   Using automatic storage                  = Yes    
    -- **   Total number of pages                    = 1
    -- *****************************************************************************
    -- *****************************************************************************
    -- ** Tablespace name                            = EF_ENGINE_16K
    -- **   Tablespace ID                            = 12
    -- **   Tablespace Type                          = Database managed space                     
    -- **   Tablespace Content Type                  = All permanent data. Large table space.     
    -- **   Tablespace Page size (bytes)             = 16384
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Auto-resize enabled                      = No     
    -- **   Total number of pages                    = 655360
    -- **   Number of usable pages                   = 655328
    -- **   High water mark (pages)                  = 96
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 12
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    FILE   '/db2/eFinanTS28/eFinance/EF_ENGINE_16K'                               655360
    );
    -- *****************************************************************************
    -- ** Tablespace name                            = TEMPSPACE16k
    -- **   Tablespace ID                            = 13
    -- **   Tablespace Type                          = System managed space                       
    -- **   Tablespace Content Type                  = System Temporary data                      
    -- **   Tablespace Page size (bytes)             = 16384
    -- **   Tablespace Extent size (pages)           = 32
    -- **   Using automatic storage                  = No     
    -- **   Total number of pages                    = 1
    -- *****************************************************************************
    SET TABLESPACE CONTAINERS FOR 13
    -- IGNORE ROLLFORWARD CONTAINER OPERATIONS
    USING (
    PATH   '/db2/eFinanTS28/eFinance/C0000016k.TMP'
    );
    -- *****************************************************************************
    -- ** start redirected restore
    -- *****************************************************************************
    RESTORE DATABASE EFINANCE CONTINUE;
    -- *****************************************************************************
    -- ** end of file
    -- *****************************************************************************



    (3)db2 rollforward database EFINAN28 to end of logs and complete  overflow log path '(/db2/eFinanceWJ28)'
    說明:EFINAN28 為還原的數據庫名稱 /db2/eFinanceWJ28為日志存放路徑 注意 日志一定要全 即要包括回復的當天的全部log文件。

    posted @ 2010-01-29 14:05 飛舞的幻想 閱讀(1684) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 久久久久亚洲精品无码网址色欲| 成年女人免费视频播放体验区| 精品国产免费人成电影在线观看| 中文字幕无码精品亚洲资源网| 亚洲精品精华液一区二区| 免费无码又爽又刺激聊天APP| 亚洲日韩中文字幕天堂不卡| 毛片免费全部播放无码| 亚洲av乱码一区二区三区香蕉 | 狠狠亚洲婷婷综合色香五月排名| 午夜免费国产体验区免费的| 亚洲一区无码精品色| GOGOGO免费观看国语| 亚洲动漫精品无码av天堂| 久草福利资源网站免费| 久久亚洲AV成人无码软件| 免费v片在线观看视频网站| 国产精品亚洲精品观看不卡| 免费观看美女裸体网站| 免费国产高清毛不卡片基地 | 日韩a级毛片免费观看| 美女黄频a美女大全免费皮| 久久久久无码专区亚洲av| 麻豆精品成人免费国产片| 亚洲欧洲在线播放| 高清国语自产拍免费视频国产| 暖暖免费中文在线日本| 亚洲精品综合一二三区在线| 国产麻豆视频免费观看| 亚洲AV无码一区二区一二区| 亚洲一区二区视频在线观看| 亚洲成人免费在线| 亚洲日本VA午夜在线电影| 亚洲成av人在片观看| 免费不卡在线观看AV| 亚洲AV无码片一区二区三区| 永久亚洲成a人片777777| 免费在线观看视频网站| 永久免费无码网站在线观看个| 亚洲午夜视频在线观看| 日美韩电影免费看|