Trace files are generated due to some errors in Oracle. We can generate it forcefully after enabling SQL_TRACE=TRUE
parameter. SQL_TRACE parameter can be modified in the session-level and system level. All trace files are logging in USER_DUMP_DEST parameter or BACKGROUND_DUMP_DEST parameter.
Generally, all trace files have read and write permission for Oracle software owner and a group of Oracle installation has the permission to read-only. Other users don’t have privilege of reading.
$cd /opt/oracle/ora11g/admin/orcl/udump
$ls -l
total 23
-rw-r—– 1 oracle oinstall 2048 Jul 23 20:43 orcl1_ora_3423.trc
-rw-r—– 1 oracle oinstall 1024 Jul 24 03:40 orcl1_ora_3517.trc
-rw-r—– 1 oracle oinstall 965 Jul 24 04:06 orcl1_ora_3518.trc
Because trace files may have some important information about database security or may have some sensitive details of data. Due to this reason Oracle’s default setting forced to non-readable to other users in USER_DUMP_DEST directory.
Oracle applies this permission using hidden parameter called _TRACE_FILES_PUBLIC. Default value of _TRACE_FILES_PUBLIC is FALSE. Due to this parameter trace files don’t have read permission to other users or public. It is not recommended to change value of this parameter because it is security risk. But in some scenario it has needed to change permission to make it readable trace files to other users or PUBLIC.
We can change this parameter using parameter file or spfile and make it TRUE.
SELECT x.ksppinm name, y.ksppstvl value
FROM x$ksppi x, x$ksppcv y
WHERE x.inst_id = userenv(‘Instance’)
AND y.inst_id = userenv(‘Instance’)
AND x.indx = y.indx
AND x.ksppinm=’_TRACE_FILES_PUBLIC’;
NAME VALUE
——————————— ————————————
_trace_files_public FALSE
For modifying this parameter login as SYSDBA and execute ALTER SYSTEM command as follows.
SQL> ALTER SYSTEM SET “_trace_files_public” = TRUE SCOPE=SPFILE;
After changing _TRACE_FILES_PUBLIC parameter to TRUE. Newly generated trace has readable permission to other users and the public too.
$cd /opt/oracle/ora11g/admin/orcl/udump
$ls -l
-rw-r–r– 1 oracle oinstall 1433 Jul 24 17:32 orcl1_ora_3577.trc
All the best,
Thanks and regards,
When you want to make a strong Oracle DBA career then you should be aware of database services and other database technology. Without having knowledge of Oracle internals, Oracle performance tuning, and skill of Oracle database troubleshooting you can’t be an Oracle DBA expert.
This expert DBA Team club blog always provides you latest technology news and database news to keep yourself up to date. You should need to be aware of Cloud database technology like DBaaS. All Oracle DBA tips are available in a single unique resource at our orageek. Meanwhile, we are also providing some sql tutorials for Oracle DBA. This is the part of Dbametrix Group and you would enjoy more advanced topics from our partner resource.