37
® IBM Software Group © 2005 IBM Corporation © IBM Corporation 2004 Informix Table Level Point in Time Restore for IDS and XPS John F. Miller III

® IBM Software Group © 2005 IBM Corporation © IBM Corporation 2004 Informix Table Level Point in Time Restore for IDS and XPS John F. Miller III

Embed Size (px)

Citation preview

®

IBM Software Group

© 2005 IBM Corporation© IBM Corporation 2004

Informix Table Level Point in Time Restore for IDS and XPS

John F. Miller III

IBM Software Group

2

Agenda

What is Table Level Point in Time Restore (TLPITR)

Syntax and Semantics

Content Release Phases

TLPITR Testing

IBM Software Group

3

TLPITR

Provide the customer with the ability to easily extract a set of tables, a table or a portion of a table from a level 0 archive to a user specified point in time.

The extracted data can be placed in an external table or on a table on the server of the user’s choice regardless of server version or machine type as long as the database server is listed in the sqlhost file.

IBM Software Group

4

Benefits

Extract a table or set of tables

Filter the retrieved data

Retrieve just a subset of columns

Repartition the data

Data may be placed in the same version database or on a different database version with a different machine architecture

IBM Software Group

5

Agenda

What is Table Level Point in Time Restore (TLPITR)

Syntax and Semantics

Content Release Phases

TLPITR Testing

IBM Software Group

6

System Overview

schema command file

schema command file

archecker AC_CONFIG

file

archecker AC_CONFIG

file

ixbar file

ixbar file

archecker DatabaseDatabase

AC_MSGPATH file(AC_CONFIG

parameter)

AC_MSGPATH file(AC_CONFIG

parameter)

IBM Software Group

7

Schema Command File

Database

Insert into … Select

Create table

Set

Restore

SQL comments

IBM Software Group

8

Database Statement

Set the current database statement

All table names referenced following the database statement are associated with the current database unless fully qualified

DATABASE <dbname> [LOG MODE ANSI]

IBM Software Group

9

Create Table Statement

The full create table syntax is supported

This statement is used to specify both target and source tables

Source Table A table that is on the archive backup

Target Table The destination table, where the data should be placed

IBM Software Group

10

Source Table

A table that is on the archive backup

For each source table you mustspecify the storage options. The dbspace names in the fragmentation clause used to find

the table’s data

The exact fragmentation schema is not required

Exact column layout is required Column types and locations must be exact

Not able to be completely verify column layout

IBM Software Group

11

Target Table

If the target table exists then data is appended

If the target does not exist then the table is created All attributes specified in

the schema file will be utilized

IBM Software Group

12

External Table

Used to specify a pipe or OS file as the location of the physical portion of the restore

CREATE EXTERNAL TABLE …. USING (‘<filename>’, ‘<format>’);

Format INFORMIX or (ASCII) DELIMITED

Logical restore does not happen

IBM Software Group

13

Insert into Select From Statement

Only a subset of the insert/select syntax is supported

One table retrieved per statement

Each statement requires a separate connection to the database

A source table may only be extracted once per restore no multi-siting A table name may only exist once as a source table

IBM Software Group

14

Insert into Select From Statement

Feature Supported Unsupported

Insert table 1. fully qualified table name 1. views2. synonyms

Insert columns

1. column names 1. column aliases2. constants

Select columns

1. column name2. projection list3. all columns ‘*’

1. subscripting2. column aliases3. constants4. aggregate5. expressions6. stored procedures

From Clause 1. single table 1. views2. multiple tables3. synonyms

IBM Software Group

15

Insert into Select From Statement (cont’ed)

Feature Supported UnSupported

Where Clause

1.Equal, Not Equal ( =, ==, <> )

2.Less than, Less than equal to 3.Greater than, Greater than

equal to4.Match, Not Match, Like, Not

Like5.IS NULL, NOT NULL6.AND7.OR8.TODAY/CURRENT

JoinsSubqueriesFunctionsProceduresMath Expr.

Having Clause

All Parts

Group By All Parts

Into Temp All Parts

Order by All Parts

Union All Parts

IBM Software Group

16

Set Statement

COMMIT TO Sets the number of records to insert

before committing

SET COMMIT TO <number>

Default to 1000

WORKSPACE TO <dbspace,….> Directs temporary tables and indexes to

the dbspaces listed

IBM Software Group

17

Restore Command

Defines point in time to restore data to

Defines if logical recovery should occur

Default is RESTORE TO CURRENT

RESTORE [ TO <timestamp> | CURRENT] [ WITH NO LOG ]

Drops and Truncate Tables stops recovery

IBM Software Group

18

Archecker Config File

Set the existing environment variable AC_CONFIG to the relative or full path name of the configuration file

If ONCONFIG is set correctly, those values will be used as defaults.

AC_MSGPATH /tmp/ac.log # Archecker message logAC_STORAGE /tmp # Directory used for temp storageAC_VERBOSE 1 # 1 verbose 0 terse messages

AC_IXBAR /tmp/ixbar # Path to ixbar fileAC_TAPEBLOCK 32 # Blocksize in KBAC_SCHEMA schcmd.txt # Schema command file

IBM Software Group

19

Archecker Command Line

Start archecker in TLPITR mode w/ schema file archecker –bsv –f {schema cmd file}

Start archecker in TLR mode

archecker –bvsX

t Use ontape interface

b Use onbar interface

s Print information to the screen

v Verbose

f Schema command file, implies X

X Table Level unloads

IBM Software Group

20

Example Screen Outputarchecker -bvs -f schema_cmd.txt

