Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Oracle Shell scripting training class

An intensive Oracle shell scripting training course
(c) 2016 by Burleson Corporation


This shell scripting course is taught at your Company site with up to 20 students. 

Click here for on-site course prices

Optional supplemental mentoring


Key Features

* Understand Oracle and ksh

* Explore Oracle shell scripts

* Learn to perform common database activities with shell scripts

* Use shell scripts in a distributed environment

* Understand Oracle shell scripts in crontab jobs




Course Description

Introduction to Oracle shell scripting is an intensive course that is designed to give the student maximum exposure to Oracle shell scripts.  The student learns by doing, and this class has dozens of in-class exercises and the student will be guided from very simple shell scripts to increasingly complex shell scripting coding techniques.

The topics start with the basics of Korn shell scripting and progresses into increasingly complex queries, including advanced shell scripts for a variety of Oracle administration activities 

Book Required

Oracle shell scripting course book   Oracle Shell Scripting

Jon Emmons


This course is designed for practicing Oracle professionals who have basic experience with UNIX and Linux commands. Prior experience with Oracle is not required, but experience using SQL with a relational database is highly desirable.

Curriculum Design

This course was designed by Donald K. Burleson, an acknowledged leader in Oracle shell scripting.  Burleson was chosen by Oracle Press to write the officially authorized edition of the Oracle UNIX administration Handbook.  Burleson Corporation instructors offer decades of real world DBA experience in Oracle features, and they will share their Oracle secrets in this intense Oracle shell scripting training

Learning Objectives

By the end of this course the student will be able to create shell scripts to perform common DBA finctions including Oracle alert log monitoring and dump management. The student will also become familiar with the internals of Oracle shell scripting.

Oracle Shell Scripting training class

(c)  2007-2016 by Donald K. Burleson

Lesson 1: UNIX and Shell Scripting

Common Ground

UNIX and its many flavors


What is a shell?

sh bash and other shells

The UNIX kernel

Memory and swap  


Files and file systems  

Why Shell Scripting?  

The shell Oracle and you  

When to script  

A warning about script bloat  

Building a shell script  


Lesson 2: Key shell scripting Concepts  

Getting to your shell  

What shell am I in?  

Switching shells on-the-fly  

Differences between interactive and non-interactive modes  

Commands options arguments and input  

Shell Variables  

Conditions and if statements  


Wildcards and Pattern Matching  

Relative and Absolute Paths  

Tilde the Short Way Home  

Permissions & Ownership  


Lesson 3: Setting up your environment  

Configuring your default shell  

Changing the Default Shell with usermod  

Changing Your Own Default Shell with the chsh Command  

Entering a shell  

bash Shell Login Behavior  

Bourne Shell Login Behavior  

Non-Interactive Shell Behavior  

Setting Your Command Prompt  

Basic Command Prompts  

Special Prompt Characters  

Variables and Commands in Prompts  

Setting Up the Binary Path  

The Manual Path  

The Library Path  


Keeping your scripts organized  

The .forward file  

Default Permissions and umask  


Lesson 4: Key tools  

man - The Online Manual Pages  

Text Editors  

Command-line and Graphical Editors – In Brief  

vi - The Visual Editor  

Manipulating Text  

Searching with grep  

More Complex Searches with egrep  

sed Text Substitution  

Breaking Out Columns with cut  

Using awk to Find Just What You Need  

Sort - Get Things in Order  

View the Beginning or End of a File  

Counting Characters Words and Lines with wc  

Managing Processes  

Stopping the Current Process  

Finding and Stopping Other Processes  

Viewing running processes with ps  

Ending running processes with the kill command  

pgrep and pkill  

Examining how long a command takes  

Job Control - Running Jobs in the Background  

Making sure things keep running with nohup  

File and Directory Ownership and Permissions  

Managing the owner and group of a file  

Managing File Permissions  

How Permissions Affect Directories  

Securing Important Files  

Manipulating Input and Output  

Redirecting Standard Input  

