DB2 Server for VM: System Administration


Switching Log Modes

In general, you should not switch indiscriminately between log modes Y, N, L, and A: pick one mode and stick to it. However, switching to another mode may at times be required. (See Choosing a Log Mode for description of log modes.)

From LOGMODE=A

To switch to LOGMODE=Y or N:

  1. Issue either an SQLEND ARCHIVE or an SQLEND UARCHIVE command. With SQLEND ARCHIVE, a database archive is automatically taken, then the application server shuts down; with SQLEND UARCHIVE, the application server shuts down immediately, then you take the user archive (using your own facilities).
  2. Start the application server with STARTUP=L and LOGMODE=Y to perform a COLDLOG to reformat the log.
  3. Run the SQLLOG EXEC, omitting the LOG1 and LOG2 parameters, to reformat the logs. Respond CONTINUE to message ARI0688D (for single logging) or ARI6129D (for dual logging). Respond 0 to message ARI0944D to reformat the log minidisks. For more information, see Running the SQLLOG EXEC.
  4. Start the application server with STARTUP=W and LOGMODE=Y or N.

To switch to LOGMODE=L:

  1. Issue either an SQLEND ARCHIVE or an SQLEND UARCHIVE command. With SQLEND ARCHIVE, a database archive is automatically taken, then the application server shuts down; with SQLEND UARCHIVE, the application server shuts down immediately, then you take the user archive. In either case, this database archive serves as the starting point for subsequent log archives.

    You do not have to take this database archive under either of the following two conditions:

    In either of these situations, the database archive you took (or restored) is in the current restore set.

  2. Start the application server with STARTUP=W and LOGMODE=L.

From LOGMODE=L

To switch to LOGMODE=Y or N:

  1. Shut down the application server by issuing an SQLEND LARCHIVE operator command to save the log.
  2. Run the SQLLOG EXEC, omitting the LOG1 and LOG2 parameters, to reformat the logs. Respond CONTINUE to message ARI0688D (for single logging) or ARI6129D (for dual logging). Respond 0 to message ARI0944D to reformat the log minidisks. For more information, see Running the SQLLOG EXEC.
  3. Start the application server with STARTUP=W and LOGMODE=Y or N.

To switch to LOGMODE=A:

  1. Shut down the application server by issuing an SQLEND LARCHIVE operator command to save the log.
  2. Start the application server with STARTUP=W and LOGMODE=A.

    You will be warned that the continuity of the log archives will be broken.

Switching the log mode when you have been using log archiving will interrupt the continuity of the log archives, unless all you do is switch from LOGMODE=L to A and then back again without taking a database archive. (This protects you from losing a sequence of log archives if you accidentally set LOGMODE to A.) If the continuity is broken and work is done on the database, you will not be able to restore the database to its current level by using database and log archives taken prior to the break. Figure 75 shows this situation:

Figure 75. Log Archive Continuity


REQTEXT

In the above diagram:

From LOGMODE=Y or N

To switch to LOGMODE=A:

  1. Start the application server with STARTUP=W, LOGMODE=Y, and SYSMODE=M.
  2. Issue either an SQLEND ARCHIVE or an SQLEND UARCHIVE command. With SQLEND ARCHIVE, a database archive is automatically taken, then the application server shuts down; with SQLEND UARCHIVE, the application server shuts down immediately, then you take the user archive (using your own facilities).
  3. Start the application server with STARTUP=W and LOGMODE=A.

To switch to LOGMODE=L:

  1. Start the application server with STARTUP=W, LOGMODE=Y, and SYSMODE=M.
  2. Issue either an SQLEND ARCHIVE or an SQLEND UARCHIVE command. With SQLEND ARCHIVE, a database archive is automatically taken, then the application server shuts down; with SQLEND UARCHIVE, the application server shuts down immediately, then you take the user archive.

    The continuity of the log archives will have been interrupted by any work that was done while LOGMODE was set to Y or N, so you must take a new database archive. This database archive will serve as the starting point for subsequent log archives.

  3. Start the application server with STARTUP=W and LOGMODE=L.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]