Recovery Log Notes Gus Björklund, Progress Dan Foreman, Bravepoint 2014 Americas PUG Challenge Westford, MA June 8 – June 11 2014.

Slides:



Advertisements
Similar presentations
Crash Recovery John Ortiz. Lecture 22Crash Recovery2 Review: The ACID properties  Atomicity: All actions in the transaction happen, or none happens 
Advertisements

CSCI 3140 Module 8 – Database Recovery Theodore Chiasson Dalhousie University.
Chapter 19 Database Recovery Techniques
Recovery from Crashes. Transactions A process that reads or modifies the DB is called a transaction. It is a unit of execution of database operations.
Recovery from Crashes. ACID A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
ICS (072)Database Recovery1 Database Recovery Concepts and Techniques Dr. Muhammad Shafique.
CS 245Notes 101 CS 245: Database System Principles Notes 10: More TP Hector Garcia-Molina.
Quick Review of May 1 material Concurrent Execution and Serializability –inconsistent concurrent schedules –transaction conflicts serializable == conflict.
Manajemen Basis Data Pertemuan 6 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
Backup and Recovery Part 1.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Transactions and Recovery
Introduction to Oracle Backup and Recovery
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 1) Academic Year 2014 Spring.
MOVE-4: Upgrading Your Database to OpenEdge® 10 Gus Björklund Wizard, Vice President Technology.
Birth, Death, Infinity Gus Björklund. ???. Dan Foreman. BravePoint. PUG Challenge Dusseldorf 2014.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Birth, Death, Infinity Gus Björklund. Progress. Dan Foreman. BravePoint. PUG Challenge Americas, 9-12 June 2013.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
ApexSQL Log Recover accidentally truncated, dropped or deleted data with or without transaction log or its backup. Recover data from un-attachable/corrupted.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
DURABILITY OF TRANSACTIONS AND CRASH RECOVERY These are mostly the slides of your textbook !
DBMS Transactions and Rollback Recovery Helia / Martti Laiho.
Strength. Strategy. Stability.. Progress Performance Monitoring and Tuning Dan Foreman Progress Expert BravePoint BravePoint
A first look at table partitioning PUG Challenge Americas Richard Banville & Havard Danielsen OpenEdge Development June 9, 2014.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
Reliability and Security in Database Servers By Samuel Njoroge.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
CS 245Notes 101 CS 245: Database System Principles Notes 10: More TP Hector Garcia-Molina.
HANDLING FAILURES. Warning This is a first draft I welcome your corrections.
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
Reliability and Recovery CS Introduction to Operating Systems.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Chapter 15 Recovery. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.15-2 Topics in this Chapter Transactions Transaction Recovery System.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
Advanced JSP, Taglibs and Struts
DB-16 : JTA Transactions in the RDBMS, What's Going on Down There? Deb Walz Principal Software Engineer.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 15: Reliability and Security in Database Servers Instructor’s.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
IT1001 – Personal Computer Hardware & system Operations Week7- Introduction to backup & restore tools Introduction to user account with access rights.
Section 06 (a)RDBMS (a) Supplement RDBMS Issues 2 HSQ - DATABASES & SQL And Franchise Colleges By MANSHA NAWAZ.
Connect with life Vinod Kumar Technology Evangelist - Microsoft
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 2) Academic Year 2014 Spring.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
Recovery technique. Recovery concept Recovery from transactions failure mean data restored to the most recent consistent state just before the time of.
Backup and Recovery - II - Checkpoint - Transaction log – active portion - Database Recovery.
CREATE THE DIFFERENCE Back ups and Recovery. CREATE THE DIFFERENCE Aims This lecture aims to cover –Back ups –Transaction logging –Security threats.
Database Applications (15-415) DBMS Internals- Part XIV Lecture 25, April 17, 2016 Mohammad Hammoud.

Database Recovery Techniques
Database Recovery Techniques
Managing Multi-User Databases
Behind The Scenes: Updating A Record
Printed on Monday, December 31, 2018 at 2:03 PM.
Database Backup and recovery
Database Recovery 1 Purpose of Database Recovery
Database Backup and Recovery
Presentation transcript:

