Shell Script to Generate Daily/Weekly AWR reports (Email)

Posted by Sagar Patil

Create  .run_awr with following details  :

"TNS-connect-string : recipient-list : hrs of AWR snapshot"
[oracle@ ~]$ cat .run_awr
prod:root@oracledbasupport.co.uk:11
I added this script in my crontab for a daily emails:

Read more…

Compare and Display difference between 2 Files

Posted by Sagar Patil

Comparing Files is one of very common task as a DBA, System Administrator. There are tonnes of Oracle,Websphere,linux configuration files. Often I have to compare one server to another and locate changes between environments.

Read more…

Oracle 10g script for User/Role/Object Privileges

Posted by Sagar Patil

Imagine you have to drop an Oracle user and create it with all privs/roles again.  This often happens in test cycle of 3rd party products. The privs are sent to user on ad hoc basis to get around the installation errors and then comes requirement to replicate it on another server.  How do you do it?  Attached script will create a spool file for user granted roles, object Privileges
Read more…

Shell Script to Delete / Copy/ Zip files older than X hours

Posted by Sagar Patil

#!/bin/bash
# Delete files older than X hours.
# This script will delete files older than 3 days from $GLOBALSHARE/current/Server01
# 14 days from $GLOBALSHARE/archive/Server01 & 14 days from /backup

Read more…

Shell Script : Copy files from local folder to a Samba/NFS share

Posted by Sagar Patil

#!/bin/bash
source=”/backup”
remotePath=”/globalbackup/current”
archivePath=”/globalbackup/archive”
log=/home/oracle/scripts/cp_to_share.log
err=/home/oracle/scripts/cp_to_share.err

Read more…

SQL server Simplest data loading script

Posted by Sagar Patil

T-SQL script to add a server load . I have used this script to test backup timings, replication latency. One run of following procedure incerased log fie to 8GB and datafile to 6GB Read more…

Compare and copy files remotely using SCP

Posted by Sagar Patil

Following script will only work if your servers were enabled with password less login ( How to for linux /HP UNIX)

Read more…

Top of Page

Top menu