2026-03-12 20:23:15

This commit is contained in:
root
2026-03-12 21:23:47 +01:00
parent eab4b36eca
commit 93039b8489
3332 changed files with 699614 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
-- GRANT SELECT ON v_$process TO system;
-- GRANT SELECT ON v_$session TO system;
-- Put OS PID into v$session.client_identifier so that it'd get recorded in ASH
-- This works with dedicated sessions. With Oracle shared servers (MTS)
-- the OS PID that was used during logon will be recorded (not necessarily the
-- process ID that gets used later)
-- If you don't want to overwrite the client_identifier, you could just append
-- the ospid= string into the end of current client id.
CREATE OR REPLACE TRIGGER logon_trigger_ospid
AFTER LOGON ON DATABASE
DECLARE
ospid NUMBER;
BEGIN
SELECT spid INTO ospid
FROM v$process
WHERE addr = (SELECT paddr FROM v$session WHERE sid = USERENV('sid'));
DBMS_SESSION.SET_IDENTIFIER('ospid='||TRIM(TO_CHAR(ospid)));
END;
/