Chapter 8. Building a corporate backup and recovery strategy 309
-- Select Blocks specifies customer table and output files
SELECT * FROM db2inst1.CUSTOMER;
OUTFILE("%{source_host}:/work%{source_node}/HPU/db2inst1.customer.file.%{
source_node}")FORMAT DEL
;
The LOAD command is issued to complete the recovery (Example 8-5).
Example 8-5 Sample control file to unload data from disk
db2 "LOAD from db2inst1.customer.file OF DEL INSERT
INTO db2inst1.CUSTOMER PARTITIONED DB CONFIG MODE LOAD_ONLY_VERIFY_PART
PART_FILE_LOCATION /work1/HPU OUTPUT_DBPARTNUMS(1,9)”
db2 "LOAD from db2inst1.customer.file OF DEL INSERT
INTO db2inst1.CUSTOMER PARTITIONED DB CONFIG MODE LOAD_ONLY_VERIFY_PART
PART_FILE_LOCATION /work2/HPU OUTPUT_DBPARTNUMS(2,10)”
-- Issue LOAD commands for all database partitions to be recovered
8.5.2 Recover dropped partitioned table using backup images on
TSM and named pipes
This scenario used Optim High Performance Unload to recover partitioned tables
from online table space backup images stored on TSM and, by using named
pipes, simultaneously loaded the data into the target database table.
The control file shown in Example 8-6 was created to use in unloading the table
from backup images on TSM for database partitions 1 and 9, which were the first
database partitions on each data node in the test environment. Because the
table had been dropped on the production database, the catalog on the catalog
backup image was referenced.
The table recovery steps are listed here:
1. Create the control file.
Each unload block processed two database partitions. Example 8-6 shows
the first two unload blocks for database partitions 1, 9 and 2, 10. The pattern
continued until all database partitions were processed.
Example 8-6 Sample control file to unload data from disk
-- Global block uses backup image of catalog on disk
GLOBAL USING BACKUP CATALOG CSTINSIGHT FROM "/work0/HPU/catalog_BACKUP"
TAKEN AT 2012033108;
310 Solving Operational Business Intelligence with InfoSphere Warehouse Advanced Edition
;
-- 1,9 specifies partitions 1 and 9
UNLOAD TABLESPACE PART(1,9)
USING BACKUP DATABASE CSTINSIGHT TABLESPACE ("FACT_TBSPC_2007") USE TSM ON
SOURCE HOST TAKEN AT 20120331080240;
SELECT * FROM GOSALESDW.CUSTOMER;
OUTFILE("%{source_host}:/work%{source_node}/HPU/pipe.%{source_node}")
FORMAT DEL
;
-- 2,10 specifies partitions 2 and 10 (continues to 8 and 16)
UNLOAD TABLESPACE PART(2,10)
USING BACKUP DATABASE CSTINSIGHT TABLESPACE ("FACT_TBSPC_2007") USE TSM ON
SOURCE HOST TAKEN AT 20120331084220;
SELECT * FROM GOSALESDW.CUSTOMER;
OUTFILE("%{source_host}:/work%{source_node}/HPU/pipe.%{source_node}")
FORMAT DEL
;
2. Create named pipes on each data node as specified in the control file.
The names in this example have the format /workN/HPU/pipe.XXX, where
XXX is the appropriate database logical node number.
The named pipes were created for the database partitions to be processed by
the unload block in the control file. Example 8-7 illustrates the commands
used to create the named pipes in the test environment.
Example 8-7 Sample control file to unload data from disk
-- Data Node 1
mkfifo /work1/HPU/pipe.001
mkfifo /work2/HPU/pipe.002
mkfifo /work3/HPU/pipe.003
mkfifo /work4/HPU/pipe.004
mkfifo /work5/HPU/pipe.005
mkfifo /work6/HPU/pipe.006
mkfifo /work7/HPU/pipe.007
mkfifo /work8/HPU/pipe.008
-- Data Node 2 (Symbolic links for /work1 to /work8 created)
mkfifo /work1/HPU/pipe.009
mkfifo /work2/HPU/pipe.010
mkfifo /work3/HPU/pipe.011
mkfifo /work4/HPU/pipe.012
mkfifo /work5/HPU/pipe.013
mkfifo /work6/HPU/pipe.014
mkfifo /work7/HPU/pipe.015
mkfifo /work8/HPU/pipe.016
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset