Friday, July 31, 2009

Change Oracle ASM resource AUTO_START

After I read otn forums. I felt curious about "ASM resource don't start automatic after server reboot or when Oracle Cluster is started".
so, made simple testing about auto_start not equal 1
# /u01/oracle/product/crs/bin/crsctl start crs
Attempting to start Oracle Clusterware stack
The CRS stack will be started shortly
$ crs_stat -t

Name Type Target State Host
------------------------------------------------------------
ora.oratest01.ASM1.asm OFFLINE OFFLINE
ora.oratest01.LISTENER_ORATEST01.lsnr ONLINE ONLINE on oratest01
ora.oratest01.gsd ONLINE ONLINE on oratest01
ora.oratest01.ons ONLINE ONLINE on oratest01
ora.oratest01.vip ONLINE ONLINE on oratest01
ASM1 didn't start automatic, try to manual start it:
$ srvctl start asm -n oratest01

$ crs_stat -t
ora.oratest01.ASM1.asm ONLINE ONLINE on oratest01
That can start +ASM1 by manual, What's happened?
$ /u01/oracle/product/crs/bin/crs_stat | grep NAME\= | grep asm
NAME=ora.oratest01.ASM1.asm

$ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm
NAME=ora.oratest01.ASM1.asm
TYPE=application
ACTION_SCRIPT=/u01/oracle/product/11.1.0/asm/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=2
that showed auto_start=2: This means, after node reboot or when Oracle Clusterware is started, resources with AUTO_START=2 will need to be started
manually via srvctl.

have to change AUTO_START=1, How? (contact oracle support... Good Idea), Or... change it by manual.

- Stop asm before
$ srvctl stop asm -n oratest01
- copy ASM1 profile, CRS_HOME/crs/public/ PATH and filename = "resource_name".cap
$ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm > /u01/oracle/product/crs/crs/public/ora.oratest01.ASM1.asm.cap
- unregister ASM1 resource
$ /u01/oracle/product/crs/bin/crs_unregister ora.oratest01.ASM1.asm

$ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm
CRS-0210: Could not find resource 'ora.oratest01.ASM1.asm'.
- Edit cap file (AUTO_START=1)
$ vi /u01/oracle/product/crs/crs/public/ora.oratest01.ASM1.asm.cap

AUTO_START=2 -> AUTO_START=1

- register ASM1 resource to Cluster
$ /u01/oracle/product/crs/bin/crs_register ora.oratest01.ASM1.asm
- Check and Test
$ /u01/oracle/product/crs/bin/crs_stat -p ora.oratest01.ASM1.asm

NAME=ora.oratest01.ASM1.asm
TYPE=application
ACTION_SCRIPT=/u01/oracle/product/11.1.0/asm/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
$ su - root

# /u01/oracle/product/crs/bin/crsctl stop crs
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.

# /u01/oracle/product/crs/bin/crsctl start crs
Attempting to start Oracle Clusterware stack
The CRS stack will be started shortly

$ crs_stat -t

Name Type Target State Host
------------------------------------------------------------
ora.oratest01.ASM1.asm ONLINE ONLINE on oratest01
ora.oratest01.LISTENER_ORATEST01.lsnr ONLINE ONLINE on oratest01
ora.oratest01.gsd ONLINE ONLINE on oratest01
ora.oratest01.ons ONLINE ONLINE on oratest01
ora.oratest01.vip ONLINE ONLINE on oratest01
Success... ASM automatic started after when Oracle Clusterware is started.

Wednesday, July 29, 2009

play install TimesTen 11.2.1.2.0


I'd like to know How I install/setup it, it differ from old versions, doesn't it?

I downloaded and started Install ("oracle" user):
$ ls timesten112120.linux8664.tar.gz
timesten112120.linux8664.tar.gz

