Get control of your Oracle instance on Windows 10

Working in today's companies often excludes access to administrative account on your Windows machines.

I have a situation on my company's laptop with Oracle XE database running on Windows 10 where my domain user is not allowed to access Services to start/stop/enable/disable neither Oracle DB nor the listener, as access to Services is reserved only for administrators. Yes, my account is part of all ORA_* groups, but that doesn't help.

Database can be started and stopped through sqlplus, but listener can't, and you'll get:

C:\Users\MyUser>lsnrctl stop listener

LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 29-SEP-2016 10:36:20

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-01190: The user is not authorized to execute the requested listener command

Solution could be based on two articles (MS Technet and Windows IT Pro) and it allows specific user to have control over Oracle XE services. Security requirements of your company will still be fulfilled and you will have the ability to control your XE services.

First download SubInACL (subinacl), a small installation package from Microsoft from the following link: https://www.microsoft.com/en-us/download/details.aspx?id=23510.
Although it says that system requirements are Windows until 2003, at the moment of writing this article I found that it's also suitable for Windows 10 Pro (64-bit).

After installation, which should be done with Windows administrative account, the rest is pretty easy.

Open "Command Prompt" as user with administrator rights and execute following (here is user DO\MyUser as example):

cd "C:\Program Files\Windows Resource Kits\Tools\

subinacl /service OracleJobSchedulerXE /grant=DO\MyUser=topc
subinacl /service OracleMTSRecoveryService /grant=DO\MyUser=topc
subinacl /service OracleServiceXE /grant=DO\MyUser=topc
subinacl /service OracleXEClrAgent /grant=DO\MyUser=topc
subinacl /service OracleXETNSListener /grant=DO\MyUser=topc

Explanation of "=topc":
    t - start service
    o - stop service
    p - pause/continue service
    c - service change configuration (autostart, manual start, disabled)

As a test, with your user open "Command Prompt" and enter:

net stop OracleServiceXE
net start OracleServiceXE

...or you can go through GUI, open "Services", find specific service and try to stop/start it.

Of course, this should work with any other Windows service, but for now, I was focused on my problem with starting and stopping Oracle XE services :)

Kresimir Skoda

Read more posts by this author.

Subscribe to Kresimir's web place

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!