• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

retrieve SQL_TRACE value

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
In my JDBC implementation, I need to alter session's trace value sometimes.
Befrore I alter the current session trace value, I need to know whether the current trace has been enabled or not. We know that trace can been set in ini.ora, if trace has been set in ini.ora, I do not need to enable trace at my JDBC connection. How can I retrieve the default SQL_TRACE value?
Thanx
Howard
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now, I know that this answer will not be specific. But there are v$ and dba_ views that give you every piece of information about your Oracle database. The specific one that holds the information from the init.ora is not right off the top of my head.
My guess is that it is either v$parameter or dba_parameter. But that is a complete guess. And since my work won't give me DBA priviledges, I can't go check.
And on that note, you must log in as a DBA or sysDBA to access this information. Which in a Java class, seems to scare me greatly.
Can't you set it in a try-catch statement and if it is already set, then an exception will be thrown that you catch, and continue on, since it is already running.
Mark
[ October 06, 2003: Message edited by: Mark Spritzler ]
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark it's actually a little more complicated.
See this note:
http://www.ixora.com.au/q+a/sqlopt.htm

V$PARAMETER still shows sql_trace as being set to FALSE, even after it has been explicitly set to TRUE using ALTER SESSION. Why?
The answer is that it does not really change the parameter. It sets an event that is equivalent. If you use the which_events.sql script, you should see that event 10046 is set at level 1.


I can't see any way to find out from v$session, v$process etc.
Simon
[ October 07, 2003: Message edited by: Simon Lee ]
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then I like my try-catch solution.
Mark
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic