Showing posts with label weblogic server. Show all posts
Showing posts with label weblogic server. Show all posts

Friday, March 13, 2015

Weblogic: How to take a Heap dump for weblogic server in jrockit


Steps to take a Heap Dump for a weblogic server running on jrockit-

1. Run ps -ef | grep oracle or ps -ef | grep managedserver to find the process id (pid)

2. Check the java path in the process

3. Run the below command for the heap dump

/usr/local/java/bin/jrcmd 19456 print_threads >  /tmp/heap_dump.txt

19456 is the process id or pid

jrcmd is a command-line tool included with the JRockit JDK that you can use to send diagnostic commands to a running JVM process

Oracle Documentation reference -
https://docs.oracle.com/cd/E15289_01/doc.40/e15061/ctrlbreakhndlr.htm

jrcmd <jrockit pid> [<command> [<arguments>]] [-l] [-f file] [-p] -h]
  • <jrockit pid> is either the process ID or the name of the Main class that runs the application.
  • [<command> [<arguments>]] is any diagnostic command and its associated arguments; for example, versionprint_propertiescommand_line.
  • -l displays the counters exposed by this process. These counters are for internal use by Oracle and are not officially supported or documented.
  • -f reads and executes commands from the file.
  • -p lists JRockit JVM processes on the local machine.
  • -h displays help.

Thursday, September 11, 2014

Weblogic: Log Rotation in weblogic server


Log Rotation can be setup for Admin and Managed servers in a Oracle Weblogic server.

Below log files can be setup for log rotation

a. Server log
b. Access log
c. Domain log

Domain log rotation -

1. Login to the Admin console of the weblogic server
2. In the Domain structure, click on the Domain name.
3. Navigate to the 'Logging' tab and edit the Logging properties. Restart the Admin and Managed servers

Server and Access Log rotation -
1. Login to the Admin console of the weblogic server
2. Select 'Environments', click on 'Servers' and select the Admin or Managed server for which the logs needs to be rotated
3. Navigate to the 'Logging' tab, select General for Server log, and HTTP for access log and edit the Logging properties. Restart the Admin and Managed servers as appropriate.


File Rotation Steps -

1. Provide the 'Rotation Type' - By Time or By Date
2. If you want to setup 'RotationType' as 'By Time' then fill the following fields
             a. Begin Rotation Time - Eg. 23:45 (provide in 24 hrs)
             b. Rotation Interval - 24 (every 24 hrs or every 4 hrs)
             c. Limit number of retained files - 5 (if you need the old files to be removed from the system) - you can check this option, if you do not want to delete the old files
             d. Log file Rotation directory - Provide the absolute path of the rotation directory
3. If you want to setup 'Rotation Type' as 'By Date' then fill the following fields
              a. Rotation file size - 5000 (in kilobytes)
              b. Limit number of retained files - 5 (if you need the old files to be removed from the system) - you can check this option, if you do not want to delete the old files
             c. Log file Rotation directory - Provide the absolute path of the rotation directory