Monday, January 30, 2012

Upgrade an Oracle database from 10.2.0.1.0 to 11.2.0.1.0 using DBUA

While trying to upgrade the database from 10.2.0.1.0 to 11.2.0.1.0 using DBUA I got the following message:
Could not get database version from the Oracle Server component. The CEP file rdbmsup.sql does not provide the version directive.

Reason:
To upgrade from 10.2.0.1.0 to 11.2.0.1.0 , we need to first upgrade from 10.2.0.1.0 to 10.2.0.4 using Oracle Patchset 10.2.0.4 (6810189).

Here is a link to an excellent blogs that gives all the details on installing the Patchset.

Once I upgraded to Oracle 10.2.0.4, I could upgrade to 11.2.0.1.0 using DBUA.

Also, this blog gives all the details on using DBUA for the upgrade.

Wednesday, January 25, 2012

SP2-1503: Unable to initialize Oracle call interface SP2-0152: ORACLE may not be functioning properly

For a new project I have both a 10g and a 11g database running on the same host.

Both the databases instances were up and running fine, the processes can be seen below

-bash-3.2$ ps -ef | grep test
oracle   13727     1  0 Jan20 ?        00:00:00 ora_pmon_testteng
oracle   13729     1  0 Jan20 ?        00:00:00 ora_psp0_testteng
oracle   13731     1  0 Jan20 ?        00:00:01 ora_mman_testteng
oracle   13733     1  0 Jan20 ?        00:00:00 ora_dbw0_testteng
oracle   13735     1  0 Jan20 ?        00:00:00 ora_dbw1_testteng
oracle   13737     1  0 Jan20 ?        00:00:00 ora_dbw2_testteng
oracle   13739     1  0 Jan20 ?        00:00:00 ora_lgwr_testteng
oracle   13741     1  0 Jan20 ?        00:00:13 ora_ckpt_testteng
oracle   13743     1  0 Jan20 ?        00:00:05 ora_smon_testteng
oracle   13745     1  0 Jan20 ?        00:00:00 ora_reco_testteng
oracle   13747     1  0 Jan20 ?        00:00:03 ora_cjq0_testteng
oracle   13749     1  0 Jan20 ?        00:00:01 ora_mmon_testteng
oracle   13751     1  0 Jan20 ?        00:00:04 ora_mmnl_testteng
oracle   13753     1  0 Jan20 ?        00:00:00 ora_d000_testteng
oracle   13755     1  0 Jan20 ?        00:00:00 ora_s000_testteng
oracle   13761     1  0 Jan20 ?        00:00:00 ora_qmnc_testteng
oracle   13979     1  0 Jan20 ?        00:00:00 ora_q000_testteng
oracle   14007     1  0 Jan20 ?        00:00:03 ora_q001_testteng

oracle   29643     1  0 22:54 ?        00:00:00 ora_pmon_testdb1
oracle   29645     1  0 22:54 ?        00:00:00 ora_vktm_testdb1
oracle   29649     1  0 22:54 ?        00:00:00 ora_gen0_testdb1
oracle   29651     1  0 22:54 ?        00:00:00 ora_diag_testdb1
oracle   29653     1  0 22:54 ?        00:00:00 ora_dbrm_testdb1
oracle   29655     1  0 22:54 ?        00:00:00 ora_psp0_testdb1
oracle   29657     1  0 22:54 ?        00:00:00 ora_dia0_testdb1
oracle   29659     1  0 22:54 ?        00:00:01 ora_mman_testdb1
oracle   29661     1  0 22:54 ?        00:00:00 ora_dbw0_testdb1
oracle   29663     1  0 22:54 ?        00:00:00 ora_dbw1_testdb1
oracle   29665     1  0 22:54 ?        00:00:00 ora_dbw2_testdb1
oracle   29667     1  0 22:54 ?        00:00:00 ora_lgwr_testdb1
oracle   29669     1  0 22:54 ?        00:00:00 ora_ckpt_testdb1
oracle   29671     1  0 22:54 ?        00:00:00 ora_smon_testdb1
oracle   29673     1  0 22:54 ?        00:00:00 ora_reco_testdb1
oracle   29675     1  0 22:54 ?        00:00:00 ora_mmon_testdb1
oracle   29677     1  0 22:54 ?        00:00:00 ora_mmnl_testdb1
oracle   29679     1  0 22:54 ?        00:00:00 ora_d000_testdb1
oracle   29681     1  0 22:54 ?        00:00:00 ora_s000_testdb1
oracle   29704     1  0 22:54 ?        00:00:00 ora_qmnc_testdb1
oracle   29718     1  0 22:54 ?        00:00:00 ora_cjq0_testdb1
oracle   29729     1  0 22:54 ?        00:00:00 ora_q000_testdb1
oracle   29731     1  0 22:54 ?        00:00:00 ora_q001_testdb1
oracle   30227     1  0 23:04 ?        00:00:00 ora_smco_testdb1
oracle   30229     1  0 23:04 ?        00:00:00 ora_w000_testdb1
oracle   31137 27895  0 23:22 pts/3    00:00:00 grep test
-bash-3.2$

