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:
- From the Start menu, enter
services.msc
in the search field and press Enter. - Locate the
OracleServiceXE
service in the Services window. - Right-click the service name, and from the menu, select Start or Stop.
- 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 nameOracleOraDB21Home<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.
cd <oracle_home>\bin
sqlplus / as sysdba
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
Setting Pluggable Databases to Automatically Open
The default pluggable database XEPDB1 will open automatically when the container database opens, such as when Windows is rebooted and the XE service starts. It will not need to be opened manually using the SQL provided above.
Other 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:
-
Oracle Multitenant Administration Guide for more information about shutting down and starting a PDB
-
Oracle Database Administrator's Guide for more information about starting up and shutting down using SQL*Plus.