Shell Scripting For DBAs and SysAdmins


This training is designed for anyone who is interested to learn Shell Scripting on a Unix like Environment. Any one who has some basic knowledge of Linux or Unix like operating system commands can take the benefit of this training to code shell scripts and make life simple in administration of Linux/Unix Operating System and Services running on top of it.

The training starts with the simple and basic knowledge of shell and continues over covering important and interesting tools like grep, awk,vi etc. It also gives a chance to understanding how to implement shell scripts in our environments for monitoring and management purpose.

The training ends with some very interesting scripts example and opens the doors for Oracle DBAs to code some of the scripts and make their life simple.
 

 

Day1
Day2
1- Quick Introduction to Linux
    What Kernel Is?
    What is Linux Shell?
    How to use Shell
    What is Shell Script ?
    Why to Write Shell Script ?
    More on Shell...

2- Getting started with Shell Programming
    How to write shell script
    Variables in shell
    How to define User defined variables (UDV)
    Rules for Naming variable name (Both UDV and System Variable)
    How to print or access value of UDV (User defined variables)
    echo Command
    Shell Arithmetic
    More about Quotes
    Exit Status
    The read Statement
    Wild cards (Filename Shorthand or meta Characters)
    More commands on one command line
    Command Line Processing
    Why Command Line arguments required
    Redirection of Standard output/input i.e. Input - Output redirection
    Pipes
    Filter
    What is Processes
    Why Process required
    Linux Command(s) Related with Process

3- Shells (bash) structured Language Constructs
    Decision making in shell script ( i.e. if command)
    test command or [ expr ]
    if...else...fi
    Nested ifs
    Multilevel if-then-else
    Loops in Shell Scripts
    for loop
    Nested for loop
    while loop
    The case Statement
    How to de-bug the shell script?
4- Advanced Shell Scripting Commands
    /dev/null - to send unwanted output of program
    Local and Global Shell variable (export command)
    Conditional execution i.e. && and ||
    I/O Redirection and file descriptors
    Functions

5- Essential Utilities for Power User
    Preparing for Quick Tour of essential utilities
    Selecting portion of a file using cut utility
    Putting lines together using paste utility
    The join utility
    Translating range of characters using tr utility
    Data manipulation using awk utility
    sed utility - Editing file without using editor
    Removing duplicate lines from text database file using uniq utility
    Finding matching pattern using grep utility

6- Learning expressions with vi
    Getting started with vi
    Printing text on-screen
    Deleting lines
    Coping lines
    Searching the words
    Find and Replace (Substituting regular expression)
    Replacing word with confirmation from user
    Finding words
    Using range of characters in regular expressions
    Using & as Special replacement character
    Converting lowercase character to uppercase
Day3

7- Shell scripting for Oracle DBA
    Writing sql block in a shell script
    Submitting cronjobs
    Working with Oracle Log files

    using  scripts
    Writing scripts to monitor Oracle  processes
    Scripts to manage remote file access
    Shell scripts for Oracle DBA Examples
    Script to collect statspack     information at defined interval
 

    Script to monitor alert.log file and report ORA errors
    Script to keep a check on sever load and raise alert
    Script to keep a check on the space usage on mounts
    Script to monitor tablespace growth
    Script to take Hot Backup of Database
    Script to monitor blocking locks
    Script to Analyze important schema in your database
    Script to manage archive files
    Script to replicate DB Creation Scripts