Operating System - HP-UX
1752815 Members
6145 Online
108789 Solutions
New Discussion юеВ

Re: favourite sysadmin scripts you always keep around....

 
SOLVED
Go to solution
S.K. Chan
Honored Contributor

Re: favourite sysadmin scripts you always keep around....

Script that I wrote to check LVM and device file status. See script for usage.
Pete Randall
Outstanding Contributor

Re: favourite sysadmin scripts you always keep around....

While not necessarily applicable to everyone, we find the attached script to move programs from development to production invaluable. We call it the Program Migration System, or PMS for short - politically incorrect for sure.

Pete

Pete
Nick Wickens
Respected Contributor

Re: favourite sysadmin scripts you always keep around....

I have the attached script running at least once a day just to check if anything (particularly hardware) has changed or failed on the system since the previous run of the script just as a backup to other syslog checks.
Hats ? We don't need no stinkin' hats !!
Yogeeraj_1
Honored Contributor

Re: favourite sysadmin scripts you always keep around....

Hello,

nice initiative BILL ;)

Maybe this forum could have a section dedicated this topic.

My contribution is the RDA(Remote Diagnostic Agent) which helps people running Oracle People should use to document their systems each time they do a change.

Poeple having access to Metalink will get the latest version from here: http://metalink.oracle.com/cgi-bin/cr/getfile_cr.cgi?281592

otherwise the current version is attached.

Cheers
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
John Carr_2
Honored Contributor

Re: favourite sysadmin scripts you always keep around....

Hi Bill

here is my bdf in MB , not as goos as yours but I needed a simple script quickly.

John.
Gnananandhan
Frequent Advisor

Re: favourite sysadmin scripts you always keep around....

Hi,
This script will help in taking oracle database backup using tar utility.

Regards,
Gnana A.
If there is a better way to do it, find it !
Yogeeraj_1
Honored Contributor

Re: favourite sysadmin scripts you always keep around....

Hello,

Another useful script that allows me to export my Oracle database and at the same time compress it. Saving precious diskspace.

---------------------------------------------
#!/bin/csh -vx

setenv UID /
setenv FN exp.`date +%j_%Y`.dmp
setenv PIPE /tmp/exp_tmp_ora8i.dmp

setenv MAXSIZE 500m
setenv EXPORT_WHAT "full=y COMPRESS=n"

echo $FN

cd /nfs/atc-netapp1/expbkup_ora8i
ls -l

rm expbkup.log export.test exp.*.dmp* $PIPE
mknod $PIPE p

date > expbkup.log
( gzip < $PIPE ) | split -b $MAXSIZE - $FN. &

# uncomment this to just SPLIT the file, not compress and split
#split -b $MAXSIZE $PIPE $FN. &

exp userid=$UID buffer=20000000 file=$PIPE $EXPORT_WHAT >>&
expbkup.log
date >> expbkup.log


date > export.test
cat `echo $FN.* | sort` | gunzip > $PIPE &

# uncomment this to just SPLIT the file, not compress and split
#cat `echo $FN.* | sort` > $PIPE &

imp userid=sys/o8isgr8 file=$PIPE show=y full=y >>& export.test
date >> export.test

tail expbkup.log
tail export.test

ls -l
rm -f $PIPE
-----------------------------------------------

This also always does an 'integrity' check of the export right after it is done with an import show=y, that shows how to use these split files with import.
----------------------------------------------

!!!
cat `echo $FN.* | sort` | gunzip > $PIPE &


sorts the filenames, sends them to cat, which give them to gunzip in the right order.

Hope this will 1000's of you people

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Bill McNAMARA_1
Honored Contributor

Re: favourite sysadmin scripts you always keep around....

Thanks all,
Good scripts, and keep them coming!

Later,
Bill
It works for me (tm)
Yogeeraj_1
Honored Contributor

Re: favourite sysadmin scripts you always keep around....

hi,

This script DBAs will love it! ;)

I still don't recall where i borrowed it however.

Email Notification whenever an error (ORA type) occurs in the database.

Hope someone appreciate it as we do it here!

NB. please do the appropriate modifications before executing it.

cheers
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
noBADy
Occasional Contributor

Re: favourite sysadmin scripts you always keep around....

Hi,

I would like to contribute with this small script, which I use to rename VG.
Be careful, because we have a little bit different convention for naming VG and LV as usually used. No problem, script is easy customized...

#!/sbin/sh
export VG_OLD=$1 #Number of an old VG
export VG_NEW=$2 #Number of a new VG
vgchange -a n vg${VG_OLD}
vgexport -s -m /tmp/vg${VG_OLD}.map vg${VG_OLD}
mkdir /dev/vg${VG_NEW}
mknod /dev/vg${VG_NEW}/group c 64 "0x"${VG_NEW}"0000"
awk -v VG_NEW="${VG_NEW}" '{if ($2 ~ /^lv/) {print $1 " lv" VG_NEW} else {print $0}}' /tmp/vg${VG_OLD}.map > /tmp/vg${VG_OLD}_.map
vgimport -s -m /tmp/vg${VG_OLD}_.map vg${VG_NEW}
vgchange -a y vg${VG_NEW}

Have a nice time,
Brano.