Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Issuing Oracle administrative commands from restricted user account
"FC" <flavio_at_tin.it> wrote in message news:<GNI2a.175157> Yeah, I know that works, my problem is slightly different.
> If you put commands like LSNCRTL in a batch command file (.bat, .cmd), even
> if you "runas /user:Administrator" the script, they don't work, presumably
> because they do not inherit administrator rights from the calling
> environment or some other unknown reason.
> If you run them one at a time with RUNAS they work, but inside a batch
> program they don't.
> The most acceptable solution I found so far is to open a command prompt with
> Administrator rights, then you can run any command you like from there and
> you have to type the Administrator password only once.
> However, in this fashion, you cannot just point and click, you must supply
> the batch program name every time.
> I just wanted to create some small scripts that prompted the user for the
> administrator password, no matter what your current account is and put them
> on the desktop or some other folder, ready to be launched.
> I have an Oracle multi-home environment and having different scripts to
> start up or shutdown a certain db instance and or listener and or related
> service is very handy.
> Not a big deal probably, but still I can't find a way around it.
How about something like this then,
Create a script called e.g. run.bat with all your commands
lsnrctl start
.......
.......
Create another script e.g. call.bat with runas command runas /user:<DOMAIN\administrator "cmd /c call <PATH>\run.bat"
Double click on call.bat and you will be prompted for password. After that all commands in run.bat will run as administrator.
Hope this helps
/Rauf Sarwar
Received on Thu Feb 13 2003 - 21:46:21 CST
![]() |
![]() |