Thursday, April 12, 2012

Parallel Information


  • The degree of parallelism for a query can be specified
    • By specifying the parallel clause during table/index creation (Or later using alter)
    • Using a parallel hint in the sql statement
    • Using ‘alter session force parallel query parallel integer’ statement
  • If One of the options in the above statement has not been specified (To enable parallelism) then, irrespective of whether the table or index is partitioned or not, oracle does not use parallelism in the query
  • When using The dedicated server connection model (As opposed to the shared server model), the sessions shadow process acts as the query co-ordinator.
  • The query uses as many “parallel execution servers” as determined by the query optimizer, to execute the query (This is based on a varitey of factors)
  • When there is No parallel degree specified at the table level, in the query hint or at the session level, but parallelism is enabled at the session level (using alter session  force parallel query) then the optimizer uses the default degree of parallelism.
  • The Default Degree of Parellism (DOP) is determined by cpu_count x parallel_threads_per_cpu
  • If you specified parallelism by issueing ‘alter session force parallel query parallel integer’ statement, then the value used for integer is used for the degree of parallelism (If a parallel hint is not specified in the query).
  • All of the above statements assume that there are enough query servers available in the pool and parallel_adaptive_multi_user does not reduce the number of parallel execution servers.
  • If interoperation parallelism can be used then you could end up using double the number of parallel execution servers as the degree of parallelism
  • If for some reason your query cannot be allocated enough parallel execution servers (typically when there are multiple sessions and all the parallel execution servers (gated by parallel_max_servers) are currently in use) and parallel_min_percent > 0 (0 is the default so your query will still get run without parallelism), your query will get an error and you can try again later.
 For a good primer on parallel query in oracle please read the white paper, Oracle Sql Parallel Execution

What Is Being Audited

Here are some little scripts to find that out:



select * from DBA_PRIV_AUDIT_OPTS
union all
select * from DBA_STMT_AUDIT_OPTS;

select * from DBA_PRIV_AUDIT_OPTS
union all
select * from DBA_STMT_AUDIT_OPTS;

Also a few audit commands I find handy:

noaudit all;
-(Turns off all statement audit options).

noaudit all privileges;
-(Turns off all privilege audit options).

noaudit all on default;
-(Turns off all default object audit options).

