DB2_安全

redhouser發表於2011-07-15

目的:
測試DB2安全,本指令碼摘錄自DB2安裝目錄admin_scripts/security.db2。
版本:Windows DB2 Express-C V9.7

操作步驟:
使用"db2cmd db2 -t"進入互動模式,執行後續操作。

-- Connect to sample database
CONNECT TO SAMPLE;

-- Retrieve the group to which the user belongs to
SELECT * FROM table (SYSPROC.AUTH_LIST_GROUPS_FOR_AUTHID (CURRENT USER)) AS ST;
--作業系統中使用者所屬組

-- Retrieve the objects owned by the current user
SELECT * FROM  SYSIBMADM.OBJECTOWNERS WHERE WNER = CURRENT USER;
   
-- Retrieve authorities/privileges directly granted to the user
SELECT * FROM SYSIBMADM.PRIVILEGES WHERE AUTHID = CURRENT USER;

-- Retrieve the authorization type of the authid
SELECT * FROM SYSIBMADM.AUTHORIZATIONIDS WHERE AUTHID = CURRENT USER;

-- Disconnect from the sample database;
CONNECT RESET;

TERMINATE;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18922393/viewspace-702291/,如需轉載,請註明出處,否則將追究法律責任。

相關文章