Check Transaction Log File Use of File System Space
TimesTen saves a copy of the database in two checkpoint files, which are stored in the directory specified by the DataStore
attribute. Each checkpoint file can grow on the file system to be equivalent to the size of the database in shared memory. For each permanent database, you must have enough file system space for the two checkpoint files and for transaction log files.
Transaction log files accumulate in the directory specified by the LogDir
attribute and are only deleted when checkpoints are performed. If the LogDir
attribute is not specified in the DSN, transaction log files accumulate in the directory specified by the DataStore
attribute. The maximum size of your transaction log files is set by the LogFileSize
attribute.
When a file system fills up with TimesTen data, it is most often due to a build-up of transaction log files. Transaction log files are used for numerous purposes in TimesTen, including transaction rollbacks, backups, and replication. It is important to determine which operation is putting a "hold" on the transaction log files, so that appropriate action can be taken to enable the transaction log files to be purged. This can be done by using the ttLogHolds
built-in procedure. There are six types of log holds. They are discussed in detail below.
-
Long-running transactions - TimesTen uses the transaction log to roll back transactions. A log hold is placed for the duration of a transaction. Transactions that are active for a long time result in log file building up if the transaction has written at least one log record. (That is, it is not a read-only transaction.) Commit write transactions with reasonable frequency to avoid significant log file build-up. See Size Transactions Appropriately in the Oracle TimesTen In-Memory Database Operations Guide for more information on transaction length.
-
Checkpoint - If a TimesTen application crashes and the database must be recovered, the checkpoint files and transaction log files are used to recover the data. The "most recent" transaction log files are used -- those written since the checkpoint was done. Transaction log files accumulate during the interval between checkpoints. If checkpoints are done very infrequently, a large number of transaction log files may accumulate, particularly if many changes are made to the database during that interval. See Checkpoint Operations in the Oracle TimesTen In-Memory Database Operations Guide.
-
Replication -TimesTen replication transmits changes from one database to one or more other databases. It does this by reading the transaction log and sending any relevant changes. If replication goes down, the transaction log files build up. See Set the Replication State of Subscribers in Oracle TimesTen In-Memory Database Replication Guide for more information on pausing and restarting or resetting replication.
-
Backup - TimesTen supports an incremental backup facility that uses transaction log files to augment a backup with changes made since the last backup. Transaction log files accumulate during the interval between incremental backups. To avoid a large log build-up, do incremental backups at relatively frequent intervals. If desired, disable incremental backups and do full backups instead.
See Back Up, Restore, and Migrate Data in TimesTen Classic in the Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide for more information.
-
XLA - TimesTen's persistent XLA facility reports changes to the database by using transaction log files. Transaction log files are kept until the corresponding transactions have been acknowledged using the
ttXlaAcknowledge
C function. CallttXlaAcknowledge
frequently enough to prevent transaction log files building up. See Retrieving Update Records from the Transaction Log in the Oracle TimesTen In-Memory Database C Developer's Guide. -
XA - TimesTen's XA support uses transaction log files to resolve distributed transactions. If these transactions are not resolved in a timely manner, transaction log files build up. See Distributed Transaction Processing: XA in the Oracle TimesTen In-Memory Database C Developer's Guide.
The following attributes are related to file system use.
-
The
LogPurge
attribute indicates whether transaction log files that no longer have a hold on them are purged (removed from the file system) or simply archived (renamed). If theLogPurge
attribute is set to the default value of 0, TimesTen renames transaction log files that it no longer needs by appending the string.arch
to the name. Once renamed, you must delete the transaction log files manually when they are no longer needed. If transaction log files are not purged, they continue to accumulate space, even when no longer needed by TimesTen. -
The
Preallocate
attribute indicates whether file system space should be reserved for checkpoint files at connect time. This is useful for big databases, to ensure that the file system always has room for the checkpoint files as data is added to the database.