You are on page 1of 5

Using the Command Line

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/...

Using the Command Line


Purpose
This tutorial covers the basic use of Oracle WebLogic Scripting Tool (WLST) to administer Oracle WebLogic Server via the command line.

Time to Complete
Approximately 15 minutes

Topics
This tutorial covers the following topics: Overview Scenario Prerequisites Starting the Administration Server by Using WLST Changing a Server Property by Using WLST Shutting Down the Administration Server by Using WLST Summary Related Information

Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.) Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.

Overview
This tutorial introduces you to Oracle WebLogic Scripting Tool (WLST). It gives you a chance to practice the basic commands and to practice changing server properties via the command line. Back to Topic List

Scenario
The WLST utility allows you to monitor servers from the command line. It also gives you the ability to shut down the server, change server attributes, and configure a domain. Back to Topic List

Prerequisites
Before starting this tutorial, you should first complete the following prerequisite tutorials: 1. Installing and Configuring Oracle WebLogic Server Back to Topic List

Starting the Administration Server by Using WLST


To open WLST and start the administration server, perform the following steps: 1. Open a terminal and navigate to the /wlserver_10.3/server/bin directory of your Oracle WebLogic Server installation.

1 of 5

8/9/2011 10:38 AM

Using the Command Line

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/...

2.

Use the setWLSEnv script to set up the environment needed for WLST. For example, on Linux:

source setWLSEnv.sh

3.

Open WLST by entering the following command at the prompt: java weblogic.WLST

4.

Start the administration server by entering the following command at the WLST prompt. If necessary, replace the sample argument values with those that match your domain environment: startServer('SERVER_NAME', 'DOMAIN_NAME', 'SERVER_ADDRESS:SERVER_PORT', 'USERNAME', 'PASSWORD')

Back to Topic List

Changing a Server Property by Using WLST


To update a running server via the command line, perform the following steps: 1. At the WLST prompt, enter the following command to connect to the running administration server. If necessary,

2 of 5

8/9/2011 10:38 AM

Using the Command Line

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/...

replace the sample argument values with those that match your domain environment: connect('USERNAME', 'PASSWORD', 'SERVER_ADDRESS:SERVER_PORT')

Tip: The supplied credentials should have access to the administration server. Tip: If not specified, the default protocol is 't3'.

2.

Change to edit mode by using the following command: edit()

3.

Change to the Log directory of your server by using the following command: cd('Servers/SERVER_NAME/Log/SERVER_NAME')

4.

Note: Replace SERVER_NAME with the name of your administration server. Start an edit session by using the following command: startEdit()

3 of 5

8/9/2011 10:38 AM

Using the Command Line

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/...

5.

Set the FileCount property of the administration server log file to 8 and then check whether the server property has been changed using the following commands: set('FileCount','8') ls()

6.

Save and activate the changes by using the following commands: save() activate()

Back to Topic List

Shutting Down the Administration Server by Using WLST


In this section, you use the Administration Console to modify the standard output severity threshold for the administration server. 1. At the WLST prompt, enter the following: shutdown()

4 of 5

8/9/2011 10:38 AM

Using the Command Line

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/...

By default, the shutdown command stops the server that you are connected to.

Back to Topic List

Summary
In this lesson, you should have learned how to: Start WLST Log in to WLST Start an administration server by using WLST Navigate through WebLogic's MBean hierarchy using WLST Change properties of a resource by using WLST Shut down the administration server by using WLST Back to Topic List

Related Information
Overview of the Administration Console WebLogic Scripting Tool Guide WLST Command Reference WebLogic Server MBean Reference To learn more about WebLogic Server, refer to additional OBEs on the OTN Web site. Back to Topic List Place the cursor over this icon to hide all screenshots.

5 of 5

8/9/2011 10:38 AM