Here I execute the .profile for the 10g instance where I set the ORACLE_HOME, ORACLE_SID and PATH. I then tried to connect using
sqlplus. As seen below everything worked fine, and I was able to connect.


-bash-3.2$ . ./.bash_profile_ten
-bash-3.2$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID
testteng
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 24 23:20:02 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL>

Next I executed the .profile for the 11g instance where I set the ORACLE_HOME, ORACLE_SID and PATH. I then tried to connect using
sqlplus. As seen below I got the SP2-1503 and the SP2-0152 error messages


-bash-3.2$ . ./.bash_profile
-bash-3.2$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID
testdb1
-bash-3.2$ sqlplus / as sysdba
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly



Reason for the error message:
Find out what sqlplus you are using.
-bash-3.2$ which sqlplus
/u01/app/oracle/product/10.2.0/dbhome_1/bin/sqlplus
-bash-3.2$
-bash-3.2$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/u01/app/oracle/product/10.2.0/dbhome_1/bin:/u01/app/oracle/product/11.2.0/dbhome_1/bin

The above showed that the sqlplus I was using was from the 10g. This was because the PATH to the 10g bin was ahead of 11g bin in the PATH variable.

Fix:
Edit to .profile for the 11g and remove the 10g path from the PATH variable.
After the edit the PATH variable should look like below

-bash-3.2$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin::/u01/app/oracle/product/11.2.0/dbhome_1/bin
-bash-3.2$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID
testdb1
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 24 23:57:17 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

Tuesday, January 24, 2012

Adding a node to an existing Ganglia setup

This is a followup to the earlier posting where I installed and configured Ganglia to monitor 2 nodes. In this posting I try and add another node(isvpx3) to that setup.

[root@isvx3 ~]# rpm -qa | grep ganglia
[root@isvx3 ~]# rpm -qa | grep php
[root@isvx3 ~]#


[root@isvx3 rhn]# yum install ganglia
Loaded plugins: rhnplugin, security
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 157, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 254, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhnplugin.py", line 121, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 219, in getLoginInfo
    login()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 186, in login
    li = server.up2date.login(systemId)
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 64, in __call__
    raise up2dateErrors.SSLCertificateVerifyFailedError()
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.
[root@isvx3 rhn]#

Changed https to http in the /etc/sysconfig/rhn/up2date file:

serverURL[comment]=Remote server URL
serverURL=https://rtp.rhn.linux.ibm.com/XMLRPC
to
serverURL[comment]=Remote server URL
serverURL=http://rtp.rhn.linux.ibm.com/XMLRPC

That helped get rid of the "The SSL certificate failed verification." error, but yum install ganglia still did not go through as shown below.


[root@isvx3 ~]# yum install ganglia
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

Setting up Install Process
No package ganglia available.
Nothing to do
[root@isvx3 ~]#

As the above failed, I  went onto to install the Extra Packages for Enterprise Linux (EPEL)  rpm as follows

[root@isvx3 ganglia]# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
--2012-01-24 14:16:58--  http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Resolving download.fedoraproject.org... 66.35.62.166, 209.132.181.16, 140.211.169.197, ...
Connecting to download.fedoraproject.org|66.35.62.166|:80... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: http://mirrors.rit.edu/epel/5/i386/epel-release-5-4.noarch.rpm [following]
--2012-01-24 14:16:58--  http://mirrors.rit.edu/epel/5/i386/epel-release-5-4.noarch.rpm
Resolving mirrors.rit.edu... 129.21.171.98
Connecting to mirrors.rit.edu|129.21.171.98|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12232 (12K) [application/x-rpm]
Saving to: `epel-release-5-4.noarch.rpm'

100%[======================================>] 12,232      62.2K/s   in 0.2s

2012-01-24 14:16:59 (62.2 KB/s) - `epel-release-5-4.noarch.rpm' saved [12232/12232]

[root@isvx3 ganglia]#
[root@isvx3 ganglia]# rpm -i epel-release-5-4.noarch.rpm
warning: epel-release-5-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
[root@isvx3 ganglia]#

Was able to install ganglia using yum install after that:

[root@isvx3 ganglia]# yum install ganglia
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