$ tar zxvf timesten112120.linux8664.tar.gz
linux8664/
linux8664/doc/
linux8664/doc/doc.zip
linux8664/3rdparty/
linux8664/3rdparty/jms-1_1-fr-apidocs.tar.bz2
linux8664/3rdparty/ant-1.6.2-bin.tar.bz2
linux8664/behaviorchanges.txt
linux8664/setup.sh
linux8664/uninst.sh
linux8664/LINUX8664/
linux8664/LINUX8664/timesten.tar.bz2
linux8664/LINUX8664/unzip
linux8664/LINUX8664/ttpatchinst
linux8664/LINUX8664/ttserver.tar.bz2
linux8664/LINUX8664/manifest
linux8664/LINUX8664/perl
linux8664/LINUX8664/common.tar.bz2
linux8664/LINUX8664/bzip2
linux8664/LINUX8664/ttclient.tar.bz2
linux8664/README.html
linux8664/install.pl

$ cd linux8664
$ ./setup.sh

ERROR: The /etc/TimesTen directory needs to be created for the instance registry
and its ownership and permissions set appropriately.
Please refer to the installation guide for assistance.
Oop! I used oracle user, so...
$ su - root
# mkdir /etc/TimesTen
# chown -R oracle:oinstall /etc/TimesTen
Try Again:
$ ./setup.sh
NOTE: Each TimesTen installation is identified by a unique instance name.
The instance name must be a non-null alphanumeric string, not longer
than 255 characters.

Please choose an instance name for this installation? [ tt1121 ] ttmb
Instance name will be 'ttmb'.
Is this correct? [ yes ]

Of the three components:

[1] Client/Server and Data Manager
[2] Data Manager Only
[3] Client Only

Which would you like to install? [ 1 ]
Where would you like to install the ttmb instance of TimesTen? [ /home/oracle ] /u02/TimesTen
Where would you like to create the daemon home directory? [ /u02/TimesTen/ttmb/info ]
Installing into /u02/TimesTen/ttmb ...
Uncompressing ...

NOTE: If you are configuring TimesTen for use with Oracle Clusterware, the
daemon port number must be the same across all TimesTen installations
managed by Oracle Clusterware.

NOTE: All installations that replicate to each other must use the same daemon
port number that is set at installation time. The daemon port number can
be verified by running 'ttVersion'.

The default port number is 53388.

Do you want to use the default port number for the TimesTen daemon? [ yes ]
The daemon will run on the default port number (53388).

NOTE: For security, we recommend that you restrict access to the
TimesTen installation to members of a single OS group. Only members of
that OS group will be allowed to perform direct mode connections to
TimesTen, and only members of that OS group will be allowed to perform
operations that access TimesTen data stores, TimesTen files and shared
memory. The OS group defaults to the primary group of the instance
administrator. You can default to this group, choose another OS group
or you can make this instance world-accessible. If you choose to make
this instance world-accessible, all database files and shared memory
are readable and writable by all users.

Restrict access to the the TimesTen installation to the group 'oinstall'? [ yes ]

NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries.

Would you like to enable PL/SQL for this instance? [ yes ]

The daemon logs will be located in /u02/TimesTen/ttmb/info
Would you like to specify a different location for the daemon logs? [ no ] yes
Where would you like the daemon logs to be written? [ /u02/TimesTen/ttmb/info ] /u02/TimesTen/ttmb/log
The directory /u02/TimesTen/ttmb/log does not exist.
Do you want to create it? [ yes ]
Are you sure you want the daemon logs to be written to /u02/TimesTen/ttmb/log? [ yes ]
TNS_ADMIN was not set in your environment but there is a tnsnames.ora
file in /u01/oracle/product/11.1.0/db/network/admin.
Would you like to use this TNS_ADMIN setting for the In-Memory Database Cache? [ yes ]

TNS_ADMIN will be set to /u01/oracle/product/11.1.0/db/network/admin
You can change TNS_ADMIN later by running /bin/ttmodinstall.
.
.
.
Installing server components ...
What is the TCP/IP port number that you want the TimesTen Server to listen on? [ 53389 ]
Do you want to install QuickStart and the TimesTen Documentation? [ no ] yes
Where would you like to install the quickstart and doc directories (s=skip)? [ /u02/TimesTen/ttmb ]

The TimesTen Quickstart applications can take up to 64 Mbytes of disk space.
Depending on how your system is configured, you may not want to create the
QuickStart DemoDataStore directory in the default location,
/u02/TimesTen/ttmb/info/DemoDataStore

