DB2 Server for VSE & VM: Operation


Stopping the Application Server

You can stop the application server when in multiple user mode by issuing the SQLEND operator command.

In single user mode, the application server stops after the application terminates, and displays informational messages. In all situations, the database manager closes the database:

CMS files and trace files (if any are active).
VSE accounting, and trace files (if active).

The syntax of the SQLEND command is as follows:



             .-NORMAL-------------.
>>-SQLEND----+--------------------+---+----------+-------------->
             +-ARCHIVE--+------+--+   '-DVERIFY--'
             |          '-FULL-'  |
             +-LARCHIVE-----------+
             +-UARCHIVE-----------+
             '-QUICK--------------'
 
>-----+-----------+--------------------------------------------><
      '-TRCPURGE--'
 
Note:SHUTDOWN is a valid synonym for SQLEND.

Keyword
Description

NORMAL
indicates that new users cannot access the application server. When all current users are finished, the application server ends.
Note:New users refers to users who are not currently connected to the application server. Whether active or not, both types of users are classified as existing or current users. (NORMAL is the default.)

ARCHIVE
specifies that new users cannot access the application server. When all current users are finished, the database manager archives the entire database and ends. You can specify ARCHIVE when the application server is running with LOGMODE set to A, Y, or L. If LOGMODE=L, the log is archived if there is information in the log before archiving the database.

If LOGMODE=Y, the application server automatically switches to LOGMODE=A to create the database archive. To continue to run with LOGMODE=Y, you must do a COLDLOG to switch back to LOGMODE=Y from LOGMODE=A.

FULL
an archive taken with the FULL option can be used as the full backup associated with an incremental backup taken with the Data Restore feature.

LARCHIVE
indicates that new users cannot access the application server. When all current users are finished, the system archives the log, which contains a record of changes made to the database, and ends. You can specify LARCHIVE only when LOGMODE=L. If you specify LARCHIVE when LOGMODE is not set to L, an error message is displayed.

UARCHIVE
specifies that new users cannot access the application server. When all current users are finished, the application server indicates in its log that a user archive will be done and the application server ends. Then you must archive the directory and dbextents using your own backup utilities and procedures. Do not archive the log with non-DB2 Server for VSE & VM facilities.

You can specify UARCHIVE regardless of the LOGMODE setting. If LOGMODE=L, the database manager archives the log before ending if there is information in the log.

If LOGMODE=Y, the database manager automatically switches to LOGMODE=A to prepare for the user archive. To continue to run with LOGMODE=Y, you must do a COLDLOG to switch back to LOGMODE=Y from LOGMODE=A.

QUICK
causes the database manager to end immediately. All users are immediately disconnected from the application server or application server partition.

DVERIFY
causes the application server to verify its directory before ending. You can specify this keyword with any other SQLEND keyword or by itself. When SQLEND is specified without keywords, a normal shutdown is implied. When SQLEND is specified with QUICK, the application server ignores DVERIFY.

The application server displays a message if it finds an error in its directory. If there is an error, and you have specified ARCHIVE, the application server does not archive the database. If you specified ARCHIVE and LOGMODE to be set to L, the database manager does the log archive if there is information in the log, but does not do the database archive.

When you specify LARCHIVE, and there are discrepancies in the directory, the database manager does the log archive anyway, because the discrepancies are in the directory, not the log.

If you specified UARCHIVE and there is an error in the directory, do not archive the database. (A message reminds you not to do the archive.) If LOGMODE is set to L when you specify UARCHIVE, the database manager archives the log if there is information in the log. Refer to the DB2 Server for VSE & VM Diagnosis Guide and Reference for information on recovering from directory errors.

TRCPURGE
specifies if you want to purge the contents of the trace buffer at DB2 Server for VSE & VM shutdown. An output trace file will not be created for the trace buffer in this case. The TRCPURGE parameter is ignored if there is no trace buffer in use when SQLEND is issued.

The following table summarizes archive activity at shutdown based on the SQLEND parameters and the LOGMODE setting. See Archiving the Database for an explanation of logmodes N, Y, L, and A.

Figure 7. Summary of Archives Done at Shutdown
SQLEND Parameter Logmode
N Y L A
NORMAL Not applicable None None None
QUICK Not applicable None None None
ARCHIVE Not applicable The database manager archives the database. 1, 2, 3 The database manager does a log archive if there is information in the log, and then does a database archive. 1, 3 The database manager archives the database. 1, 3
LARCHIVE Not applicable You cannot specify LARCHIVE when LOGMODE=Y. (An error message is displayed.) The database manager does a log archive. You cannot specify LARCHIVE when LOGMODE=A. (An error message is displayed.)
UARCHIVE Not applicable The operator archives the database after shutdown. 1, 2 The database manager does a log archive if there is information in the log; then the operator archives the database after shutdown. 1 The operator archives the database after shutdown. 1
Notes:

1
If you have specified DVERIFY, and DVERIFY is successful, the database manager does the archives shown in Figure 7. You should do user archives as appropriate. If DVERIFY fails, the database manager does all log archives indicated, but not the database archive. Any inconsistency in the database is recorded in the database archive, and a subsequent restore using that archive will fail. Do not do a user archive when DVERIFY fails.

2
If LOGMODE is set to Y when you issue the SQLEND command, and you specify either ARCHIVE or UARCHIVE, LOGMODE is automatically reset to A.

3
If the FULL parameter is specified, the archive can be used as the full backup associated with an incremental backup taken with the Data Restore feature.

Because NORMAL, ARCHIVE, LARCHIVE, and UARCHIVE let users complete their work, a delay occurs before the application server ends. After entering SQLEND with one of these keywords, you can enter the SHOW USERS command to determine who is still using the application server. The SHOW USERS command is described on page ***.

When you specify ARCHIVE or LARCHIVE (or UARCHIVE with LOGMODE=L), the database manager writes information to tape, unless you are in a VM environment and you are taking a log archive to disk. After all database manager activity stops, the database manager then requests that you mount the required tape volume(s) to store the archive. At the same time, it displays information that you can use to label the tape externally.

In VM only, when the database manager prompts you to mount and prepare the archive volume, respond with the virtual device number. Unless you have entered your own CMS FILEDEF command before starting the application server, the virtual device number for database archives is 181. The default virtual device number for log archives is 183. If you are taking a log archive to disk, you do not have to know the virtual device number. You can direct the archive to disk during the log archive, or change the FILEDEF command for the log archive file before starting the application server. For information on directing the log archive to disk, see your system administrator, or refer to the description of archiving procedures in the DB2 Server for VM System Administration.

When you enter SQLEND NORMAL, ARCHIVE, LARCHIVE, or UARCHIVE, the application server displays a message that indicates the number of agents or agent structures still active. An agent structure is the internal representation for a user. As agents become inactive, the application server issues another message with an updated count.

If you do a quick stop using the SQLEND QUICK command, the application server immediately inactivates all agents and agent structures. It then displays return code 508. You can enter an SQLEND QUICK command at any time, even after issuing an SQLEND with another keyword.


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