Saturday, February 26, 2011

Reliable Datagram Sockets (RDS)

Reliable Datagram Sockets (RDS) is a reliable-socket off-load driver and inter-processor communication (IPC) protocol with low overhead, low-latency, high-bandwidth. RDS enables enhanced application performance and cluster scalability.
***Contributor: www.openfabrics.org (Particularly, Oracle)***
Reference:
http://www.openfabrics.org
http://oss.oracle.com/projects/rds/

RDS protocol provides reliable datagram services multiplexing UDP packets over InfiniBand connection improving performance to Oracle RAC. It provides high performance cluster interconnect for Oracle RAC. (Interest Link)

How to know RDS is used on RAC?
SQL> oradebug setmypid
Statement processed.
SQL> oradebug ipc
Information written to trace file.
On Oracle RAC (no RDS) - In trace file:
SSKGXPT 0x6700190 flags SSKGXPT_READPENDING socket no 7 IP 192.168.99.1 UDP 48798
context timestamp 0
On Oracle RAC (RDS) - In trace file:
SKGXP:[2b4d5065d400.97]{ctx}: SSKGXPT 0x2b4d506b1d98 flags 0x0 sockno 10 IP 192.168.99.1 RDS 26387 lerr 0
SKGXP:[47611061326848.97]{ctx}: SKGXPGPID Internet address 192.168.99.1 RDS port number 26387
Or... check in alert log file:
Cluster communication is configured to use the following interface(s) for this instance
192.168.99.1
cluster interconnect IPC version:Oracle RDS/IP (generic)
IPC Vendor 1 proto 3
If database cluster (RAC) not use RDS - rebuild RAC IPC library for RDS (use "oracle" user and stop what instances use this ORACLE_HOME before):
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk ipc_rds ioracle
If need to revert back RAC to use UDP instead of RDS:
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk ipc_g ioracle
Note: some command-line on Linux (rds-tools git repo):
rds-info - display information from the RDS kernel module
rds-ping - test reachability of remote node over RDS
rds-stress - send messages between processes over RDS sockets
Example:
# rds-info -n

RDS Connections:
LocalAddr RemoteAddr NextTX NextRX Flg
192.168.99.1 192.168.99.1 117066 6 --C
192.168.99.1 192.168.99.3 1167415 1060920 --C
192.168.99.1 192.168.99.2 1104151 1018883 --C
192.168.99.1 192.168.99.5 106692 62660 --C
192.168.99.1 192.168.99.4 1129073 990390 --C
192.168.99.1 192.168.99.7 341345 413031 --C
192.168.99.1 192.168.99.6 530757 603414 --C
192.168.99.1 192.168.99.9 108975 120114 --C
192.168.99.1 192.168.99.8 491816 560933 --C
192.168.99.1 192.168.99.11 270190 283060 --C
192.168.99.1 192.168.99.10 578831 588658 --C

# rds-ping 192.168.99.2
1: 29 usec
2: 28 usec
3: 31 usec
4: 33 usec

server01
# rds-stress
waiting for incoming connection on 0.0.0.0:4000

then on server02:
# rds-stress -s 192.168.99.1 -p 4000 -t 1 -d 1 -D 1024000
connecting to 192.168.99.1:4000
negotiated options, tasks will start in 2 seconds
Starting up....
tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu %
1 1252 1252 2647.90 1250670.54 1250670.54 28.47 764.87 -1.00
1 1251 1251 2643.31 1247501.25 1249497.26 29.39 764.85 -1.00
1 1247 1247 2637.50 1246756.98 1244758.98 29.56 767.66 -1.00
1 1248 1248 2639.52 1246709.66 1246709.66 30.07 766.60 -1.00
1 1247 1248 2638.61 1245780.38 1246779.40 29.93 767.10 -1.00
^C

Check on server01
# rds-stress
waiting for incoming connection on 0.0.0.0:4000
accepted connection from 192.168.99.2:46507 on 192.168.99.1:4000
negotiated options, tasks will start in 2 seconds
Starting up....
tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu %
1 1252 1252 2648.12 1250774.24 1250774.24 31.86 761.95 -1.00
1 1250 1250 2643.83 1248746.26 1248746.26 31.46 763.10 -1.00
1 1245 1245 2635.89 1244996.27 1244996.27 32.84 766.34 -1.00
1 1247 1247 2640.09 1246980.05 1246980.05 33.06 765.58 -1.00
1 1247 1246 2639.09 1247006.24 1246006.23 32.69 765.56 -1.00
---------------------------------------------
1 1247 1247 2641.41 1247701.42 1247501.50 32.39 764.81 -1.00 (average)
On Exadata, Oracle uses RDS (Reliable Datagram Sockets) V3. Oracle has developed it and we know in name the Zero Data loss UDP (ZDP) protocol.

