• Keine Ergebnisse gefunden

The data base utilities provide for maintenance and u s e o f l o g a n d r e c o v e r y fi l e s . T h e d a t a a d m i n i s

trator has the major role in determining the use of t h e u t i l i t i e s i n t h e d a t a b a s e e n v i r o n m e n t a n d i n c o n s t r u c t i n g t h e j o b s t h a t u s e t h e d a t a b a s e u t i l i t i e s . T h e d a t a b a s e u t i l i t i e s a r e d e s c r i b e d in following subsections in the the order listed:

DBREC utility DBQRFA utility DBQRFI utility DBRCN utility DBRST utility

60485200 E 9 - 4 . 1 / 9 - 4 . 2

TABLE 9-1. SUMMARY OF REQUIREMENTS OF DATA BASE DEFINITION FOR FEATURES OF AUTOMATIC RECOVERY

DBREC UTILITY

T h e D B R E C u t i l i t y p r o v i d e s f o r t w o o p e r a t i o n s : t r a n s f e r r i n g t h e c o n t e n t s o f t h e j o u r n a l l o g fi l e t o a t a p e fi l e ( c a l l e d d u m p i n g t h e j o u r n a l l o g fi l e ) a n d i n i t i a l i z i n g t h e fi l e s m a i n t a i n e d f o r d a t a b a s e r e c o v e r y. T h e s e fi l e s a r e t h e j o u r n a l l o g fi l e , t h e q u i c k r e c o v e r y fi l e , t h e t r a n s a c t i o n r e c o v e r y fi l e , a n d t h e r e s t a r t i d e n t i fi e r fi l e . The operations which the DBREC utility will perform a r e s p e c i fi e d b y c l a u s e s i n a s o u r c e i n p u t fi l e . T h e u t i l i t y i s c a l l e d b y t h e D B R E C c o n t r o l s t a t e ment.

The DBREC utility executes as a batch job at its own control point. DBREC can be executed either o n l i n e o r o f fl i n e . I n o f fl i n e e x e c u t i o n , t h e d a t a administrator constructs a batch job that executes t h e D B R E C u t i l i t y. I n o n l i n e e x e c u t i o n , C D C S i n i t i a t e s a b a t c h j o b t h a t e x e c u t e s t h e D B R E C u t i l i t y .

Schema Entry

The source input for the DBREC utility consists of one or more schema entries. Clauses included in the schema entry indicate operations to be per formed on log and recovery files for the specified schema. The format of the schema entry is shown in figure 9-3.

The clauses of the schema entry identify the schema and specify any operation to be performed. One or more schemas can be specified in any order in schema entries.

Schema-name must be a valid schema name, 1 to 30 characters in length, that exists in the master directory attached during execution of the DBREC utility. Schema-name must not duplicate any other schema-name specified in the source input to the DBREC utility.

DUMP Clause

The DUMP clause provides for transferring the contents of a journal log file to a tape file and for reinitialization of the journal log file. The DUMP clause can be specified in a job for either online or offline execution. More than one DUMP c l a u s e c a n b e s p e c i fi e d i n a j o b f o r o f fl i n e execution; the job inititiated by CDCS for online execution includes only one DUMP clause.

Log-file-name specified in the DUMP clause is the 7-character permanent file name of the journal log file. Log-file-name must be specified as foiLows:

the first six characters of the name must be the same as the 6-character permanent file name specified for the journal log fiLe in the master directory; the seventh character must be the digit 1 or 2.

If CDCS initiates the job of dumping the journal log file, CDCS determines the appropriate log-file name. If the data administrator initiates the job of dumping the journal log file, the data adminis trator must determine the appropriate log-file-name.

Clauses in the input file have a free-field for mat. Data appears in columns 1 through 72; columns

73 through 80 are not examined and can be used for sequencing or identification purposes.

The DUMP and ALLOCATE clauses must refer to log or recovery files specified in the master directory for the same schema as identified in the SCHEMA NAME clause. DUMP and ALLOCATE clauses can appear in any order within a schema entry.

SCHEMA NAME Clause

The SCHEMA NAME clause identifies the schema. This m u s t b e t h e fi r s t c l a u s e s p e c i fi e d i n t h e s c h e m a

e n t r y.

After the DBREC utility has dumped the journal log to tape, the DBREC utility causes the journal log fi l e t o b e r e i n i t i a l i z e d a s i f t h a t fi l e w e r e specified in an ALLOCATE clause.

ALLOCATE Clause

The ALLOCATE clause provides for the initialization o f a s p e c i fi e d fi l e . I f t h e fi l e i s a j o u r n a l l o g , q u i c k r e c o v e r y , o r t r a n s a c t i o n r e c o v e r y fi l e , s t o r a g e i s a l l o c a t e d f o r i t d u r i n g i n t i a l i z a t i o n . This process is called preallocation.

The ALLOCATE clause can be specified only for a job e x e c u t i n g o f fl i n e .

SCHEMA NAME IS schema-name-1 DUMP

-1 C.J J

JOURNAL LOG FILE NAME IS log-file-name

"ALLOCATE

JOURNAL LOG FILE [NAME IS log-file-name-2] SIZE is integer-1 PRUS QUICK RECOVERY FILE NAME IS qrf-name-1 SIZE IS integer-2 PRUS TRANSACTION RECOVERY FILE NAME IS trf-name

RESTART IDENTIFIER FILE NAME IS rif-name

C.J

Figure 9-3. Schema Entry Format (DBREC Utility)

F i l e o p t i o n s i d e n t i f y t h e fi l e t y p e s a n d t h e p e r m a n e n t fi l e n a m e s o f t h e fi l e s t o b e i n i t i a l i z e d . T h e r u l e s f o r s p e c i f y i n g fi l e o p t i o n s a r e a s f o l l o w s :

F i l e o p t i o n s c a n b e s p e c i fi e d i n a n y o r d e r i n an ALLOCATE clause.

One ALLOCATE clause can specify one or more fi l e o p t i o n s .

One or more ALLOCATE clauses can be included in a schema entry.

A p a r t i c u l a r fi l e o p t i o n c a n b e s p e c i fi e d o n l y once in a schema entry.

T h e q r f - n a m e s p e c i fi e d i n t h i s o p t i o n m u s t s p e c i f y t h e p e r m a n e n t fi l e n a m e o f t h e q u i c k r e c o v e r y file. Qrf-name must be be the same permanent file name (a 1- through 7-character permanent file name) a s t h e n a m e s p e c i fi e d f o r t h e q u i c k r e c o v e r y fi l e in the master directory.

I n t e g e r - 2 s p e c i fi e s t h e s i z e i n p h y s i c a l r e c o r d u n i t s o f t h e q u i c k r e c o v e r y fi l e ; i t m u s t b e a p o s i t i v e i n t e g e r . C D C S c a n w r i t e t o t h e q u i c k r e c o v e r y fi l e u n t i l t h e s p a c e p r o v i d e d b y s p e c i fi c a t i o n o f t h e i n t e g e r i s fi l l e d . C D C S e n f o r c e s t h e s i z e s p e c i fi e d b y i n t e g e r - 2 b y i n i t i a t i n g a r e c o v e r y p o i n t , w h i c h i s d e s c r i b e d l a t e r i n t h i s s e c t i o n .

JOURNAL LOG FILE Option

T h e J O U R N A L L O G F I L E o p t i o n p r o v i d e s f o r t h e i n i t i a l i z a t i o n o f a j o u r n a l l o g fi l e . E v e r y j o u r n a l l o g fi l e u s e d b y C D C S m u s t b e i n i t i a l i z e d b y the DBREC utility.

Log-file-name identifies the permanent file name of t h e j o u r n a l l o g fi l e . O n e o r t w o j o u r n a l l o g fi l e s c a n b e i n i t i a l i z e d b y u s e o f t h i s c l a u s e . L o g -fi l e - n a m e c a n e i t h e r b e o m i t t e d o r a 7 - c h a r a c t e r log-file-name can be specified.

If log-file-name is omitted, two log file names are assumed. The first six characters of both assumed n a m e s a r e c h a r a c t e r s s p e c i fi e d f o r t h e p e r m a n e n t fi l e n a m e o f t h e j o u r n a l l o g fi l e i n t h e m a s t e r d i r e c t o r y. T h e s e v e n t h c h a r a c t e r o f o n e n a m e i s t h e d i g i t 1 ; t h e s e v e n t h c h a r a c t e r o f t h e o t h e r n a m e i s t h e d i g i t 2 . W h e n l o g - fi l e - n a m e i s o m i t t e d , o n e o r t w o fi l e s a r e i n i t i a l i z e d d e p e n d i n g on whether one or two files have been established a s p e r m a n e n t fi l e s b y o p e r a t i n g s y s t e m c o n t r o l s t a t e m e n t s . R e f e r t o t h e s u b s e q u e n t s u b s e c t i o n E x e c u t i o n o f D B R E C f o r A l l o c a t i o n f o r f u r t h e r i n f o r m a t i o n .

If log-file-name is specified, the name must be one of the 7-character names that would be assumed by CDCS and must be the permanent file name of an e s t a b l i s h e d p e r m a n e n t fi l e . T o i n i t i a l i z e t h e second log file in this situation, another ALLOCATE clause must be specified. Refer to the subsequent s u b s e c t i o n E x e c u t i o n o f D B R E C f o r A l l o c a t i o n f o r f u r t h e r i n f o r m a t i o n .

I n t e g e r - 1 s p e c i fi e s t h e s i z e i n p h y s i c a l r e c o r d u n i t s ( P R U S ) o f t h e j o u r n a l l o g fi l e ; i t m u s t b e a p o s i t i v e i n t e g e r . C D C S u t i l i z e s t h e s i z e o f t h e journal log file to determine when to switch to the a l t e r n a t e fi l e .

TRANSACTION RECOVERY FILE Option

The TRANSACTION RECOVERY FILE option provides for i n i t i a l i z a t i o n o f t h e t r a n s a c t i o n r e c o v e r y fi l e . T h i s fi l e m u s t b e i n i t i a l i z e d b y t h e D B R E C u t i l i t y before the file can be used.

Tr f - n a m e s p e c i fi e s t h e p e r m a n e n t fi l e n a m e o f t h e t r a n s a c t i o n r e c o v e r y fi l e . Tr f - n a m e m u s t b e s p e c i fi e d a s f o l l o w s : t h e fi r s t s i x c h a r a c t e r s m u s t b e t h e s i x c h a r a c t e r s o f t h e p e r m a n e n t fi l e n a m e s p e c i fi e d f o r t h e t r a n s a c t i o n r e c o v e r y fi l e i n t h e master directory; the seventh character must be the d i g i t 1 .

RESTART IDENTIFIER FILE Option

The RESTART IDENTIFIER option provides for the i n i t i a l i z a t i o n o f t h e r e s t a r t i d e n t i fi e r fi l e . T h i s fi l e m u s t b e i n i t i a l i z e d b y t h e D B R E C u t i l i t y, before the file can be used.

R i f - n a m e s p e c i fi e s t h e p e r m a n e n t fi l e n a m e o f t h e r e s t a r t i d e n t i fi e r fi l e . R i f - n a m e m u s t b e t h e s a m e p e r m a n e n t fi l e n a m e ( a 1 - t h r o u g h 7 - c h a r a c t e r permanent file name) as the name specified for the r e s t a r t i d e n t i fi e r fi l e i n t h e m a s t e r d i r e c t o r y.

DBREC Control Statement

E x e c u t i o n o f t h e D B R E C u t i l i t y i s c a l l e d b y t h e D B R E C c o n t r o l s t a t e m e n t . F i g u r e 9 - 4 i l l u s t r a t e s the format of the DBREC control statement. Option ally, the comma immediately following DBREC can be r e p l a c e d b y a l e f t p a r e n t h e s i s ; t h e t e r m i n a t i n g period can be replaced by a right parenthesis.

DBRECC,I=lfn-i:ir.,L=lfn-2J.

QUICK RECOVERY FILE Option

The QUICK RECOVERY FILE option provides for the i n i t i a l i z a t i o n o f t h e q u i c k r e c o v e r y fi l e . T h i s fi l e m u s t b e i n i t i a l i z e d b e f o r e i t c a n b e u s e d . U s e o f t h e D B R E C u t i l i t y r a t h e r t h a n t h e D B Q R F I u t i l i t y i s r e c o m m e n d e d f o r i n i t i a l i z i n g t h e q u i c k r e c o v e r y fi l e .

Figure 9-4. DBREC Control Statement

All parameters of the DBREC control statement are optional and can appear in any order.

