- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: running lsnr commands in DCL com file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 11:29 AM
тАО10-21-2008 11:29 AM
lsnrctl < EOF
set current_listener listener_name
set password encrypted_password
stop
exit
EOF
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 12:32 PM
тАО10-21-2008 12:32 PM
Solutioncommand works the same way, I'd expect
something like this to work:
$ lsnrctl
set current_listener listener_name
set password encrypted_password
stop
exit
Lines without "$" are normally read as input
to the program. See also, "HELP DECK".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 12:35 PM
тАО10-21-2008 12:35 PM
Re: running lsnr commands in DCL com file
I'm not sure if Oracle define lsnrctl as a DCL command or foreign command. I'm assuming you can just type "lsnrctl" interactively and get a prompt. If not, you need to work that part out (maybe ask Oracle?)
If "listener_name" and "encrypted password" are literal text, then this should work:
$ lsnrctl
$ DECK
set current_listener listener_name
set password encrypted_password
stop
exit
$ EOD
$ EXIT
This also assumes that lsnrctl reads input from SYS$INPUT. It's possible (but hopefully unlikely!) that it reads directly from SYS$COMMAND, in which case you'd need to redirect input prior to running the command. Ask Oracle if the above doesn't work.
If "listener_name" and "encrypted password" are intended to be variables, you need to get a bit more creative:
$ listener_name="mylistener"
$ encrypted_password="secret"
$ wo="WRITE SYS$OUTPUT"
$ PIPE (-
wo "set current listener ",listener_name ;-
wo "set password ",encrypted_password ;-
wo "stop" ;-
wo "exit") | -
(define/user sys$input sys$pipe ;
lsnrctl)
$ EXIT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 12:37 PM
тАО10-21-2008 12:37 PM
Re: running lsnr commands in DCL com file
Well,
Typically all you need for OpenVMS is
a 'command' file which would look something like:
$LSNRCTL
command 1
command 2
$EXIT
HOWEVER... (For Oracle 10.2) On OpenVMS 'lsnrctl' is an alias.
$SHOW SYMBOL lnsrctl !--->
LSNRCTL == "@ora_root:[bin]lsnrctl"
This foils the normal SYS$INPUT redirection.
Now if you look into ora_root:[bin]lsnrctl.COM,
then you'll see it actually runs: ORA_ROOT:[bin]LSNRCTL.EXE
So a script has too look like, for example:
$RUN ORA_ROOT:[bin]LSNRCTL.EXE
status
exit
$EXIT
Now if you need variables, then it becomes much more fun.
You'll need something like:
$listener_name = "test"
$OPEN/WRITE tmp lsnrctl.TMP
$WRITE tmp "status ", listener_name
$WRITE tmp "exit"
$CLOSE tmp
$DEFINE/USER SYS$INPUT lsnrctl.TMP
$RUN ORA_ROOT:[bin]LSNRCTL.EXE
$DELETE lsnrctl.TMP.
Enjoy!
Hein van den Heuvel ( at gmail dot com )
HvdH Performance Consulting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 03:02 PM
тАО10-22-2008 03:02 PM
Re: running lsnr commands in DCL com file
The LSNRCTL commands are instantiated as DCL foreign commands after you run @ORAUSER
and that of course only works after you have run @INSORACLE (as ORACLE) from the appropriate [ORACLE.?] folder. Where the ? depends on your version number.
I do the LSNRCTRL commands as DCL foreign verbs all of the time in batch jobs that manage my startup. So I know it is possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 03:09 PM
тАО10-22-2008 03:09 PM
Re: running lsnr commands in DCL com file
I concur. I have done this many times at various client sites.
However, the question of which version of Oracle is being used AND how the local environment is set up does make a difference. The comment about ORAUSER setting the context is appropriate and correct.
- Bob Gezelter, http://www.rlgsc.com