Re: AW: transmitting the result of an sql query to a script ? + loop struture ?
2001-11-27 18:22:19
Subject: |
Re: AW: transmitting the result of an sql query to a script ? + loop struture ? |
From: |
Robin Sharpe <Robin_Sharpe AT BERLEX DOT COM> |
Date: |
Tue, 27 Nov 2001 16:39:32 -0500 |
Here's one that we use every day, and it works pretty well... from an AIX
4.3.3 machine. This kills any running reclaims:
# Kill any reclaim processes that are running
alias dsmadmc="dsmadmc -id=maestro -pa=admin"
list_reclaim_pids()
{
dsmadmc select process_num from processes where process=\'Space
Reclamation\' | tail +13 | grep -v ANS
}
list_tape_stgpools()
{
dsmadmc select stgpool_name from stgpools where devclass=\'DLT\' | tail
+13 | grep -v ANS
}
dsmadmc q pr
for POOL in `list_tape_stgpools`
do
print "Setting $POOL reclaim threshold to 100%"
dsmadmc upd stg $POOL reclaim=100 > /dev/null
done
for PID in `list_reclaim_pids`
do
print "Canceling reclamation process $PID"
dsmadmc cancel process $PID
done
Robin Sharpe
Berlex Labs
"Baines, Paul"
<[email protected]
ZBANK.COM> To: ADSM-L AT VM.MARIST DOT
EDU
cc: (bcc: Robin
Sharpe/WA/USR/SHG)
11/22/01 06:00 AM Subject:
Please respond to "ADSM: AW: transmitting the
result of an sql query to a script ? + loop
Dist Stor Manager" struture ?
I can't think how you'd do it without a shell script. Try this (not
tested!)
for proc in `dsmadmc -se=xxx -id=xxx -password=xxx -tab "select '#!#!',
process_num from processes where process='Space Reclamation'" | awk '/^#!
#!/
{printf("%d\n", $2)}'`
do
dsmadmc -se=xxx -id=xxx -password=xxx -tab "cancel proc $proc"
done
Mit freundlichen Grüßen - With best regards
Serdeczne pozdrowienia - Slan agus beannacht
Paul Baines
TSM/ADSM Consultant
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- Re: AW: transmitting the result of an sql query to a script ? + loop struture ?,
Robin Sharpe <=
|
|
|