Recovery Log Notes Gus Björklund, Progress Dan Foreman, Bravepoint 2014 Americas PUG Challenge Westford, MA June 8 – June

2 Abstract The OpenEdge RDBMS uses two kinds of transaction logs. These form the basis for a variety of important features like transaction rollback, crash recovery, replication, media failure recovery and so on. In this talk we will open the bonnet on the topic of After-Image Journaling and Recovery Log Records (aka "Notes"). We will describe what they are, what they do, and how to monitor them. But most importantly, we will show you some practical applications of your newfound understanding of Notes.

who uses after-imaging ?

who uses the after-imaging daemon ?

disaster strikes ! (ap photo)

transaction logging to the rescue!

7 Two transaction logs Original Database Transactions make changes Changed Database Redo-Log (After-Image Journals) Undo-Redo Log (Before-Image Log) BI AI dbdb’

8 Two transaction logs Original Database Transactions make changes Changed Database Redo-Log (After-Image Journals) Undo-Redo Log (Before-Image Log) BI AI dbdb’

9 T2: begin T1: begin T1: action 1 T1: action 2 T1: action 3 T3: begin T1: action 4 T3: action 1 T3: action 2 T2: action 1 T1: end T2: action 2 T3: end T2: action 3 T2: action 4 actions taken by transaction 1 transaction log records (aka “notes”) actions taken by transaction 2 actions taken by transaction 3 Time notes form a complete history of everything

Over to Dan

11 log records (notes)  generated for every change to database.  each describes exactly one change to one database block. almost - there are log records that describe changes to purely memory-resident data structures like the transaction table  apply only to specific version number of block  some operations require more than one change index splits, multi-block records  written in same order changes are executed.  notes from concurrent transactions are mixed together.

12 Undo-Redo (aka Before-Image) Log Records  each log record (or “note”) contains: transaction number data area number database block number (its dbkey) database block's version number note type – specifies what operation to perform any information needed to undo the operation –in case we have to roll back any information needed to redo the operation –in case we lose the result before writing to disk

13 Redo (aka After-Image) Log Records  each log record (or “note”) contains: transaction number data area number database block number (its dbkey) database block's version number note type – specifies what operation to perform any information needed to undo the operation –in case we have to roll back any information needed to redo the operation –in case we lose the result before writing to disk

Did you notice anything about those two kinds of notes (bi and ai) ????

15 Special cases  After-image journalling AI extent switches generate notes  Replication causes "parenthesis" notes to bracket logical operations  JTA (Java Transaction API) can cause bracketing notes  Auditing generates extra notes for creating audit records and their index entries  TDE (Transparent Data Encryption) generates extra notes when encryption policies set or changed  etc.

16 The So-Called "Before-Image" File Is NOT  Does not really contain before images  It has a record of all recent database changes  The data are sufficient to: Undo or roll back transactions Perform crash recovery

17 The So-Called "After-Image" File Is NOT  Does not really contain after images  It has a record of all database changes after a backup this can be called time 0  The data are sufficient to: Recreate everything that happened since time 0 Recreate the before-image log Undo or roll back transactions Perform crash recovery

why? Over to Gus

19 because  What if someone unplugs server to plug in vacuum cleaner?  What if we want to undo (roll back) ?  What if we make several more changes and only one block of a fragmented record chain is written to disk to make room in the buffer pool ?  What if our ship runs aground and falls down

20 because  What if someone unplugs server to plug in vacuum cleaner? the change will be lost  What if we want to undo (rollback) ? we don’t know the old value or how to undo  What if we make several more changes and only one block of a fragmented record chain is written to disk to make room in the buffer pool ? the database will be corrupted  What if our ship runs aground and falls down the database will disappear completely these are all bad things (tm)

scanning after-image journals over to Dan

