Oracle WebLogic Server 12c: Using the WebLogic Scripting Tool

Overview

Purpose
This tutorial shows you how to use the WebLogic Scripting Tool (WLST) to administer Oracle WebLogic Server 12c (12.1.3) from the command line.

Time to Complete
Approximately 15 minutes

Introduction
With WLST, you can monitor, control, and configure servers and other domain resources from the command line. You can also save groups of commands in files so that you can reliably perform the same tasks many times.
This tutorial introduces you to WLST. It gives you a chance to practice basic commands and to change server attributes from the command line.
Hardware and Software Requirements
  • Oracle Linux 5.6+
  • Oracle WebLogic Server 12c (12.1.3)

Prerequisites
Before starting this tutorial, you should have completed the Oracle by Example tutorial titled Oracle WebLogic Server 12c: Installing WebLogic Server and Creating a Domain.

Running WLST in Interactive Mode

The administration server does not have to be running to access WLST. However, in this tutorial, because WLST connects to the administration server, it must be running.
To run WLST in interactive mode, perform the following steps:

1. If the administration server of the domain is not already running, open a Terminal window and navigate to the domain directory for this tutorial: /scratch/domains/mydomain

2. At the prompt, enter the following command:$>./startWebLogic.sh


3. At the prompt, enter the domain administrator's credentials. In this tutorial, the username is weblogic and the password is Welcome1. (The password is not displayed.)


4. In a new Terminal window, navigate to<MIDDLEWARE_HOME>for this tutorial:/scratch/u01/app/fmw

5. Change the directory:cd oracle_common/common/bin

6. Run thewlst.shscript:$>./wlst.sh
#OUGTH: wlst.sh มีอยู่ 2 ที่คือ ‘oracle_common/common/bin’ กับ ‘wlserver/common/bin’.


If you are accessing WLST for the first time, Jython scans the Java Archive (JAR) files that the WLST depends on before the welcome message and the WLST offline prompt are displayed.

Changing a Server Property

To change a server property by using WLST in interactive mode, perform the following steps:

1. At the WLST prompt, enter the following command to connect to the running administration server:
wls:/offline>connect('<USERNAME>', '<PASSWORD>', 't3://<ADMIN_HOST>:<ADMIN_PORT>')

Replace the sample argument values with those that match your domain environment. In this tutorial, the command is:
wls:/offline>connect('weblogic', 'Welcome1', 't3://<ip_address>:7001')

wls:/offline>connect('weblogic', 'Welcome1', 't3://192.168.56.101:7001')

In the previous command,<ip_address>is the actual IP address of the tutorial's administration server.
Note:WLST always uses thet3(ort3s) proprietary protocol to connect to a server.


2. Change to edit mode:

wls:/mydomain/serverConfig>edit()

3. Start an edit session to lock the configuration:

wls:/mydomain/edit>startEdit()

#OUGTH: ขั้นนี้รอนานมาก.

4. Change to the Log directory of your administration server:

wls:/mydomain/edit !>cd('Servers/<SERVER_NAME>/Log/<SERVER_NAME>')

Replace the sample argument values with those that match your domain environment. In this tutorial, the command is:

wls:/mydomain/edit !>cd('Servers/AdminServer/Log/AdminServer')


5. Set the FileCount property of the administration server log file to 8, and then use the ls() command to check whether the server property was changed.

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer !>set('FileCount', '8')
wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer !>ls()


6. Save and activate the changes:

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer !>save()
wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer !>activate()


Shutting Down the Administration Server

To shut down the administration server of the domain by using WLST in interactive mode, perform the following steps:

1. At the WLST prompt, enter the following command:

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer>shutdown()

Note: By default, the WLST shutdown() command shuts down the server to which it is connected.

2. At the prompt, enter the following command to exit WLST:

wls:/offline>exit()



Summary
In this tutorial, you learned how to:
  • Start WLST in interactive mode
  • Change a server property
  • Shut down the administration server
  • Exit WLST
Resources
Credits
  • Lead Curriculum Developer: Bill Bell
  • Original Oracle by Example tutorial for version 11g created by: TJ Palazzolo
  • Other Contributors: Susan Moxley

Permalink: http://goo.gl/CcmZxL | E

141120.13:40:39
• แก้รูปแบบเอกสาร.

141127.14:48:01
• ผ่าน.

141203.16:48:39
• ตรวจทาน.

/link/obe-10623-oracle-weblogic-server-12c-using-the-weblogic-scripting-tool