Consultor Eletrônico



Kbase 17307: Roll Forward to endtime or endtrans in 6.3F and 7.3A
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Roll Forward to endtime or endtrans in 6.3F and 7.3A

The purpose of this notebook entry is two-fold.
FIRST: The Sys Admin Ref for V7 (February 1995) and V8.0 (October
1995) show incorrect syntax for endtime and endtrans. ALL non-dashed
arguments (verbose endtime endtrans) belong to the roll forward
qualifier, and as such must immediately follow the roll forward
qualifier, and ahead of the -a -B and -r options. See examples below.

SECOND: The endtime and endtrans enhancements to the roll forward
qualifier are available, although undocumented in 6.3F and 7.3A.

NOTE: Multi-extent AI files are not supported in Version 6.
Therefore, in the example below, Version 6 syntax is used. That is,
there are no AI extends specified in the .st file, and there are -a
parameters specified where they might not be needed in Version 7.

The roll forward enhancement is useful for recovering a database with
bad block in the AI file. This will allow recovery of as much data as

possible from the corrupt AI file. This feature will also be useful
in those cases where it is known that the database became corrupt
after a certain point in time and allow recovery up to that point.

The enhancements work just like regular roll forward with a qualifier
to specify the end time or end transaction id (trid). Here is the
undocumented 6.3F/7.3A syntax:

rfutil <dbname> -C roll endtime <time>
where <time> is in the form: yyyy:mm:dd:hh:mm:ss

OR

rfutil <dbname> -C roll endtrans <trid>

The times can be pulled from .lg or by using aimage scan verbose, the
trids can only be found using aimage scan verbose.

EXAMPLE:

1) Create a file called myV6demo.st as shown below:

d ./myV6demo.d1 f 1024
d ./myV6demo.d2
b ./myV6demo.b1 f 32
b ./myV6demo.b2

2) Create a copy of demo.db in the void myV6demo database:
prostrct create myV6demo
procopy demo myV6demo

3) Create backup copy of myV6demo:
probkup myV6demo myV6demo.bak

4) Start After Imaging in initial AI extent:
rfutil myV6demo -C aimage begin unbuff -a myV6demo.ai

5) Create procedure, "updcust.p", that updates all customers in db:
for each customer:
customer.max-credit = customer.max-credit + 10.
end.

6) Create procedure, "delcust.p", that deletes all customers in db:
for each customer:
for each order where order.Cust-Num = customer.Cust-Num:
for each order-line where order-line.Order-num =
order.Order-num:
delete order-line.
end.
delete order.
end.
delete customer.
end.

7) Run procedure, "updcust.p", that updates all customers in db:
pro myV6demo -p updcust.p

8) Run procedure, "delcust.p", that deletes all customers in db:
pro myV6demo -p delcust.p

9) Scan AI extent to see where delete operations began. It may be
advisable to save the output in a file and use an editor to find
the entry in which you are interested. In our example, RL_LSTMOD
is the seperator between updcust.p and delcust.p.

rfutil myV6demo -C aimage scan verbose -a myV6demo.a1
...
code = RL_INMEM (1637)
transaction index = 0 (1638)
transaction index = 0 (1638)
dbkey = 0 update counter = 0 (1639)
code = RL_LSTMOD (1637) <-- db open for updcust.o
transaction index = 0 (1638)
dbkey = 32 update counter = 772 (1639)
code = RL_TBGN (1637)
transaction index = 755 (1638)
dbkey = 0 update counter = 0 (1639)
Trid: 755 Fri Oct 3 08:08:06 1997
...
code = RL_TEND (1637)
transaction index = 787 (1638)
dbkey = 0 update counter = 0 (1639)
Trid: 787 Fri Oct 3 08:08:06 1997
code = RL_LSTMOD (1637) <-- db open for delcust.p
transaction index = 0 (1638)
dbkey = 32 update counter = 773 (1639)
code = RL_TBGN (1637) <-- start of first delete.
transaction index = 788 (1638)
dbkey = 0 update counter = 0 (1639)
Trid: 788 Fri Oct 3 08:08:39 1997
code = RL_IXREM (1637)
transaction index = 788 (1638)
dbkey = 6560 update counter = 74 (1639)

...

10) Note the delete starts at Trid: 788 Fri Oct 3 08:08:39 1997
If other transactions, which need to be included in the roll
forward, also begin at this time, you will need to use the Trid
to roll forward to endtrans.

11) To recover the database to just before the deletes start:
rfutil myV6demo -C aimage end -a myV6demo.ai
prodel myV6demo
prostrct create myV6demo
prorest myV6demo myV6demo.bak

a) To roll forward and stop at time when deletes began:
rfutil myV6demo -C roll endtime 1997:10:03:08:08:39 -a myV6demo.
ai

b) To roll forward and stop at transaction where deletes began:
rfutil myV6demo -C roll endtrans 788 -a myV6demo.ai

NOTE: In roll forward to transaction, roll forward will include
transactions up to but not including the transaction containing
the specified transaction number.

Progress Software Technical Support Note # 17307