T h e I p a r a m e t e r i d e n t i fi e s t h e l o c a l fi l e t h a t c o n t a i n s s o u r c e i n p u t f o r t h e D B R E C u t i l i t y. T h e I parameter is interpreted as follows:

60485200 A 9-7

omitted

Local file INPUT is assumed to contain the s o u r c e i n p u t f o r t h e u t i l i t y.

Local file COMPILE is assumed to contain t h e s o u r c e i n p u t f o r t h e u t i l i t y.

I = l f n - 1

Ta b l e 9 - 2 i n d i c a t e s t h e p e r m a n e n t fi l e n a m e t h a t m u s t b e s p e c i fi e d i n t h e o p e r a t i n g s y s t e m c o n t r o l s t a t e m e n t s t o e s t a b l i s h a p e m a n e n t fi l e f o r e a c h fi l e o p t i o n o f t h e A L L O C AT E c l a u s e . A d d i t i o n a l l y, t a b l e 9 - 2 s u m m a r i z e s a l l t h e c o n t e x t s i n w h i c h p e r m a n e n t fi l e n a m e i s s p e c i fi e d f o r a l l o c a t i o n o f a fi l e .

E x e c u t i o n o f t h e D B R E C u t i l i t y r e q u i r e s t h a t t h e m a s t e r d i r e c t o r y fi l e b e a t t a c h e d b y u s i n g t h e

local file name MSTRDIR.

T h e s p e c i fi e d fi l e n a m e i d e n t i fi e s t h e l o c a l fi l e t h a t c o n t a i n s t h e s o u r c e i n p u t f o r t h e u t i l i t y .

1=0

Not allowed.

T h e L p a r a m e t e r i d e n t i fi e s t h e l o c a l fi l e t h a t receives a listing and diagnostics generated by the D B R E C u t i l i t y. T h e L p a r a m e t e r i s i n t e r p r e t e d a s f o l l o w s :

omitted

Local file OUTPUT receives the listing and diagnostics generated by the utility.

Local file OUTPUT receives the listing and diagnostics generated by the utility.

L=lfn-2

The specified local file name identifies t h e fi l e t h a t r e c e i v e s t h e l i s t i n g a n d diagnostics generated by the utility.

L=0

T h e l o c a l fi l e O U T P U T r e c e i v e s o n l y t h e d i a g n o s t i c s g e n e r a t e d b y t h e u t i l i t y.

Execution of DBREC for Allocation

The job for execution of the DBREC utility for file a l l o c a t i o n c a n o n l y b e i n i t i a t e d o f fl i n e . A d a t a base administrator can initiate the job when CDCS i s e i t h e r a c t i v e o r i n a c t i v e .

All files that are specified in an ALLOCATE clause m u s t h a v e b e e n e s t a b l i s h e d a s p e r m a n e n t ( d i r e c t access for NOS) files before execution of the DBREC u t i l i t y . T h e f o l l o w i n g l i s t i n g i l l u s t r a t e s a s e r i e s o f c o n t r o l s t a t e m e n t s t h a t , i f e x e c u t e d f o r a p a r t i c u l a r p e r m a n e n t fi l e n a m e ( p f n ) , e s t a b l i s h the permanent file:

For NOS DEFINE RETURN For NOS/BE

REQUEST REWIND CATALOG RETURN

DBREC Execution to Dump the Journal Log File

The DBREC utility can be executed both online and offline for dumping the journal log file. The data administrator creates and initiates the job for offline execution; CDCS creates and initiates the job for online execution.

Much greater flexibility is available during online execution if the CCLPROC sub-clause is specified in the JOB CONTROL clause of DBMSTRD input. The storage file can be specified as either magnetic tape or a permanent file. The online job can be set up to copy the journal log file as an extension of the storage file instead of over writing the storage file on each execution.

The following steps must be contained within the CCL procedure:

1. Specify an ATTACH, REQUEST or LABEL statement to obtain the file to which the journal log file is to be dumped. This file must be given the local file name of LOGDUMP.

2. The file, LOGDUMP, must be positioned at the beginning or at the end of information, as selected by the installation.

3. The CDCS master directory must be attached with the local file name MSTRDIR.

4. The utility progam, DBREC, must be called to dump the journal log file.

These are the basic steps required. A recommended addition would be to place an EXIT statement after the DBREC statement. This can be used to notify the data administrator of a failure of the online dump job.

Offline Execution

The DBREC utility assumes the local file name LOGDUMP for the tape file. This local file must be associated with a tape volume serial number. The VSN control statement should be included In the job stream to associate the local file LOGDUMP with a tape. If no tape volume serial number is supplied in the job stream, the DBREC utility requests that t h e o p e r a t o r a s s i g n o n e . T h e t a p e t y p e a n d density, if not specified in the master directory, are assumed to be type NT (nine-track) with the density of the installation default density.

Execution of the DBREC utility requires that the master directory be attached in the job stream with

the local file name MSTRDIR.

F i g u r e 9 - 5 i s a n e x a m p l e o f a j o b f o r o f fl i n e e x e c u t i o n o f t h e D B R E C u t i l i t y f o r d u m p i n g t h e j o u r n a l l o g fi l e .

Online Execution

W h e n a j o u r n a l l o g fi l e i s f u l l o r a b a d fi l e condition exists, CDCS can initiate a job to dump the journal log file. CDCS uses the ROUTE control statement to initiate execution of the job.

The following requirements must be met to provide CDCS with information necessary to initiate a job:

T h e m a s t e r d i r e c t o r y p e r m a n e n t fi l e a t t a c h information must have been supplied as input to CDCS through the CDCS control statement.

T h e j o b c o n t r o l I n f o r m a t i o n r e q u i r e d f o r i n i t i a t i o n o f t h e D B R E C j o b m u s t h a v e b e e n s u p p l i e d a s p a r t o f t h e i n p u t f o r t h e m a s t e r d i r e c t o r y.

D u r i n g t h e o n l i n e j o b , t h e t a p e t o w h i c h t h e j o u r n a l l o g fi l e i s d u m p e d i s s p e c i fi e d b y t h e o p e r a t o r. T h e d a t a a d m i n i s t r a t o r m u s t p r o v i d e t h e o p e r a t o r w i t h a l i s t o f b l a n k - l a b e l e d t a p e s t h a t can be used for journal log file dumps.

60485200 E 9 - 8 . 1 / 9 - 8 . 2 |

, ^ ^ \

TABLE 9-2. SUMMARY OF PERMANENT FILE NAME SPECIFICATIONS FOR ALLOCATION OF FILES BY DBREC UTILITY Context in

Which

Perma-File Type

file Name (pfn) Journal Log Quick Recovery Transaction Recovery R e s t a r t I d e n t i fi e r

I s S p e c i fi e d F i l e F i l e F i l e F i l e

Master The 6-character T h e l i t e r a l The 6-character T h e l i t e r a l ( o f 1 t o d i r e c t o r y l i t e r a l t h a t s p e c i (of 1 to 7 l i t e r a l t h a t 7 characters in

fi e s p f n i n t h e characters in s p e c i fi e s p f n i n l e n g t h ) t h a t s p e c i JOURNAL LOG FILE l e n g t h ) t h a t the TRANSACTION fi e s p f n i n t h e

c l a u s e . s p e c i fi e s t h e RECOVERY FILE RESTART IDENTIFIER

pfn in the clause. FILE clause.

QUICK RECOVERY FILE clause.

Control A 7-character pfn The same pfn A 7-character pfn The same pfn as

statements must be specified. as specified must be specified. s p e c i fi e d i n t h e (DEFINE T h e fi r s t s i x c h a r in the clause T h e fi r s t s i x c h a r clause indicated

and so acters are the same i n d i c a t e d acters are the same above.

f o r t h f o r as those specified above. as those specified

NOS or in the clause indi in the clause above.

CATALOG cated above. The The seventh

and so seventh character character must

f o r t h f o r must be the digit be the digit 1.

NOS/BE) 1 or 2. The recom

mended procedure is t o i n c l u d e c o n t r o l statements speci fying both allowed p f n ' 8 t o e s t a b l i s h t w o fi l e s .

F i l e Either the pfn The same pfn The same 7-char The same pfn

o p t i o n s is omitted from the must be speci acter pfn must be must be specified

of the JOURNAL LOG FILE fi e d i n t h e s p e c i fi e d i n t h e In the RESTART

ALLOCATE option or a 7-char QUICK RECOVERY TRANSACTION RECOVERY IDENTIFIER FILE

