Oracle DBA Tips and Techniques

By Arjun Raja

Archive for November, 2011

DEINSTALL 11G GRID CONTROL AGENT HOME

Posted by Arjun Raja on November 28, 2011

oasd:/u01/oracle/agent11g/oui/bin> export ORACLE_HOME=/u01/oracle/agent11g

oasd:/u01/oracle/agent11g/oui/bin> ./runInstaller -deinstall -silent “REMOVE_HOMES={/u01/oracle/agent11g}” -removeallfiles
Starting Oracle Universal Installer…

Checking swap space: must be greater than 500 MB. Actual 8192 MB Passed
Preparing to launch Oracle Universal Installer
from /tmp/OraInstall2011-11-28_11-09-42AM. Please
wait …oasd:/u01/oracle/agent11g/oui/bin> Oracle Universal Installer, Version 11.1.0.8.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.

Starting deinstall

Deinstall in progress (Monday, November 28, 2011 11:09:53 AM WST) Configuration assistant “Agent Deinstall Assistant” succeeded Configuration assistant “Oracle Configuration Manager Deinstall” succeeded ……………………………………………………… 100% Done.

Deinstall successful

End of install phases.(Monday, November 28, 2011 11:10:47 AM WST) End of deinstallations
Please check
‘/u01/oracle/oraInventory/logs/silentInstall2011-11-28_11-09-42AM.log’ for more details.

ControlC to quit.

oasd:/u01/oracle> cd agent11g
ksh: agent11g: not found
oasd:/u01/oracle>

So the deinstall with parameter -removeallfiles also gets rid of the agent11g directory.

Posted in Uncategorized | Leave a Comment »

DEINSTALL 11.2.0.2 GRID INFRA

Posted by Arjun Raja on November 15, 2011

Export ORACLE_HOME=’/u01/oracle/product/11.2.0.2.grid

+ASM:/u01/oracle/product/11.2.0.2.grid/bin> ./crsctl stop has

+ASM:/u01/oracle/product/11.2.0.2.grid/deinstall> ./deinstall Checking for required files and bootstrapping …
Please wait …
Location of logs /u01/oracle/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############

######################### CHECK OPERATION START ######################### Install check configuration START

Checking for existence of the Oracle home
location /u01/oracle/product/11.2.0.2.grid
Oracle Home type selected for de-install is: SIHA
Oracle Base selected for de-install is: /u01/oracle
Checking for existence of central inventory
location /u01/oracle/oraInventory
Checking for existence of the Oracle Grid Infrastructure
home /u01/oracle/product/11.2.0.2.grid

Install check configuration END

Skipping Windows and .NET products configuration check

Checking Windows and .NET products configuration END

Traces log file: /u01/oracle/oraInventory/logs//crsdc.log

Network Configuration check config START

Network de-configuration trace file
location: /u01/oracle/oraInventory/logs/netdc_check2011-11-15_01-29-06-PM.log

Specify all Oracle Restart enabled listeners that are to be de-configured [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file
location: /u01/oracle/oraInventory/logs/asmcadc_check2011-11-15_01-29-23-PM.log

Specify the ASM Diagnostic Destination [ ]: /u01/oracle

Specify the diskstring []: +DATA
Specify the diskgroups that are managed by this ASM instance []: +DATA

De-configuring ASM will drop the diskgroups at cleanup time. Do you want deconfig tool to drop the diskgroups y|n [y]:
######################### CHECK OPERATION END #########################

####################### CHECK OPERATION SUMMARY ####################### Oracle Grid Infrastructure Home is: /u01/oracle/product/11.2.0.2.grid The cluster node(s) on which the Oracle home de-installation will be performed are:null
Oracle Home selected for de-install is: /u01/oracle/product/11.2.0.2.grid Inventory Location where the Oracle home registered
is: /u01/oracle/oraInventory
Skipping Windows and .NET products configuration check
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y – yes, n – no)? [n]: y
A log of this session will be written to:
‘/u01/oracle/oraInventory/logs/deinstall_deconfig2011-11-15_01-29-02-PM.out’ Any error messages from this session will be written to:
‘/u01/oracle/oraInventory/logs/deinstall_deconfig2011-11-15_01-29-02-PM.err’

######################## CLEAN OPERATION START ######################## ASM de-configuration trace file
location: /u01/oracle/oraInventory/logs/asmcadc_clean2011-11-15_01-31-10-PM.log ASM Clean Configuration START
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file
location: /u01/oracle/oraInventory/logs/netdc_clean2011-11-15_01-31-16-PM.log

De-configuring Oracle Restart enabled listener(s): LISTENER

De-configuring listener: LISTENER
Stopping listener: LISTENER
Warning: Failed to stop listener. Listener may not be running. Deleting listener: LISTENER
Listener deleted successfully.
Listener de-configured successfully.

De-configuring backup files…
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END
Asm Check Configuration START

ASM de-configuration trace file location: /u01/oracle/oraInventory/logs/asmcadc_check2011-11-15_01-29-23-PM.log

Specify the ASM Diagnostic Destination [ ]: /u01/oracle

Specify the diskstring []: +DATA
Specify the diskgroups that are managed by this ASM instance []: +DATA

De-configuring ASM will drop the diskgroups at cleanup time. Do you want deconfig tool to drop the diskgroups y|n [y]:
######################### CHECK OPERATION END #########################

