Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query help.

Status
Not open for further replies.

Gormag

Technical User
Mar 8, 2004
29
NZ
I am new to SQL query and need a hand.

If I run this: q act begind=-1 s=ANR1420

I obviousley get something like this,

09/18/06 15:35:44 ANR1420W Read access denied for volume QB3164 - volume access mode = "unavailable". (SESSION: 91400)
09/18/06 15:36:18 ANR1420W Read access denied for volume QB2887 - volume access mode = "unavailable". (SESSION: 91103)

The thing is, there can be thousands of lines like this, and I just want a simple query to take this data from a specific day and show me the list of tapes.

How would this be done?
 
is this helpfull ?

select volume_name, access, status from volumes where access='UNAVAILABLE'
 
also try "q vol access=unav" if you want to change the status after that "upd vol XXXXXX access=readw/reado
 
I gave up on the sql query, in the end just did this.

dsmadmc -id=YOU -pass=YOURPASS "q act begind=-3 s=ANR1420" | grep "Read access denied for volume" | awk '{print $9}' | sort -u

Provides a nice short list..
 
Here you go:
select volume_name,stgpool_name,pct_utilized,access, write_errors,read_errors from volumes where access='UNAVAILABLE' and volume_name in (select volume_name from libvolumes)

and here for the ReadOnly tapes:
select volume_name,stgpool_name,pct_utilized,access, write_errors,read_errors from volumes where access='READONLY' order by stgpool_name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top