Thursday, February 24, 2011

Distributed Shell for Oracle Storage

"dcli" script executes commands on multiple cells in parallel threads. The cells are referenced by their domain name or ip address. Local files can be copied to cells and executed on cells.
If we would like to know more about setting up "dcli". we can find out on My Oracle Support - Setting up DCLI Utility on Oracle DB host [ID 787205.1]

This is shell utility on Exadata servers, It seems to use "SSH login without password" idea (push ssh key to cell's authorized_keys file) on "root" user or ...
Example:
# cat all_group
exadb01
exadb02
exadb03
exadb04
exacel01
exacel02
exacel03
exacel04
exacel05
exacel06
exacel07

# dcli -g all_group -l root "hostname"
exadb01: exadb01.domain
exadb02: exadb02.domain
exadb03: exadb03.domain
exadb04: exadb04.domain
exacel01: exacel01.domain
exacel02: exacel02.domain
exacel03: exacel03.domain
exacel04: exacel04.domain
exacel05: exacel05.domain
exacel06: exacel06.domain
exacel07: exacel07.domain
# cat dbs_group
exadb01
exadb02
exadb03
exadb04

# dcli -g dbs_group -l root "vmstat 1 2| tail -1"
exadb01: 0 0 0 93954080 84384 3399876 0 0 0 0 1352 10532 0 0 100 0 0
exadb02: 0 0 0 93701856 98800 3552584 0 0 0 0 1282 10636 0 0 100 0 0
exadb03: 0 0 0 92977872 98836 4266000 0 0 0 0 1275 10504 0 0 100 0 0
exadb04: 0 0 0 93257040 85704 3739464 0 0 0 0 1258 10277 0 0 100 0 0
If want to use "vmstat" with "dcli", use option:
--vmstat=VMSTATOPS vmstat command options
Example:
# dcli -l root -g dbs_group --vmstat="-a 1 2"
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
00:54:49: r b swpd free inact active si so bi bo in cs us sy id wa st
exadb01: 0 0 0 73336200 20123384 4346176 0 0 0 8 3 4 0 0 100 0 0
exadb02: 0 0 0 92061888 2797188 3472388 0 0 0 17 4 2 0 0 100 0 0
exadb03: 0 0 0 91947248 2783296 3597512 0 0 0 16 4 6 0 0 100 0 0
exadb04: 1 0 0 91658088 2993800 3664716 0 0 0 4 3 2 0 0 100 0 0
Minimum: 0 0 0 73336200 2783296 3472388 0 0 0 4 3 2 0 0 100 0 0
Maximum: 1 0 0 92061888 20123384 4346176 0 0 0 17 4 6 0 0 100 0 0
Average: 0 0 0 87250856 7174417 3770198 0 0 0 11 3 3 0 0 100 0 0
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
00:54:50: r b swpd free inact active si so bi bo in cs us sy id wa st
exadb01: 0 0 0 73334824 20123416 4346228 0 0 0 0 1109 10562 1 0 99 0 0
exadb02: 1 0 0 92062160 2797184 3472456 0 0 0 8 1104 9977 0 0 100 0 0
exadb03: 0 0 0 91947776 2783292 3597516 0 0 0 4 1112 10077 0 0 100 0 0
exadb04: 0 0 0 91657872 2993804 3664720 0 0 0 16 1108 10109 0 0 100 0 0
Minimum: 0 0 0 73334824 2783292 3472456 0 0 0 0 1104 9977 0 0 99 0 0
Maximum: 1 0 0 92062160 20123416 4346228 0 0 0 16 1112 10562 1 0 100 0 0
Average: 0 0 0 87250658 7174424 3770230 0 0 0 7 1108 10181 0 0 99 0 0
This is easy to executes commands on multiple cells. But I'm afraid "SSH login without password" idea for "root" user or ... on all cells(servers). How do you think?

McCullough and Berglund on Mastering Git by Matthew McCullough, Tim Berglund

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
If we would like to learn about Git, we can learn from this video "McCullough and Berglund on Mastering Git" by Matthew McCullough, Tim Berglund. This Video has 10 topics and shows us to learn the Git version control system through visual examples and step-by-step explanations. Experts Matthew McCullough and Tim Berglund demonstrate how Git not only incorporates the best features of existing source control systems, but also includes unique distributed capabilities that make version control commands available without connectivity, allowing you to choose when to interact with a network.

What will we learn from this Video:
- Setting Up Git and Configuring Git
- Three Stage Thinking, The Git File Workflow and Speed
- Cloning Repositories
- Command Composition, Storage and Hashes
- Branches
- Remotes
- Tagging
- Merging
- Rebasing
- Undo and Bonus Tips

We can learn from Git docs and etc, However McCullough and Berglund on Mastering Git Video is great option for Git learning. We'll learn in detail how each of Git's new terms and commands works in practice. This video will help us know more... to use Git.

By the way, They explained something what we should know for using Git... step-by-step, idea to idea and practice to practice. This video teaches from basic to immediate, so if we don't know about Git, This video can help.

Wednesday, February 23, 2011

How to start about Exadata Learning?

The foundation of the Exadata family of products is the Oracle Exadata Database Machine (Database Machine). The Database Machine is a complete and fully integrated database system that includes all the components to quickly and easily deploy any enterprise database delivering the best performance. The Exadata Storage Server (Exadata storage or Exadata cells) is used as the storage for the Oracle Database in the Database Machine and is used to grow existing Database Machine deployments.
However, I don't want to explain what is EXADATA? I'm just curious some idea: How to start about Exadata Learning?
I think someone who work as Oracle DBA need to know this answer. sure!!! Me too. If You have Exadata, It may easy for learning -)