22 Questions  When was an ‘evil’ transaction started? Then i know how far to Roll Forward  What transactions were active during an online backup? those would be reversed if the backup was restored  What transactions were active during a quiet point? those would be reversed if the backup was restored  What userid is causing the BI file to grow? and why?  Is my database code crappy?  Why did lock table overflow? Who caused it?

23 rfutil aimage scan Prerequisites:  After Imaging is enabled  Use the "verbose" option to get exquisite detail  aimage scan verbose is VERY verbose. you might use up all of your disk space and cause a disaster  Prior to V10.1A the transaction index rolls over at in the report

24 How to do it prostrct add foo ai.st rfutil foo –C mark rfutil foo –C aimage begin.... change stuff in database rfutil bar –C aimage scan verbose \ –a longaimagefilename.a1 \ > aiscanreport.txt NOTE: cannot do this with live ai extents, only archived ones or copies dbname "bar" does not matter here.

25 what do you get? Trid: 17 dbkey = 0 update counter = 0 (12530) Trid: 18 Wed Jan 27 16:54: (2598) Trid: 18 User Id: Dan (12531) Trid: 18 code = RL_TBGN version = 1 (12528) Trid: 18 dbkey = 0 update counter = 0 (12530) Trid: 18 code = RL_RMCR version = 2 (12528) Trid: 18 area = 7 dbkey = 480 update counter = 5 (12529) Trid: 18 code = RL_CXINS version = 2 (12528) Trid: 18 area = 9 dbkey = 28 update counter = 24 (12529) Trid: 18 code = RL_CXINS version = 2 (12528) Trid: 18 area = 9 dbkey = 36 update counter = 24 (12529) Trid: 18 code = RL_CXINS version = 2 (12528) Trid: 18 area = 9 dbkey = 44 update counter = 24 (12529) Trid: 18 Wed Jan 27 16:54: (2598) Trid: 18 code = RL_TEND version = 1 (12528) Trid: 18 dbkey = 0 update counter = 0 (12530) Trid: 19 Wed Jan 27 16:54: (2598

over to dan & gus

Now, let see some 4GL examples and their patterns a few are from George Potemkin

first, we play with customers

we need a picture here

30 DO TRANSACTION: FIND Customer 1 NO-LOCK NO-ERROR. END. example 0

32 DO TRANSACTION: FIND Customer 1 EXCLUSIVE-LOCK NO-ERROR. END. example 1

34 DO TRANSACTION: CREATE Customer. DELETE Customer. END. example 2

Trid: Thu Jun 5 14:25: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_SEINC version = 1 (12528) Trid: area = 6 dbkey = 96 update counter = 27 (12529) Trid: code = RL_TMSAVE version = 2 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 22 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 10 dbkey = 640 update counter = 220 (12529) Trid: code = RL_CXREM version = 2 (12528) Trid: area = 10 dbkey = 640 update counter = 221 (12529) Trid: code = RL_RMDEL version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 23 (12529) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 24 (12529) Trid: Thu Jun 5 14:25: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530)

36 DISABLE TRIGGERS FOR LOAD OF Customer. DO TRANSACTION: CREATE Customer. DELETE Customer. END. example 3

38 DEF VAR N AS INT NO-UNDO. DISABLE TRIGGERS FOR LOAD OF Customer. DO TRANSACTION: CREATE Customer. N = RECID(Customer). DELETE Customer. END. example 4

Trid: Thu Jun 5 14:25: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_RMDEL version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 25 (12529) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 26 (12529) Trid: code = RL_RMDEL version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 27 (12529) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 9 dbkey = 1344 update counter = 28 (12529) Trid: Thu Jun 5 14:25: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530)

then, we play with orders

41 create order. assign custnum = 1 orderdate = today ordernum = time shipdate = today + 1. example 5

Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_SEINC version = 1 (12528) Trid: area = 6 dbkey = 96 update counter = 33 (12529) Trid: code = RL_TMSAVE version = 2 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 11 dbkey = update counter = 14 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4768 update counter = 354 (12529) part 1...