AC_STORAGE /tmp

AC_MSGPATH /tmp/ac.log

AC_VERBOSE on

AC_TAPEBLOCK32

AC_PAGESIZE 4096

AC_IXBAR /vobs/tristarm/sqldist/etc/Bixbar_olympia.85

Extracting table dbs:source_table into dbs1:target_table

Scan PASSED

Control page checks PASSED

Table checks PASSED

Table extraction commands 1

Tables/fragments found on archive 1

LOADED: dbms1:m_frag_new produced 2008 rows.

IBM Software Group

21

Recovery of Lost Table

Extracts a table called test1:tlr from the most recent backup of dbspace1 and places the data in table test1:tlr

database test1;create table tlr (

a_serial serial, b_integer integer, c_char char(20), d_decimal decimal, ) in dbspace1;

insert into tlr select * from tlr;

IBM Software Group

22

Restoring from a Previous Backup

Extracts a table called test1:tlr from the level 0 backup of dbspace1 just prior “2003-01-01 01:01:01” and places the data in table test1:tlr

database test1;create table tlr (

a_serial serial, b_integer integer, c_char char(20), d_decimal decimal, ) in dbspace1;

insert into tlr select * from tlr;restore to ‘2003-01-01 01:01:01’;

IBM Software Group

23

Extracting a Subset of Columns

Extracts a table called test1:source_tab from the most recent backup of dbspace1 and places the data in column c_char into column X_char, d_decimal into Y_decimal in table test1:target_tab

database test1;create table source_tab (

a_serial serial, c_char char(20), d_decimal decimal ) in dbspace1;

create table target_tab ( X_char char(20), Y_decimal decimal, Z_name char(40) ) in dbspace2;

insert into target_tab ( X_char, Y_decimal ) select c_char,d_decimal from source_tab;

IBM Software Group

24

Using Data Filtering

Extracts the physical records only from a table called test1:tlr from the most recent backup of dbspace1 and places the data in table test1:tlr only where the where conditions are true.

database test1;create table tlr ( a_serial serial, b_integer integer, c_char char(20), d_decimal decimal, ) in dbspace1;

insert into tlr select * from tlr where c_char matches ‘j*’ and d_decimal is NOT NULL and b_integer > 100;

RESTORE WITH NO LOG

IBM Software Group

25

Using External Tables

Extracts a table called dl:source_tab from the most recent backup of dbspace1 and sends the data in ASCII format with fields delimited to the file named /TMP/PIPE.

database d1;create table source_tab (cola int) in dbspace1;

create external table target_tab (cola int) USING (‘/TMP/PIPE’,

‘DELIMITED’);

insert into target_tab select * from source_tab;

IBM Software Group

26

Two Table Example

Extracts a table called test1:tlr_1 and test:tlr_2 from the most recent backup of dbspace1 and places the data in table test1:tlr_1_dest and test1:tlr_2_dest using only one scan of the tape.

database test1;

create table tlr_1 ( columns ) in dbspace1;create table tlr_1_dest ( columns ); create table tlr_2 ( columns ) in dbspace1;create table tlr_2_dest ( columns );

insert into tlr_1_dest select * from tlr_1;insert into tlr_2_dest select * from tlr_2;

IBM Software Group

27

Distributed Restore

Extracts a table called test:source_tab from the most recent backup of dbspace1 and places the data on the database server rem_srv in the table target_dbs:tlr_1

database target_dbs;create table target_tab ( columns );

database test;create table source_tab ( columns ) in dbspace1;

insert into target_dbs@rem_srv.target_tab select * from source_tab;

IBM Software Group

28

Agenda

What is Table Level Point in Time Restore (TLPITR)

Syntax and Semantics

Content Release Phases

TLPITR Testing

IBM Software Group

29

Data Types Not Support in the First Release

Extended Data TypeLISTS

MULTISET

SET

ROW

DISTINCT

OPAQUE

Built-in Data TypeCLOB

BLOB

TEXT IN BLOBSPACE

BYTE IN BLOBSPACE

• Tables can not be restored • This mean these data types can

not be in any of tables being restored

• If these data types do appear an error will be given when processing the command file

• Table can be restored but the column in the table will be set to NULL

• Future IDS versions will support extended data types, clob, blob

IBM Software Group

30

Agenda

What is Table Level Point in Time Restore (TLPITR)

Syntax and Semantics

Content Release Phases

TLPITR Testing

IBM Software Group

31

Test Cases

123. . .

Full Filter Serial Index

• Serial Stream - Full Table Restore

• Serial Stream - Partial Table Restore (Filter)

• Serial Stream - Table with a serial column

• Serial Stream - Table with index

• Parallel Streams - Full Table Restore

IBM Software Group

32

Serial Stream - Full Table Restore

XPS

dbspaces (dbslice)

Variations on the Theme

• Partial Table ( where clause )

• Table with Index

• Table with Serial Column

Legato Archecker

XBSA

IBM Software Group

33

Parallel Streams - Full Table Restore

XBSA

Legato Archecker XPS

dbspaces (dbslice)

Archecker

Archecker

Archecker

1 archecker for each dbspace

IBM Software Group

34

Serial Stream - “External Enhancement”

Legato

XBSA

Named Pipe

Archecker XPS

PLOAD(dbaccess/external tables)

IBM Software Group

35

Serial Stream - “DevNull”

ArcheckerLegato

XBSA

/dev/null

IBM Software Group

36

Performance

0.991.22

2.76

4.08

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

MB/sec

Serial Parallel External DevNull

IBM Software Group

37

Questions