Idea 1: Search "exadata" word on My Oracle Support, I guaratee it's useful.
Master Note for Oracle Database Machine and Exadata Storage Server [ID 1187674.1]
Exadata V2 Starter Kit [ID 1244344.1]
However, Database System on Exadata is Oracle RAC!!! we should know Oracle RAC also.
Master Note for Real Application Clusters (RAC) Oracle Clusterware and Oracle Grid Infrastructure [ID 1096952.1]
Idea 2: If no My Oracle Support, we can check on Oracle Learning Library (Exadata and Database Machine Version 2 Series)

Idea 3: Read from Blogs:
- The Oracle Instructor (by UWE HESSE)
- Kerry Osborne’s Oracle Blog
- Kevin Closson’s Oracle Blog
- Structured Data (by Greg Rahn)
- Frits Hoogland Weblog
- ocpdba oracle weblog
- Pythian Blog
- ETC ...

*** watch some Webcast also ***

Idea 4: Read on Oracle Forums

Idea 5: Buy Exadata books (check on Oracle Press ,APRESS or Amazon)

Idea 6: Study from Oracle University

Idea 7: How about your idea? I hope to hear some idea from you -)

Monday, February 21, 2011

How can we calculate archivelog size each day?

How can we calculate archivelog size each day/hour?
This is not a difficult idea for someone who work as DBA, I just wish more idea for discussion and sharing . Some Idea using V$LOG.BYTES and V$ARCHIVED_LOG.*
but I believe V$ARCHIVED_LOG view be able to help:
Archivelog size each day:
SQL> select trunc(COMPLETION_TIME) TIME, SUM(BLOCKS * BLOCK_SIZE)/1024/1024 SIZE_MB from V$ARCHIVED_LOG group by trunc (COMPLETION_TIME) order by 1;

TIME SIZE_MB
---------- ----------
2011-02-12 71797.87
2011-02-13 75880.52
2011-02-14 73569.37
2011-02-15 76776.81
2011-02-16 73959.86
2011-02-17 69969.71
2011-02-18 74677.10
2011-02-19 75474.95
2011-02-20 77967.07
2011-02-21 67802.70
Archivelog size each hour:
SQL> alter session set nls_date_format = 'YYYY-MM-DD HH24';

Session altered.

