Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
191 views

Using The WebLogic Scripting Tool

Using the WebLogic Scripting Tool

Uploaded by

Addi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views

Using The WebLogic Scripting Tool

Using the WebLogic Scripting Tool

Uploaded by

Addi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

WebLogic Server 12c (12.2.1): Using the


WebLogic Scripting Tool

Before You Begin

Purpose

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

Time to Complete

Approximately 15 Minutes.

Background

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.

What Do You Need?

You should have completed the following Oracle by Example tutorials:

WebLogic Server 12c (12.2.1): Installing WebLogic Server Using the Generic Installer
(https://apexapps.oracle.com/pls/apex
/f?p=44785:24:0:::24:P24_CONTENT_ID,P24_PREV_PAGE:12310,1)

WebLogic Server 12c (12.2.1): Creating and Starting a Basic Domain (https://apexapps.oracle.com
/pls/apex/f?p=44785:24:0:::24:P24_CONTENT_ID,P24_PREV_PAGE:12311,1)

WebLogic Server 12c (12.2.1): Configuring Managed Servers (https://apexapps.oracle.com/pls/apex


/f?p=44785:24:0:::24:P24_CONTENT_ID,P24_PREV_PAGE:12315,1)

. This tutorial assumes that Oracle WebLogic Server 12c (12.2.1) has been installed successfully.

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

1 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

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:

$ cd /scratch/u01/app/fmw/user_projects/domains/mydomain

2. At the prompt, enter the following command:

$ ./startWebLogic.sh

3. At the prompt, enter the domain administrator's credentials.

Enter username to boot WebLogic server:weblogic


Enter password to boot WebLogic server:<welcome1>

Note:The password is not visible for security reasons.

4. In a new Terminal window, navigate to middleware home for this tutorial:

$ cd /scratch/u01/app/fmw/

5. Change the directory:

$ cd oracle_common/common/bin

6. Run the wlst.sh script.

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

2 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

$ ./wlst.sh

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline>

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://localhost:7001')

Connecting to t3://localhost:7001 with userid weblogic ...


Successfully connected to Admin Server "AdminServer" that belongs to domain "mydomai
n".

Warning: An insecure protocol was used to connect to the server.


To ensure on-the-wire security, the SSL port or Admin port should be used instead.

wls:/mydomain/serverConfig/>

Note: WLST always uses the t3 (or t3s) proprietary protocol to connect to a server.

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

3 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

2. Change to edit mode:

wls:/mydomain/serverConfig/>edit()
Location changed to edit tree.
This is a writable tree with DomainMBean as the root.
To make changes you will need to start an edit session via startEdit().
For more help, use help('edit').

wls:/mydomain/edit/>

3. Start an edit session to lock the configuration:

wls:/mydomain/edit>startEdit()
Starting an edit session ...
Started edit session, be sure to save and activate your changes once you are done.
wls:/mydomain/edit/ !>

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')
wls:/mydomain/edit/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 !>

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

4 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer!>ls()
dr-- DomainLogBroadcastFilter
dr-- LogFileFilter
dr-- MemoryBufferFilter
dr-- StdoutFilter

-rw- BufferSizeKB 8
-rw- DateFormatPattern MMM d, yyyy h:mm:ss a z
-rw- DomainLogBroadcastFilter null
-rw- DomainLogBroadcastSeverity Notice
-rw- DomainLogBroadcasterBufferSize 10
-r-- DynamicallyCreated false
-rw- FileCount 8
-rw- FileMinSize 5000
-rw- FileName logs/AdminServer.log
-rw- FileTimeSpan 24
-r-- Id 0
-rw- Log4jLoggingEnabled false
-rw- LogFileFilter null
-rw- LogFileRotationDir null
-rw- LogFileSeverity Trace
-rw- LogMonitoringEnabled true
-rw- LogMonitoringIntervalSecs 30
-rw- LogMonitoringThrottleMessageLength 50
-rw- LogMonitoringThrottleThreshold 1500
-rw- LoggerSeverity Info
-rw- LoggerSeverityProperties null
-rw- MemoryBufferFilter null
-rw- MemoryBufferSeverity Trace
-rw- MemoryBufferSize 500
-rw- Name AdminServer
-rw- Notes null
-rw- NumberOfFilesLimited true
-rw- PlatformLoggerLevels null
-rw- RedirectStderrToServerLogEnabled false
-rw- RedirectStdoutToServerLogEnabled false
-rw- RotateLogOnStartup false
-rw- RotationTime 00:00
-rw- RotationType bySize
-rw- ServerLoggingBridgeUseParentLoggersEnabled false

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

5 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

-rw- StdoutFilter null


-rw- StdoutFormat standard
-rw- StdoutLogStack true
-rw- StdoutSeverity Notice
-rw- Tags null
-r-- Type Log

-r-x addTag Boolean : String(tag)


-r-x freezeCurrentValue Void : String(attributeName)
-r-x getInheritedProperties String[] : String[](propertyNam
es)
-r-x isInherited Boolean : String(propertyName)
-r-x isSet Boolean : String(propertyName)
-r-x removeTag Boolean : String(tag)
-r-x restoreDefaultValue Void : String(attributeName)
-r-x unSet Void : String(propertyName)

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer !>

6. Save and activate the changes:

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer!>save()
Saving all your changes ...
Saved all your changes successfully.
wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer !>

wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer!>activate()
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released once the activation is c
ompleted.
Activation completed
wls:/mydomain/edit/Servers/AdminServer/Log/AdminServer>

Shutting Down the Administration Server

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

6 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

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()
Shutting down the server AdminServer with force=false while connected to AdminServer
...
Disconnected from weblogic server: AdminServer
WLST lost connection to the WebLogic Server that you were connected to.
This may happen if the server was shut down or partitioned.
You will have to re-connect to the server once the server is available.
Disconnected from weblogic server: AdminServer
wls:/offline>

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

Exiting WebLogic Scripting Tool.

Want to Learn More?

For documentation on Oracle WebLogic Server 12c (12.2.1), visit the Oracle WebLogic Server
Documentation Library. (http://docs.oracle.com/middleware/1221/wls/index.html)

For more information on the WebLogic Scripting Tool, see the WLST Command Reference for WebLogic
Server (http://docs.oracle.com/middleware/1221/wls/WLSTC/) document.

To learn more about Oracle WebLogic Server, refer to additional OBEs in the Oracle Learning Library
(http://www.oracle.com/goto/oll)

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

7 of 8 12/12/2020 4:50 PM
WebLogic Server 12c (12.2.1): Using the WebLogic Scripting Tool https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/1...

Credits

Lead Curriculum Developer: Tom Eliason, Veerabhadra Rao Putrevu


Other Contributors: Susan Moxley

Version

01-32-001-UsingWLST

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)


Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

8 of 8 12/12/2020 4:50 PM

You might also like