I have been working on correcting (and understanding) a logon trigger that sets trace on...
In short, the trigger does the following:
1) I set a string that includes the users name to append to the trace file: s_trace_file_name := LOWER(SYS_CONTEXT('userenv', 'session_user'));
2) I alter the session to set the tracefile_identifier (v$process.traceid): EXECUTE IMMEDIATE 'ALTER SESSION SET TRACEFILE_IDENTIFIER='''|| s_trace_file_name||'''';
3) Finally, I set trace on: EXECUTE IMMEDIATE 'ALTER SESSION SET EVENTS ''10046 trace name context forever, level 12''';
To accomodate errors resulting from user names including hyphens and single quotes, I have updated the trigger to replace those characters when setting the string: s_trace_file_name := replace(replace(LOWER(SYS_CONTEXT('userenv', 'session_user')),'-', '_'), '''' , '_');
I have reviewed the documentation for the TRACEFILE_IDENTIFIER parameter, and it states the properties as follows:
Parameter type is String
Syntax is TRACEFILE_IDENTIFIER = "traceid"
Default value is There is no default value.
Modifiable is ALTER SESSION
Range of Values is Any characters that can occur as part of a file name on the customer platform.
My platform is Unix and there is no problem with creating a file name that includes a hyphen.
The error is created with either of the following commands:
alter session set tracefile_identifier = "john.-.doe";
alter session set tracefile_identifier = 'john.-.doe';
ERROR:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-02236: invalid file name
Works fine if the hyphen is replaced with underscore:
alter session set tracefile_identifier = "john._.doe";
alter session set tracefile_identifier = 'john._.doe';
That's the background of what has been done. My question is: Are there known characters that are INVALID in setting the TRACEFILE_IDENTIFIER? Clearly the documentation indicates that any characters are valid, but the errors indicate otherwise.
Thanks for any help!
Sorry for the post length, just trying to give all the details...
In short, the trigger does the following:
1) I set a string that includes the users name to append to the trace file: s_trace_file_name := LOWER(SYS_CONTEXT('userenv', 'session_user'));
2) I alter the session to set the tracefile_identifier (v$process.traceid): EXECUTE IMMEDIATE 'ALTER SESSION SET TRACEFILE_IDENTIFIER='''|| s_trace_file_name||'''';
3) Finally, I set trace on: EXECUTE IMMEDIATE 'ALTER SESSION SET EVENTS ''10046 trace name context forever, level 12''';
To accomodate errors resulting from user names including hyphens and single quotes, I have updated the trigger to replace those characters when setting the string: s_trace_file_name := replace(replace(LOWER(SYS_CONTEXT('userenv', 'session_user')),'-', '_'), '''' , '_');
I have reviewed the documentation for the TRACEFILE_IDENTIFIER parameter, and it states the properties as follows:
Parameter type is String
Syntax is TRACEFILE_IDENTIFIER = "traceid"
Default value is There is no default value.
Modifiable is ALTER SESSION
Range of Values is Any characters that can occur as part of a file name on the customer platform.
My platform is Unix and there is no problem with creating a file name that includes a hyphen.
The error is created with either of the following commands:
alter session set tracefile_identifier = "john.-.doe";
alter session set tracefile_identifier = 'john.-.doe';
ERROR:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-02236: invalid file name
Works fine if the hyphen is replaced with underscore:
alter session set tracefile_identifier = "john._.doe";
alter session set tracefile_identifier = 'john._.doe';
That's the background of what has been done. My question is: Are there known characters that are INVALID in setting the TRACEFILE_IDENTIFIER? Clearly the documentation indicates that any characters are valid, but the errors indicate otherwise.
Thanks for any help!
Sorry for the post length, just trying to give all the details...