Pacific computer training institute
903 Pavilion Court Suite I, McDonough, GA 30253
Tel: 1-877-405-4554
Unix Shell Scripting For DBAs
Part A: The Korn Shell Programming Fundamentals
1. Introduction
2. UNIX SHELLS
• Bourne Shell
• C and TC Shell
• Korn Shell
• Bash Shell
3. The Environment
• The /etc/profile File
• The .profile File
• The ENV File
• The set –o options
• The prompts
• The primary prompts
• The secondary Prompt
• The Search Path
• The dot command
4. The Command Line
• The Exit Status
• Multiple Commands and command grouping
• Conditional execution of commands
• Commands in the Background
• Command-Line History
5. Aliases
• Listing Aliases
• Creating Aliases
• Deleting Aliases
6. Job Control
1
• Listing Jobs
• Stopping current Job
• Running jobs in background
• Running jobs in foreground
• Waiting for Jobs
• Killing Jobs
7. Metacharacters
8. Filename Substitution
• The Asterisk
• The Question Mark
• The Squared Brackets
• Escaping metal Characters
• Tilde and Hyphen Expansion
• New KSH Metal Characters
9. Variables
• Local Variables
• Setting and Referencing Local Variables
• The Scope of Local Variables
• Setting Read-Only Variables
• Environment Variables
• Setting Environment
• Special Environment Variables
• Listing Set Variables
• Unsetting Variables
• Printing the Values of Variables
• Escape Sequences
• Variable Expressions
• Variable Expansion
• Variable Attributes : The typeset Command
• Positional Parameters
• Other Special Variables
10. Quoting
• The Backslash
• The single Quotes
• The Double Quotes
11. Command Substitution
12. Standard I/O and redirection
• Redirection and the Child Shell
2
13. Pipes
• The Here Document and Redirecting Input
14. Timing Commands
• The time Command
• The TMOUT variable
• The sleep Command
Part B: The Korn Shell Programming
15. Introduction
• The steps in creating a shell script
• The First Line(shbang)
• Comments
• Executable statements and Korn Shell Constructs
• Naming and Storing Scripts
• Using a script as an argument to ksh
16. Reading user input
• Reading and File Descriptors
• Reading through Files
17. Arithmetic Operation
• The integer type
• Listing Integers
• Arithmetic Operators and the let command
18. Positioning Parameters and command line arguments
• The set Positional Parameters
19. Conditional Constructs and Flow Control
• Testing Exit Status and the $? Variable
• The test command
• File Testing with Binary Operators
• Expression Testing with Logical Operators
• File Testing with Flags
• The if Command
• Using the Korn Test
• Korn Test with numbers
• The let command and testing numbers
• The if/else command
• The exit command
• The null Command
3
• The case command
• The case command and the here document
20. The Looping Command
• The for command
• The $* and $@ Variable and wordlists
• The while Command
• The until Command
• The select command and Menus
• The looping control structures
• The shift Command
• The break Command
• the continue Command
• Nesting Loops and Loop Control
• I/O redirection and Loops
• The exec Command and Loops
• The IFS and Loops
21. Functions
• Defining Functions
• Listing and Unsetting Functions
• Local Variables and Return Value
• Exported Functions
• Function options and the typeset command
22. Trapping Signals
• Pseudo or Fake Signals
• Resetting Signals
• Ignoring Signals
• Listing Traps
• Traps and Functions
23. Debugging Korn Shell Scripts
• -n debug option
• -x debug option
• -v debug option
24. Parsing Command Line Arguments
• Processing Command Line Options with getopts
25. Special Utilities
• cut utility
• sed utility
• awk utility
4
• tr utility
Part C: Oracle Database administration and Shell Scripts
1. The Shell wrapper
2. Logging on to SQL*PLUS
3. Executing SQL commands within shell scripts
4. Calling a SQL script from shell script
5. Informing the DBA: Sending emails and pages
6. Scheduling scripts with cron jobs
7. Common Database automation tasks
• Automating backups
• Checking Oracle log files for errors
• Checking disk space utilization
• Automating database startups and shutdowns
• Automating startup and shutdown of listener and other utilities
• Automating database monitoring
Recommended Books:
1. Anatole Olczak: The Korn Shell (Unix and Linux Program Manual)
(ISBN ISBN-10: 0201675234 , ISBN-13: 978-0201675238)
2. Jon Emmons and Donald K. Burleson: Oracle Shell Scripting, Linux and Unix
Programming for Oracle(ISBN 0977671550)
Contact Information:
Pacific Systems, Inc.
903 Pavilion Court Suite I
McDonough, GA 30253
1-877-405-4554