ADSM-L

Re: SQL select and update command

2001-10-10 20:35:13
Subject: Re: SQL select and update command
From: Scotty Logan <swl AT STANFORD DOT EDU>
Date: Wed, 10 Oct 2001 17:30:44 -0700
On Unix clients, you can generate the script in a single step:

% dsmadmc -se=$TSM_SRVR -id=$TSM_ID -pass=$TSM_ID -tab \
> select \'update volume\',volume_name,\'access=readwrite\' \
> from volumes where access '!=' \'READWRITE\' \> update.mac
ADSTAR Distributed Storage Manager
Command Line Administrative Interface - Version 3, Release 1, Level 0.7
(C) Copyright IBM Corporation, 1990, 1999, All Rights Reserved.

Session established with server ADSM: AIX-RS/6000
  Server Version 3, Release 7, Level 3.0
  Server date/time: 10/10/01   17:13:34  Last access: 10/10/01
17:13:02

Output of command redirected to file 'update.mac'

ANS8002I Highest return code was 0.


% head -5 update.mac
update volume   UA1206  access=readwrite
update volume   UA1220  access=readwrite
update volume   UA1233  access=readwrite
update volume   UA1239  access=readwrite
update volume   UA1240  access=readwrite

The command for NT is similar (this needs to be a single line, since I
don't think cmd.exe has a line continuation character):

C:> dsmadmc -se=%TSM_SRVR% -id=%TSM_ID% -pass=%TSM_PASS% -tab
select 'update volume', volume_name,'acc=readwrite'
from volumes where access != 'READWRITE' ">" c:\temp\update.mac

Tivoli Storage Manager
Command Line Administrative Interface - Version 4, Release 2, Level 0.0
(C) Copyright IBM Corporation, 1990, 2001, All Rights Reserved.

Session established with server ADSM_4: AIX-RS/6000
  Server Version 3, Release 7, Level 3.0
  Server date/time: 10/10/2001 17:20:04  Last access: 10/10/2001
17:13:02

Output of command redirected to file 'C:\TEMP\UPDATE.MAC'

ANS8002I Highest return code was 0.

C:> head -5 c:\temp\update.mac
update volume   UA1206  acc=readwrite
update volume   UA1220  acc=readwrite
update volume   UA1233  acc=readwrite
update volume   UA1239  acc=readwrite
update volume   UA1240  acc=readwrite

Either method generates a script that can be run as a macro.

Hope this helps,

  Scotty

--
Scotty Logan <swl AT stanford DOT edu>
Scotty Logan <swl AT stanford DOT edu>
ITSS-CSS http://www.stanford.edu/group/itss/css/

> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU]On
> Behalf Of
> Bill Colwell
> Sent: Wednesday, October 10, 2001 14:25
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Re: SQL select and update command
>
>
> I don't have a complete answer, but part of the solution
> might be to do have the sql make a file that is ready (almost)
> to be a macro file.  For example -
>
> select 'update volume', volume_name, ' access=readwrite'
>  from volumes
>   where access != 'READWRITE'
>    > c:\a_macro_file
>
> The output will have the sql and headers and trailing text,
> but if you do some editting script you can remove the garbage.
>
> Then you can wrap it all up in a 3 step script;
>
> 1 dsmadmc (run the sql & quit)
> 2. edit the sql output
> 3. dsmadmc (run the macro & quit).
>
> I do this process manually because I don't know the scripting
> languages.
<Prev in Thread] Current Thread [Next in Thread>