亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
1. Switch to the Oracle User and Set Environment Variables
*2. Use SQLPlus to Start and Stop the Database**
Stop the Oracle Database
Start the Oracle Database
3. Optional: Using Oracle Net and Listener Control
Stop the Listener
Start the Listener
4. Automating with Scripts (Optional)
Quick Summary Commands
Home Database Oracle How to start and stop Oracle database on Linux?

How to start and stop Oracle database on Linux?

Jul 29, 2025 am 01:43 AM
oracle linux

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.

How to start and stop Oracle database on Linux?

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.

How to start and stop Oracle database on Linux?

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:

How to start and stop Oracle database on Linux?
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 the ORACLE_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:

How to start and stop Oracle database on Linux?
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), or SHUTDOWN 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 with STARTUP)

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72
What is Impossible Cloud Network (ICNT)? How? A comprehensive introduction to the ICN project that Binance will launch soon What is Impossible Cloud Network (ICNT)? How? A comprehensive introduction to the ICN project that Binance will launch soon Jul 07, 2025 pm 07:06 PM

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

Fixed the failure to upload files in Windows Google Chrome Fixed the failure to upload files in Windows Google Chrome Jul 08, 2025 pm 02:33 PM

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

How to find my private and public IP address in Linux? How to find my private and public IP address in Linux? Jul 09, 2025 am 12:37 AM

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.

How does Oracle manage transaction commits and rollbacks using redo and undo mechanisms? How does Oracle manage transaction commits and rollbacks using redo and undo mechanisms? Jul 08, 2025 am 12:16 AM

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

JavaScript time object, someone builds an eactexe, faster website on Google Chrome, etc. JavaScript time object, someone builds an eactexe, faster website on Google Chrome, etc. Jul 08, 2025 pm 02:27 PM

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

What is the code number of Bitcoin? What style of code is Bitcoin? What is the code number of Bitcoin? What style of code is Bitcoin? Jul 22, 2025 pm 09:51 PM

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.

System requirements to install linux System requirements to install linux Jul 20, 2025 am 03:49 AM

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

How to use the `shutdown` command How to use the `shutdown` command Jul 15, 2025 am 12:26 AM

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.

See all articles