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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving lock info on file

Status
Not open for further replies.

donnpascual

IS-IT--Management
Jan 29, 2004
5
JP
everybody.

i check the currently locked database by
executing the command 'start showlocks' at DBW.
show locks utility is executed in another
terminal which shows the locked database at
the instant (instanteneous lock information).
now, my problem is on how i would be able to save
this information to a file and on how i could
execute the said command via command line.

i am planning to store the information of the lock
databases and use this information in a script
that will do the rest of the task that i am suppose
to do. in short, i plan to automize my work through
scripts so i need to execute the 'start showlocks'
command through the prompt and store it in a file.

i need your expertise, friends.

thanks.
don andres pascual (japan)
 


Any Utility you can run from DBW can be run from the from the command line using the CNSRUN program running on the TPA node. Checktable and ferret can be scripted this way as a well but require special handling and can't be aborted once started.

cnsrun -utility showlocks -commands '{line1} {line2} ...' -debug 1 > /tmp/output 2>&1

don't forget the -debug 1 or the output will not come back to the file.


Since I am not as familiar with showlocks as I should be I don't know what to put in {line1} and {line2}.

The Quotes and {braces} are required as part of the command syntax. You can put in as many {lines} as you want but each one must be eclosed in it own {Brackets}. each {LINE} will be sent in turn to the utility when it requests input from the user.

Don't forget the {quit;} line ( or whatever showlocks uses to terminate the utility ) or CNSRUN will leave the utility running in the DBW window where it started it.

If that happens just start DBW and go to that Application Window and exit the utility.

If you have more {lines} than you can fit on a SHELL command line you can alos put the commands in a file and use

-file mycommandfile

instead of

-command '{line1} {line2} ... '



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top