Timezone set incorrectly in Oracle automated database maintenance tasks
- Article Type: General
- Product: Aleph
- Product Version: 20
Description:
We find that the time zone is set incorrectly in our Oracle automated database maintenance tasks (see, for instance, KB 16384-31441), so that they run in the middle of the day instead of at night.
Resolution:
Use the following script, and the attached class (GetSystemTimeZone.class), to set the timezone correctly:
#!/bin/csh
set get_timezone=`java -cp . GetSystemTimeZone`
set primo_dba_pw=`get_ora_passwd primo_dba`
sqlplus -s primo_dba/$primo_dba_pw as sysdba << EOF
exec dbms_scheduler.set_scheduler_attribute('default_timezone','$get_timezone');
EOF
exit
At this particular site the above did not work....
I tried this on several servers under several Java implementations, but cannot don't find any which have GetSystemTimeZone. Tried under both our Aleph 20 and Primo server accounts, and get missing definitions
aleph20@timothy(a20_1) NDU50> java -cp . GetSystemTimeZone
Exception in thread "main" java.lang.NoClassDefFoundError: GetSystemTimeZone
primo@martha(p3_1):~/p3_1/primom$java -cp . GetSystemTimeZone
Exception in thread "main" java.lang.NoClassDefFoundError: GetSystemTimeZone
Caused by: java.lang.ClassNotFoundException: GetSystemTimeZone
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: GetSystemTimeZone. Program will exit.
The site *was* able to do the following successfully:
exec DBMS_SCHEDULER.SET_SCHEDULER_ATTRIBUTE('default_timezone','US/Eastern');
- Article last edited: 10/8/2013