Create Database   «Prev  Next»

Lesson 3 Creating a new Oracle service on Windows
Objective Create and verify a Windows service for an Oracle 19c (or later) database instance

Creating an Oracle Service on Windows with the ORADIM Utility

In modern Oracle environments, most cloud deployments (including Oracle Cloud Infrastructure) run Oracle Database on Linux and manage database lifecycle through the cloud console, REST APIs, and automation tools. On Windows, however, the database instance still runs inside one or more Windows services, and the ORADIM utility is the supported command-line tool for creating and managing those services for Oracle Database 19c and later.

Use ORADIM when you:
  • Install Oracle Database on a Windows server (on-premises or cloud-hosted VM) and want to create a new instance manually.
  • Need to add, modify, or delete the Windows service that starts the database instance.
  • Are working in a hybrid environment where some databases run in the cloud and others run as Windows services.
In fully managed cloud services (for example Autonomous Database), ORADIM is not used; those services manage instances automatically. In this lesson, we focus on Windows-based Oracle Database 19c+ where ORADIM is still the key utility.

Step-by-Step: Creating a New Oracle Service

The following procedure assumes you have already installed Oracle Database on a Windows server and want to create a service for a database such as COIN or ORCL.

  1. Open Command Prompt with administrative privileges
    • From the Start menu, search for Command Prompt.
    • Right-click and choose Run as administrator.
  2. Run the ORADIM command

    General syntax for creating a new service in Oracle 19c+ on Windows:

    oradim -new -sid <SID> -startmode {AUTO | MANUAL} [-pfile <parameter_file>] [-spfile] [-intpwd <password>] [-log <log_file>]
    • -new: Indicates that you are creating a new service.
    • -sid <SID>: System Identifier of the instance (for example COIN or ORCL).
    • -startmode {AUTO | MANUAL}:
      • AUTO – Starts the instance automatically when the Windows service starts.
      • MANUAL – Requires you to start the service, and thus the instance, manually.
    • -pfile / -spfile: Points to the initialization file:
      • -pfile: traditional text init<SID>.ora file.
      • -spfile: server parameter file spfile<SID>.ora located in the default directory.
    • -intpwd <password>: Sets the password for privileged connections used by the service (for example SYS). This should follow your password policy.
    • -log <log_file>: Writes ORADIM operations to a custom log file (otherwise oradim.log is used by default).
  3. Example: creating a COIN service that starts automatically

    Assume your SID is COIN and you are using a text initialization file:

    oradim -new -sid COIN -startmode AUTO ^
           -pfile C:\oracle\admin\COIN\pfile\initCOIN.ora ^
           -log   C:\oracle\logs\oradim-coin.log
    • The Windows service name will typically be OracleServiceCOIN.
    • The instance will start when the Windows service starts (because -startmode AUTO is used).
    • ORADIM writes diagnostic information to oradim-coin.log.
  4. Verify the service
    • Open the Services console (services.msc).
    • Locate OracleServiceCOIN (or the name matching your SID).
    • Confirm that:
      • Status is Running (if you chose AUTO and the service started successfully).
      • Startup type matches Automatic or Manual based on your ORADIM command.
  5. Start and stop the service

    You can manage the service from the command prompt:

    net start OracleServiceCOIN
    net stop  OracleServiceCOIN

    Or you can use the Services console to start, stop, or restart the service.


ORADIM Syntax Reference (Windows)

The ORADIM syntax below summarizes the core options for creating an Oracle Database service on Windows. This form has been stable from Oracle 9i through 19c and remains relevant in current Windows deployments.

oradim -new {-sid sid | -srvc service}
       [-intpwd password] [-maxusers integer]
       [-startmode {auto | manual}] [-pfile filespec | -spfile]
       [-timeout seconds] [-log <log_file>]
  1. oradim – The Windows-only utility for creating and managing Oracle database services.
  2. -new – Indicates you are creating a new service (as opposed to editing or deleting one).
  3. -sid sid – Specifies the SID for the new instance (for example COIN or ORCL).
  4. -srvc service – Specifies a custom Windows service name. You use either -sid or -srvc, but not both.
  5. -intpwd password – Sets the internal/privileged password used when the service starts the instance (optional but recommended for security).
  6. -maxusers integer – Reserves space for a maximum number of user processes; in modern systems this is less commonly used but still supported.
  7. -startmode {auto | manual} – Controls whether the service starts automatically when Windows boots or must be started manually.
  8. -pfile filespec – Points to the initialization parameter file (initSID.ora).
  9. -spfile – Uses the server parameter file (spfileSID.ora) instead of a text pfile.
  10. -timeout seconds – Limits how long ORADIM waits before timing out service creation.
  11. -log <log_file> – Directs diagnostic output to the specified log file.

Administering an Oracle Instance with ORADIM

ORADIM is typically needed only when you:
  • Manually create or delete a database instance on Windows.
  • Change how the service starts (AUTO vs MANUAL).
  • Reset the internal password or change the parameter file used at startup.

To view ORADIM help and parameter descriptions:

oradim -? 
oradim -h
oradim -help

ORADIM writes operational details to a log file named oradim.log in:

%ORACLE_HOME%\database

or in the directory specified by the registry parameter ORA_CWD. You should always check this log file to verify whether service creation or modification succeeded.

Typical ORA-12640 Issue on Windows

On Windows, Oracle Database commonly uses OS authentication via the setting:

SQLNET.AUTHENTICATION_SERVICES = (NTS)

If the database service starts as the built-in LocalSystem account and networking or authentication is misconfigured, you may see:

ORA-12640: Authentication adapter initialization failed

Modern approaches to resolving this problem include:

  1. Run the service under a dedicated Windows user
    Configure the OracleServiceSID service to use a domain or local user that:
    • Has the required “Log on as a service” right.
    • Has appropriate access to Oracle binaries, datafiles, and network locations.
  2. Review sqlnet.ora
    Ensure that SQLNET.AUTHENTICATION_SERVICES is set appropriately for your security model. For example, to allow OS authentication on Windows:
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
    Only if you have a clear security design and do not require OS authentication would you consider:
    SQLNET.AUTHENTICATION_SERVICES = (NONE)
    Disabling OS authentication may simplify some configurations but should be evaluated carefully in regulated or enterprise environments.
  3. Start the database explicitly after the service
    Even when the service starts successfully, you can use SQL*Plus as SYSDBA to verify and start the instance:
    sqlplus / as sysdba
    STARTUP;
    This is common in scripted or automated startup scenarios on Windows servers, including cloud-hosted Windows VMs.

Verifying Oracle Services in the Windows Console

After creating your service for the COIN database, verify its configuration using the Windows Services console:

Create Oracle Service - Exercise

Now, go on to the exercise to create a service for your database, and open the services control panel on your own.
Create Oracle Service - Exercise

SEMrush Software 3 SEMrush Banner 3