audit drop any table:
-(Adds auditing for any table that is dropped.

A Faster Insert


Question: I need to speed up some slow running big inserts, what can I do?  Would if help if the table was partitioned?

Well first off, partitioning a table does not make inserts run any faster.   Now if you were trying to improve the performance of deletes, then partitioning would buy you some speed there. So if partitioning isn't the answer what else can you do to help out your slow processing inserts?   

Are you doing any joins withing the insert code to generate the data you are using for the inserts?  If you are, then that would be a good place to take a long hard look.  As often that can very will be a large part of the issue.  It is important to know what all tables are being joined together.  You might find that you are using a view or two or three within you join conditions; and views are often built on multi-table joins.  You could find yourself joining a larger number of tables together and not even realize it. 

Speaking of joins; You can play with your explain plan (I know you executed one before just throwing some new code out there on the server and letting it run wild consuming resources-) by trying things like a sort merge or maybe a nested loops join instead of hash join (which don't seem to be the best choice when doing inserts as it tends to execute much slower).

Some more basic first-line type of things you can do to help with insert speeds are:
-Ensure an appropriate parallel degree setting for the table.
1.     -Alter session enable parallel dml.
2.      -Add the /*+ append */ hint.  Note that this hint will increase your insert speed, but it will also increase your table fragmentation over time. Therefore, you will need to keep an eye on your table and rebuild it as needed.
3.     

I Want A Bigger SGA But My Server Won't Let Me

Well let's say you want to increase the size of the SGA on one of your instances residing on a Linux box.  So you get an updated pfile (create pfile form spfile;), edit it, increasing the sga_max_size and sga_target parameters.  Then you update the spifle (create spfile from pfile='$ORACLE_HOME/dbs/init.ora;) and restart the instance. But the new size throws an error each time you try a startup.

If you find yourself here, a quick place to look is the kernel parameter shmall.  Many times this tends to be the limiting factor.  Find out what your shmall setting is: (cat /proc/sys/kernel/shmall).  Now sum all the values of the sga_target or sga_max_size (whichever is greater) parameter for all the instance(s) you have on this server.  Don't worry about the PGA, as it does not factor into the shmall value.  Let's say your shmall value is 4194304 and the sum of all your instances is 16 gbs.  And you attempted to increase one of your instances SGA by adding 22 more gbs (this would have given you an new overall total SGA size of 38 gbs).  This of course would account for the failure during the startup attempt as your shmall setting is too small.

Now let's see what you need to do to figure out the correct shmall setting to accommodate your desires:

First you will need to know your page size (getconf PAGE_SIZE); you issue this command and find out your pagesize is 4096.

Here is the simple math to get you there:
                 
                    ( X 1024 X 1024) / 4
                                              (16 X 1024 X 1024) / 4 = 9961472

Therefore you new shmall setting will need to be 9961472 to accommodate 38 gbs of SGA.

Easy As Pie: Changing REDO Logfile Sizes

Below is a quick and to the point example of how to quickly change you current logfile sizes.  

Log in as sys

Select * from v$log; 
- (The Group# field will tell you what you current highest logfile group number being used is).


Select * from v$controlfile_record_section where type ='REDO LOG';
- (Comparing the Records_Used against the Records_Total will tell you how man more groups can be added).

Alter database add logfile group 5 ''+DGRP_RAID5_01_0000' size 1G reuse;
Alter database add logfile group 6 ''+DGRP_RAID5_01_0000' size 1G reuse;
Alter database add logfile group 7 ''+DGRP_RAID5_01_0000' size 1G reuse;
Alter database add logfile group 8 ''+DGRP_RAID5_01_0000' size 1G reuse;

Or


Alter database add logfile group 5 ''+DGRP_RAID5_01_0000' size 1G reuse
                                                ,''+DGRP_RAID5_01_0000' size 1G reuse;
Alter database add logfile group 6 ''+DGRP_RAID5_01_0000' size 1G reuse
                                                ,''+DGRP_RAID5_01_0000' size 1G reuse;
Alter database add logfile group 7 ''+DGRP_RAID5_01_0000' size 1G reuse
                                                ,''+DGRP_RAID5_01_0000' size 1G reuse;
Alter database add logfile group 8 ''+DGRP_RAID5_01_0000' size 1G reuse
                                               , ''+DGRP_RAID5_01_0000' size 1G reuse;



-(Add your new logfile groups).


Select * from v$log;
-(Use the Status filed to ensure that none of you old logfile groups are "CURRENT").
-(If any of them are, then use the following as many times as necessary to move the "CURRENT" to a new log).


Alter system switch logfile;

Alter system checkpoint;
-(This will force a checkpoint and write all the current contents of the logs to the appropriate data file(s)).



Alter database drop logfile group 1;
Alter database drop logfile group 2;
Alter database drop logfile group 3;
Alter database drop logfile group 3;
-(This will drop the old log file groups).


Select * form v$log;
-(To see your handy work).

Tuesday, April 10, 2012

DBD ERROR: OCISessionBegin

Here is a quick workaround you can use to get an instance back-up an open for business if you are running into these types of Oracle errors and users cannot log-in to the system:


ERROR:
ORA-04031: unable to allocate 4064 bytes of shared memory ("shared
pool","update seq$ set increment$=:...","sga heap(1,0)","kglsim heap")

Or maybe:


ORA-00604: error occurred at recursive SQL level 1
ORA-04031: unable to allocate 2336 bytes of shared memory ("shared pool","unknown object","sga heap(1,1)","ksv work msg") (DBD ERROR: OCISessionBegin)

SQL> ALTER SYSTEM FLUSH SHARED_POOL;

Note:  Taking this action will get rid of everything stored in the shared pool.  This will affect you hard/soft parse ratios.

This of course will not correct the underlying issue, but it will allow you to get the instance open quickly.  Then you can go looking for the offender(s).

Friday, March 16, 2012

Preparing LUN's for ASM with ASMLIB

A few simple steps for preparing new LUN's for addition to ASM.

Become root.


root@svr01[inst1]:/etc/init.d> oracleasm listdisks
VOL1
VOL10
VOL11
VOL12
VOL13
VOL14
VOL2
VOL3
VOL4
VOL5
VOL6
VOL7
VOL8
VOL9

root@svr01[inst1]:/etc/init.d> oracleasm createdisk VOL15 /dev/dm-34
Writing disk header: done
Instantiating disk: done

root@svr01[inst1]:/etc/init.d> oracleasm createdisk VOL16 /dev/dm-35
Writing disk header: done
Instantiating disk: done

root@svr01[inst1]:/etc/init.d> oracleasm createdisk VOL17 /dev/dm-36
Writing disk header: done
Instantiating disk: done

root@svr01[inst1]:/etc/init.d> oracleasm listdisks
VOL1
VOL10
VOL11
VOL12
VOL13
VOL14
VOL15
VOL16
VOL17
VOL2
VOL3
VOL4
VOL5
VOL6
VOL7
VOL8
VOL9

Monday, March 05, 2012

ASM Map To Disk

Here is a quick and simple way to map your ASM disks to their physical disks.  The examples are from Linux.


SQL> select path from v$asm_disk;

PATH
----------------------------------------------
/dev/oracleasm/disks/VOL3
/dev/oracleasm/disks/VOL7
/dev/oracleasm/disks/VOL4
/dev/oracleasm/disks/VOL8
/dev/oracleasm/disks/VOL5
/dev/oracleasm/disks/VOL9
/dev/oracleasm/disks/VOL10
/dev/oracleasm/disks/VOL11
/dev/oracleasm/disks/VOL12
/dev/oracleasm/disks/VOL6
/dev/oracleasm/disks/VOL13
/dev/oracleasm/disks/VOL14
/dev/oracleasm/disks/VOL1
/dev/oracleasm/disks/VOL2

14 rows selected.

(I used the following to get the Major and Minor numbers to id the disks):

$>:/home/oracle> cd /dev/oracleasm/disks
$>:/dev/oracleasm/disks> ls -ltarF
total 0
drwxr-xr-x 4 root   root       0 Sep 23 22:30 ../
drwxr-xr-x 1 root   root       0 Sep 23 22:30 ./
brw-rw---- 1 oracle dba  253, 30 Mar  5 13:54 VOL8
brw-rw---- 1 oracle dba  253, 32 Mar  5 13:54 VOL7
brw-rw---- 1 oracle dba  253, 31 Mar  5 13:54 VOL4
brw-rw---- 1 oracle dba  253, 33 Mar  5 13:54 VOL3
brw-rw---- 1 oracle dba  253, 19 Mar  5 13:54 VOL2
brw-rw---- 1 oracle dba  253, 22 Mar  5 13:54 VOL14
brw-rw---- 1 oracle dba  253, 23 Mar  5 13:54 VOL13
brw-rw---- 1 oracle dba  253, 27 Mar  5 13:54 VOL10
brw-rw---- 1 oracle dba  253, 20 Mar  5 13:54 VOL1
brw-rw---- 1 oracle dba  253, 28 Mar  5 13:54 VOL9
brw-rw---- 1 oracle dba  253, 24 Mar  5 13:54 VOL6
brw-rw---- 1 oracle dba  253, 29 Mar  5 13:54 VOL5
brw-rw---- 1 oracle dba  253, 25 Mar  5 13:54 VOL12
brw-rw---- 1 oracle dba  253, 26 Mar  5 13:54 VOL11

$>:/home/oracle> ls -l /dev
brw-rw----  1 root root 253,     0 Sep 23 22:29 dm-0
brw-rw----  1 root root 253,     1 Sep 23 22:29 dm-1
brw-rw----  1 root root 253,    10 Sep 23 22:29 dm-10
brw-rw----  1 root root 253,    11 Sep 23 22:29 dm-11
brw-rw----  1 root root 253,    12 Sep 23 22:29 dm-12
brw-rw----  1 root root 253,    13 Sep 23 22:29 dm-13
brw-rw----  1 root root 253,    14 Sep 23 22:29 dm-14
brw-rw----  1 root root 253,    15 Sep 23 22:29 dm-15
brw-rw----  1 root root 253,    16 Sep 23 22:29 dm-16
brw-rw----  1 root root 253,    17 Sep 23 22:29 dm-17
brw-rw----  1 root root 253,    18 Sep 23 22:29 dm-18
brw-rw----  1 root root 253,    19 Sep 23 22:29 dm-19
brw-rw----  1 root root 253,     2 Sep 23 22:29 dm-2
brw-rw----  1 root root 253,    20 Sep 23 22:29 dm-20
brw-rw----  1 root root 253,    21 Sep 23 22:29 dm-21
brw-rw----  1 root root 253,    22 Sep 23 22:29 dm-22
brw-rw----  1 root root 253,    23 Sep 23 22:29 dm-23
brw-rw----  1 root root 253,    24 Sep 23 22:29 dm-24
brw-rw----  1 root root 253,    25 Sep 23 22:29 dm-25
brw-rw----  1 root root 253,    26 Sep 23 22:29 dm-26
brw-rw----  1 root root 253,    27 Sep 23 22:29 dm-27
brw-rw----  1 root root 253,    28 Sep 23 22:29 dm-28
brw-rw----  1 root root 253,    29 Sep 23 22:29 dm-29
brw-rw----  1 root root 253,     3 Sep 23 22:29 dm-3
brw-rw----  1 root root 253,    30 Sep 23 22:29 dm-30
brw-rw----  1 root root 253,    31 Sep 23 22:29 dm-31
brw-rw----  1 root root 253,    32 Sep 23 22:29 dm-32
brw-rw----  1 root root 253,    33 Sep 23 22:29 dm-33
brw-rw----  1 root root 253,     4 Sep 23 22:29 dm-4
brw-rw----  1 root root 253,     5 Sep 23 22:29 dm-5
brw-rw----  1 root root 253,     6 Sep 23 22:29 dm-6
brw-rw----  1 root root 253,     7 Sep 23 22:29 dm-7
brw-rw----  1 root root 253,     8 Sep 23 22:29 dm-8
brw-rw----  1 root root 253,     9 Sep 23 22:29 dm-9

Thx

Friday, February 03, 2012

AIX - Often Missed Parameter

I am part of an excellent DBA team that support many VLDB's (multi-tera byte range) on many different platforms (primarily Unix and Linux).  It was reiterated today that many people miss setting the AIXTHREAD_SCOPE parameter in the OS.

This tends to be important because Oracle recommends the usage of system-wide contention, which in-turn maps Oracle threads to kernel threads statically.  This fact becomes even more critical in an Oracle RAC environment.

Setting the AIXTHREAD_SCOPE parameter in the OS provides the desirable benefit of reducing memory allocation at the Oracle process level in AIX version 5.2 or later.

The AIXTHREAD_SCOPE parameter should be set at the OS level as an environment variable for your Oracle instance owner.

“AIXTHREAD_SCOPE=S”  ...don't for to export it.

PS: Since we are talking about AIX another parameter you will want to consider setting is an Oracle init. one:

filesystemio_options='SETALL'



File System caching is better suited when your work load tends to be heavily sequential with low 
write content. 
To enable caching for Journal-ed File System (JFS) you would set: default file-system mount options and the Oracle init. parm: filesystemio_options=ASYNCH.



On the other hand, to disable JFS caching and in-turn utilize Direct I/O (DIO)  which tends to benefit heavily random access workloads, you would want to set the init. parm. to filesystemio_options=DIRECT.


Then again, if you want the best of both worlds, Cached I/O (CIO) which tends to be better for heavy update workloads, and DIO, then you will want to use the filesystemio_options='SETALL' parameter.


As an after thought you may want to consider increasing you init. param's for db_cache_size and db_file_multiblock_read_count.  This is because, when you are using CIO and DIO then your file-system buffer cache is not being used.

Monday, January 30, 2012

Arc-Log-Space/RMAN


This is a little script I used for checking archive log space usage:

connect / as sysdba
set linesize 132
set numf 999,999,999,999,999
column name format a32

archive log list;

show parameter db_recovery_file_dest;

SELECT * FROM V$RECOVERY_FILE_DEST;

connect /


Then for manual RMAN backup and removal of log files I use the following:

ORACLE_SID= export ORACLE_SID
rman
connect target /
BACKUP ARCHIVELOG ALL DELETE ALL INPUT;

Thx

Friday, January 27, 2012

Alter My Table

When one of our developers was thinking of executing a couple of alter table statements they asked the following questions:

               (alter table  enable row movement; 
                alter table  shrink space cascade;)

What do I need to consider before executing?  Here are my concerns:

1  Does this command require additional tablespace to shrink the table?
2  Do I need to make sure nothing is hitting the table while running the commands?
3  Is there a better way to accomplish the same thing?
4  Can I expect only a 10% savings in TS as my test on test I performed?
5  What is the max size of table (or other limitation) I should consider before executing the command?

   Here is the response from one of our great DBA's:

   1  No, it doesn't, as it uses same table to move blocks down below the high water mark (HWM).
2     It depends. Whole operation could be broken down into two parts:
a.     Blocks move-down operation (ALTER TABLE table SHRINK SPACE COMPACT) causes row locks, leaving whole table unlocked.
b.    Amend HWM:  ALTER TABLE SHRINK SPACE (CASCADE) will require exclusive lock on the table for very short time.
3   .Yes. Please try (as long as you have space available), CREATE TABLE table2 AS SELECT * FROM table1. Then create relevant indexes. Drop original tables. This will insert all the blocks into new table sequentially, increasing HWM together with loaded data.
4   No, there is no rule. DBAs have a Segment Advisor tool that might give approximate saving on particular table.
5.    No size limitation, as whole process is done on the original table, plus some temp space is needed. It also utilizes PGA (Program Global Area) – memory assigned to a session. Plus, the I/O utilization . Also for partitioned tables it would be wiser to shrink partitions instead of entire table (ALTER TABLE table MODIFY PARTITION partition SHRINK SPACE).


Wednesday, January 25, 2012

Twin UID's

Just today our DBA support group came across this little feller:  One of our Oracle 11R2 instances running on Linux using LDAP suddenly started to no longer allow users who were logging in via putty to execute CTAS's or SQL*Loader.  Oddly however, they could execute SQL*Plus with no issues.  After troubleshooting the issue it was found that a LDAP group was created with the same UID as Oracle's.  Once the new group received a unique UID the problem went away.

Friday, October 07, 2011

Opening Your Wallet


1.        Connect  sys/password as sysdba
2.        alter system set wallet open indentified by  “”.

Wednesday, October 05, 2011

RMAN TDE BACKUP'S

One of my peer's tested the RMAN TDE backup and got the following list of results:

1. RMAN Transparent Encryption can create and restore encrypted backups with no DBA intervention. The wallet must be open.
2. RMAN backup created as a backupset can be encrypted. RMAN image copies cannot be encrypted.
3. RMAN encrypted backups can be taken to disk. Advanced Security Option licensing is required.
4. Encrypted backups to tape are only possible with Oracle Secure Backup as the media manager. Advanced Security Option licensing is not required.
5. Oracle Secure Backup is a Oracle separate backup product. Oracle Secure Backup can not be integrated with any 3rd-party backup tools.(for example :Veritas NBU)
Oracle Secure Backup is an alternative to those product offerings(just like Veritas NBU).

Tuesday, October 04, 2011

ORION (ORracle IO Numbers)


Here is what I did to accomplish an Orion test on a new server I am currently installing oracle on and configuring.  The orion executable (11R2 is the first release to included this package) is stored under $ORACLE_HOME/bin directory.

user1a@serv01[dpprod]:/u01/app/oracle/product/11.2.0/db_1/bin> ll *orion*
-rwxr-xr-x 1 oracle dba 8698817 Sep  4  2010 orionO*
-rwxr-x--x 1 oracle dba 8700950 Jun 29 21:34 orion*

(Note that this is on Linux 64 bit).
I created a directory under /u01/app/oracle/ called orion. 
I then created the following file in that same orion directory: asm.vols.lun
I used the information from /dev/oracleasm/disks to populate it:
user1a@sevr2:/u01/app/oracle/orion> ls -l /dev/oracleasm/disks/
total 0
brw-rw---- 1 oracle dba 8,  33 Sep 29 10:12 VOL1
brw-rw---- 1 oracle dba 8,  49 Sep 29 10:12 VOL2
brw-rw---- 1 oracle dba 8,  65 Sep 29 10:12 VOL3
brw-rw---- 1 oracle dba 8,  81 Sep 29 10:12 VOL4
brw-rw---- 1 oracle dba 8,  97 Sep 29 10:12 VOL5
brw-rw---- 1 oracle dba 8, 113 Sep 29 10:12 VOL6

Here is the content of the asm.vols.lun file:
user1a@sevr2:/u01/app/oracle/orion> cat asm.vols.lun
/dev/oracleasm/disks/VOL1
/dev/oracleasm/disks/VOL2
/dev/oracleasm/disks/VOL3
/dev/oracleasm/disks/VOL4
/dev/oracleasm/disks/VOL5
/dev/oracleasm/disks/VOL6

Note that this server is using RDAC (Redundant Disk Array Controller).  I was able to determine this by noting that there were no files in the /dev/mapper/ directory (the storage is direct attached):
user1a@sevr2:/u01/app/oracle/orion> ll /dev/mapper
total 0
crw-------  1 root root 10, 63 Sep 29 10:12 control
drwxr-xr-x  2 root root     60 Sep 29 10:12 ./
drwxr-xr-x 12 root root   4380 Oct  4 11:38 ../

If this was multipath as it is on the sevr1 (esan) the mapper directory would be populated:
user1a@sevr1[dbprod]:/u01/app/oracle/product/11.2.0/db_1/bin> ll /dev/mapper
total 0
crw-------  1 root root  10, 63 Sep 23 22:29 control
brw-rw----  1 root disk 253,  0 Sep 23 22:29 mpath9
brw-rw----  1 root disk 253, 16 Sep 23 22:29 mpath8
brw-rw----  1 root disk 253, 15 Sep 23 22:29 mpath7
brw-rw----  1 root disk 253, 14 Sep 23 22:29 mpath5
brw-rw----  1 root disk 253, 13 Sep 23 22:29 mpath4
brw-rw----  1 root disk 253, 12 Sep 23 22:29 mpath3
brw-rw----  1 root disk 253, 11 Sep 23 22:29 mpath2
brw-rw----  1 root disk 253,  8 Sep 23 22:29 mpath17
brw-rw----  1 root disk 253,  7 Sep 23 22:29 mpath16
brw-rw----  1 root disk 253,  6 Sep 23 22:29 mpath15
brw-rw----  1 root disk 253,  5 Sep 23 22:29 mpath14
brw-rw----  1 root disk 253,  4 Sep 23 22:29 mpath13
brw-rw----  1 root disk 253,  3 Sep 23 22:29 mpath12
brw-rw----  1 root disk 253,  2 Sep 23 22:29 mpath11
brw-rw----  1 root disk 253,  1 Sep 23 22:29 mpath10
brw-rw----  1 root disk 253, 10 Sep 23 22:29 mpath1
brw-rw----  1 root disk 253,  9 Sep 23 22:29 mpath0
brw-rw----  1 root disk 253, 18 Sep 23 22:29 mpath8p1
brw-rw----  1 root disk 253, 17 Sep 23 22:29 mpath7p1
brw-rw----  1 root disk 253, 19 Sep 23 22:29 mpath2p1
brw-rw----  1 root disk 253, 20 Sep 23 22:29 mpath1p1
brw-rw----  1 root disk 253, 21 Sep 23 22:29 mpath0p1
brw-rw----  1 root disk 253, 22 Sep 23 22:29 mpath17p1
brw-rw----  1 root disk 253, 23 Sep 23 22:29 mpath16p1
brw-rw----  1 root disk 253, 24 Sep 23 22:29 mpath9p1
brw-rw----  1 root disk 253, 25 Sep 23 22:29 mpath15p1
brw-rw----  1 root disk 253, 26 Sep 23 22:29 mpath14p1
brw-rw----  1 root disk 253, 27 Sep 23 22:29 mpath13p1
brw-rw----  1 root disk 253, 28 Sep 23 22:29 mpath12p1
brw-rw----  1 root disk 253, 29 Sep 23 22:29 mpath5p1
brw-rw----  1 root disk 253, 30 Sep 23 22:29 mpath11p1
brw-rw----  1 root disk 253, 31 Sep 23 22:29 mpath4p1
brw-rw----  1 root disk 253, 32 Sep 23 22:29 mpath10p1
brw-rw----  1 root disk 253, 33 Sep 23 22:29 mpath3p1
drwxr-xr-x  2 root root     740 Sep 23 22:29 ./
drwxr-xr-x 14 root root   14840 Sep 23 22:31 ../

Here is what sevr1’s /dev/oracleasm/disks directory looks like:
user1a@serv2[dbprod]:/u01/app/oracle/product/11.2.0/db_1/bin> ll /dev/oracleasm/disks
total 0
drwxr-xr-x 4 root   root       0 Sep 23 22:30 ../
drwxr-xr-x 1 root   root       0 Sep 23 22:30 ./
brw-rw---- 1 oracle dba  253, 28 Oct  4 16:55 VOL9
brw-rw---- 1 oracle dba  253, 27 Oct  4 16:55 VOL10
brw-rw---- 1 oracle dba  253, 20 Oct  4 16:55 VOL1
brw-rw---- 1 oracle dba  253, 30 Oct  4 16:55 VOL8
brw-rw---- 1 oracle dba  253, 32 Oct  4 16:55 VOL7
brw-rw---- 1 oracle dba  253, 24 Oct  4 16:55 VOL6
brw-rw---- 1 oracle dba  253, 29 Oct  4 16:55 VOL5
brw-rw---- 1 oracle dba  253, 31 Oct  4 16:55 VOL4
brw-rw---- 1 oracle dba  253, 33 Oct  4 16:55 VOL3
brw-rw---- 1 oracle dba  253, 19 Oct  4 16:55 VOL2
brw-rw---- 1 oracle dba  253, 22 Oct  4 16:55 VOL14
brw-rw---- 1 oracle dba  253, 23 Oct  4 16:55 VOL13
brw-rw---- 1 oracle dba  253, 25 Oct  4 16:55 VOL12
brw-rw---- 1 oracle dba  253, 26 Oct  4 16:55 VOL11

If that where the case then my asm.vols.lun file contents would have looked like this:
/dev/mapper/mpath1p1   
/dev/mapper/mpath13p1  
/dev/mapper/mpath14p1  
/dev/mapper/mpath15p1  
/dev/mapper/mpath16p1  
/dev/mapper/mpath17p1  
/dev/mapper/mpath2p1   
/dev/mapper/mpath3p1   
/dev/mapper/mpath4p1   
/dev/mapper/mpath5p1   
/dev/mapper/mpath9p1   
/dev/mapper/mpath10p1  
/dev/mapper/mpath11p1  
/dev/mapper/mpath12p1

Here is the command line entries I used to execute the orion test:
./$ORACLE_HOME/bin/orion -run advanced -testname asm.vols -type seq -matrix point -num_large 6 -num_small 0 -duration 120  -write 0
Note: (-num_large typically is assigned the same number as the number of lun’s you have.)
Here is the output from the command execution:
ORION: ORacle IO Numbers -- Version 11.1.0.7.0
asm.vols_20111004_1538
Test will take approximately 5 minutes
Larger caches may take longer

rwbase_run_test: rwbase_reap_req failed
rwbase_run_process: rwbase_run_test failed
rwbase_rwluns: rwbase_run_process failed
orion_warm_cache: Warming cache failed. Continuing

Note: (The failures are expected in this case.)
The following files were created:
oracle@serv1:/u01/app/oracle/orion> ll
total 45296
-rwxrwxrwx 1 oracle dba 46350238 Oct  4 14:31 orion_linux_x86-64*
drwxrwxr-x 3 oracle dba     4096 Oct  4 14:43 ../
-rw-r--r-- 1 oracle dba      157 Oct  4 15:22 asm.vols.lun
drwxrwxr-x 2 oracle dba     4096 Oct  4 15:38 ./
-rw-r--r-- 1 oracle dba     2651 Oct  4 15:40 asm.vols_20111004_1538_trace.txt
-rw-r--r-- 1 oracle dba      907 Oct  4 15:40 asm.vols_20111004_1538_summary.txt
-rw-r--r-- 1 oracle dba       41 Oct  4 15:40 asm.vols_20111004_1538_mbps.csv
-rw-r--r-- 1 oracle dba       24 Oct  4 15:40 asm.vols_20111004_1538_lat.csv
-rw-r--r-- 1 oracle dba       24 Oct  4 15:40 asm.vols_20111004_1538_iops.csv

The “summary.txt” file contains the overall i/o speed results:
user1a@serv1:/u01/app/oracle/orion> cat *summary*
ORION VERSION 11.2.0.2.0

Commandline:
-run advanced -testname asm.vols -type seq -matrix point -num_large 6 -num_small 0 -duration 120 -write 0

This maps to this test:
Test: asm.vols
Small IO size: 8 KB
Large IO size: 1024 KB
IO Types: Small Random IOs, Large Sequential Streams
Number of Concurrent IOs Per Stream: 4
Force streams to separate disks: No
Simulated Array Type: CONCAT
Write: 0%
Cache Size: Not Entered
Duration for each Data Point: 120 seconds
Small Columns:,      0
Large Columns:,      6
Total Data Points: 1

Name: /dev/oracleasm/disks/VOL1 Size: 1170202328064
Name: /dev/oracleasm/disks/VOL2 Size: 1170202328064
Name: /dev/oracleasm/disks/VOL3 Size: 1170202328064
Name: /dev/oracleasm/disks/VOL4 Size: 1170202328064
Name: /dev/oracleasm/disks/VOL5 Size: 1170202328064
Name: /dev/oracleasm/disks/VOL6 Size: 1170202328064
6 FILEs found.

Maximum Large MBPS=1574.57 @ Small=0 and Large=6

As you can see, I am getting 1.5 gbs/sec.
The rule of thumb to expect for these i/o subsystems is around 250 MB/s per LUN.   Therefore for six LUNs it would be 1.5 GB/s. 

And I am happy, as that is what I got.
Thx

Monday, September 26, 2011

JUST SEEMS A LITTLE SLOW TO ME

Over the past week or two I just had a gut feeling that one of our databases i/o subsystem was performing slower than it should have been. This is Oracle 11gR2 on Linux 64 bit using ASM with San storage (8 HBA’s). The DASD is RAID 5 sliced into 1.1 tb Lun’s. There are 15 of these Lun’s presented to ASM as Volume’s (asm lib was used).

When I found a window of lower utilization on the server we ran some “Read” tests against the disks. We were getting 2.5 gbs/second and peaked at 2.9 gbs/second. That told me that my gut feeling was not coming from the i/o sub-system.

Some digging reveled the following:
/dev/oracleasm/disks> ls -ltrfa
brw-rw---- 1 oracle dba 253, 28 Sep 26 10:04 VOL9
brw-rw---- 1 oracle dba 253, 30 Sep 26 10:04 VOL8
brw-rw---- 1 oracle dba 253, 32 Sep 26 10:04 VOL7
 brw-rw---- 1 oracle dba 253, 24 Sep 26 10:04 VOL6
brw-rw---- 1 oracle dba      8, 29 Sep 26 10:04 VOL5
brw-rw---- 1 oracle dba      8, 31 Sep 26 10:04 VOL4
brw-rw---- 1 oracle dba      8, 33 Sep 26 10:04 VOL3
brw-rw---- 1 oracle dba      8, 19 Sep 26 10:04 VOL2
brw-rw---- 1 oracle dba 253, 22 Sep 26 10:04 VOL14
brw-rw---- 1 oracle dba 253, 23 Sep 26 10:04 VOL13
brw-rw---- 1 oracle dba 253, 25 Sep 26 10:04 VOL12
brw-rw---- 1 oracle dba 253, 26 Sep 26 10:04 VOL11
brw-rw---- 1 oracle dba 253, 27 Sep 26 10:04 VOL10
brw-rw---- 1 oracle dba     8, 20 Sep 26 10:04 VOL1

Take note of the column with the numbers 253 and 8 in it. This is the Agent (Major) number. A 253 is a multi-path’ing device. However, an 8 is a single-path device. We changed these all to 253’s and now the world is a little better place.

Thursday, September 15, 2011

Beware if you are RAC & ASM and are planning on upgrading to 11R2

We are starting to use ACFS some and while doing some reading I came across the following information as a Burleson comment and wanted to pass it along. Thx ASM Cluster Filesystem (ACFS) There is a serious vulnerability for Oracle RAC databases noted in the Oracle 11g Release 2 RAC documentation. This note indicates a scenario where it's possible for an entire RAC cluster to fail. This exposure is only for RAC databases that are using Automatic Storage Management (ASM). When using RAC, Oracle has announced that the key clusterware files, the OCR and Votedisks can now be stored in Oracle Automated Storage Management (ASM). However, research by expert DBA's indicate that it may well be premature to use this feature. According to Oracle's documentation, if a single node is lost, then the entire cluster may go down if that node happens to be the master node. The entire cluster only fails if the Oracle ASM instance on the OCR master node fails. If the majority of the OCR locations are in Oracle ASM and if there is an OCR read or write access, then the crsd stops and the node becomes inoperative. In order to identify the OCR master node, search the crsd.log file for the line -- "I AM THE NEW OCR MASTER" -- with the most recent time stamp. Oracle has announced that new installations of 11g Release 2 (as opposed to upgrades) will not allow the installation of the OCR and Votedisks on RAW. So the best solution at this time is to install these files on a shared, non-ASM file system such as OCFS2. Clusterware upgraded to 11g Release 2 may still be on RAW.

Monday, July 25, 2011

OUR FIRST BUG PATCH (11R2)

Well, it was bound to happen “sooner” than “later”; we hit our fist bug with a newly installed 11.2.0.2 instance. She is installed on 64bit Linux. This one is a sqlplus issue.
The bug report from Oracle is as follows:

Bug 10269193 - Wrong results with outer join and CASE expression optimization [ID 10269193.8]

Modified 27-MAY-2011 Type PATCH Status PUBLISHED

Bug 10269193 Wrong results with outer join and CASE expression optimization

This note gives a brief overview of bug 10269193.
The content was last updated on: 27-MAY-2011

Affects:
Product (Component) Oracle Server (Rdbms)
Range of versions believed to be affected Versions BELOW 12.1
Versions confirmed as being affected 11.2.0.2

Platforms affected Generic (all / most platforms affected)


Wrong results are possible with outer join and case expression optimization containing a ROWID column.

Rediscovery Notes:
1. Wrong Results OR an ORA-600 in Parallel Query
2. Outer Join
3. CASE Expression
4. ROWID column is involved in CASE Expression

This bug is possible even when ROWID column or CASE expression is not explicitly present in the query, because
* A ROWID column can be added during query transformation
(eg. non-native full outer join)
* CASE and ROWID column can be added during view merge

A 10053 trace maybe needed to identify it.

Here is an example of what we saw:

If you make a query that (1) doesn’t select a case statement (2) from a left join with no matches, then the result is correct - no matches from the right table.
If you make a query that (1) selects a case statement (2) from a left join with no matches, then the result behaves as if there were actually matches in the right table.

On other, more reasonable databases:
If you write the same query (left join to a table with no matches), then you get the correct result regardless of whether or not there was a case statement in the select.

SELECT
CASE WHEN 1=1 THEN 'comment this out' END case_statement,
VAL_A should_be_A,
VAL_B should_be_null
FROM
(SELECT 'A' VAL_A from dual),
(SELECT 'B' VAL_B from dual)
WHERE
VAL_A = VAL_B(+);

SELECT
--CASE WHEN 1=1 THEN 'comment this out' END case_statement,
VAL_A should_be_A,
VAL_B should_be_null
FROM
(SELECT 'A' VAL_A from dual),
(SELECT 'B' VAL_B from dual)
WHERE
VAL_A = VAL_B(+);

The corrective patch set we applied was:
p10269193_112020_Linux-x86-64.zip

*** Since this was posted we have found that there is a workaround for this as well.
It appears that if you substitute a regular table where you have dual, it works correctly.
Thx

Wednesday, June 08, 2011

OUCH: Fixing Invalid Objects

One of our DBA’s hit an interrupt today when trying to recompile invalid object on one of the instances we support.

He said, “Please be careful when using the database upgrade assistant. After I ran:
dbua -silent -dbname $ORACLE_SID -oracleHome $ORACLE_HOME -sysDBAUserName SYS -sysDBAPassword $PASS -recompile_invalid_objects true

It put the database into RESTRICTED and UPGRADE modes, disconnecting all sessions, unfortunately. After I took the db out of restricted mode it still stayed in UPGRADE mode; the only remedy seem to be to bounce the database.” Which we did and everything went back to “normal” (FYI, “normal’ is just a setting on your clothes dryer.) and all production jobs were restarted.

Thx

Thursday, March 24, 2011

Oracle Stops All Software Development For Intel Itanium Microprocessor

REDWOOD SHORES, Calif., March 22, 2011

After multiple conversations with Intel senior management Oracle has decided to discontinue all software development on the Intel Itanium microprocessor. Intel management made it clear that their strategic focus is on their x86 microprocessor and that Itanium was nearing the end of its life.

Both Microsoft and RedHat have already stopped developing software for Itanium. HP CEO Leo Apotheker made no mention of Itanium in his long and detailed presentation on the future strategic direction of HP.

Oracle will continue to provide customers with support for existing versions of Oracle software products that already run on Itanium.

The following url is the respone from HP.

http://www.hp.com/hpinfo/newsroom/press/2011/110323c.html?mtxs=rss-corp-news