-- 1. 현재 Trace 대상 Session 조회 (SYSTEM)
SELECT SID, SERIAL#, USERNAME, SERVICE_NAME, MODULE, ACTION, CLIENT_IDENTIFIER
FROM V$SESSION
WHERE 1 = 1
AND USERNAME IS NOT NULL
;

       SID    SERIAL# USERNAME     SERVICE_NAME     MODULE            ACTION     CLIENT_IDENTIFIER    
---------- ---------- ------------ ---------------- ----------------- ---------- ---------------------
         9      23710 SYSTEM       SYS$USERS        SQL Developer                                     
       134      42707 SCOTT        SYS$USERS        SQL Developer                                     


-- 2. V$SESSION.CLIENT_IDENTIFIER 식별자지정 (SCOTT)
EXEC DBMS_SESSION.SET_IDENTIFIER('ANZINDA');


-- 3. 현재 Trace 대상 Session 조회 (SYSTEM)
SELECT SID, SERIAL#, USERNAME, SERVICE_NAME, MODULE, ACTION, CLIENT_IDENTIFIER
FROM V$SESSION
WHERE 1 = 1
AND USERNAME IS NOT NULL
;

       SID    SERIAL# USERNAME     SERVICE_NAME     MODULE            ACTION     CLIENT_IDENTIFIER    
---------- ---------- ------------ ---------------- ----------------- ---------- ---------------------
         9      23710 SYSTEM       SYS$USERS        SQL Developer                                     
       134      42707 SCOTT        SYS$USERS        SQL Developer                ANZINDA              


-- 4. Trace 해제 -> V$SESSION.CLIENT_IDENTIFIER 지정된 식별자 자동제거 됨
BEGIN
    DBMS_MONITOR.CLIENT_ID_TRACE_DISABLE (
        CLIENT_ID => 'ANZINDA'
    );
END;