Trid: code = RL_CXREM version = 2 (12528) Trid: area = 11 dbkey = 4768 update counter = 355 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 864 update counter = 68 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4768 update counter = 356 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 3104 update counter = 474 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 384 update counter = 3956 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4704 update counter = 215 (12529) Trid: code = RL_RMCHG version = 2 (12528) Trid: area = 11 dbkey = update counter = 15 (12529) Trid: Fri Jun 6 13:44: (2598) Trid: code = RL_TEND version = 1 (12528) part 2

44 disable triggers for load of order. create order. assign custnum = 1 orderdate = today ordernum = time shipdate = today + 1. example 6

Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 11 dbkey = update counter = 18 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 864 update counter = 70 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4768 update counter = 360 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 3104 update counter = 476 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 384 update counter = 3958 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4704 update counter = 217 (12529) Trid: Fri Jun 6 14:05: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530)

46 disable triggers for load of order. create order. assign custnum = 1 orderdate = today ordernum = time. shipdate = today + 1. example 7

47 disable triggers for load of order. create order. assign custnum = 1 orderdate = today ordernum = time. shipdate = today + 1. example 7

Trid: Fri Jun 6 14:13: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 11 dbkey = update counter = 19 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 864 update counter = 71 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4768 update counter = 361 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 3104 update counter = 477 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 384 update counter = 3959 (12529) Trid: code = RL_CXINS version = 2 (12528) Trid: area = 11 dbkey = 4704 update counter = 218 (12529) Trid: code = RL_RMCHG version = 2 (12528) Trid: area = 11 dbkey = update counter = 20 (12529) Trid: Fri Jun 6 14:13: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530)

49 find order 1. misc-info = fill("abc", 6000). display record-length (order). example 8 (... serendipity)

Trid: 0 code = RL_INMEM version = 3 (12528) Trid: 0 dbkey = 0 update counter = 0 (12530) Trid: 0 code = RL_LSTMOD version = 2 (12528) Trid: 0 area = 6 dbkey = 32 update counter = 31 (12529) Trid: 15 Fri Jun 6 15:27: (2598) Trid: 15 User Id: gus (12531) Trid: 15 code = RL_TBGN version = 1 (12528) Trid: 15 dbkey = 0 update counter = 0 (12530) Trid: 15 code = RL_RMDEL version = 2 (12528) Trid: 15 area = 8 dbkey = 3136 update counter = 19 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3136 update counter = 20 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3152 update counter = 6 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 2 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3152 update counter = 7 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3168 update counter = 1 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 3 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3168 update counter = 2 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3184 update counter = 1 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 4 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3184 update counter = 2 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3200 update counter = 1 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 5 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3200 update counter = 2 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3216 update counter = 1 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3200 update counter = 3 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3184 update counter = 3 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3168 update counter = 3 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3152 update counter = 8 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3136 update counter = 21 (12529) Trid: 15 Fri Jun 6 15:27: (2598) Trid: 15 code = RL_TEND version = 1 (12528) Trid: 15 dbkey = 0 update counter = 0 (12530)

Trid: 0 code = RL_INMEM version = 3 (12528) Trid: 0 dbkey = 0 update counter = 0 (12530) Trid: 0 code = RL_LSTMOD version = 2 (12528) Trid: 0 area = 6 dbkey = 32 update counter = 31 (12529) Trid: 15 Fri Jun 6 15:27: (2598) Trid: 15 User Id: gus (12531) Trid: 15 code = RL_TBGN version = 1 (12528) Trid: 15 dbkey = 0 update counter = 0 (12530) Trid: 15 code = RL_RMDEL version = 2 (12528) Trid: 15 area = 8 dbkey = 3136 update counter = 19 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3136 update counter = 20 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3152 update counter = 6 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 2 (12529)

Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3152 update counter = 7 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3168 update counter = 1 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 3 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3168 update counter = 2 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3184 update counter = 1 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 4 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3184 update counter = 2 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3200 update counter = 1 (12529) Trid: 15 code = RL_BKFRM version = 2 (12528) Trid: 15 area = 8 dbkey = 3072 update counter = 5 (12529) Trid: 15 code = RL_BKFRB version = 2 (12528) Trid: 15 area = 8 dbkey = 3200 update counter = 2 (12529) Trid: 15 code = RL_RMCR version = 2 (12528) Trid: 15 area = 8 dbkey = 3216 update counter = 1 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3200 update counter = 3 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3184 update counter = 3 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3168 update counter = 3 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3152 update counter = 8 (12529) Trid: 15 code = RL_RMNXTF version = 2 (12528) Trid: 15 area = 8 dbkey = 3136 update counter = 21 (12529) Trid: 15 Fri Jun 6 15:27: (2598) Trid: 15 code = RL_TEND version = 1 (12528) Trid: 15 dbkey = 0 update counter = 0 (12530)