Where would you like to create the DemoDataStore directory? [ /u02/TimesTen/ttmb/info ]
Creating /u02/TimesTen/ttmb/info/DemoDataStore ...

Installing client components ...

Would you like to use TimesTen Replication with Oracle Clusterware? [ no ] yes
Please provide the path to the Oracle Clusterware installation on this machine (s=skip)? [ /u01/oracle/product/crs ]
Please enter a port number for the TimesTen Clusterware agent? [ 53394 ]

Executing '/u01/oracle/product/crs/bin/crsctl check cluster' ...
Oracle Clusterware is currently configured on the following nodes :
.
.
.
NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.

Run the 'setuproot' script :
cd /u02/TimesTen/ttmb/bin
./setuproot -install
This will move the TimesTen startup script into its appropriate location.

The startup script is currently located here :
'/u02/TimesTen/ttmb/startup/tt_ttmb'.

The Quickstart home page can be accessed here :
'/u02/TimesTen/ttmb/quickstart/index.html'

Starting the daemon ...
TimesTen Daemon startup OK.
End of TimesTen installation.
when installed, it's time to test with it:
setup data store:
$ vi /u02/TimesTen/ttmb/info/sys.odbc.ini

[ODBC Data Sources]
mb_db01=TimesTen 11.2.1 Driver

[mb_db01]
Driver=/u02/TimesTen/ttmb/lib/libtten.so
DataStore=/u02/TimesTen/ttmb/info/TT/mb_db01
PermSize=100
TempSize=100
PLSQL=1
DatabaseCharacterSet=US7ASCII
start data store and test create user:
$ cd /u02/TimesTen/ttmb/bin
$ mkdir /u02/TimesTen/ttmb/info/TT
$ ./ttisql

Copyright (c) 1996-2009, Oracle. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "dsn=mb_db01";
Connection successful: DSN=mb_db01;UID=oracle;DataStore=/u02/TimesTen/ttmb/info/TT/mb_db01;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/u02/TimesTen/ttmb/lib/libtten.so;PermSize=100;TempSize=100;TypeMode=0;
(Default setting AutoCommit=1)

Command> create user tt01 identified by password;
User created.

Command> GRANT CREATE TABLE TO tt01;
Command>

Command> connect "DSN=mb_db01;uid=tt01";
Enter password for 'tt01':
15107: User lacks CREATE SESSION privilege; logon denied
The command failed.

none: Command> connect "DSN=mb_db01" ;
Connection successful: DSN=mb_db01;UID=oracle;DataStore=/u02/TimesTen/ttmb/info/TT/mb_db01;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/u02/TimesTen/ttmb/lib/libtten.so;PermSize=100;TempSize=100;TypeMode=0;
(Default setting AutoCommit=1)
con1: Command>
con1: Command>
con1: Command> grant create session to tt01;
con1: Command> grant create procedure to tt01;
con1: Command> connect "DSN=mb_db01;uid=tt01";
Enter password for 'tt01':
Connection successful: DSN=mb_db01;UID=tt01;DataStore=/u02/TimesTen/ttmb/info/TT/mb_db01;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/u02/TimesTen/ttmb/lib/libtten.so;PermSize=100;TempSize=100;TypeMode=0;
(Default setting AutoCommit=1)
and Test PL/SQL (sample):
con1: Command>set serveroutput on

con1: Command> create or replace procedure hello_world as
begin
dbms_output.put_line('Hello World!');
end;
/

con1: Command> begin
> hello_world;
> end;
> /
Hello World!
That 's just simple to install , read more at doc, best practices

Tuesday, July 28, 2009

Oracle TimesTen Release 11.2.1.2.0


After I read Oracle Announces Oracle® TimesTen In-Memory Database 11g and Oracle In-Memory Database Cache 11g and go to Oracle TimesTen download.
Oracle changed Oracle TimesTen Release from 7.0.5.2.0 to 11.2.1.2.0 for download.

Read Release Notes , by the way this version support PL/SQL.

