title: DB2 INCREMENTAL BACKUP RESTORY
body: <p><strong>We use IBM DB2 10.1 on Windows Server 2008 R2.</strong></p>
  
  <p>I try to test recovery plan for DB2.</p>
  
  <ol>
  <li>I create a new database</li>
  </ol>
  
  <p><em><code>CREATE DATABASE EAPOTEST AUTOMATIC STORAGE YES ALIAS EAPOBLOB</code></em></p>
  
  <ol start="2">
  <li>Craate BufferPool and Tablespace</li>
  </ol>
  
  <p><em><code>CREATE BUFFERPOOL "BufferPool32" IMMEDIATE ALL DBPARTITIONNUMS SIZE AUTOMATIC NUMBLOCKPAGES 0 PAGESIZE 32 K</code></em></p>
  
  <pre><code>CREATE REGULAR TABLESPACE "tablespace1"
  IN DATABASE PARTITION GROUP "IBMDEFAULTGROUP"
  PAGESIZE 32 K
  MANAGED BY AUTOMATIC STORAGE
  AUTORESIZE YES
  EXTENTSIZE 16
  PREFETCHSIZE 16
  BUFFERPOOL "BufferPool32"
  OVERHEAD 10.5
  TRANSFERRATE 0.14
  DATA TAG NONE
  USING STOGROUP "IBMSTOGROUP"
  FILE SYSTEM CACHING
  </code></pre>
  
  <ol start="3">
  <li>Create 2 simple tables.</li>
  </ol>
  
  <p><em><code>CREATE TABLE "DB2ADMIN"."ARTIFACT_FILE1" (
  "FILE_ID" DECIMAL(10 , 0) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( 
  START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 9999999999 NO CYCLE CACHE 20 NO ORDER ),"FILE_TYPE" VARCHAR(1) NOT NULL) 
  DATA CAPTURE NONE 
  IN "tablespace1" 
  COMPRESS NO</code></em></p>
  
  <pre><code>CREATE TABLE "DB2ADMIN"."EA_PACKAGE1" (
  "DOSSIER_NUMBER" VARCHAR(50) NOT NULL 
  )
  DATA CAPTURE NONE 
  IN "tablespace1"
  COMPRESS NO
  </code></pre>
  
  <ol start="3">
  <li>Add one row per table.</li>
  <li>Enable incremental backup</li>
  </ol>
  
  <p><em><code>UPDATE DATABASE CONFIGURATION FOR EAPOTEST USING TRACKMOD YES</code></em></p>
  
  <ol start="5">
  <li>Prepare full offline backup.</li>
  </ol>
  
  <p><em><code>BACKUP DATABASE EAPOTEST TO %DB_PATH_BACKUP% COMPRESS EXCLUDE LOGS WITHOUT PROMPTING</code></em> </p>
  
  <ol start="6">
  <li>After that, i have done some changes in the database, and taken the offline incremental backup.</li>
  </ol>
  
  <p><em><code>BACKUP DATABASE EAPOTEST INCREMENTAL TO %DB_PATH_BACKUP% COMPRESS EXCLUDE LOGS WITHOUT PROMPTING</code></em></p>
  
  <ol start="7">
  <li>Drop database.</li>
  </ol>
  
  <p><em><code>DROP DATABASE EAPOTEST</code></em></p>
  
  <ol start="8">
  <li>Restory full backup. <strong>Ok.</strong></li>
  </ol>
  
  <p><em><code>RESTORE DB EAPOTEST FROM "..." TAKEN AT ... REPLACE HISTORY FILE WITHOUT PROMPTING</code></em></p>
  
  <ol start="9">
  <li>Restory incremental backup. </li>
  </ol>
  
  <p><em><code>RESTORE DATABASE EAPOTEST INCREMENTAL FROM "..." TAKEN AT ... WITHOUT PROMPTING</code></em></p>
  
  <p><strong>The message is: SQL2540W  Восстановление успешно, однако при работе утилиты Database "2539".</strong></p>
  
  <p><strong>Dtabese is not accessable!</strong>
  When i try to connect:
  <strong>SQL1119N SQLSTATE=57019</strong></p>
  
  <p><strong>Is this feasible approach for backup and are steps we take to backup and restore adequate?</strong> </p>