Redirecting Standard Output and Standard Error  

Linking Output to Input with Pipes  

Performing Math with expr  


Lesson 5: Simple Scripting  

Setting Up Your First Script  

The Significance of the Shebang  

Commenting Your Script  


Variable Scope  

Variable Names  

Using Arguments in Your Script  

Prompting for Input  

Debugging Shell Scripts  

Place Temporary Markers in the Script  

Echo Variables to the Display  

Starting the Script in Debug Mode  


Lesson 6: Interacting with SQL*Plus  

Calling SQL Scripts from Shell Scripts  

Embedding SQL within a Shell Script  

Prompting for a password  

Reading a Password from a File  

Running shell commands from SQL*Plus  

Passing variables into SQL*Plus  

SQL Script Arguments  

Shell Variables and Embedded SQL  

Getting Information Out of SQL*Plus  

 Lesson 7: Making Decisions  

Conditional Expressions  

Comparing Numbers  

Comparing Text  

Checking Files  

Combining Comparisons  

Making Simple Decisions with if and else  

Secondary Checks with elif  

Choosing from a list with case  

The while Loop  

The for Loop  

Breaking Out of Loops  

Nesting Loops  


Lesson 8: Checking and Reporting Results  

The Exit Status: The Unseen Result  

Setting the Exit Status of a Shell Script  

Setting the Exit Status for SQL*Plus  

Scanning Logs for Output  

Checking the Output of Commands  


Lesson 9: Making the Shell Behave  

Listing multiple commands on one line  

Conditional Execution  

Listing Long Commands on Multiple Lines  

Backslash as an Escape Character  

Single Quotes  

Double Quotes  

Back Quotes  

Exit a Shell Script Anytime  


Lesson 10: Making Scripts Run Automatically  

Scheduling Repeating Tasks with Cron  

The cron Daemon  

crontab Command Options  

The Format of the crontab File  

crontab Entries  

Scheduling One-Time Tasks with at  

Performing Tasks On Login  


Lesson 11: Reaching Further  

Transferring Files between Systems  

sftp - Secure FTP  

scp - Secure Copy  

Executing commands on another system  

Keep Directories in Sync with rsync  

Getting Past the Password Problem  

Executing Commands with Another User’s Permissions  

Using su to become Another User  

Emailing from scripts  

Emailing System Users and the .forward File  

Emails from cron and at Jobs  

The mail command  


Lesson 12: Oracle Database Maintenance  

Monitoring and Maintaining the Alert Log  

Checking for Errors in the Alert Log  

Rotating the Alert Log  

Finding and removing old dump files  

Monitoring Tablespace Usage  

Clean Up Old Statspack Data  

Check Certain Database Accounts are Locked  

Cleaning Old Data Out of Tables  

Execute a SQL Script on Every Database  

Copy the TNSNames File to a List of Systems  


Lesson 13: Backup Scripts  

Cold Backups without RMAN  

Hot Backups without RMAN  

Hot Backups with RMAN  

Database and Schema Export  


Lesson 14: Oracle Database Monitoring  

Listener Availability  

Database Availability  

Monitor Free Space within Tablespaces  

Table is Writeable Readable or Other Specific SQL  

Check for Invalid Objects  


Lesson 15: Oracle Application Server  

Starting and Stopping Oracle Application Server  

Cleaning Up Web Server Log Files  

Starting and Stopping the Application Server Console  

Check Running OPMN Processes  


Lesson 16: Monitoring the System  

Checking the System Log  

Monitoring disk space  

Find the Size of a Directory  

Monitoring system load  

Save Load Averages in Oracle  

Gathering CPU Usage Statistics from sar  

Synchronize a Directory on Several Systems  


Lesson 17: Windows Scripting  

What’s Different in Windows?  

Database Exports  

RMAN backups  

Running a SQL Script  

Other Scripting Options for Windows  

Scheduling Scripts in Windows  



This is a BC Oracle shell scripting training course (c) 2002-2016


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational