Wuhai’s Weblog

October 27, 2008

How to properly rotate OracleAS log files

Filed under: Linux,OracleAS — wuhai @ 4:23 am

To use logrotate, particularly its option ‘copytruncate’.

cat /etc/logrotate.d/oracleas

/home/oracle/OraAPP/j2ee/oc4j_container/log/oc4j_container_default_island_1/server.log {
daily
missingok
rotate 5
compress
delaycompress
notifempty
copytruncate
}

To quickly test it:

# logrotate -f /etc/logrotate.conf
From /usr/sbin/lsof | grep server.log, we could see the mapping of inode# and java pid is still the same before and after the log rotation.

copytruncate
Truncate  the  original log file in place after creating a copy,
instead of moving the old log file and optionally creating a new
one,  It  can be used when some program can not be told to close
its logfile and thus might continue writing (appending)  to  the
previous log file forever.  Note that there is a very small time
slice between copying the file and truncating it, so  some  log-
ging  data  might be lost.  When this option is used, the create
option will have no effect, as the old log file stays in  place.

January 21, 2008

How to debug OC4J 10.1.3 class loading issue

Filed under: OracleAS — wuhai @ 7:04 am

To add the following in file opmn.xml (opmnctl reload):

-Dclass.load.trace=class+loader -Dclass.load.log.file=/tmp/classloadlog.txt -Dclass.load.log.level=all

 In my case, it’s oc4j 10.1.3.3.

Metalink notes: 454178.1

December 13, 2007

Find JDBC version for Oracle10gAS

Filed under: OracleAS — wuhai @ 7:35 pm

$ locate ojdbc14.jar | grep OraSSO
/home/oracle/OraSSO/jdbc/lib/ojdbc14.jar

$ cp /home/oracle/OraSSO/jdbc/lib/ojdbc14.jar /tmp/sso

$ cd /tmp/sso; jar xf ojdbc14.jar

$ cat META-INF/MANIFEST.MF

Manifest-Version: 1.0
Implementation-Version: “Oracle JDBC Driver version – 10.1.0.5.0″
Specification-Title: “Oracle JDBC driver classes for use with JDK1.
4″
Specification-Version: “Oracle JDBC Driver version – 10.1.0.5.0″
Implementation-Title: “ojdbc14.jar”
Created-By: 1.2.2 (Sun Microsystems Inc.)
Implementation-Time: “Wed Dec 28 05:06:13 2005″
Implementation-Vendor: “Oracle Corporation”
Specification-Vendor: “Oracle Corporation” .

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.