Skip Headers
Oracle® Database Installation Guide
11g Release 1 (11.1) for Linux

Part Number B32002-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

6 Removing Oracle Software

This chapter describes how to completely remove all Oracle databases, instances, and software from an Oracle home directory. It includes information about the following topics:

See Also:

If you want to remove an Oracle RAC installation, refer to Oracle Clusterware Installation Guide for Linux and Oracle Real Application Clusters Installation Guide for Linux and UNIX for more information

If you want to remove an individual product, refer to the product-specific documentation for requirements and restrictions

6.1 Overview

To completely remove all Oracle databases, instances, and software from an Oracle home directory, you must:

6.2 Identifying All Instances

To identify all instances associated with the Oracle home that you want to remove, enter the following command:

$ more /etc/oratab

The output of this command contains entries similar to the following:

+ASM:/u01/app/oracle/product/11.1.0/db_1:N
CUST:/u01/app/oracle/product/11.1.0/db_1:N

These entries show that the +ASM Automatic Storage Manager instance and the CUST Oracle database instance are associated with the /u01/app/oracle/product/11.1.0/db_1 Oracle home directory.

6.3 Removing Oracle Configuration Manager

To uninstall Oracle Configuration Manager, follow these steps:

  1. If the $ORACLE_HOME directory contains a database, remove the Oracle Configuration Manager user and the associated objects from the database by running the following script:

    SQL> $ORACLE_HOME/ccr/admin/scripts/dropocm.sql
    
    
  2. If the database is a repository for the Oracle E-Business Suite, log in to the database as an SYSDBA user and remove the additional objects from the database by running the following script:

    $ORACLE_HOME/ccr/admin/scripts/ebs_dropccr.sql Oracle_Applications_User
    
    
  3. If the database is a repository for Oracle Grid Control, log in to the database as the SYSMAN user and remove the additional objects from the database by running the following script:

    $ORACLE_HOME/ccr/admin/scripts/dropemrep_collect.sql
    
    
  4. To stop the Scheduler and remove the service or the crontab entry, enter the following command:

    $ORACLE_HOME/ccr/bin/deployPackages -d $ORACLE_HOME/ccr/inventory/core.jar
    
    
  5. Delete the ccr directory by entering the following command:

    $ rm -rf $ORACLE_HOME/ccr
    
    

    Oracle Configuration Manager is successfully uninstalled.

6.4 Removing Oracle Application Express from the Database

This section describes how to remove the Oracle Application Express schema, synonyms, and users from the database without deleting the database. If you are going to delete the database, then you do not need to complete these steps.

After using Oracle Universal Installer to remove Oracle Application Express from its Oracle home, you can remove Oracle Application Express components from the database. Perform the following steps:

Note:

You should not follow these steps if you have upgraded your database from a prior release, and still want to use the prior release of Oracle Application Express.
  1. Use SQL*Plus to connect to the database as the privileged user SYS, for example:

    $ $ORACLE_HOME/bin/sqlplus 
    SQL> CONNECT SYS as SYSDBA
    Enter password: SYS_password
    
    
  2. Execute the following commands:

    SQL> ALTER SESSION SET CURRENT_SCHEMA = FLOWS_030000;
    SQL> EXEC wwv_flow_upgrade.drop_public_synonyms;
    SQL> ALTER SESSION SET CURRENT_SCHEMA = SYS;
    SQL> DROP USER FLOWS_030000 CASCADE;
    SQL> DROP USER flows_files CASCADE;
    SQL> DROP USER apex_public_user CASCADE;
    

6.5 Removing an Oracle Database

To completely remove Oracle Database software, you must remove any installed databases. To remove an Oracle database:

Note:

Removing an Oracle database deletes all of the data in the database. If you want to keep this data, make sure that you back up the database before deleting it.
  1. Log in as the oracle user:

    $ sudo - oracle
    
    
  2. Run the oraenv or coraenv script to set the environment for the database that you want to remove, for example:

    • Bourne, Bash, or Korn shell:

      $ . /usr/local/bin/oraenv
      
      
    • C shell:

      % source /usr/local/bin/coraenv
      
      
  3. At the prompt, specify the SID for the database that you want to remove.

  4. Start the Database Configuration Assistant:

    $ dbca
    
    

    The Welcome window appears.

  5. Click Next.

    The Operations window appears.

  6. Select Delete a Database, then click Next.

  7. Select the database that you want to delete, then click Finish.

  8. In the window that appears, confirm that you want to delete the database.

  9. When Database Configuration Assistant removes the database, you are prompted to choose whether you want to perform another operation. Click Yes to return to the Operations screen or click No to exit from Database Configuration Assistant. If you want to remove another database, click Yes and repeat steps 6 through 8.

