May 03 2011

How the sequence and Cache size of RAC instances work?

Sequences in RAC are handled separately by each instance.Each instance reads the sequence from the database and start allocating number until is it finish the cache range.Then it reads the sequence again and start allocating new numbers.

Assuming cache size of 3:

RAC1 – first call – 1 (save next value = 4 in the database).

RAC2 – first call – 4 (save next value = 7 in the database).

RAC1 – second call – 2

RAC1 – third call – 3

RAC1 – forth call – 7

RAC2 – second call – 5

There also contention between the nodes when they need to update the next value for the sequence.
On RAC, where inserts are performed on both nodes it depends if you care about the order or you just want to make sure that each row has a different value.

1) Order is important – Define the sequence with ordered and big cache. This will cause global lock between the nodes and will degrade performence.

2) Order is not important – Just define with big cache.
Big cache minimize the contention for updating the sequence.

Mar 23 2011

RAC – Load Balance

Understanding and Troubleshooting Instance Load Balancing [ID 263599.1]

10g & 11g :Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]

Feb 22 2011

How to find out the Master Node of a RAC

How to find out the Master Node of a RAC

Option 1:

# ocrconfig -showbackup

The node that store OCR backups is the master node.

Option 2:

$ cssd >grep -i master node ocssd.log | tail -1

[CSSD]CLSS-3001: local node number 1, master node number 1

Above grep shows the master node in the cluster is node number 1.

Option 3:

$ grep master rac3_diag_4217.trc

Im the master node

Option 4:

Query V$GES_RESOURCE to identified master node.


Feb 18 2011

ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes available

ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes available
Why the above error messages
1. Flash Recovery Area Full
2. How to Free space when FRA is Full
3. May be your disk will have free space but still you get the above error messages due to manually deleting archive logs in FRA.
Solution:
SQL> select * from v$flash_recovery_area_usage;
SQL> select * from v$recovery_file_dest;
Step 1. Delete unwanted archive log files from disk ( rm/del)
Step 2. Connect to RMAN (rman target / nocatalog)
Step 3. rman> crosscheck archivelog all;
The above command will marks the control file that the archives have been deleted.
Step 4. rman> delete expired archivelog all;
The above command will deletes the log entries identified above.

ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes availableWhy the above error messages1. Flash Recovery Area Full2. How to Free space when FRA is Full3. May be your disk will have free space but still you get the above error messages due to manually deleting archive logs in FRA.
Solution:
SQL> select * from v$flash_recovery_area_usage;
SQL> select * from v$recovery_file_dest;
Step 1. Delete unwanted archive log files from disk ( rm/del)

Step 2. Connect to RMAN (rman target / nocatalog)

Step 3. rman> crosscheck archivelog all;

The above command will marks the control file that the archives have been deleted.

Step 4. rman> delete expired archivelog all;

The above command will deletes the log entries identified above.

Feb 12 2011

Server Performance Data Collection – Collectl

Server Performance Data Collection

1. Disk

2. CPU

3. Network … Etc

There are a number of times in which you find yourself needing performance data. These can include benchmarking, monitoring a system’s general heath or trying to determine what your system was doing at some time in the past. Sometimes you just want to know what the system is doing right now. Depending on what you’re doing, you often end up using different tools, each designed to for that specific situation.

Unlike most monitoring tools that either focus on a small set of statistics, format their output in only one way, run either interatively or as a daemon but not both, collectl tries to do it all. You can choose to monitor any of a broad set of subsystems which currently include buddyinfo, cpu, disk, inodes, infiniband, lustre, memory, network, nfs, processes, quadrics, slabs, sockets and tcp.

By default it shows cpu, network and disk stats in brief format. The key point of this format is all output appears on a single line making it much easier to spot spikes or other anomalies in the output:

[oracle@Mudhalvan] collectl

while writing to an NFS mounted filesystem, collectl displays interrupts, memory usage and nfs activity with timestamps. Keep in mind that you can mix and match any data and in the case of brief format you simply need to have a window wide enough to accommodate your output.
[oracle@Mudhalvan] collectl -sjmf -oT

You can also display the same information in verbose format, in which case you get a single line for each type of data at the expense of more screen real estate, as can be seen in this example of network data during NFS writes. Note how you can actually see the network traffic stall while waiting for the server to physically write the data.
[oracle@Mudhalvan] collectl -sn –verbose -oT
[oracle@Mudhalvan] collectl -sJ -oTm