epel                                                     | 3.7 kB     00:00
epel/primary_db                                          | 3.7 MB     00:12
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ganglia.i386 0:3.0.7-1.el5 set to be updated
---> Package ganglia.x86_64 0:3.0.7-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch             Version                Repository      Size
================================================================================
Installing:
 ganglia           i386             3.0.7-1.el5            epel            91 k
 ganglia           x86_64           3.0.7-1.el5            epel            91 k

Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 182 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): ganglia-3.0.7-1.el5.i386.rpm                      |  91 kB     00:00
(2/2): ganglia-3.0.7-1.el5.x86_64.rpm                    |  91 kB     00:00
--------------------------------------------------------------------------------
Total                                           155 kB/s | 182 kB     00:01
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
epel/gpgkey                                              | 1.7 kB     00:00
Importing GPG key 0x217521F6 "Fedora EPEL <epel@fedoraproject.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : ganglia                                                  1/2
  Installing     : ganglia                                                  2/2

Installed:
  ganglia.i386 0:3.0.7-1.el5            ganglia.x86_64 0:3.0.7-1.el5

Complete!
[root@isvx3 ganglia]#

Next I install ganglia-gmond using yum.

[root@isvx3 ganglia]# yum install ganglia-gmond
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ganglia-gmond.x86_64 0:3.0.7-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch           Version                Repository    Size
================================================================================
Installing:
 ganglia-gmond         x86_64         3.0.7-1.el5            epel         220 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 220 k
Is this ok [y/N]: y
Downloading Packages:
ganglia-gmond-3.0.7-1.el5.x86_64.rpm                     | 220 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : ganglia-gmond                                            1/1

Installed:
  ganglia-gmond.x86_64 0:3.0.7-1.el5

Complete!
[root@isvx3 ganglia]#

Edit the /etc/gmond.conf file as follows:

cluster {
  name = "unspecified"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}

to

cluster {
  name = "my servers"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}


also, change the following in the /etc/gmond.conf

udp_send_channel {
  mcast_join = 239.2.11.71
  port = 8649
  ttl = 1
}

to

udp_send_channel {
  host = isvx7.storage.tucson.ibm.com
  port = 8649
}

also, change the following in the /etc/gmond.conf

/* You can specify as many udp_recv_channels as you like as well. */
udp_recv_channel {
  mcast_join = 239.2.11.71
  port = 8649
  bind = 239.2.11.71
}

/* You can specify as many tcp_accept_channels as you like to share
   an xml description of the state of the cluster */
tcp_accept_channel {
  port = 8649
}


to

/* udp_recv_channel {
}
tcp_accept_channel {
} */

Start the gmond daemon

[root@isvx3 ganglia]# service gmond start
Starting GANGLIA gmond:                                    [  OK  ]

You can see the Hosts up count has increased by 1. Also you can see the name of the newly added host in the drop down menu for "my servers"

Install and Configure Ganglia on Red Hat 4.1.2-50

I wanted to install and play around with ganglia on my RedHat 4.1.2-50 Linux box. I found the a really good HOW TO:
http://acidborg.wordpress.com/2010/10/08/how-to-install-and-configure-ganglia-on-red-hat-enterprise-linux-5/

When I tried to do "yum install ganglia" I got the below message.

[root@isvx7 ganglia]# yum install ganglia
Loaded plugins: rhnplugin, security
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 157, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 254, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhnplugin.py", line 121, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 219, in getLoginInfo
    login()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 186, in login
    li = server.up2date.login(systemId)
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 64, in __call__
    raise up2dateErrors.SSLCertificateVerifyFailedError()
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.
[root@isvx7 ganglia]#

As the above failed, I  went onto to install the Extra Packages for Enterprise Linux (EPEL)  rpm as follows


[root@isvx4 ganglia]# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
--2012-01-23 18:22:37--  http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Resolving download.fedoraproject.org... 66.35.62.166, 152.19.134.146, 209.132.181.16, ...
Connecting to download.fedoraproject.org|66.35.62.166|:80... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: http://mirror.steadfast.net/epel/5/i386/epel-release-5-4.noarch.rpm [following]
--2012-01-23 18:22:38--  http://mirror.steadfast.net/epel/5/i386/epel-release-5-4.noarch.rpm
Resolving mirror.steadfast.net... 208.100.4.53, 2607:f128:1:3::2
Connecting to mirror.steadfast.net|208.100.4.53|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12232 (12K) [application/x-redhat-package-manager]
Saving to: `epel-release-5-4.noarch.rpm'

100%[======================================>] 12,232      --.-K/s   in 0.1s

2012-01-23 18:22:38 (80.9 KB/s) - `epel-release-5-4.noarch.rpm' saved [12232/12232]

[root@isvx4 ganglia]# ls
epel-release-5-4.noarch.rpm
[root@isvx4 ganglia]# rpm -i epel-release-5-4.noarch.rpm
warning: epel-release-5-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
[root@isvx4 ganglia]#

Some blogs say to check the data and time of the host doing a "yum install", and that it could cause the error message "up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification."

In my case the date and time were fine, and that was not the cause of the problem.

I found a workaround to the issue which says, to edit /etc/sysconfig/rhn/up2date and change serverURL=http://... instead of https.

It fixed the "up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification." issue, and I was able to install ganglia using "yum install".


[root@isvx7 ganglia]# yum install ganglia
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ganglia.i386 0:3.0.7-1.el5 set to be updated
---> Package ganglia.x86_64 0:3.0.7-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch             Version                Repository      Size
================================================================================
Installing:
 ganglia           i386             3.0.7-1.el5            epel            91 k
 ganglia           x86_64           3.0.7-1.el5            epel            91 k

Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 182 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): ganglia-3.0.7-1.el5.i386.rpm                      |  91 kB     00:00
(2/2): ganglia-3.0.7-1.el5.x86_64.rpm                    |  91 kB     00:00
--------------------------------------------------------------------------------
Total                                            38 kB/s | 182 kB     00:04
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
epel/gpgkey                                              | 1.7 kB     00:00
Importing GPG key 0x217521F6 "Fedora EPEL <epel@fedoraproject.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : ganglia                                                  1/2
  Installing     : ganglia                                                  2/2

Installed:
  ganglia.i386 0:3.0.7-1.el5            ganglia.x86_64 0:3.0.7-1.el5

Complete!



In addition to that, on the node I wanted to monitor I also installed ganglia-gmond

[root@isvx7 ganglia]# yum install ganglia-gmond
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ganglia-gmond.x86_64 0:3.0.7-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch           Version                Repository    Size
================================================================================
Installing:
 ganglia-gmond         x86_64         3.0.7-1.el5            epel         220 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 220 k
Is this ok [y/N]: y
Downloading Packages:
ganglia-gmond-3.0.7-1.el5.x86_64.rpm                     | 220 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : ganglia-gmond                                            1/1

Installed:
  ganglia-gmond.x86_64 0:3.0.7-1.el5

Complete!
[root@isvx4 ganglia]#

Use the Gabglia Status Tool(gstat) and tried to see if the thing were working fine.

[root@isvx7 lib]# gstat -a
CLUSTER INFORMATION
       Name: my servers
      Hosts: 2
Gexec Hosts: 0
 Dead Hosts: 0
  Localtime: Mon Jan 23 20:23:05 2012

CLUSTER HOSTS
Hostname                     LOAD                       CPU              Gexec
 CPUs (Procs/Total) [     1,     5, 15min] [  User,  Nice, System, Idle, Wio]

isvx4.storage.tucson.ibm.com
   24 (    0/  873) [  0.07,  0.03,  0.01] [   0.0,   0.0,   0.1,  99.9,   0.0] OFF
isvx7.storage.tucson.ibm.com
   24 (    0/ 1068) [  2.07,  2.11,  2.27] [   0.0,   0.0,   0.1,  95.1,   4.8] OFF
[root@isvx7 lib]#

http://isvx7.storage.tucson.ibm.com/ganglia still didn't work for me as it did need some more work.

I then downloaded the ganglia-web-3.0.7-1.el5 RPM for i386 rpm
from http://rpmfind.net/linux/RPM/epel/5/i386/ganglia-web-3.0.7-1.el5.i386.html

I also installed php as I did not have php on my Liux host

[root@isvx7 php]# rpm -qa php
[root@isvx7 php]#


[root@isvx7 ganglia]# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
--2012-01-23 23:11:12--  http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
Resolving rpms.famillecollet.com... 88.191.74.232, 2a01:e0b:1:74:2e0:f4ff:fe1b:b827
Connecting to rpms.famillecollet.com|88.191.74.232|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4974 (4.9K) [application/x-rpm]
Saving to: `remi-release-5.rpm'

100%[======================================================================================>] 4,974       26.9K/s   in 0.2s

2012-01-23 23:11:13 (26.9 KB/s) - `remi-release-5.rpm' saved [4974/4974]


[root@isvx7 ganglia]# yum --enablerepo=remi install php
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.9-1.el5.remi set to be updated
--> Processing Dependency: php-cli = 5.3.9-1.el5.remi for package: php
--> Processing Dependency: php-common = 5.3.9-1.el5.remi for package: php
--> Processing Dependency: libedit.so.0()(64bit) for package: php
--> Running transaction check
---> Package libedit.x86_64 0:2.11-2.20080712cvs.el5 set to be updated
---> Package php-cli.x86_64 0:5.3.9-1.el5.remi set to be updated
---> Package php-common.x86_64 0:5.3.9-1.el5.remi set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================
 Package                      Arch                     Version                                     Repository              Size
================================================================================================================================
Installing:
 php                          x86_64                   5.3.9-1.el5.remi                            remi                   2.8 M
Installing for dependencies:
 libedit                      x86_64                   2.11-2.20080712cvs.el5                      epel                    80 k
 php-cli                      x86_64                   5.3.9-1.el5.remi                            remi                   2.6 M
 php-common                   x86_64                   5.3.9-1.el5.remi                            remi                   997 k

Transaction Summary
================================================================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 6.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): libedit-2.11-2.20080712cvs.el5.x86_64.rpm                                                         |  80 kB     00:00
(2/4): php-common-5.3.9-1.el5.remi.x86_64.rpm                                                            | 997 kB     00:01
(3/4): php-cli-5.3.9-1.el5.remi.x86_64.rpm                                                               | 2.6 MB     00:03
(4/4): php-5.3.9-1.el5.remi.x86_64.rpm                                                                   | 2.8 MB     00:03
--------------------------------------------------------------------------------------------------------------------------------
Total                                                                                           582 kB/s | 6.4 MB     00:11
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 00f97f56
remi/gpgkey                                                                                              | 1.3 kB     00:00
Importing GPG key 0x00F97F56 "Remi Collet <RPMS@FamilleCollet.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction

WARNING : These php-* RPM are not official Fedora/Redhat build and
overrides the official ones. Don't file bugs on Fedora Project nor Redhat.

Use dedicated forums http://forums.famillecollet.com/

  Installing     : php-common                                                                                               1/4
  Installing     : libedit                                                                                                  2/4
  Installing     : php-cli                                                                                                  3/4
  Installing     : php                                                                                                      4/4

Installed:
  php.x86_64 0:5.3.9-1.el5.remi

Dependency Installed:
  libedit.x86_64 0:2.11-2.20080712cvs.el5      php-cli.x86_64 0:5.3.9-1.el5.remi      php-common.x86_64 0:5.3.9-1.el5.remi

Complete!
[root@isvx7 ganglia]#
[root@isvx7 ganglia]# php -v
PHP 5.3.9 (cli) (built: Jan 10 2012 20:04:35)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
[root@isvx7 ganglia]#

Then installed php-gd as follows:

[root@isvx7 rhn]# yum --enablerepo=remi install php-gd
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:

Error Message:
        Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

remi                                                     | 2.5 kB     00:00
remi/primary_db                                          | 266 kB     00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-gd.x86_64 0:5.3.9-1.el5.remi set to be updated
--> Processing Dependency: libt1.so.5()(64bit) for package: php-gd
--> Running transaction check
---> Package t1lib.x86_64 0:5.1.1-7.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch            Version                    Repository     Size
================================================================================
Installing:
 php-gd          x86_64          5.3.9-1.el5.remi           remi          209 k
Installing for dependencies:
 t1lib           x86_64          5.1.1-7.el5                epel          208 k

Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 417 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): t1lib-5.1.1-7.el5.x86_64.rpm                      | 208 kB     00:00
(2/2): php-gd-5.3.9-1.el5.remi.x86_64.rpm                | 209 kB     00:01
--------------------------------------------------------------------------------
Total                                           108 kB/s | 417 kB     00:03
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : t1lib                                                    1/2
  Installing     : php-gd                                                   2/2

Installed:
  php-gd.x86_64 0:5.3.9-1.el5.remi

Dependency Installed:
  t1lib.x86_64 0:5.1.1-7.el5

Complete!
[root@isvx7 rhn]#
Installed the ganglia-web rpm, and restarted the httpd.

[root@isvx7 ganglia]# rpm -i ganglia-web-3.0.7-1.el5.x86_64.rpm
[root@isvx7 ganglia]#
[root@isvx7 ganglia]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@isvx7 ganglia]#

The Cluster report graphs were available using a browser
http://isvx7.storage.tucson.ibm.com/ganglia/


Summary:
  • Ganglia rpm's that were installed on the collector server
[root@isvx7 ganglia]# rpm  -qa | grep ganglia
ganglia-gmond-3.0.7-1.el5
ganglia-3.0.7-1.el5
ganglia-gmetad-3.0.7-1.el5
ganglia-3.0.7-1.el5
ganglia-web-3.0.7-1.el5
[root@isvx7 ganglia]#
  • Ganglia rpm's that were installed on the node that was monitored.
[root@isvx4 ~]# rpm -qa | grep ganglia
ganglia-gmond-3.0.7-1.el5
ganglia-3.0.7-1.el5
ganglia-3.0.7-1.el5
  • On the collector node isvx7.storage.tucson.ibm.com edit /etc/gmetad.conf
data_source "my servers" 10 localhost

Also edit /etc/gmond.conf
cluster {
  name = "my servers"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}


udp_send_channel {
  host = isvx7.storage.tucson.ibm.com
  port = 8649
}


udp_recv_channel {
  port = 8649
}


tcp_accept_channel {
  port = 8649
}
  • Restart the collector daemons:
