Uninstalling from a Failed Install


Of course, no DBA is perfect, and chances are that at some point you may want to remove one of your Oracle databases and its binaries and do a fresh installation. We discuss the major points to be noted for such an operation here. For operating systemspecific instructions, please refer to the appropriate Oracle Database Installation Guide. The point to be noted for all platforms is that you should remove all related Oracle homes, Oracle files, and daemons by using DBCA or a series of steps from the command line for a fool-proof cleanup process. The following sections focus primarily on UNIX/Linux-based systems, and cover Windows-based systems at the end.

Get a Backup Before the Uninstall Process

Before you start any unistall process, make sure that you do not have any useful data in the database. If you feel that there may be any worthwhile data for you to keep, make a complete backup of the database (assuming that the database is in an operable state). If the database has very little data and you are sure of the schema owner information, do an export of that schema or schemas so that the data can be salvaged. If the database installation didn't complete successfully, then you shouldn't have second thoughts on removing it.


The major steps for any uninstall process are to identify all database instances associated with the Oracle home, remove database and ASM instances (if any), stop all the processes/daemons, and completely remove the software. You may also need to reconfigure the Oracle Cluster Synchronization Services (CSS) daemon, depending on your installation. More details on cluster services are given in Chapter 15, "Utilizing Oracle Database 10g Real Applications Clusters."

Step 1: Identify All Database Instances

To begin the uninstall process, you must mark all database instances associated with the Oracle home. The Oracle instances are noted in the oratab file, which is located in the /var/opt/oracle directory for Solaris systems and in the /etc directory for other UNIX- and Linux-based systems. Use cat or more to read the oratab file. You will see an output like the following:

 +ASM:/u01/app/oracle/product/10.1.0/ASMDB:Y Q0OR10G:/u01/app/oracle/product/10.1.0/Q0OR10G:Y 

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

Step 2: Remove the Database(s)

Log in to the database server where you want to do the database operation as oracle. Using oraenv or coraenv (under /usr/local/bin/), set your environment to point to the database you will be working on. Specify your database instance name (SID) at the prompt and you will be connected to the appropriate one. The steps in this process are as follows:

1.

Start the Database Configuration Assistant (DBCA) by typing dbca at the UNIX prompt.

2.

The Welcome screen appears. Click Next to continue to the Operations screen.

3.

Select Delete a Database, and then click Next.

4.

Select the name of the database to be deleted and click Finish.

5.

In the Confirmation screen, confirm that you want to delete the database.

After the DBCA has removed the database, you will be asked if you want to perform another operation. Click Yes to get back to the Operations screen or click No to exit from the DBCA. For removing multiple databases, click Yes and repeat the preceding steps.

File Deletion After a DROP DATABASE Command

When you issue a DROP DATABASE command, it does not remove archived log files and back up copies of the database. You should use RMAN to delete these files. If the database is on raw disks, the actual raw disk files will not be deleted by the DROP DATABASE command. If you have used DBCA to create the database, you can use it to drop the database and remove the files, as well.


Removing ASM Database(s)

If you have started experimenting with ASM installations and would like to remove an ASM database, you must remove any associated ASM instances running in the Oracle home.

Follow the steps mentioned in the preceding section until the SID selection at the oraenv/coraenv prompt. Here you specify the SID for the ASM instance to be removed. When you have chosen the correct instance, connect to it as the SYS user:

 $ sqlplus "SYS/password AS SYSDBA" 

Check to see if any Oracle database instance is using this ASM instance by using the following SQL command:

 SQL> select instance_name from v$asm_client; 

You will see a list of all database instances that are running and are associated with this ASM instance under the Oracle home. If you have a database instance using this ASM instance, but using another Oracle home, do not remove this ASM instance or the Oracle home.

If the preceding query doesn't return any rows, then there are no associated database instances and you can proceed to clean up the ASM disk groups. (You will learn more about ASM and ASM disk groups in Chapter 4.) This is accomplished by dropping the ASM disk group, which relieves the disk device for use with another ASM instance.

Identify the disk groups associated with the ASM instance by using the following SQL command:

 SQL> select name from from v$asm_diskgroup; 

For every disk group to be deleted, use the following command. Shut down the ASM instance on successful removal of disk groups.

 SQL> drop diskgroup diskgroup_name including contents; SQL> shutdown immediate; 

When the ASM instance is shut down, clean up the oratab files by deleting or commenting out the appropriate ASM instance entries.

Configuring Oracle Cluster Synchronization Services

When you install Oracle Database 10g for the first time, root.sh configures a daemon process called Oracle Cluster Synchronization Services (CSS). This CSS daemon, which starts at the time of system boot, is required for synchronization between Oracle ASM and database instances.

