《循序渐进Oracle数据库管理、优化与备份恢复》脚本收集

gettrcname.sql:获得跟踪文件名称

SELECT 
  a.VALUE || b.symbol || c.instance_name || '_ora_' || d.spid ||  '.trc' TRACE_FILE_NAME
FROM 
  (SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest')  a,
  (SELECT SUBSTR(VALUE, -6, 1) symbol  FROM v$parameter WHERE NAME = 'user_dump_dest')  b,
  (SELECT instance_name FROM v$instance) c,
  (SELECT spid FROM v$session s, v$process p, v$mystat m WHERE s.paddr = p.addr AND s.SID = m.SID AND m.statistic# = 0) d

 

你可能感兴趣的:(oracle,sql,C++,c,脚本)