Output can also be saved in a rolling set of logs for later playback or displayed interactively in a variety of formats. If all that isn’t enough there are additional mechanisms for supplying data to external tools by generating output as s-expressions, a format of choice for some tools such as supermon or in another format called list-expressions. This output can be written to a file or sent over a socket. You can even create files in space-separated format for plotting with external packages like gnuplot or colplot, part of the collectl utilities project, which provides a web-based interface to gnuplot.

Collectl runs on all linux distros (it’s included as part of Fedora) and only requires perl. If the perl Time::Hires module is installed, you will be able to use fractional intervals and display timestamps in msecs. If the Compress::Zlib module is installed the recorded data will be compressed and therefore use on average 90% less storage when recording to a file. Also note that the above links are not for RPMs. If you’d rather work with RPMs there are far too many versions out there to link to and so I’m sorry to say you’re on your own.

Did you know there was an inconsistency in the way Linux reported disk metrics that wasn’t even noticed/fixed until the 2.6-14 kernel was released? Collectl did. Or how about the fact that network stats may not accurately reported by most network monitoring tools at one second intervals? See this page for a description of the problem and how you can get more accurate stats by simply running collectl at a sub-second interval.

You can have the updated version here

Feb 11 2011

Data Guard Background processes

Data Guard Background processes

DMON – The Data Guard Broker process.

SNP – The snapshot process.

MRP – Managed recovery process – For Data Guard, the background process that applies archived redo log to the standby database.

ORBn – performs the actual rebalance data extent movements in an Automatic Storage Management instance. There can be many of these at a time, called ORB0, ORB1, and so forth.

OSMB – is present in a database instance using an Automatic Storage Management disk group. It communicates with the Automatic Storage Management instance.

RFS – Remote File Server process – In Data Guard, the remote file server process on the standby database receives archived redo logs from the primary database.

QMN – Queue Monitor Process (QMNn) – Used to manage Oracle Streams Advanced Queuing.

Feb 04 2011

How to set Data Protection Mode of a Primary Database

How to set Data Protection Mode of a Primary Database

Step 1 Select a data protection mode that meets your availability, performance and data protection requirements.

Step 2 Verify that redo transport is configured to at least one standby database The value of the LOG_ARCHIVE_DEST_n database initialization parameter that corresponds to the standby database must include the redo transport attributes listed for the data protection mode that you are moving to.

Maximum Protection, Availability – AFFIRM,SYNC, DB_UNIQUE_NAME
Maximum Performance – NOAFFIRM, ASYNC, DB_UNIQUE_NAME

Step 3 Verify that the DB_UNIQUE_NAME database initialization parameter has been set to a unique name on the primary and standby database.

Step 4 Verify that the LOG_ARCHIVE_CONFIG database initialization parameter has been defined on the primary and standby database and that its value includes a DG_CONFIG list that includes the DB_UNIQUE_NAME of the primary and standby database.

SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG=’DG_CONFIG=(MMPRY,MMSTB)’;

Step 5 Shut down the primary database and restart it in mounted mode if the protection mode is being set to Maximum Protection or being changed from Maximum Performance to Maximum Availability. If the primary database is an Oracle Real Applications Cluster, shut down all of the instances and then start and mount a single instance.
For example:
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;

Step 6 Set the data protection mode.
Execute the following SQL statement on the primary database:
SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};

Step 7 Open the primary database.
SQL> ALTER DATABASE OPEN;

Step 8 Confirm that the primary database is operating in the new protection mode.

SQL> SELECT PROTECTION_MODE FROM V$DATABASE;

Feb 02 2011

How to know Linux machine is 32 or 64 bit?

How to know Linux machine is 32 or 64 bit?

# uname -m

i386 or i686 then it is 32 bit
x86_64 is 64bit

Feb 02 2011

HP-Unix machine is 32 or 64 bit?

HP-Unix machine is 32 or 64 bit?

Method 1:
# getconf KERNEL_BITS

Method 2:
# ps -ef |grep RT

Method 3:

# file /stand/vmunix

If 64 bit it will show something like: ELF-64 executable object file

Feb 02 2011

How to know Sun Solaris machine is 32 or 64 bit?

How to know Sun Solaris machine is 32 or 64 bit?

# isainfo -v

Alibi3col theme by Themocracy