SQL> select trunc(COMPLETION_TIME,'HH24') TIME, SUM(BLOCKS * BLOCK_SIZE)/1024/1024 SIZE_MB from V$ARCHIVED_LOG group by trunc (COMPLETION_TIME,'HH24') order by 1;

TIME SIZE_MB
------------- ----------
2011-02-21 00 6396.65
2011-02-21 01 2797.31
2011-02-21 02 2010.45
2011-02-21 03 1871.77
2011-02-21 04 1481.5
2011-02-21 05 2868.20
2011-02-21 06 2363.89
2011-02-21 07 4269.26
2011-02-21 08 2469.08
2011-02-21 09 3007.06
2011-02-21 10 3561.97
2011-02-21 11 2530.57
2011-02-21 12 3509.08
2011-02-21 13 3022.5
2011-02-21 14 3514.97
2011-02-21 15 4057.45
2011-02-21 16 3021.27
2011-02-21 17 4014.31
2011-02-21 18 4011.66
2011-02-21 19 4008.10
2011-02-21 20 3015.46
That is just my samples ^^
How about archive log size each of day/hour on RAC?- Using GV$ARCHIVED_LOG ???
SQL> select INST_ID, RECID, NAME, to_char(COMPLETION_TIME,'YYYY-MM-DD HH24:MI:SS'), ARCHIVAL_THREAD# , blocks * block_size from GV$ARCHIVED_LOG order by COMPLETION_TIME;
INST_ID RECID NAME TO_CHAR(COMPLETION_ ARCHIVAL_THREAD#
---------- ---------- -------------------------------------------------- ------------------- ----------------
4 258572 +ARCH/DB/4_73214_617849235.dbf 2011-02-21 20:29:52 4
2 258572 +ARCH/DB/4_73214_617849235.dbf 2011-02-21 20:29:52 4
1 258572 +ARCH/DB/4_73214_617849235.dbf 2011-02-21 20:29:52 4
3 258572 +ARCH/DB/4_73214_617849235.dbf 2011-02-21 20:29:52 4
1 258573 +ARCH/DB/1_55739_617849235.dbf 2011-02-21 20:44:22 1
3 258573 +ARCH/DB/1_55739_617849235.dbf 2011-02-21 20:44:22 1
4 258573 +ARCH/DB/1_55739_617849235.dbf 2011-02-21 20:44:22 1
2 258573 +ARCH/DB/1_55739_617849235.dbf 2011-02-21 20:44:22 1

NO!!! - What do we see? - When we want to calculate archivelog size on RAC, we just use V$ARCHIVED_LOG view. So, on RAC:
Archivelog size each day:
SQL> select trunc(COMPLETION_TIME) TIME, SUM(BLOCKS * BLOCK_SIZE)/1024/1024 SIZE_MB from V$ARCHIVED_LOG group by trunc (COMPLETION_TIME) order by 1;

TIME SIZE_MB
---------- ----------
2011-02-12 71797.87
2011-02-13 75880.52
2011-02-14 73569.37
2011-02-15 76776.81
2011-02-16 73959.86
2011-02-17 69969.71
2011-02-18 74677.10
2011-02-19 75474.95
2011-02-20 77967.07
2011-02-21 67802.70
Archivelog size each hour:
SQL> alter session set nls_date_format = 'YYYY-MM-DD HH24';

Session altered.

SQL> select trunc(COMPLETION_TIME,'HH24') TIME, SUM(BLOCKS * BLOCK_SIZE)/1024/1024 SIZE_MB from V$ARCHIVED_LOG group by trunc (COMPLETION_TIME,'HH24') order by 1;

TIME SIZE_MB
------------- ----------
2011-02-21 00 6396.65
2011-02-21 01 2797.31
2011-02-21 02 2010.45
2011-02-21 03 1871.77
2011-02-21 04 1481.5
2011-02-21 05 2868.20
2011-02-21 06 2363.89
2011-02-21 07 4269.26
2011-02-21 08 2469.08
2011-02-21 09 3007.06
2011-02-21 10 3561.97
2011-02-21 11 2530.57
2011-02-21 12 3509.08
2011-02-21 13 3022.5
2011-02-21 14 3514.97
2011-02-21 15 4057.45
2011-02-21 16 3021.27
2011-02-21 17 4014.31
2011-02-21 18 4011.66
2011-02-21 19 4008.10
2011-02-21 20 3015.46
How about your idea?