The SNAP_WRITE_FILE procedure writes system snapshot data
to a file in the tmp subdirectory of the instance
directory.
Important: The SNAP_WRITE_FILE
procedure is deprecated and might be removed in a future release.
Start using the monitoring SQL interfaces. If you still need to write
snapshot data to a file, use other methods before this procedure becomes
discontinued.
Syntax
>>-SNAP_WRITE_FILE--(--requestType--,--dbname--,--member--)----><
The schema is SYSPROC.
Procedure parameters
- requestType
- An input argument of type VARCHAR (32) that specifies a valid
snapshot request type. The possible request types are text identifiers
based on defines in sqlmon.h, and are one of:
- APPL_ALL
- BUFFERPOOLS_ALL
- DB2
- DBASE_ALL
- DBASE_LOCKS
- DBASE_TABLES
- DBASE_TABLESPACES
- DYNAMIC_SQL
- dbname
- An input argument of type VARCHAR(128) that specifies a valid
database name in the same instance as the currently connected database
when calling this function. Specify a database name that has a directory
entry type of either "Indirect" or "Home", as returned by the LIST
DATABASE DIRECTORY command. Specify NULL or
empty string to take the snapshot from the currently connected database.
- member
- An input argument of type INTEGER that specifies a valid member
number. Specify -1 for the current member,
or -2 for an aggregate of all active members.
An active member is a member where the database is available for connection
and use by applications.
If a null value is specified, -1 is
set implicitly.
Authorization
One of the following
authorizations is required to execute the procedure:
- EXECUTE privilege on the procedure
- DATAACCESS authority
To access snapshot monitor data, one of the following
authorities is also required:
- SYSMON authority
- SYSCTRL authority
- SYSMAINT authority
- SYSADM authority
Note: If you do not have SYSMON, SYSCTRL,
SYSMAINT, or SYSADM authority, you can read the saved snapshot data
by passing null values as the inputs to snapshot functions.
Default PUBLIC privilege
In
a non-restrictive database, EXECUTE privilege is granted to PUBLIC
when the procedure is automatically created.
Example
Take a snapshot of database manager
information by specifying a request type of 'DB2' (which corresponds
to SQLMA_DB2), and defaulting to the currently connected database
and current database partition.
CALL SYSPROC.SNAP_WRITE_FILE ('DB2', '', -1)
This
will result in snapshot data being written to the instance temporary
directory, which is sqllib/tmp/SQLMA_DB2.dat on UNIX operating systems, and sqllib\DB2\tmp\SQLMA_DB2.dat on
a Windows operating system.
Usage notes
If an unrecognized input parameter
is provided, the following error is returned: SQL2032N The
"REQUEST_TYPE" parameter is not valid.