search
HomeDatabaseOracleoracle delete instance

Oracle is a very popular relational database management system. When using Oracle, sometimes you need to delete an instance (instance), for example, because you want to rebuild a new instance or because you need to clear old data. This article will introduce how to delete an Oracle instance.

First, we need to confirm the status of the current instance. You can check using the following command:

$ ps -ef | grep pmon

If the instance is running, one or more processes will be output immediately following it, as shown below:

oracle   1234     1  0 09:06 ?        00:00:00 ora_pmon_MYINSTANCE

Where "MYINSTANCE" is the name of the instance .

If the instance is running, we need to stop the instance first. You can use the following command to stop:

$ sqlplus '/as sysdba'
SQL> shutdown immediate;

This command will immediately close the database and stop the instance.

Next, we need to confirm some instance information. You can use the following command to view the directory structure of the instance:

$ ls $ORACLE_HOME/dbs/myinstance*

If there are one or more files related to the instance, such as "myinstance.ora", "myinstance.pfile", etc., you need to ensure that these files will be deleted .

In addition, we also need to delete the configuration of the instance in Oracle Net Listener. This can be confirmed using the following command:

$ lsnrctl status LISTENER

where LISTENER is the name of the Oracle Net Listener. The output result will contain some content as shown below:

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)))
SERVICE_LISTENER =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521))
    (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
  )
SID_LIST_LISTENER =
  (SID_LIST=
    (SID_DESC=
      (GLOBAL_DBNAME=myinstance)
      (ORACLE_HOME=/usr/local/oracle)
      (SID_NAME=myinstance)
    )
  )

where, myhost is the host name of the Oracle server, 1521 is the port number used by Oracle Net Listener, and myinstance is the name of the instance. All references to instances need to be deleted.

You can use the following command to delete the configuration in Oracle Net Listener:

$ lsnrctl stop LISTENER
$ vi $ORACLE_HOME/network/admin/listener.ora
$ vi $ORACLE_HOME/network/admin/tnsnames.ora
$ lsnrctl start LISTENER

Among them, LISTENER is the name of Oracle Net Listener, $ORACLE_HOME/network/admin/listener.ora is the name of Oracle Net Listener Configuration file, $ORACLE_HOME/network/admin/tnsnames.ora is the configuration file used by the Oracle client. All content related to the instance needs to be deleted in these two files.

Finally, we need to delete the archive directory and data files of the instance. You can use a command similar to the following to confirm:

$ ls /u01/app/oracle/oradata/myinstance/

Then you can use the following command to delete these data files:

$ rm -rf /u01/app/oracle/oradata/myinstance/

Finally, we also need to delete the init.ora file and Oracle's environment variable settings. You can use the following command to delete the init.ora file:

$ rm $ORACLE_HOME/dbs/myinstance.ora
$ rm $ORACLE_HOME/dbs/myinstance.pfile

Then you can use a command similar to the following to delete Oracle's environment variable settings:

$ unset ORACLE_HOME
$ unset ORACLE_SID

The above are all the steps to delete the Oracle instance. It should be noted that before performing these steps, you need to make adequate backups to avoid data loss due to misoperation.

The above is the detailed content of oracle delete instance. For more information, please follow other related articles on the PHP Chinese website!

Statement
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
MySQL vs. Oracle: Understanding Licensing and CostMySQL vs. Oracle: Understanding Licensing and CostMay 03, 2025 am 12:19 AM

MySQL uses GPL and commercial licenses for small and open source projects; Oracle uses commercial licenses for enterprises that require high performance. MySQL's GPL license is free, and commercial licenses require payment; Oracle license fees are calculated based on processors or users, and the cost is relatively high.

Oracle: From Databases to Cloud ServicesOracle: From Databases to Cloud ServicesMay 02, 2025 am 12:05 AM

Oracle's evolution from database to cloud services demonstrates its strong technical strength and market insight. 1. Oracle originated in the 1970s and is famous for its relational database management system, and has launched innovative functions such as PL/SQL. 2. The core of Oracle database is relational model and SQL optimization, which supports multi-tenant architecture. 3. Oracle cloud services provide IaaS, PaaS and SaaS through OCI, and AutonomousDatabase performs well. 4. When using Oracle, you need to pay attention to the complex licensing model, performance optimization and data security issues in cloud migration.

Oracle and MySQL: Exploring Data Management ApproachesOracle and MySQL: Exploring Data Management ApproachesMay 01, 2025 am 12:13 AM

Oracle is suitable for enterprise-level applications that require high performance and complex queries, and MySQL is suitable for web applications that are rapidly developed and deployed. 1. Oracle supports complex transaction processing and high availability, suitable for financial and large ERP systems. 2.MySQL emphasizes ease of use and open source support, and is widely used in small and medium-sized enterprises and Internet projects.

MySQL vs. Oracle: A Look at the User ExperienceMySQL vs. Oracle: A Look at the User ExperienceApr 30, 2025 am 12:12 AM

The differences in user experience between MySQL and Oracle are mainly reflected in: 1. MySQL is simple and easy to use, suitable for quick access and high flexibility scenarios; 2. Oracle has powerful functions, suitable for scenarios that require enterprise-level support. MySQL's open source and free features attract startups and individual developers, while Oracle's complex features and tools meet the needs of large enterprises.

MySQL and Oracle: Exploring Performance and ScalabilityMySQL and Oracle: Exploring Performance and ScalabilityApr 29, 2025 am 12:12 AM

The difference between MySQL and Oracle in performance and scalability is: 1. MySQL performs better on small to medium-sized data sets, suitable for fast scaling and efficient reading and writing; 2. Oracle has more advantages in handling large data sets and complex queries, suitable for high availability and complex business logic. MySQL extends through master-slave replication and sharding technologies, while Oracle achieves high availability and scalability through RAC.

What Oracle Software Does: Key Functions and FeaturesWhat Oracle Software Does: Key Functions and FeaturesApr 28, 2025 am 12:08 AM

Key features of Oracle software include multi-tenant architecture, advanced analytics and data mining, real-time application clustering (RAC), and automated management and monitoring. 1) A multi-tenant architecture allows for the management of multiple independent databases in one database instance, simplifying management and reducing costs. 2) Advanced analytics and data mining tools such as Oracle Advanced Analytics and OracleDataMining help extract insights from data. 3) Real-time application cluster (RAC) provides high availability and scalability, improving system fault tolerance and performance. 4) Automated management and monitoring tools such as Oracle EnterpriseManager (OEM) to automate daily maintenance tasks and monitor numbers in real time

Oracle's Impact: Data Management and BeyondOracle's Impact: Data Management and BeyondApr 27, 2025 am 12:11 AM

Oracle has a profound impact in the fields of data management and enterprise applications. Its database is known for its reliability, scalability and security, and is widely used in industries such as finance, medical care and government. Oracle's influence has also expanded to middleware and cloud computing fields such as WebLogicServer and OracleCloudInfrastructure (OCI), providing innovative solutions. Despite the competition in the open source database and cloud computing market, Oracle maintains its leading position through continuous innovation.

Oracle: Exploring the Company's Mission and ValueOracle: Exploring the Company's Mission and ValueApr 26, 2025 am 12:06 AM

Oracle's mission is to "help people see the value of data", and its core values ​​include: 1) Customer first, 2) Integrity, 3) Innovation, and 4) Teamwork. These values ​​guide Oracle's strategic decision-making and business innovation in the market.

See all articles

Hot AI Tools

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.

Undress AI Tool

Undress AI Tool

Undress images for free

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

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.