Using the Command Line

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

Approximately 15 minutes

Topics

This tutorial covers the following topics:

Starting the Administration Server by Using WLST

Changing a Server Property by Using WLST

Shutting Down the Administration Server by Using WLST

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

 

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.


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, 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')


Note: Replace SERVER_NAME with the name of your administration server.

4.

Start an edit session by using the following command:


startEdit()



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()

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

 

Back to Topic List

In this lesson, you should have learned how to:

Log in to WLST
Navigate through WebLogic's MBean hierarchy using WLST
Shut down the administration server by using WLST

Back to Topic List

Back to Topic List

Place the cursor over this icon to hide all screenshots.