The release numbering system has been changed. In the release number
a.b.c.d.e, a.b.c represents the TimesTen release (11.2.1), d represents the
patch release (2) and e represents the port patch (0).

read PKCS #12 format file by openssl


Oracle Wallet Manager stores X.509 certificates and private keys in industry-standard, PKCS #12 format.

If need to read private key and certificates from file (PKCS #12 format):

that can use openssl to help(have to know "wallet password"):

Read from file (PKCS #12 format) to standard out:
$ openssl pkcs12 -in ewallet.p12
Enter Import Password:
MAC verified OK
.
.

If need to write to file standard:
$ openssl pkcs12 -in ewallet.p12 -out file.out
Enter Import Password:
MAC verified OK

If reading private key from file (PKCS #12 format), we need to type "pass phrase" (phrase is too short, needs to be at least 4 chars):
$ openssl pkcs12 -in ewallet.p12 -out file.out
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
Warning unsupported bag type: secretBag
.
.

Friday, July 24, 2009

Dynamic SQL: cursor: pin S wait on X

I worked with load testing on oracle database with OLTP (query many times in the same sql statements) and found high waited events on cursor: pin S wait on X and cursor: mutex X
cursor: pin S wait on X:
A session waits on this event when requesting a mutex for sharable operations related to pins(such as executing a cursor)), but the mutex cannot be granted because it is being held exclusively by another session (which is most likely parsing the cursor).
read ideas from Tanel Poder and Alex Fatkulin
And then i investigated PL/SQL code and found dynamic sql, so i made test (wrote pl/sql with dynamic sql) and check waited events.

Example Test

Dynamice SQL:
create or replace function build_query_stmt (obj_id IN number) return varchar2
is
v_stmt varchar2(2000);
begin
v_stmt := 'select count(1) c from TMP01 ';
v_stmt := v_stmt || ' where object_id=' || obj_id ;

return v_stmt;
end;
/

create or replace procedure A (obj_id IN number)
is
type t_refcur is REF CURSOR;
crs t_refcur;
v_stmt varchar2(2000);
v_c number;
begin
v_stmt := build_query_stmt(obj_id);
open crs for v_stmt;
< < a_loop > >
LOOP
begin
fetch crs into v_c;
exit a_loop when crs%NOTFOUND;
dbms_output.put_line(v_c);
end;
end loop;
close crs;
end;
/

Test many times: exec a(:p);
Check:
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
cursor: pin S wait on X 19,679 216 11 49.8 Concurrenc
CPU time 183 42.1
kksfbc child completion 445 22 50 5.1 Other
cursor: mutex S 1,017 1 1 0.2 Concurrenc
latch: library cache 1,886 1 0 0.2 Concurrenc
Static SQL:
create or replace procedure B (obj_id IN number)
is
v_c number;
begin
execute immediate 'select count(*) from TMP01 where object_id = :p1' into v_c using obj_id ;
dbms_output.put_line(v_c);
end;
/

Test many times: exec b(:p);
Check:
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
CPU time 80 55.7
cursor: pin S wait on X 4,364 49 11 33.6 Concurrenc
kksfbc child completion 234 12 50 8.2 Other
latch: library cache 2,556 1 1 1.0 Concurrenc
latch: shared pool 1,971 1 0 0.4 Concurrenc
Dynamic SQL use waited time event: "cursor: pin S wait on X" higher Static SQL, so be careful to use it.

Wednesday, July 22, 2009

Interface type 1 configured from OCR for use as a cluster interconnect

Just my curious when i startup asm/database on rac and see some messages in alert log.
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Interface type 1 eth1 192.168.1.0 configured from OCR for use as a cluster interconnect
Interface type 1 eth0 10.10.10.0 configured from OCR for use as a public interface

that shows oracle rac configured interface subnet at OCR, and asm/database used them...

Name:
oifcfg - Oracle Interface Configuration Tool.

Usage: oifcfg iflist [-p [-n]]
oifcfg setif {-node < nodename > | -global} { < if_name > / < subnet > :< if_type >}...
oifcfg getif [-node < nodename > | -global] [ -if < if_name > [/ < subnet >] [-type < if_type >] ]
oifcfg delif [-node < nodename > | -global] [ < if_name > [/ < subnet > ]]
oifcfg [-help]

< nodename > - name of the host, as known to a communications network
< if_name > - name by which the interface is configured in the system
< subnet > - subnet address of the interface
< if_type > - type of the interface { cluster_interconnect | public | storage }

$ oifcfg getif
eth0 10.10.10.0 global public
eth1 192.168.1.0 global cluster_interconnect
if use "oifcfg getif", and Nothing! ... that means no configured and no see above message in alert log.

by the way, if nothing to show "oifcfg getif" we should set them... because It may make asm/database confuse ;) if uses private ip on both Public Interface and Private Interface.

$ netstat -rn

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

$ oifcfg setif -global eth0/10.10.10.0:public

$ oifcfg setif -global eth1/192.168.1.0:cluster_interconnect

$ oifcfg getif

eth0 10.10.10.0 global public
eth1 192.168.1.0 global cluster_interconnect

If we have to change IPs on Interface (public or private), and it differences from old networks, don't forget to change... "oifcfg delif", "oifcfg setif" ;)

...Check...

- View the available interface names
$ oifcfg iflist

eth0 10.10.10.0
eth1 192.168.1.0
- View the currently configured interfaces
$ oifcfg getif

eth0 10.10.10.0 global public

eth1 192.168.1.0 global cluster_interconnect

if "the available interface names" differ "the currently configured interfaces", we'll see warning in alert log.
Interface type 1 eth1 192.168.11.0 configured from OCR for use as a cluster interconnect
WARNING 192.168.11.0 could not be translated to a network address error 1
So, don't forget to check your alert log file.

;)

