7 Starting and Stopping Oracle Database Free

You can start and stop the database manually or set it to automatically start when the system shuts down or starts.

Shut Down and Start-Up Using SQL*Plus

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

To shut down the database, log in as the oracle user with its environment variables set for access to Oracle Database Free, and run the following SQL*Plus command:

$ sqlplus / as sysdba
SQL> SHUTDOWN IMMEDIATE

To start the database:

SQL> STARTUP
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;

Automating Shutdown and Start-Up

Oracle recommends that you configure the system to automatically start Oracle Database Free when the system starts, and to automatically shut it down when the system shuts down.

To automate the start up and shutdown of the listener and database, run the following commands as root:

$ sudo -s

For Oracle Linux 8 and Oracle Linux 9:

# systemctl daemon-reload
# systemctl enable oracle-free-23ai

Shutting Down and Starting Up Using the Configuration Services Script

After you configure the listener, log in as root using sudo and run the Configuration Services Script to check the status of the database and listener.

$ sudo -s
# /etc/init.d/oracle-free-23ai status

The output of this command is similar to the following:

Status of the Oracle FREE 23ai service:

LISTENER status: RUNNING
FREE Database status: RUNNING

Run the following commands as root using sudo.

$ sudo -s

Oracle Linux 8 and Oracle Linux 9:

To start the listener and the database:

# systemctl start oracle-free-23ai

To stop the database and the listener:

# systemctl stop oracle-free-23ai

To stop and start the listener and the database:

# systemctl restart oracle-free-23ai