7 Starting and Stopping Oracle Database XE

After you have installed Oracle Database XE, the database is up and running and you can begin using it right away.

The Oracle Database service must be running and the database must be started and opened prior to use.

By default, when the Oracle Database service is started, the container database is started and opened, but any pluggable databases must be opened before use. See below for a command to automatically open pluggable databases when the Oracle service starts.

Starting Up and Shutting Down Using Windows Services

The Oracle Database service must be started prior to accessing the database. By default, the Oracle Database Service will automatically startup and open the container database. Pluggable databases will remain closed by default and must be opened manually or set to automatically open.

You can start or stop the database using Windows Services:

  1. From the Start menu, enter services.msc in the search field and press Enter.
  2. Locate the OracleServiceXE service in the Services window.
  3. Right-click the service name, and from the menu, select Start or Stop.
  4. To set its startup properties, right-click and select Properties, and in the dialog box, select either Automatic, Manual, or Disabled from the Startup type list.

Note:

To control connections to the database from the network, you can start or stop the Net Services listener. The listener runs as a service with the name OracleOraDB18Home<n>TNSListener, where <n> is a number chosen by the Oracle Database XE installer based on other Oracle homes previously installed on the host. Use Windows Services to control the listener service similar to the database service as described above.

Starting Up and Shutting Down Using SQL*Plus

You can shut down and start the database using SQL*Plus.

To shutdown the database issue the following SQL*Plus commands:
cd <oracle_home>\bin
sqlplus / as sysdba
SQL> SHUTDOWN IMMEDIATE
To start the database, issue the commands:
SQL> STARTUP
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;

Setting Pluggable Databases to Automatically Open

By default, a pluggable database (such as XEPDB1) will not open automatically and will need to be opened manually using the SQL provided above.

Pluggable databases can be set to automatically open when the container database opens by connecting to the container database via SQL*Plus (as above), and issuing the following SQL:

SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
SQL> ALTER PLUGGABLE DATABASE ALL SAVE STATE;

Note:

If additional pluggable databases are created, these commands will need to be reissued.

See Also: