Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

retrieve SQL_TRACE value

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then I like my try-catch solution.
Mark
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!