1>拿到当前system时间
(You can use any of the SYSDUMMYxtables
when you need to write a query, but no data from a table is referenced.
In any query, you must specify a table reference in the FROM clause,
but if the query does not reference any data from the table, it does not
matter which table is referenced in the FROM clause. Each of the
SYSDUMMYxtables contains one row, so a SYSDUMMYxtable can be referenced in a SELECT INTO statement without the need for a predicate to limit the result to a single row of data)
SELECT NOW() FROM SYSIBM/SYSDUMMY1SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1SELECT CURRENT TIMESTAMP FROM SYSIBM.SYSDUMMY1
2>从journal recevier 拿到特定user的记录
(The DISPLAY_JOURNAL table function returns information about journal entries. It returns information similar to what is returned by the Display Journal (DSPJRN) CL command and the Retrieve Journal Entries (QjoRetrieveJournalEntries) API)
SELECT *FROM TABLE (QSYS2.DISPLAY_JOURNAL('QSYS' , 'QAUDJRN' ,JOURNAL_ENTRY_TYPES=>'DO' ,STARTING_RECEIVER_NAME=>'*CURCHAIN')) AS JDOwhere job_User = 'AMAPICS'
3>按内存使用大小排序用户
(
The USER_STORAGE view contains details about storage by user profile.
The user storage consumption detail is determined by using Retrieve User Information (QSYRUSRI) API.
You must have *OBJOPR and *READ authority to a *USRPRF or it will not be returned. To see information for independent ASPs (iASPs), the iASP must be varied on.
User storage is broken down by SYSBAS and iASPs.
SELECT AUTHORIZATION_NAME, STORAGE_USED,DENSE_RANK()OVER (ORDER BY storage_used DESC ) AS rankFROMQSYS2/USER_STORAGE
4>查询当前作业的日志(便于保存分析)
(The JOBLOG_INFO table function returns one row for each message in a job log.)
SELECT MESSAGE_TEXT FROMTABLE(QSYS2.JOBLOG_INFO('*')) AWHERE A.MESSAGE_TYPE = 'REQUEST'ORDER BY ORDINAL_POSITION DESCFETCH FIRST 100 ROW ONLY
更多具体table讲解和使用,可以参考IBM官网(非常非常详细的链接)


后台回复 IBM7.2
可以获取详细链接。