[root@isvx7 php]# service gmetad restart
Shutting down GANGLIA gmetad:                              [  OK  ]
Starting GANGLIA gmetad:                                   [  OK  ]
[root@isvx7 php]# service gmetad restart
Shutting down GANGLIA gmetad:                              [  OK  ]
Starting GANGLIA gmetad:                                   [  OK  ]
[root@isvx7 php]#
  • On the node that was monitored isvx4.storage.tucson.ibm.com
Edit the file /etc/gmond.conf
cluster {
  name = "my servers"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}


udp_send_channel {
  host = isvx7.storage.tucson.ibm.com
  port = 8649
}


/* udp_recv_channel {
}
tcp_accept_channel {
} */
  • Restart the gmond daemon:
[root@isvx4 ~]# service gmond restart
Shutting down GANGLIA gmond:                               [  OK  ]
Starting GANGLIA gmond:                                    [  OK  ]
  • Monitoring data was available at:
http://isvx7.storage.tucson.ibm.com/ganglia





Friday, January 20, 2012

Oracle 10g R2 runInstaller issues on RedHat 5

For my new project I was trying to install Oracle 10g R2 on my RedHat 5 Linux host. I already had an Oracle 11g R2 installed on that Linux host, so I was hoping that the installation should be rather straight forward but wasn't so.

I downloaded the 10g R2 binaries from the Oracle web page, and after gunzipping and cpioing proceeding to execute the runInstaller.

Here is the first issue that I hit:

-bash-3.2$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Failed <<<<

Exiting Oracle Universal Installer, log for this session can be found at /u01/app/oraInventory/logs/installActions2012-01-19_04-28-30PM.log

Looks like at the time Oracle 10g R2 was released, RedHat was still at version 4, so when the installer looks at the certified OS'es it fails.

/home/oracle/database/10g/database/install/oraparam.ini file is where the Certified Versions of Linux are listed. As you see redhat-5 is missing.

