Switch to the oracle user and set ORACLE_SID, ORACLE_HOME, and PATH environment variables. 2. Use sqlplus / as sysdba to access SQLPlus, then run SHUTDOWN IMMEDIATE to stop the database or STARTUP to start it, which initializes the instance, mounts the database, and opens it for users. 3. Optionally, manage the listener separately using lsnrctl start or lsnrctl stop to enable or disable remote connections. 4. For automation, use custom scripts or systemd services if configured, though manual SQLPlus control remains the standard method. Always verify correct ORACLE_SID and ORACLE_HOME settings, especially when multiple databases exist on the same server.
Starting and stopping an Oracle database on Linux involves using Oracle’s command-line tools, primarily through the sqlplus
utility and sometimes via Oracle’s dbca
or service scripts depending on the setup. Below are the standard methods for manually starting and stopping an Oracle database instance.

1. Switch to the Oracle User and Set Environment Variables
Before managing the database, you need to log in or switch to the Oracle software owner (usually oracle
) and ensure the Oracle environment is set.
sudo su - oracle
Make sure ORACLE_SID
and ORACLE_HOME
are set. You can set them manually if needed:

export ORACLE_SID=orcl export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 export PATH=$ORACLE_HOME/bin:$PATH
Replace
orcl
and theORACLE_HOME
path with your actual database SID and Oracle installation path.
*2. Use SQLPlus to Start and Stop the Database**
Stop the Oracle Database
Connect to the database as SYSDBA
and shut it down:

sqlplus / as sysdba
Once in SQL*Plus:
SHUTDOWN IMMEDIATE;
SHUTDOWN IMMEDIATE
rolls back uncommitted transactions and disconnects users. It's the most common safe shutdown method.- Other options:
SHUTDOWN TRANSACTIONAL
,SHUTDOWN NORMAL
(graceful), orSHUTDOWN ABORT
(like a crash – only if necessary).
After shutdown, you can exit:
EXIT;
Start the Oracle Database
Restart the instance and mount and open the database:
sqlplus / as sysdba
Then:
STARTUP;
This command does the following:
- Starts an instance (allocates memory and starts background processes)
- Mounts the database (associates the instance with the database)
- Opens the database (makes it available to users)
If you only want to mount or open partially, you can use:
STARTUP NOMOUNT
– instance started, no database mounted (used for creating databases or recovery)STARTUP MOUNT
– instance and database mounted, but not open (used for maintenance)STARTUP OPEN
– fully opens the database (default withSTARTUP
)
3. Optional: Using Oracle Net and Listener Control
The database listener (usually LISTENER
) runs separately and should also be managed:
Stop the Listener
lsnrctl stop
Start the Listener
lsnrctl start
The listener allows remote clients to connect. Always ensure it's running after starting the database.
4. Automating with Scripts (Optional)
On some systems, especially with Oracle Restart or systemd (in newer setups), you can use scripts or services.
For example, using a custom systemd service is possible but not standard unless configured. Most Oracle DBAs prefer manual sqlplus
control or Oracle Grid Infrastructure.
Quick Summary Commands
As the oracle
user:
# Stop the database sqlplus / as sysdba << EOF SHUTDOWN IMMEDIATE; EXIT; EOF # Start the database sqlplus / as sysdba << EOF STARTUP; EXIT; EOF # Listener control lsnrctl start # or stop
Note: Always ensure you're using the correct ORACLE_SID
and ORACLE_HOME
. Multiple databases on the same server require switching these variables accordingly.
Basically, it's sqlplus / as sysdba
followed by STARTUP
or SHUTDOWN IMMEDIATE
. Not complex, but easy to mess up if environment variables are wrong.
The above is the detailed content of How to start and stop Oracle database on Linux?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Contents 1. What is ICN? 2. ICNT latest updates 3. Comparison and economic model between ICN and other DePIN projects and economic models 4. Conclusion of the next stage of the DePIN track At the end of May, ICN (ImpossibleCloudNetwork) @ICN_Protocol announced that it had received strategic investment in NGPCapital with a valuation of US$470 million. Many people's first reaction was: "Has Xiaomi invested in Web3?" Although this was not Lei Jun's direct move, the one who had bet on Xiaomi, Helium, and WorkFusion

Have problems uploading files in Google Chrome? This may be annoying, right? Whether you are attaching documents to emails, sharing images on social media, or submitting important files for work or school, a smooth file upload process is crucial. So, it can be frustrating if your file uploads continue to fail in Chrome on Windows PC. If you're not ready to give up your favorite browser, here are some tips for fixes that can't upload files on Windows Google Chrome 1. Start with Universal Repair Before we learn about any advanced troubleshooting tips, it's best to try some of the basic solutions mentioned below. Troubleshooting Internet connection issues: Internet connection

In Linux systems, 1. Use ipa or hostname-I command to view private IP; 2. Use curlifconfig.me or curlipinfo.io/ip to obtain public IP; 3. The desktop version can view private IP through system settings, and the browser can access specific websites to view public IP; 4. Common commands can be set as aliases for quick call. These methods are simple and practical, suitable for IP viewing needs in different scenarios.

Oracleensurestransactiondurabilityandconsistencyusingredoforcommitsandundoforrollbacks.Duringacommit,Oraclegeneratesacommitrecordintheredologbuffer,markschangesaspermanentinredologs,andupdatestheSCNtoreflectthecurrentdatabasestate.Forrollbacks,Oracle

Hello, JavaScript developers! Welcome to this week's JavaScript news! This week we will focus on: Oracle's trademark dispute with Deno, new JavaScript time objects are supported by browsers, Google Chrome updates, and some powerful developer tools. Let's get started! Oracle's trademark dispute with Deno Oracle's attempt to register a "JavaScript" trademark has caused controversy. Ryan Dahl, the creator of Node.js and Deno, has filed a petition to cancel the trademark, and he believes that JavaScript is an open standard and should not be used by Oracle

As a pioneer in the digital world, Bitcoin’s unique code name and underlying technology have always been the focus of people’s attention. Its standard code is BTC, also known as XBT on certain platforms that meet international standards. From a technical point of view, Bitcoin is not a single code style, but a huge and sophisticated open source software project. Its core code is mainly written in C and incorporates cryptography, distributed systems and economics principles, so that anyone can view, review and contribute its code.

Linuxcanrunonmodesthardwarewithspecificminimumrequirements.A1GHzprocessor(x86orx86_64)isneeded,withadual-coreCPUrecommended.RAMshouldbeatleast512MBforcommand-lineuseor2GBfordesktopenvironments.Diskspacerequiresaminimumof5–10GB,though25GBisbetterforad

The shutdown command of Linux/macOS can be shut down, restarted, and timed operations through parameters. 1. Turn off the machine immediately and use sudoshutdownnow or -h/-P parameters; 2. Use the time or specific time point for the shutdown, cancel the use of -c; 3. Use the -r parameters to restart, support timed restart; 4. Pay attention to the need for sudo permissions, be cautious in remote operation, and avoid data loss.
