Create Database   «Prev  Next»

Lesson 3 Creating a new Oracle service on Windows
Objective Create and verify a Windows service for an Oracle AI Database 26ai 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 still the tool for creating and managing those services in Oracle AI Database 26ai — it's the exact step Oracle's own multitenant creation walkthrough calls out as "Step 5 (Windows Only): Create an Instance," which is where this lesson picks up if you're following the CREATE DATABASE sequence from the previous lesson on a Windows host.

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 AI Database 26ai, where ORADIM remains the key utility.

Step-by-Step: Creating a New Oracle Service

The following procedure assumes you have already prepared the initialization parameters and are ready to create the instance itself for a database such as COIN — this is exactly the point in the Lesson 2 sequence where you'd move from having a parameter file ready to running STARTUP NOMOUNT and, on Windows, that requires the instance's Windows service to exist first.

  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 — with STARTMODE MANUAL, not AUTO

    General syntax for creating a new service in Oracle AI Database 26ai on Windows:

    oradim -new -sid <SID> -startmode {AUTO | MANUAL} [-pfile <parameter_file>] [-spfile] [-intpwd <password>] [-log <log_file>]

    This is worth calling out directly because it's a mistake easy to make and easy to overlook: at this stage, always use -startmode MANUAL, even if you eventually want the instance to start automatically with Windows. Setting AUTO here causes the new service to immediately try starting and mounting a database that doesn't exist yet, since you haven't run CREATE DATABASE against it. You switch it to AUTO afterward, once the database actually exists — covered in step 5 below.

    • -new: Indicates that you are creating a new service.
    • -sid <SID>: System Identifier of the instance (for example COIN).
    • -startmode {AUTO | MANUAL}:
      • MANUAL – the correct choice when the service is first created; you start it yourself once the database exists.
      • AUTO – starts the instance automatically when the Windows service starts; set this later, not at creation time.
    • -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 a password ORADIM associates with the service at creation time. This is a separate concern from the Oracle Home User password discussed below — don't conflate the two.
    • -log <log_file>: Writes ORADIM operations to a custom log file (otherwise oradim.log is used by default).
  3. Example: creating the COIN service

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

    oradim -new -sid COIN -startmode MANUAL ^
          -pfile C:\oracle\admin\COIN\pfile\initCOIN.ora ^
          -log   C:\oracle\logs\oradim-coin.log
    • The Windows service name will typically be OracleServiceCOIN.
    • Most Oracle services on Windows log on using the privileges of the Oracle Home User — the OS account associated with this Oracle home at install time, rather than the built-in LocalSystem account. ORADIM prompts you for that account's password as part of service creation; this is separate from any database-level password.
    • Because -startmode MANUAL was used, the service does not attempt to start or mount anything yet — you're free to proceed to CREATE DATABASE without the service racing ahead of you.
    • ORADIM writes diagnostic information to oradim-coin.log.
  4. Verify the service, then create the database
    • Open the Services console (services.msc).
    • Locate OracleServiceCOIN (or the name matching your SID).
    • Confirm that Startup type shows Manual — this is expected and correct at this stage.
    • Start the service, connect with sqlplus / as sysdba, run STARTUP NOMOUNT, and proceed with the CREATE DATABASE statement from the previous lesson.
  5. Once the database exists: switch the service to automatic startup

    With the database created and working, you can now safely change the service to start automatically whenever Windows restarts, using -EDIT rather than -NEW:

    oradim -edit -sid COIN -startmode AUTO -srvcstart SYSTEM -spfile
    • -edit: modifies an existing service rather than creating a new one.
    • -srvcstart SYSTEM: specifies which account context the service starts under; SYSTEM here refers to the startup context, not a database password.
    • This is the point where AUTO becomes the right choice — the database exists now, so there's nothing left for the automatic mount attempt to fail against.
  6. Start and stop the service manually, any time

    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 syntax below summarizes the core options for creating and editing an Oracle Database service on Windows. The -NEW, -EDIT, -SID, -STARTMODE, -PFILE, and -SPFILE options are confirmed current for Oracle AI Database 26ai. For the complete, authoritative option list — including less commonly used flags — see the Oracle Database Platform Guide for Microsoft Windows, which is the canonical ORADIM reference and not part of the Oracle AI Database core documentation set covered elsewhere in this course.

oradim -new {-sid sid | -srvc service}
      [-intpwd password] [-maxusers integer]
      [-startmode {auto | manual}] [-pfile filespec | -spfile]
      [-timeout seconds] [-log <log_file>]

oradim -edit -sid sid
      [-startmode {auto | manual}] [-srvcstart {system | demand}]
      [-pfile filespec | -spfile]
  1. oradim – The Windows-only utility for creating and managing Oracle database services.
  2. -new – Creates a new service. Always pair this with -startmode MANUAL; a database doesn't exist yet at this point, so AUTO causes a failed mount attempt.
  3. -edit – Modifies an existing service, such as switching it to AUTO once the database has been created.
  4. -sid sid – Specifies the SID for the instance (for example COIN).
  5. -srvc service – Specifies a custom Windows service name. You use either -sid or -srvc, but not both.
  6. -intpwd password – Sets a service-level password at creation time.
  7. -maxusers integer – Reserves space for a maximum number of user processes.
  8. -startmode {auto | manual} – Controls whether the service starts automatically when Windows boots or must be started manually.
  9. -srvcstart {system | demand} – Used with -edit to control the startup context once you're ready for automatic startup.
  10. -pfile filespec – Points to the initialization parameter file (initSID.ora).
  11. -spfile – Uses the server parameter file (spfileSID.ora) instead of a text pfile.
  12. -timeout seconds – Limits how long ORADIM waits before timing out service creation.
  13. -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), which — as covered above — should happen as a separate -EDIT step after the database exists, not at initial creation.
  • 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 under an account that doesn't have appropriate access — most often the Oracle Home User account discussed above, rather than the older LocalSystem convention — and networking or authentication is misconfigured, you may see:

ORA-12640: Authentication adapter initialization failed

Modern approaches to resolving this problem include:

  1. Confirm the Oracle Home User has the access it needs
    Configure the OracleServiceSID service to run as the Oracle Home 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