####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/oracle/product/11.2.0.2.grid
The cluster node(s) on which the Oracle home de-installation will be performed are:null
Oracle Home selected for de-install is: /u01/oracle/product/11.2.0.2.grid
Inventory Location where the Oracle home registered is: /u01/oracle/oraInventory
Skipping Windows and .NET products configuration check
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y – yes, n – no)? [n]: y
A log of this session will be written to: ‘/u01/oracle/oraInventory/logs/deinstall_deconfig2011-11-15_01-29-02-PM.out’
Any error messages from this session will be written to: ‘/u01/oracle/oraInventory/logs/deinstall_deconfig2011-11-15_01-29-02-PM.err’

######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /u01/oracle/oraInventory/logs/asmcadc_clean2011-11-15_01-31-10-PM.log
ASM Clean Configuration START
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /u01/oracle/oraInventory/logs/netdc_clean2011-11-15_01-31-16-PM.log

De-configuring Oracle Restart enabled listener(s): LISTENER

De-configuring listener: LISTENER
Stopping listener: LISTENER
Warning: Failed to stop listener. Listener may not be running.
Deleting listener: LISTENER
Listener deleted successfully.
Listener de-configured successfully.

De-configuring backup files…
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

—————————————->

Run the following command as the root user or the administrator on node “xxxxxxxu056”.

/tmp/deinstall2011-11-15_01-28-33PM/perl/bin/perl -I/tmp/deinstall2011-11-15_01-28-33PM/perl/lib -I/tmp/deinstall2011-11-15_01-28-33PM/crs/install /tmp/deinstall2011-11-15_01-28-33PM/crs/install/roothas.pl -force -deconfig -paramfile /tmp/deinstall2011-11-15_01-28-33PM/response/deinstall_Ora11g_gridinfrahome2.rsp

xxxxu056 # /tmp/deinstall2011-11-15_01-28-33PM/perl/bin/perl -I/tmp/deinstall2011-11-15_01-28-33PM/perl/lib -I/tmp/deinstall2011-11-15_01-28-33PM/crs/install /tmp/deinstall2011-11-15_01-28-33PM/crs/install/roothas.pl -force \
-deconfig -paramfile /tmp/deinstall2011-11-15_01-28-33PM/response/deinstall_Ora11g_gridinfrahome2.rsp

Using configuration parameter file: /tmp/deinstall2011-11-15_01-28-33PM/response/deinstall_Ora11g_gridinfrahom
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
ACFS-9200: Supported
This may take several minutes. Please wait …
0518-307 odmdelete: 1 objects deleted.
0518-307 odmdelete: 1 objects deleted.
0518-307 odmdelete: 1 objects deleted.
Successfully deconfigured Oracle Restart stack

Press Enter after you finish running the above commands

Press Enter after you finish running the above commands

<—————————————-

Removing Windows and .NET products configuration END
Oracle Universal Installer clean START

Detach Oracle home '/u01/oracle/product/11.2.0.2.grid' from the central inventory on the local node : Done

Failed to delete the directory '/u01/oracle/product/11.2.0.2.grid/deinstall'. The directory is in use.
Failed to delete the directory '/u01/oracle/product/11.2.0.2.grid'. The directory is not empty.
Delete directory '/u01/oracle/product/11.2.0.2.grid' on the local node : Failed <<<

While trying to re-install – the ASM disks were still considered members….

So the foll command must be run before they are considered candidates again –

To get around this problem, it is necessary to overwrite the ASM header information on the disk. This can be achieved with the UNIX command dd.

The following command will write 100x1024b blocks to the specified raw device:

oasd:/dev> dd if=/dev/zero of=/dev/asm_disk1 bs=1024 count=100
100+0 records in
100+0 records out
oasd:/dev> dd if=/dev/zero of=/dev/asm_disk2 bs=1024 count=100
100+0 records in
100+0 records out
oasd:/dev> dd if=/dev/zero of=/dev/asm_disk3 bs=1024 count=100
100+0 records in
100+0 records out
oasd:/dev>

Now all 3 disks show up as candidates on relaunch of installer .

Posted in Uncategorized | Leave a Comment »

MATERIALIZED VIEWS REFRESH – FORCE TRUNCATE AND INSERT .

Posted by Arjun Raja on November 3, 2011

I faced this issue when we upgraded 9i to 10g – you may face the same issue if you upgrade from 9i to 11g as well.

This is the story :

After migrating from 9i to 10g or 11g, take care in case you have materialized views and are doing a complete refresh.

The following command to refresh an MVIEW resulted in the database undo tablespace filling up and the appearance of the dreaded snapshot too old error.

execute DBMS_MVIEW.REFRESH(‘OBJECT_OWNER.TEST_MVIEW,’C’);

That is because in 10g the behaviour of Oracle in case the
atomic_refresh=false parameter is not included is to delete the data first before inserting or refreshing the view.

To avoid this, issue the following command

execute DBMS_MVIEW.REFRESH
(‘OBJECT_OWNER.TEST_MVIEW’,’C’,ATOMIC_REFRESH=>false);

This guarantees that Oracle will first TRUNCATE the MIVEW and then refresh it thereby excluding the need of the use of the UNDO tablespace.

Posted in Uncategorized | Leave a Comment »