clause of acter pfn must be FILE option FILE option as o p t i o n a s s p e c i fi e d the DBREC s p e c i fi e d i n t h e as specified s p e c i fi e d i n t h e in the master direc u t i l i t y o p t i o n . T h e 7 - in the master control statements tory and in the

character pfn must directory and indicated above. control statements

be the same pfn as i n t h e c o n t r o l indicated above.

t h e p f n s p e c i fi e d statements i n c o n t r o l s t a t e i n d i c a t e d

ments indicated above.

a b o v e . I f p f n i s o m i t t e d , t w o fi l e s w i t h 7 - c h a r a c t e r

pfn'8 as indicated above are assumed.

DBQRFA UTILITY

T h e D B Q R FA u t i l i t y a p p l i e s t h e c o n t e n t s o f t h e quick recovery file to a data base before a recon s t r u c t i o n o r r e s t o r a t i o n o p e r a t i o n i s i n i t i a t e d . T h i s p r o c e d u r e e n s u r e s t h a t t h e fi l e s a r e i n a p r o c e s s a b l e s t a t e f o r s u b s e q u e n t o p e r a t i o n s . T h e D B Q R FA u t i l i t y d u p l i c a t e s a r e c o v e r y c a p a b i l i t y o f automatic recovery.

E x e c u t i o n o f t h e D B Q R FA u t i l i t y i s c a l l e d b y t h e D B Q R FA c o n t r o l s t a t e m e n t . F i g u r e 9 - 6 i l l u s t r a t e s t h e f o r m a t o f t h e D B Q R F A c o n t r o l s t a t e m e n t . Optionally, the comma immediately following DBQRFA c a n b e r e p l a c e d b y a l e f t p a r e n t h e s i s ; t h e t e r m i n a t i n g p e r i o d c a n b e r e p l a c e d b y a r i g h t parenthesis.

T h e p a r a m e t e r s c a n a p p e a r i n a n y o r d e r i n t h e D B Q R FA c o n t r o l s t a t e m e n t . T h e S C p a r a m e t e r i s required; the other parameters are optional.

The SC parameter identifies the schema associated w i t h t h e q u i c k r e c o v e r y fi l e b e i n g p r o c e s s e d . T h e SC parameter is interpreted as follows:

SC=schema-id

S c h e m a - i d m u s t b e t h e 4 - d i g i t s c h e m a i d e n t i fi c a t i o n a s s i g n e d b y t h e D B M S T R D u t i l i t y a n d l i s t e d i n t h e m a s t e r d i r e c t o r y c o n t e n t s r e p o r t .

60485200 A 9-9

NOS

NOS/BE

Job statement Job statement

FAMILY control statement ACCOUNT control statement

USER control statement VSN(LOGDUMP=vsn)

CHARGE control statement MOUNT(SN=set-name,VSN=vsn)

RESOURC(tape-type=integer) ATTACH,MSTRDIR,pfn,ID=id,PW=read-passwds, ATTACH,MSTRDIR=pfn/UN=usernum,PW=passwd,M=R, MR=1,SN=setname.

R=devi ce-type/PN=packname. DBREC.

VSN (LOGDUMP=VSN) End-of-record

DBREC. SCHEMA NAME IS SAMPSCH1

End-of-record DUMP JOURNAL LOG FILE DB1JLF1.

SCHEMA NAME IS SAMPSCH1 SCHEMA NAME IS SAMPSCH2

DUMP JOURNAL LOG FILE DB1JLF1. DUMP JOURNAL LOG FILE DB2JLF2.

SCHEMA NAME IS SAMPSCH2 End-of-informat i on

DUMP JOURNAL LOG FILE DB2JLF2.

End-of-Informaticn

."<s^\

Figure 9-5. Sample Off-line Execution of DBREC Utility to Dump the Journal Log File

DBQRFA,SC=schema-idC^MD=lfn-13C,QF=lfn-23.

Figure 9-6. DBQRFA Utility Control Statement

T h e M D p a r a m e t e r i d e n t i fi e s t h e l o c a l fi l e t h a t contains the master directory. The MD parameter is i nt e r p r e t ed as fo ll ow s :

omitted

Local file MSTRDIR is assumed to contain the master directory.

MD

Not allowed.