[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2

The fix is pretty straight forward. We just have add redhat-5 to that list.

A good way to go about with that is to copy the oraparam.ini file to /tmp and then add redhat-5 to the list as shown below.

[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2,redhat-5

This resolves the first issue and we move a bit further along, but not for long. I now see a new error message.

-bash-3.2$ ./runInstaller -paramFile /tmp/oraparam.ini
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLin
ux-1.0, asianux-1, asianux-2 or redhat-5
                                      Passed


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-01-19_05-10-37PM. Please wait ...-bash-3.2$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.

Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2012-01-19_05-10-37PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred..
java.lang.UnsatisfiedLinkError: /tmp/OraInstall2012-01-19_05-10-37PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or d


I looked for the libXp rpm, and noticed that I already had them.


-bash-3.2$ rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep libXp
libXpm-devel-3.5.5-3 (x86_64)
libXpm-3.5.5-3 (i386)
libXpm-3.5.5-3 (x86_64)

The fix for this is to install libXp-1.0.0-8.1.el5.i386.rpm

I downloaded the rpm from http://rpm.pbone.net/index.php3/stat/4/idpl/8077225/com/libXp-1.0.0-8.1.el5.i386.rpm.html


[root@isvx7 rpm]# ls
libXp-1.0.0-8.1.el5.i386.rpm
[root@isvx7 rpm]# rpm -i libXp-1.0.0-8.1.el5.i386.rpm
warning: libXp-1.0.0-8.1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
[root@isvx7 rpm]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep libXp
libXpm-devel-3.5.5-3 (x86_64)
libXp-1.0.0-8.1.el5 (i386)
libXpm-3.5.5-3 (i386)
libXpm-3.5.5-3 (x86_64)
[root@isvx7 rpm]#

Things were good after that, and the installer GUI came up fine.

If you have access to Metalink, or whatever they call it these days, checkout the below documents.
[ID 456634.1]
[ID 443617.1]

Friday, January 13, 2012

Enabling Asynchronous I/O and direct I/O in Oracle 11g R2 running on Red Hat Linux

I found a really good paper by Red Hat titled "Oracle 10g Server on Red Hat Enterprise Linux 5 Deployment Recommendations"

I have an Oracle 11g R2 (11.2.0.1.0) database running on Red Hat Linux version 2.6.18-274.7.1.el5, and wanted to try out if the recommendation still worked. So all the stuff you see below is right out of the above Red Hat document.The conclusion is, the recommendations by Red Hat still stand good for 11g R2.

To enable async I/O in Oracle, the disk_asynch_io parameter needs to be set to true in the init.ora file:
disk_asynch_io=true

The parameter disk_asynch_io is set to true by default in Oracle 11g:

SQL> show parameter disk_asynch_io;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
disk_asynch_io                       boolean     TRUE
SQL>

In my case the data files are on a file system(ext3) which supports asynchronous I/O.

To do async I/O on file systems, the filesystemio_options parameter needs to be set to "asynch" in addition to
disk_asynch_io=true:

filesystemio_options=asynch

This parameter is platform-specific. By default, this parameter is set to none for Linux and thus needs to be changed:

SQL> show parameter filesystemio_options;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      none
SQL>

The filesystemio_options variable can have the following values:
asynch: Enables asynchronous I/O on file system files
directio: Enables direct I/O on file system files
setall: Enables both asynchronous and direct I/O on file system files
none: Disables both asynchronous and direct I/O on file system files

If you also wish to enable Direct I/O Support, set filesystemio_options to "setall".

As per the documentation "For Red Hat Enterprise Linux 5, it is strongly recommended to use “setall” for ext2, ext3, GFS, NFS and OCFS2 file systems."

Below is what I did to enable asynchronous I/O and direct I/O for my Oracle 11g R2 database.


SQL> alter system set filesystemio_options=setall scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup;
ORACLE instance started.

Total System Global Area 2.6991E+10 bytes
Fixed Size                  2213976 bytes
Variable Size            1.7448E+10 bytes
Database Buffers         9395240960 bytes
Redo Buffers              145174528 bytes
Database mounted.
Database opened.
SQL> show parameter filesystemio_options;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      SETALL
SQL>

Thursday, January 12, 2012

dbv and dbfsize for Oracle datafile info

I came across these pretty cool utilities that give lots of good information about the Oracle datafiles.

Here we pass the foo5.dbf file created in the earlier post to the dbv utility.

-bash-3.2$ dbv FILE=foo5.dbf

DBVERIFY: Release 11.2.0.1.0 - Production on Thu Jan 12 16:12:10 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

DBVERIFY - Verification starting : FILE = /oracle/ORCLTBLSP/datafile/foo5.dbf


DBVERIFY - Verification complete

Total Pages Examined         : 393216
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 127
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 393089
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 1004562 (0.1004562)

Below we pass the foo5.dbf datafile to the dbfsize utility

-bash-3.2$ dbfsize foo5.dbf

Database file: foo5.dbf
Database file type: file system
Database file size: 393216 8192 byte blocks
-bash-3.2$

It tells us the data file is on a file system. And more importantly that it's size is 393216 x 8k blocks which is around 3GB, which is the size of the datafile that we added to the tablespace in the earlier post.

How does Oracle initalize the datafiles that make up the tablespaces?

To see how or what Oracle does while initializing a datafile(file system) while adding it to a tablespace I tried the following little test on my RedHat Linux host. The file system was ext3.

Here is the result when  No asynchronous I/O was used. ie. the Oracle parameter filesystemio_options=none


-bash-3.2$  strace -f sqlplus / as sysdba 2> output.txt

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 12 15:25:50 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter tablespace users add datafile '/oracle/ORCLTBLSP/datafile/foo5.dbf' size 3G;

Tablespace altered.

SQL>

Here is a snippet of the out that was collected by strace. Here we see that the datafile foo5.dbf gets created, and then initialized with 0's

[pid 18769] open("/oracle/ORCLTBLSP/datafile/foo5.dbf", O_RDONLY) = 14
[pid 18769] open("/oracle/ORCLTBLSP/datafile/foo5.dbf", O_RDONLY) = 14
[pid 18769] open("/oracle/ORCLTBLSP/datafile/foo5.dbf", O_RDWR) = 14
[pid 18769] pwrite(14, "\0\242\0\0\1\0\0\0\0\0\0\0\0\0\1\5\1\247\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1040384, 8192) = 1040384
[pid 18769] pwrite(14, "\0\242\0\0\200\0\0\0\0\0\0\0\0\0\1\5\200\247\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576, 1048576) = 1048576
[pid 18769] pwrite(14, "\0\242\0\0\0\1\0\0\0\0\0\0\0\0\1\5\0\246\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576, 2097152) = 1048576
[pid 18769] pwrite(14, "\0\242\0\0\200\1\0\0\0\0\0\0\0\0\1\5\200\246\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576, 3145728) = 1048576
[pid 18769] pwrite(14, "\0\242\0\0\0\2\0\0\0\0\0\0\0\0\1\5\0\245\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576, 4194304) = 1048576
[pid 18769] pwrite(14, "\0\242\0\0\200\2\0\0\0\0\0\0\0\0\1\5\200\245\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576, 5242880) = 1048576
[pid 18769] pwrite(14, "\0\242\0\0\0\3\0\0\0\0\0\0\0\0\1\5\0\244\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576, 6291456) = 1048576

We can also check this by looking directly at the datafile file foo5.dbf

[root@isvx7 datafile]# hexdump foo5.dbf | more
0000000 a200 0000 0000 ffc0 0000 0000 0000 0000
0000010 fa60 0000 2000 0000 0000 0006 7c7d 7a7b
0000020 81a0 0000 0000 0000 0000 0000 0000 0000
0000030 0000 0000 0000 0000 0000 0000 0000 0000
*
0002000 a20b 0000 0001 0240 0000 0000 0000 0401
0002010 5aa1 0000 0000 0000 0000 0b20 412c 722d
0002020 524f 4c43 4254 534c 0465 0000 0000 0006
0002030 2000 0000 0009 0003 0000 0000 0000 0000
0002040 0000 0000 0000 0000 0000 0000 0000 0000
*
0002060 0000 0000 526b 000f 0000 0000 a9a2 2e09
0002070 56ee 2e08 6c20 000e 0000 0000 0000 0000
0002080 0000 0000 0000 0000 0000 0004 0002 0000
0002090 0000 0000 0001 0000 0000 0000 0000 0000
00020a0 0000 0000 0000 0000 0000 0000 0000 0000


Here is the same test when Asynchronous I/O was used. ie. the Oracle parameter filesystemio_options=asynch

When asynchronous I/O was used, there were lots of io_submit could be see happening as expected. The man page says the following about io_submit "io_submit - Submit asynchronous I/O blocks for processing"

Below is a snippet of the output from the strace file when asynchronous i/o was used to add a datafile to the tablespace.


[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f9430, 0, 1, 0, 14}}) = 1
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f9688, 0, 1, 0, 14}}) = 1
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f98e0, 0, 1, 0, 14}}) = 1
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f9b38, 0, 1, 0, 14}}) = 1
[pid 14927] io_getevents(47213877018624, 4, 128, {{0x2af0d65f9430, 0x2af0d65f9430, 1040384, 0}, {0x2af0d65f9688, 0x2af0d65f9688, 1048576, 0}, {0x2af0d65f98e0, 0x2af0d65f98e0, 1048576, 0}, {0x2af0d65f9b38, 0x2af0d65f9b38, 1048576, 0}}, {0, 0}) = 4
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f9430, 0, 1, 0, 14}}) = 1
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f9688, 0, 1, 0, 14}}) = 1
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f98e0, 0, 1, 0, 14}}) = 1
[pid 14927] io_submit(47213877018624, 1, {{0x2af0d65f9b38, 0, 1, 0, 14}}) = 1

Tuesday, January 10, 2012

Oracle files deleted by SQL> drop database;

I knew when we dropped an Oracle database that it deleted the control files, data files, and the redo log files for that particular instance of the database. I was curious to what other files it deleted when we dropped an instance of the database

So on my Linux box I created a database called "testdel". The database "testdel" created it's files control files, data files, and the redo log files under /oracle/testdel

I used "strace" to see what files were unlinked during the "drop database" command by redirecting the strace output to the output_testdel.txt file as shown below.



-bash-3.2$ export ORACLE_SID=testdel
-bash-3.2$ strace -f -e unlink sqlplus / as sysdba 2> output_testdel.txt

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 10 01:31:59 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup restrict mount;
ORACLE instance started.

Total System Global Area 2.6991E+10 bytes
Fixed Size                  2213976 bytes
Variable Size            1.7448E+10 bytes
Database Buffers         9395240960 bytes
Redo Buffers              145174528 bytes
Database mounted.
SQL> drop database;

Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

Here are a list of file that get unlinked or deleted:

Automatic Memory Management(AMM) memory segments are memory mapped files in /dev/shm.

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/lkinsttestdel

The files nder the /oracle/testdel directory

[pid 23376] unlink("/oracle/testdel/system01.dbf") = 0
[pid 23376] unlink("/oracle/testdel/sysaux01.dbf") = 0
[pid 23376] unlink("/oracle/testdel/undotbs01.dbf") = 0
[pid 23376] unlink("/oracle/testdel/users01.dbf") = 0
[pid 23376] unlink("/oracle/testdel/redo01.log") = 0
[pid 23376] unlink("/oracle/testdel/redo02.log") = 0
[pid 23376] unlink("/oracle/testdel/redo03.log") = 0
[pid 23376] unlink("/oracle/testdel/temp01.dbf") = 0

Here are some other files they that get deleted
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiletestdel.ora

/u01/app/oracle/diag/rdbms/testdel/testdel/alert/log.xml

Also, all metadata, lck, and trace files under the following directory
/u01/app/oracle/diag/rdbms/testdel/testdel/metadata

/u01/app/oracle/diag/rdbms/testdel/testdel/lck

/u01/app/oracle/diag/rdbms/testdel/testdel/trace/

And finally the control files under /oracle/testdel
[pid 23376] unlink("/oracle/testdel/control01.ctl") = 0
[pid 23376] unlink("/oracle/testdel/control02.ctl") = 0