Thursday, October 23, 2014

WebLogic: How to Create a WLS Domain?

In WebLogic Server, you can create a domain using:[1]
  • WebLogic Configuration Wizard
  • WLST
  • weblogic.Server (a command-line utility)
Your actual choice of a domain creation tool depends on whether you prefer a graphical or command-line interface, and whether you need to automate the domain creation process. Using above-mentioned tools, you can either create a domain or extend an existing domain.

In this article, we will look at two ways to create a WebLogic domain:
  • Creating a new domain based on an existing domain
  • Creating a new domain based on a domain template

Domain Template


A template is simply a jar file that contains the necessary scripts and files WebLogic Server needs to create or extend domains.

There are three basic types of templates in WebLogic Server:[1]
  • Domain Templates
    • Help create an entire domain
      • Defines the full set of resources within a WebLogic domain, including:
        • Infrastructure components
        • Applications
        • Services
        • Security options
        • General environment and operating system options.
  • Extension Templates
    • Add to the functionality of a domain
      • Oracle uses special extension templates for various Fusion Middleware products.
  • Managed Server Templates
    • Defines the subset of resources within a WebLogic domain that are required to create a Managed Server domain directory on a remote machine. 
You can create the first two types of templates with the Domain Template Builder,[2] and you can create all three types with the pack utility.[3]

Creating a New Domain Based on an Existing Domain


Follow these steps to create a new domain using WLST offline commands:
  1. Execute the readDomain command to open an existing WebLogic domain
    • wls:/offline>readDomain('C:/Oracle/Middleware/user_projects/domains/base_domain')
    • wls:/offline/base_domain>
  2. Execute the writeTemplate command to write the current domain configuration to a specific domain template.
    • wls:/offline/base_domain>writeTemplate('C:/Oracle/Middleware/user_templates/MyBaseTemplate.jar')
    • wls:/offline/base_domain>
  3. Execute the closeDomain command to close it
    • wls:/offline/base_domain>closeTemplate()
    • wls:/offline/base_domain>
  4. Execute writeDomain command to create a new domain
    • wls:/offline/base_domain>createDomain('C:/Oracle/Middleware/user_templates/ws_server_12.1.2.0.jar', 'C:/Oracle/Middleware/user_projects/domains/my_domain1','weblogic','welcome1')
    • wls:/offline/base_domain>
You won’t receive any confirmation that the domain has been created, but the absence of any error messages means that the domain was successfully created. Note that the createDomain WLST command works essentially the same as the unpack command.[3]

Creating a New Domain Based on a Domain Template


Probably the easiest way to create a domain is through the Configuration Wizard. The Configuration Wizard uses default templates to create or extend an existing domain.

Follow these steps to create a new domain using Configuration Wizard on Windows:[1,7]
  1. Click the Windows shortcut at Start | Programs | Oracle | OracleHome | WebLogic Server 12c | Tools | Configuration Wizard
  2. Select Create A New Domain On the Create Domain screen
  3. Choose one of the following two options on the Templates screen
    • Create Domain Using Product Templates
    • Create Domain Using Custom Template
  4. Specify the login credentials for this new domain on the Administrator Account screen
  5. Configure startup mode and JDK on the Domain Mode And JDK screen
  6. Configure the database schemas on the Configure JDBC Data Sources screen
  7. Specify keystore password on the Configure Keystore Credentials screen
  8. Perform certain advanced configuration tasks on the Advanced Configuration screen
  9. Review your domain configuration settings on the Configuration Summary screen
  10. Check Configuration Progress and Status
You can use Configuration Wizard to create a domain with just an Admin Server or a domain that includes additional Managed Servers or even a cluster. In addition, you can customize a domain by configuring JDBC settings, for example, to point to a different database rather than the default database (Apache Derby database) used by the domain and extension templates.

Avitek Medical Records Sample Domain


Avitek Medical Records Sample Domain Template is one of the WebLogic domain templates that are provided with your WebLogic Server installation.[5] You can use it to extend the basic WebLogic Server domain, which creates the Avitek Medical Records sample domain.

This domain is a WebLogic Server sample application suite that demonstrates all aspects of the J2EE platform. Read [5] to view the details of generated domain output.

References

  1. Oracle WebLogic Server 12c Administration Handbook
  2. Using the Domain Template Builder to Create Domain Templates
  3. Overview of the Pack and Unpack Commands
  4. WebLogic Server Templates (12c)
  5. Avitek Medical Records Sample Domain Template
  6. The Configuration File in WebLogic Server Domain — config.xml (Xml and More)
  7. Configuring Your Oracle Service Bus Domain

Wednesday, October 15, 2014

Excel: How to Adjust the Scale of the Axis in a Scatter Chart

Routinely, we have been using TextPad and Excel to analyze Garbage Collection (GC) events gathered in GC log files.

In this article, we will demonstrate how to use these data to create a Scatter Chart and also adjust the scale of the horizontal axis in the chart as shown below:

Before Scale Change


After Scale Change


The Data


After cleaning the data, we have two columns holding data as shown below:
  • GC time stamp
  • Mixed GC pause time
Using shift key, you can select both A1 and B1 cells as shown below:

Then you can select entire columns by pressing:[1]
CTRL+SHIFT+DOWN ARROW key


Create a Scatter Chart from Spreadsheet Data


A scatter chart has two value axes, showing one set of numerical data along the x-axis and another along the y-axis. It combines these values into single data points and displays them in uneven intervals, or clusters.

To create a scatter chart, you do:[2]
  1. Arrange your data so that the x-values are in the first column of your worksheet, and the y-values are located in adjacent columns.
  2. Select the range of x- and y-values that you want to plot in the chart.
  3. Click Chart on the Insert menu to start the Chart Wizard.
  4. In the Chart type box, select Scatter .
  5. Under Chart sub-type, click the chart sub-type you want to use.

This will create a scatter chart as shown in diagram 1.  But, you can see the scale of X-axis is not appropriate.

Change the Scale of Horizontal Axis


By default, Microsoft Office Excel determines the minimum and maximum scale values of the axis when you create a chart. However, you can customize the scale to better meet your needs.  To customize the scale of horizontal axis, you do:
  1. Change the label/title of the series to "Mixed GC"[4]
  2. In the chart, click the horizontal (value) axis that you want to change.
  3. This displays the Chart Tools, adding the Design, Layout, and Format tabs.
  4. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click Horizontal (Value) Axis.
  5. In the Current Selection group, click Format Selection.
  6. In the Format dialog box, change maximum value of X-axis from 40000.0 to 30000.0.
Voila, you have created a scatter chart of the Mixed GC diagram with a good scale at horizontal axis (see diagram 2 above).