other stuff

54 DO TRANSACTION: CREATE _View. DELETE _View. END. example 9

Trid: Thu Jun 5 14:25: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 6 dbkey = update counter = 22 (12529) Trid: code = RL_RMDEL version = 2 (12528) Trid: area = 6 dbkey = update counter = 23 (12529) Trid: code = RL_RMCR version = 2 (12528) Trid: area = 6 dbkey = update counter = 24 (12529) Trid: Thu Jun 5 14:25: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530)

56 DISABLE TRIGGERS FOR LOAD OF Customer. DO TRANSACTION: DO i = 1 TO 1: CREATE Customer. DELETE Customer. END. example 10

58 DISABLE TRIGGERS FOR LOAD OF Customer. DO TRANSACTION: REPEAT i = 1 TO 1: CREATE Customer. DELETE Customer. END. example 11

Trid: Thu Jun 5 14:25: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_TMSAVE version = 2 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: Thu Jun 5 14:25: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) subtransaction causes transaction to start 0 notes if using -nosavepoint

60 DEF VAR N AS INT NO-UNDO. DO TRANSACTION: N = CURRENT-VALUE(NextCustNum). END. example 12

62 DEF VAR N AS INT NO-UNDO. DO TRANSACTION: N = NEXT-VALUE(NextCustNum). END. example 13

Trid: Thu Jun 5 14:25: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_SEINC version = 1 (12528) Trid: area = 6 dbkey = 96 update counter = 28 (12529) Trid: Thu Jun 5 14:25: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530)

64 DISABLE TRIGGERS FOR LOAD OF Customer. DO TRANSACTION: REPEAT i = 1 TO 1: CREATE Customer. UNDO. END. example 14

Trid: Thu Jun 5 14:25: (2598) Trid: User Id: gus (12531) Trid: code = RL_TBGN version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_TMSAVE version = 2 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: code = RL_TMSAVE version = 2 (12528) Trid: dbkey = 0 update counter = 0 (12530) Trid: Thu Jun 5 14:25: (2598) Trid: code = RL_TEND version = 1 (12528) Trid: dbkey = 0 update counter = 0 (12530) subtransaction causes main transaction to start 0 notes if using -nosavepoint

66 DISABLE TRIGGERS FOR LOAD OF Customer. DO TRANSACTION: CREATE Customer. UNDO. END. example 15

68 DO TRANSACTION: FIND FIRST Customer NO-LOCK WHERE RECID(Customer) EQ 1 NO-ERROR. UNDO. END. example 16

70 DEF VAR N AS INT NO-UNDO. DO: N = NEXT-VALUE(NextCustNum). END. example 17

Trid: 0 code = RL_SEINC version = 1 (12528) Trid: 0 area = 6 dbkey = 96 update counter = 29 (12529)

72 do transaction: find _myconnect. _myconn-numseqbuffers = 3. end. example 18

74 So...  When was an ‘evil’ transaction started?  What transactions were active during an online backup?  What transactions were active during a quiet point?  What userid is causing the BI file to grow? and why?  Is my database code crappy?  Why did lock table overflow? Who caused it?

76 Answers