6.6 Removing an Automatic Storage Management Instance

To completely remove Oracle database software, you must also remove any Automatic Storage Management instances running in the Oracle home. To remove an Automatic Storage Management instance:

  1. If necessary, log in as the oracle user:

    $ su - oracle
    
    
  2. Run the oraenv or coraenv script to set the environment for the Automatic Storage Management instance that you want to remove, for example:

    • Bourne, Bash, or Korn shell:

      $ . /usr/local/bin/oraenv
      
      
    • C shell:

      $ source /usr/local/bin/coraenv
      
      
  3. At the prompt, specify the SID for the Automatic Storage Management instance that you want to remove.

  4. Connect to the Automatic Storage Management instance as the SYS user:

    $ $ORACLE_HOME/bin/sqlplus 
    SQL> CONNECT SYS as SYSDBA
    Enter password: SYS_password
    
    
  5. Enter the following command to determine whether any Oracle database instance is using the Automatic Storage Management instance:

    SQL> SELECT INSTANCE_NAME FROM V$ASM_CLIENT;
    
    

    This command lists all of the database instances that are using this Automatic Storage Management instance.

    Note:

    This command only lists database instances that are running. It is possible that other instances are associated with the Automatic Storage Management instance, but they are not currently running.

    If you removed a database from this Oracle home but the output from the command shows that this Automatic Storage Management instance is supporting a database instance in another Oracle home, do not remove the Automatic Storage Management instance or the Oracle home.

  6. If there are no database instances associated with this Automatic Storage Management instance, drop the disk groups associated with this instance as follows:

    Note:

    Dropping the Automatic Storage Management disk group makes the disk device available for use with another Automatic Storage Management instance if required. However, all data in the disk group is lost. Make sure that no other database instance requires any data from this disk group before you drop it.
    1. Identify the disk groups associated with the Automatic Storage Management instance:

      SQL> SELECT NAME FROM V$ASM_DISKGROUP;
      
      
    2. For each disk group that you want to delete, enter a command similar to the following:

      SQL> DROP DISKGROUP name INCLUDING CONTENTS;
      
      
  7. Enter the following command to shut down the Automatic Storage Management instance:

    SQL> SHUTDOWN
    
    
  8. Remove the entry for the Automatic Storage Management instance from the /etc/oratab file.

6.7 Reconfiguring Oracle Cluster Synchronization Services

Oracle Cluster Synchronization Services (CSS) is a daemon process that is configured by the root.sh script when you configure an Automatic Storage Management instance. It is configured to start every time the system boots. This daemon process is required to enable synchronization between Oracle Automatic Storage Management and database instances. It must be running if an Oracle database is using Automatic Storage Management for database file storage.

Note:

On cluster systems with Oracle RAC installations, the CSS daemon is configured during the Oracle Clusterware installation. If the system is running Oracle Clusterware, refer to Oracle Real Application Clusters Installation Guide for Linux and UNIX for information about removing Oracle RAC or Oracle Clusterware.

Before you remove an Oracle Database 11g Oracle home, you must determine whether the CSS daemon is running from that Oracle home and whether any other Oracle Database 11g Oracle homes exist on the system:

The following sections describe how to complete these tasks:

6.7.1 Identifying Oracle Database 11g Oracle Homes

To identify all of the Oracle Database 11g Oracle home directories, enter the following command:

$ more /etc/oratab

From the output, identify any Oracle home directories where Oracle Database 11g is installed. Oracle homes that contain Oracle Database 11g typically have paths similar to the following. However, they might use different paths.

/mount_point/app/oracle/product/11.1.0/db_n

If there is only one Oracle home directory that contains Oracle Database 11g, refer to the "Deleting the Oracle CSS Daemon Configuration" section for information about deleting the Oracle CSS daemon configuration.

If you identify more than one Oracle Database 11g Oracle home directory, refer to the following section for information about reconfiguring the Oracle CSS daemon.

6.7.2 Reconfiguring the Oracle CSS Daemon

