The set nologging statement allows you to bypass the logging and recovery system. This can be time-efficient for certain types of batch update operations but must always be used with extreme care.
The set nologging statement is intended to be used solely for large database load operations for which the reduction of logging overhead and logfile space usage outweigh the benefits of having the system recover automatically from update errors.
To suspend transaction logging for the current session, issue the following statement:
set nologging
This statement can be issued only by the DBA of the database on which the session is operating and cannot be issued while currently executing a multi-statement transaction.
After the set nologging statement is issued, updates performed by the current session are not recorded in the log file or journal files. Updates are not reapplied if the database is rolled forward from a checkpoint, and updates do not appear in an audit trail. When transaction logging is suspended:
To use the set nologging option, you as the DBA must:
Important! Do not use the set nologging statement in an attempt to improve performance during everyday use of a production database. Because the recovery procedures for failed nologging transactions are non-automated and require full database restoration, you must consider other methods if database load performance needs improving. For assistance, see the chapter "Improving Database and Query Performance."
To resume logging, issue the following statement:
set logging
The set logging statement re-enables logging for a session for which the set nologging statement was issued.
After set logging is executed, automatic database recovery is again guaranteed.
If you use set nologging on a journaled database, take a new checkpoint immediately after completion of the set nologging operations to establish a new base from which to journal updates.
When a session operation in set nologging mode disconnects from a database, a set logging operation is implicitly executed to bring the database to a guaranteed consistent state before completing the disconnect.
Here is an example sequence of using a set nologging application to load a new database:
The following sequence uses a set nologging application to load data to an existing database:
ckpdb -j dbname
(In VDBA, use the Checkpoint dialog.)
ckpdb +j dbname
This establishes a new point from which rollforwarddb processing can be done.
The load is complete. The database can be made accessible to other applications.