How can I check master node on RAC?


How can I check master node on RAC?
That's a question about... and hope someone help about idea.

About me: I have RAC 4 nodes and need to know master node:

- Use ocrconfig -showbackup
Oracle backup OCR file automatic on master node, So check OCR backup information be able help.

$ ocrconfig -showbackup

node04 2009/07/21 23:10:38 /u01/oracle/product/crs/cdata/crs
node04 2009/07/21 19:10:38 /u01/oracle/product/crs/cdata/crs
node04 2009/07/21 15:10:38 /u01/oracle/product/crs/cdata/crs
node04 2009/07/20 23:10:36 /u01/oracle/product/crs/cdata/crs
node04 2009/07/08 11:10:14 /u01/oracle/product/crs/cdata/crs


that mean master node be "node04"

- grep -i "master node" ocssd.log | tail -1 at ORA_CRS_HOME/log/nodename/cssd/ path.
But perhaps not see in ocssd.log file.


$ for x in `ls -tr ocssd.*`; do grep -i "master node" $x ; done | tail -1
[ CSSD]CLSS-3001: local node number 2, master node number 4
Master node is node 4.

Or find "MASTER" word in ocssd.* files
[ CSSD]2009-06-25 12:08:36.994 [1231087968] >TRACE: clssgmEstablishMasterNode: MASTER for 86 is node(4) birth(75)

Hope to hear another idea;)

Tuesday, July 21, 2009

use OSWatcher

I used OSWatcher to monitor CPU/Memory/Network to investigate the problem on servers. I think It's easy to setup. But I have to download it from metalink.
OS Watcher (OSW) is a collection of UNIX shell scripts intended to collect and archive operating system and network metrics to aid support in diagnosing performance issues. We can download it from metalink. OSW operates as a set of background processes on the server and gathers OS data on a regular basis, invoking such Unix utilities as vmstat, netstat and iostat.
More detail: metalink: 301137.1

After I downloaded it from metalink. It's time to setup:
$ ls osw212.tar
osw212.tar

$ tar xvf osw212.tar
./
./osw/
./osw/Exampleprivate.net
./osw/OSWatcher.sh
./osw/OSWatcherFM.sh
./osw/profile/
./osw/oswnet.sh
./osw/oswsub.sh
./osw/startOSW.sh
./osw/stopOSW.sh
./osw/tarupfiles.sh
./osw/topaix.sh
./osw/README
./osw/OSWgREADME
./osw/src/
./osw/src/OSW_profile.htm
./osw/src/coe_logo.gif
./osw/src/oswg_input.txt
./osw/src/missing_graphic.gif
./osw/src/tombody.gif
./osw/src/watch.gif
./osw/gif/
./osw/oswlnxtop.sh
./osw/private.net
./osw/oswlnxio.sh
./osw/oswg.jar
./osw/tmp/

$ cd osw

Just extract from tar file... read README file and get idea with utility commands:

startOSW.sh
script:
need 2 arguments which control the frequency that data is collected and the number of hours worth of data to archive.
An optional 3rd argument allows the user to specify a zip utility name to compressthe files after they have been created:

ARG1 = snapshot interval in seconds (default 30 seconds).
ARG2 = the number of hours of archive data to store (default 48 hours)
ARG3 (optional) = the name of the zip utility to run if the user wants to compress the files automatically after creation.

Example:
./startOSW.sh
Info...You did not enter a value for snapshotInterval.
Info...Using default value = 30
Info...You did not enter a value for archiveInterval.
Info...Using default value = 48
.
.

./startOSW.sh 60 10 gzip
Info...Zip option IS specified.
Info...OSW will use gzip to compress files.
.
.
Starting OSWatcher V2.1.2 on Tue Jul 21 11:16:40 ICT 2009
With SnapshotInterval = 60
With ArchiveInterval = 10
.
.

stopOSW.sh script:

Example:
./stopOSW.sh

Or use "OSWatcher.sh" run to test:

$ ./OSWatcher.sh

Info...You did not enter a value for snapshotInterval.
Info...Using default value = 30
Info...You did not enter a value for archiveInterval.
Info...Using default value = 48

Testing for discovery of OS Utilities...

VMSTAT found on your system.
IOSTAT found on your system.
MPSTAT found on your system.
NETSTAT found on your system.
TOP found on your system.

Discovery completed.

Starting OSWatcher V2.1.2 on Tue Jul 21 10:29:55 ICT 2009
With SnapshotInterval = 30
With ArchiveInterval = 48

OSWatcher - Written by Carl Davis, Center of Expertise, Oracle Corporation

Starting Data Collection...

osw heartbeat:Tue Jul 21 10:29:55 ICT 2009
.
.

CTRL+C

It's time to show it (TEST): Starting
$ ./startOSW.sh
Info...You did not enter a value for snapshotInterval.
Info...Using default value = 30
Info...You did not enter a value for archiveInterval.
Info...Using default value = 48

Testing for discovery of OS Utilities...

VMSTAT found on your system.
IOSTAT found on your system.
MPSTAT found on your system.
NETSTAT found on your system.
TOP found on your system.

Discovery completed.

Starting OSWatcher V2.1.2 on Tue Jul 21 10:34:24 ICT 2009
With SnapshotInterval = 30
With ArchiveInterval = 48

OSWatcher - Written by Carl Davis, Center of Expertise, Oracle Corporation

Starting Data Collection...

osw heartbeat:Tue Jul 21 10:34:24 ICT 2009
osw heartbeat:Tue Jul 21 10:34:55 ICT 2009
osw heartbeat:Tue Jul 21 10:35:25 ICT 2009
.
.
.
monitor!... and want to stop:
$ ./stopOSW.sh
Terminated

What I see?

Archives 're stored in osw/archive/ PATH.
$ find ./archive/ -type f
./archive/oswiostat/oratest01_iostat_09.07.21.1000.dat
./archive/oswslabinfo/oratest01_slabinfo_09.07.21.1000.dat
./archive/oswprvtnet/oratest01_prvtnet_09.07.21.1000.dat
./archive/oswps/oratest01_ps_09.07.21.1000.dat
./archive/oswtop/oratest01_top_09.07.21.1000.dat
./archive/oswvmstat/oratest01_vmstat_09.07.21.1000.dat
./archive/oswmeminfo/oratest01_meminfo_09.07.21.1000.dat
./archive/oswnetstat/oratest01_netstat_09.07.21.1000.dat
./archive/oswmpstat/oratest01_mpstat_09.07.21.1000.dat
.
.
.

