The db2 tutorial I am watching is: 1000 common fool questions for DB2 (fourth). 100.How to delete a sequence?
DROPSEQUENCESEQUENCE_NAME
101. Is there any file format for DB2 that supports import (IMPORT)?
There are: DEL, ASC, IXF, WSF, etc.
102. Is there any file format for DB2 that supports export (EXPORT)?
There are: DEL, IXF, WSF, etc.
ASC format is not supported.
103. Is there any file format for DB2 that supports loading (LOAD)?
There are: DEL, ASC, IXF, etc.
WSF format is not supported.
104. Is there any file format for DB2MOVE that supports DB2?
There are: IXF, etc.
ASC, DEL, WSF formats are not supported.
105. Two components of DB2 database monitoring?
SNAPSHOTMONITOR returns snapshots of database activity at a specific point in time.
Event monitoring (EVENTMONITOR) records the data of events.
106. What is the type of data element that the system monitors?
The counter (COUNTER) records the number of times the activity occurs.
Measure (GAUGE) The current value of the measurement entry.
The maximum or minimum value that the waterline (WATERMARK) reaches from the monitoring element.
Information (INFORMATION) details of the reference type of monitoring activity.
The date and time when the time point (TIMESTAMP) activity occurs.
Time (TIME) returns the time spent on an activity.
107. How to know the number of pages required to monitor the heap?
(NUMBEROFMONITORINGAPPLICATIONS+1)*(NUMBEROFDATABASES*(800+(NUMBEROFTABLES
ACCESSED*20)+((NUMBEROFAPPLICATIONSCONNECTED+1)*(200+(NUMBEROFTABLE
SPACES*100)))))/4096
Its size is controlled by the parameter MON_HEAD_SZ.
108.How to establish an event monitor?
CREATEEVENTMONITORTABLEMONFORTABLESWRITETOFILE'D:\TEMP'
109. How to activate the event monitor?
SETEVENTMONITORTABLEMONSTATE1
110.How to stop the event monitor?
SETEVENTMONITORTABLEMONSTATE0
111. How to query the status of the monitor?
SELECTEVMONNAME,EVENT_MON_STATE(EVMONNAME)
112. How to delete event monitor?
DROPEVENTMONITORTABLEMON
What is the difference between creating a pipeline event monitor on WINDOWS (PIPE means EVNT, see MONITOR)?
Step 1: Define the event monitor
UNIX:
CONNECTTOSAMPLE
CREATEEVENTMONITORSTMB2FORSTATEMENTSWRITETOPIPE'/TMP/EVPIPE1'
WINDOWS:
CONNECTTOSAMPLE
CREATEEVENTMONITORSTMB2FORSTATEMENTSWRITETOPIPE'\\.\TMP\EVPIPE1'
Step 2: Establish a named pipeline
UNIX:
You can use the MKFIFO() function or the MKFIFO command.
WINDOWS:
You can use the CREATENAMEDPIPE() function, and the pipeline name is the same as the specified name of CREATEEVENTMONITOR.
Step 3: Open the named pipe
UNIX:
Use the OPEN() function.
WINDOWS:
Use the CONNECTNAMEDPIPE() function.
You can also use the DB2EVMON command, such as:
DB2EVMON-DBSAMPLE-EVMSTMB2
Step 4: Activate the named pipe event monitor
Unless the named pipe event monitor is automatically activated
SETEVENTMONITORSTMB2STATE1
Step 5: Read data from the named pipe
UNIX:
You can use the READ() function.
WINDOWS:
You can use the READFILE() function.
Step 6: Stop the Event Monitor
SETEVENTMONITORSTMB2STATE0
Step 7: Close the named pipe
UNIX:
You can use the CLOSE() function.
WINDOWS:
The DISCONNECTNAMEDPIPE() function can be used.
Step 8: Delete the named pipe
UNIX:
The UNLINK() function can be used.
WINDOWS:
You can use the CLOSEHANDLE() function.
114. What are the categories of SQL statements in DB2?
DCL: Data control language, providing access to database objects.
DDL: Data definition language, creating, modifying, and deleting database objects.
DML: a data manipulation language, used to insert, update, and delete data.
DROPSEQUENCESEQUENCE_NAME
101. Is there any file format for DB2 that supports import (IMPORT)?
There are: DEL, ASC, IXF, WSF, etc.
102. Is there any file format for DB2 that supports export (EXPORT)?
There are: DEL, IXF, WSF, etc.
ASC format is not supported.
103. Is there any file format for DB2 that supports loading (LOAD)?
There are: DEL, ASC, IXF, etc.
WSF format is not supported.
104. Is there any file format for DB2MOVE that supports DB2?
There are: IXF, etc.
ASC, DEL, WSF formats are not supported.
105. Two components of DB2 database monitoring?
SNAPSHOTMONITOR returns snapshots of database activity at a specific point in time.
Event monitoring (EVENTMONITOR) records the data of events.
106. What is the type of data element that the system monitors?
The counter (COUNTER) records the number of times the activity occurs.
Measure (GAUGE) The current value of the measurement entry.
The maximum or minimum value that the waterline (WATERMARK) reaches from the monitoring element.
Information (INFORMATION) details of the reference type of monitoring activity.
The date and time when the time point (TIMESTAMP) activity occurs.
Time (TIME) returns the time spent on an activity.
107. How to know the number of pages required to monitor the heap?
(NUMBEROFMONITORINGAPPLICATIONS+1)*(NUMBEROFDATABASES*(800+(NUMBEROFTABLES
ACCESSED*20)+((NUMBEROFAPPLICATIONSCONNECTED+1)*(200+(NUMBEROFTABLE
SPACES*100)))))/4096
Its size is controlled by the parameter MON_HEAD_SZ.
108.How to establish an event monitor?
CREATEEVENTMONITORTABLEMONFORTABLESWRITETOFILE'D:\TEMP'
109. How to activate the event monitor?
SETEVENTMONITORTABLEMONSTATE1
110.How to stop the event monitor?
SETEVENTMONITORTABLEMONSTATE0
111. How to query the status of the monitor?
SELECTEVMONNAME,EVENT_MON_STATE(EVMONNAME)
112. How to delete event monitor?
DROPEVENTMONITORTABLEMON
What is the difference between creating a pipeline event monitor on WINDOWS (PIPE means EVNT, see MONITOR)?
Step 1: Define the event monitor
UNIX:
CONNECTTOSAMPLE
CREATEEVENTMONITORSTMB2FORSTATEMENTSWRITETOPIPE'/TMP/EVPIPE1'
WINDOWS:
CONNECTTOSAMPLE
CREATEEVENTMONITORSTMB2FORSTATEMENTSWRITETOPIPE'\\.\TMP\EVPIPE1'
Step 2: Establish a named pipeline
UNIX:
You can use the MKFIFO() function or the MKFIFO command.
WINDOWS:
You can use the CREATENAMEDPIPE() function, and the pipeline name is the same as the specified name of CREATEEVENTMONITOR.
Step 3: Open the named pipe
UNIX:
Use the OPEN() function.
WINDOWS:
Use the CONNECTNAMEDPIPE() function.
You can also use the DB2EVMON command, such as:
DB2EVMON-DBSAMPLE-EVMSTMB2
Step 4: Activate the named pipe event monitor
Unless the named pipe event monitor is automatically activated
SETEVENTMONITORSTMB2STATE1
Step 5: Read data from the named pipe
UNIX:
You can use the READ() function.
WINDOWS:
You can use the READFILE() function.
Step 6: Stop the Event Monitor
SETEVENTMONITORSTMB2STATE0
Step 7: Close the named pipe
UNIX:
You can use the CLOSE() function.
WINDOWS:
The DISCONNECTNAMEDPIPE() function can be used.
Step 8: Delete the named pipe
UNIX:
The UNLINK() function can be used.
WINDOWS:
You can use the CLOSEHANDLE() function.
114. What are the categories of SQL statements in DB2?
DCL: Data control language, providing access to database objects.
DDL: Data definition language, creating, modifying, and deleting database objects.
DML: a data manipulation language, used to insert, update, and delete data.
12Next pageRead the full text