To reconfigure the Oracle CSS daemon so that it runs from an Oracle home that you are not removing, follow these steps:

  1. In all Oracle home directories on the system, stop all Oracle Automatic Storage Management instances and any Oracle Database instances that use Automatic Storage Management for database file storage.

  2. Switch user to root.

  3. Enter the following command to identify the Oracle home directory being used to run the CSS daemon:

    # more /etc/oracle/ocr.loc
    
    

    The output from this command is similar to the following:

    ocrconfig_loc=/u01/app/oracle/product/11.1.0/db_1/cdata/ \
    localhost/local.ocr
    local_only=TRUE
    
    

    The ocrconfig_loc parameter specifies the location of the Oracle Cluster Registry (OCR) used by the CSS daemon. The path up to the cdata directory is the Oracle home directory where the CSS daemon is running (/u01/app/oracle/product/11.1.0/db_1 in this example).

    Note:

    If the value of the local_only parameter is FALSE, Oracle Clusterware is installed on this system.

    See Also:

    Oracle Real Application Clusters Installation Guide for Linux and UNIX for information about removing Oracle Real Applications Clusters or Oracle Clusterware

    If this Oracle home directory is not the Oracle home that you want to remove, go to the "Removing Oracle Software" section.

  4. Change directory to the Oracle home directory for an Oracle Database 11g installation that you are not removing.

  5. Set the ORACLE_HOME environment variable to specify the path to this Oracle home directory:

    • Bourne, Bash, or Korn shell:

      # ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_2;
      # export ORACLE_HOME
      
      
    • C shell:

      # setenv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_2
      
      
  6. Enter the following command to reconfigure the CSS daemon to run from this Oracle home:

    # $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
    
    

    This command stops the Oracle CSS daemon, reconfigures it in the new Oracle home, and then restarts it. When the system boots, the CSS daemon starts automatically from the new Oracle home.

  7. To remove the original Oracle home directory, refer to "Removing Oracle Software" section.

6.7.3 Deleting the Oracle CSS Daemon Configuration

To delete the Oracle CSS daemon configuration, follow these steps:

Note:

Delete the CSS daemon configuration only if you are certain that no other Oracle Database 11g installation requires it.
  1. Remove any databases or Automatic Storage Management instances associated with this Oracle home. Refer to the preceding sections for information about how to complete these tasks.

  2. Switch user to root.

  3. Change directory to the Oracle home directory that you are removing.

  4. Set the ORACLE_HOME environment variable to specify the path to this Oracle home directory:

    • Bourne, Bash, or Korn shell:

      # ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
      # export ORACLE_HOME
      
      
    • C shell:

      # setenv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1
      
      
  5. Enter the following command to delete the CSS daemon configuration from this Oracle home:

    # $ORACLE_HOME/bin/localconfig delete
    
    

    The script stops the Oracle CSS daemon, then deletes its configuration. When the system boots, the CSS daemon no longer starts.

6.8 Removing Oracle Software

The following steps describe how to use Oracle Universal Installer to remove Oracle software from an Oracle home:

Note:

Always use Oracle Universal Installer to remove Oracle software. Do not delete any Oracle home directories without first using Oracle Universal Installer to remove the software.
  1. If necessary, log in as the oracle user:

    $ sudo - oracle
    
    
  2. Set the ORACLE_HOME environment variable to specify the path of the Oracle home directory that you want to remove:

    • Bourne, Bash, or Korn shell:

      $ ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 
      $ export ORACLE_HOME
      
      
    • C shell:

      $ setenv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1
      
      
  3. Remove any databases or Automatic Storage Management instances associated with this Oracle home and delete or reconfigure the Oracle CSS daemon.

    Refer to the preceding sections for information about how to complete these tasks.

  4. Stop any processes running in this Oracle home:

    Process Name Command
    Database Control $ORACLE_HOME/bin/emctl stop dbconsole
    Oracle Net listener $ORACLE_HOME/bin/lsnrctl stop

  5. Start Oracle Universal Installer as follows:

    $ $ORACLE_HOME/oui/bin/runInstaller
    
    
  6. In the Welcome window, click Deinstall Products.

    The Inventory screen appears, listing all of the Oracle homes on the system.

  7. In the Inventory screen, select the Oracle home and the products that you want to remove, then click Remove.

    Note:

    If you choose to remove Oracle JVM, Oracle Universal Installer removes all installed products that depend on Oracle JVM, including Oracle Database 11g.

    Oracle Universal Installer displays a confirmation window asking you to confirm that you want to deinstall the products and their dependent components.

  8. Click Yes.

    Oracle Universal Installer displays a progress indicator as it removes the software.

  9. Click Close on the Inventory screen.

  10. When the products have been deleted, click Cancel to exit from Oracle Universal Installer, and then click Yes.