📜  连接后的 oracle 触发器 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:56.699000             🧑  作者: Mango

代码示例1
CREATE OR REPLACE TRIGGER my_schema.trigger_name AFTER LOGON ON DATABASE
BEGIN
    INSERT INTO my_log_table
    VALUES (USER AS CONNECTED_USER,
        sys_context('USERENV', 'SESSIONID') AS SESSION_ID,
        substr(sys_context('USERENV', 'OS_USER'), 1, 50) AS OS_USER,
        substr(sys_context('USERENV', 'HOST'), 1, 30) AS HOST,
        SYSDATE AS LOGON_DATE);
END;
ALTER TRIGGER my_schema.trigger_name ENABLE;