Shutting Down the Database Using SQL Command Line

Previous
Previous
Next
Next

When you shut down the database with SQL Command Line, you must run SQL Command Line on the same computer where you installed Oracle Database XE (the "Oracle Database XE host computer").

To shut down the database using SQL Command Line:

  1. Do one of the following:

    • On Windows: Log in to the Oracle Database XE host computer as a user who is a member of the ORA_DBA user group. This is typically the user that installed Oracle Database XE.

    • On Linux: Log in to the Oracle Database XE host computer as a user who is a member of the dba user group. This is typically the oracle user.

    See "Operating System Authentication" for more information.

  2. If not already opened, open a terminal session or command window.

  3. Linux platform only: Ensure that environment variables are set properly.

    See "Setting Environment Variables on the Linux Platform" for details.

  4. At the operating system prompt, enter the following command to start SQL Command Line and connect to the database:

    SQLPLUS / AS SYSDBA
    
    

    The slash (/) indicates that the database should authenticate you with operating system authentication.

  5. At the SQL Command Line prompt, enter the following command:

    SHUTDOWN IMMEDIATE
    
    

    Note that this command may take a short while to complete. If the command is successful, it displays the following output:

    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    
    

    If the command displays no output after a number of minutes, indicating that the shutdown operation is not proceeding, you can press CTRL-C to interrupt the command, and then enter the following command:

    SHUTDOWN ABORT
    
    

    The database must go through a recovery process when it starts up after a SHUTDOWN ABORT command. It is recommended that you enable the recovery process to take place immediately, after which you can shut down the database normally. To do this, enter the following commands when the SHUTDOWN ABORT completes:

    STARTUP
    SHUTDOWN IMMEDIATE
    
    

    See Oracle Database Administrator's Guide for information on the SHUTDOWN ABORT command.

  6. Enter the following command to exit SQL Command Line:

    EXIT