From Archive Files, that can see stats. and use archives to make graph as well:
use OSWg(more detail: metalink 461053.1) generate graph (requires as a minimum java version 1.4.2 or higher), and need X-windows.

read OSWgREADME File to help generate Graph.
and test with some archives:
$ $ORACLE_HOME/jdk/bin/java -version
java version "1.4.2_14"

$ $ORACLE_HOME/jdk/bin/java -jar oswg.jar -i archive/

Starting OSWg V2.1.2
OSWatcher Graph Written by Oracle Center of Expertise
Copyright (c) 2008 by Oracle Corporation

Parsing Data. Please Wait...

Parsing file oratest01_iostat_09.07.21.1000.dat ...
Parsing file oratest01_iostat_09.07.21.1100.dat ...
.
.
.

Parsing Completed.

Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs
Enter 5 to Display Disk IO Graphs

Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter 8 to Generate All Disk Gif Files

Enter L to Specify Alternate Location of Gif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently Displayed Graphs
Enter P to Generate A Profile
Enter Q to Quit Program

Please Select an Option:5

The Following Devices and Average Service Times Are Ready to Display:

Device Name Average Service Times in Milliseconds

sda 2.0477464788732385
sdb 1.192676056338029

Specify A Case Sensitive Device Name to View (Q to exit): sda


these're graph example.

From menu, I can generate... CPU Process Queue Graphs, CPU Utilization Graphs, CPU Other Graphs, Memory Graphs, Disk IO Graphs

...

Friday, July 10, 2009

Make Sure! RAC VIP configure, right?

when i implemented Oracle RAC and i used Virtual IP for connecting "but network ;) told me... find packets on both Virtual IP and Public IP"
Example:

service1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = service1)
)
)
why? I connected by virtual IPs;)

while connection from client; so i tested "tcpdump" on client and rac01/rac02 servers, and i found traffics/packets on Public IP and Virtual IP.

As "tcpdump" told me client connected by Virtual IP... But used Public IP to work.
client -> rac01-vip:1521
.
.
client -> rac01:1521.
.
.
What wrong?
So, checked on oracle rac "lsnrctl services":
$ lsnrctl services
.
.
.
Service "service1" has 2 instance(s).
Instance "db1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:2 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=rac01)(PORT=1521))
Instance "db2", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=rac02)(PORT=1521))
"DEDICATED" established:8316 refused:0 state:ready
LOCAL SERVER
A mistake configuration about rac vip???
after I read "Oracle RAC — VIP Configuration Mistakes: by Alex Gorbache, i changed configuration:
-> listener.ora

rac01:
LISTENER_rac01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac01-vip)(PORT = 1521)(IP = FIRST)))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac01)(PORT = 1521)(IP = FIRST)))
)
)

rac02:
LISTENER_rac02 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac02-vip)(PORT = 1521)(IP = FIRST)))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac02)(PORT = 1521)(IP = FIRST)))
)
)

-> tnsnames.ora on both nodes

LISTENERS_DB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac02-vip)(PORT = 1521))
)

LISTENERS_rac01 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac01-vip)(PORT = 1521))
)

LISTENERS_rac02 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac02-vip)(PORT = 1521))
)

-> DATABASE


rac01:

SQL> show parameter listener

NAME TYPE VALUE
-----------------------------------------------------------------
local_listener string LISTENERS_rac01
remote_listener string LISTENERS_DB

rac02:
SQL> show parameter listener

NAME TYPE VALUE
-----------------------------------------------------------------
local_listener string LISTENERS_rac02
remote_listener string LISTENERS_DB
(just example)

and then checked:
$ lsnrctl services
.
.
Service "service1" has 2 instance(s).
Instance "db1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:2 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=rac01-vip)(PORT=1521))
Instance "db2", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=rac02-vip)(PORT=1521))
"DEDICATED" established:8316 refused:0 state:ready
LOCAL SERVER
after that, I tested connection from client by Virtual IPs again, and "tcpdump" dumped traffics/packets.
client -> rac01-vip:1521
.
.
client -> rac01-vip:1521.
.
.
I've not found traffics/packets on Public IP anymore.