On cluster systems with Oracle Real Application Clusters (RAC) installations, the CSS daemon is configured during the Oracle Cluster Ready Services (CRS) installation. A discussion on Oracle CRS and RAC will be done in Chapter 15. For more details, refer to the Oracle Real Application Clusters Installation and Configuration Guide.

Before you remove an Oracle home, check to see whether the CSS daemon is running from that Oracle home and whether any other Oracle Database 10g Oracle homes exist on the system. If the Oracle home to be removed is the the only Oracle Database 10g installation on the system, you can delete the CSS daemon. If there are other Oracle databases on this system, you have to reconfigure the CSS daemon to run from another Oracle home.

In step 1, if you found only one Oracle home directory that contains Oracle Database 10g, follow the action items given here:

Remove all Oracle databases and ASM instances associated with this Oracle home.

As root, go to the Oracle home directory that you are removing and set the ORACLE_HOME environment variable:

 $ cd $ORACLE_HOME $ export ORACLE_HOME=<environment variable> 

Delete the CSS daemon configuration from this Oracle home. The last command stops the Oracle CSS daemon and deletes its configuration. When the system reboots, the CSS daemon will not start.

 $ cd $ORACLE_HOME/bin $ localconfig delete 

In step 1, if you found any other Oracle databases, reconfigure the CSS daemon as follows:

Switch to each Oracle home directory identified on the system. Stop all Oracle ASM instances and any associated Oracle databases.

Login as root. Identify the Oracle home directory being used to run the CSS daemon. This information can be found in the ocr.loc file under /etc/oracle (for Linux/AIX) or /var/opt/oracle (for all other UNIX-based systems). The ocrconfig_loc parameter in the ocr.loc file gives the location of the Oracle Cluster Registry (OCR) used by the CSS daemon. The path until the cdata directory gives the ORACLE_HOME directory hosting the CSS daemon. If this ORACLE_HOME is not the one that you want to remove, go to step 3.

If you want to reset the ORACLE_HOME, change this directory (in ocr.loc) to the ORACLE_HOME of an Oracle Database 10g installation that you are planning to keep. Then reconfigure the CSS daemon to run from this new Oracle home as follows:

 $ $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME 

This script stops the Oracle CSS daemon, reconfigures it, and restarts it from the new home. From the next system reboot, the CSS daemon will start automatically from the new ORACLE_HOME.

Step 3: Remove the Oracle Software

This section discusses how to use the Oracle Universal Installer (OUI) to remove Oracle software from an Oracle home. Many DBAs (especially on Windows platforms) attempt to delete Oracle home directories to remove the software, which leaves unwanted registry entries and creates chaos with the next installation. As a rule of thumb, it is preferable to use the Oracle Universal Installer to remove the software and then delete any unwanted Oracle home directories.

1.

Assuming that you are still logged in as oracle user, set the ORACLE_HOME environment variable to the path of the Oracle home directory to be removed.

2.

With Bourne or Korn shell, run the following:

 $ ORACLE_HOME=/u01/app/oracle/product/10.1.0/Q0OR10G $ export ORACLE_HOME 

With C shell, run the following:

 $ setenv ORACLE_HOME /u01/app/oracle/product/10.1.0/Q0OR10G 

3.

You should have already deleted any database or ASM instance associated with this ORACLE_HOME. The next step is to stop all remaining processes running on this ORACLE_HOME. The following commands are for iSQL*Plus, database console, Oracle listener, and Ultra Search options:

 $ORACLE_HOME/bin/isqlplusctl stop $ORACLE_HOME/bin/emctl stop dbconsole $ORACLE_HOME/bin/lsnrctl stop $ORACLE_HOME/bin/searchctl stop 

4.

Set the DISPLAY variable correctly on your screen and start the installer (runInstaller.sh) program with tracing on:

 $ cd $ORACLE_HOME/oui/bin $ ./.runInstaller  -D-JTRACING.ENABLED=TRUE D-JTRACING.LEVEL=2 

5.

In the Welcome screen, click Deinstall Products.

6.

The Inventory screen appears, listing all available Oracle homes on the server. Choose the Oracle home and the products to be removed, and then click Remove. If you select Oracle JVM, the OUI will remove all installed products including Oracle databases (which depend on Oracle JVM).

7.

The Confirmation screen appears, asking you to verify your choice to deinstall the products and dependant components. Click Yes.

8.

The OUI will show a progress bar while it removes the software. After all the selected products have been deleted, click Cancel to exit from the Oracle Universal Installer and then click Yes to confirm.



    Oracle Database 10g Insider Solutions
    SUSE LINUX Enterprise Server 9 Administrators Handbook
    ISBN: 672327910
    EAN: 2147483647
    Year: 2006
    Pages: 214

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net