Author Archives: alesk

A said day for Oracle community

Recent blog tagging “affair” within Oracle community, that started a week (or two ago) looked like an “innocent” fun for some part of Oracle blog community, caused not only a havoc in news aggregators (most notably OraNA, but also ended in Howard J. Rogers decision, to remove all the content from his site. Howard has been my favorite Oracle blogger for a long time, his excellent articles were a great contribution to community and will be missed as much as his writing style of his blogs. I’m totally on Howard side. I admit that I do not use any of the Oracle news aggregator sites, so in this case I’m only affected indirectly, nevertheless I understand the problem and agree with HJR standings expressed on comp.databases.oracle.server. I’m strongly against any chain-letter activity, pyramid systems and similar stupidity coming either from third parties or from inside community.
I hope this madness surrounding blog tagging will soon end and that (hopefully) HJR will reconsider his (legitimate) decision and open the site for the public.

Using cooked files with ASM on Windows

Today I needed to setup a small test Oracle database on Windows with Oracle ASM storage. Because I didn’t have unused disk partitions that I could spare for Oracle ASM, I decided to use cooked files instead.


Note: Using cooked files instead of raw disks is unsupported by Oracle and should not be used on development and production systems! I needed a quick (and dirty) way to do some testing with ASM, I would never use cooked files in development and/or production.


You’ll need dd port for Windows for creating fake ASM disk files. I used dd version 0.5. For a complete explanation of the procedure refer to Metalink Note:602620.1 “ASM Using OS Files Instead of Real Raw Devices On Windows”.

SET ORACLE_SID=+ASM
sql> connect / as sysdba
--
-- Turn on cooked files support in addition to raw disks
--
sql> alter system set "_asm_allow_only_raw_disks"=false scope=spfile;
--
-- Let's see what I have on the system
--
sql> select path from v$asm_disk; 

no rows selected
--
-- I'll store asm cooked files in C:\ORADATA\ASMDATA so I need to
-- add appropriate disk string for ASM instance to recognize those files
-- as "disk" candidates.
--
sql> alter system set asm_diskstring='C:\ORADATA\ASMDATA\*' scope=both;
--
-- At this point restart the ASM instance for parameters to take effect...
--
--
-- Let's create a couple of disks, I chose 4 x 500MB files...
--
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk01 bs=1k count=500000 
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk02 bs=1k count=500000
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk03 bs=1k count=500000
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk04 bs=1k count=500000
--
-- Let's check if I see those "disks"...
--
SQL> select path from v$asm_disk;

PATH
-------------------------------------
C:\ORADATA\ASMDATA\ASMDISK01
C:\ORADATA\ASMDATA\ASMDISK04
C:\ORADATA\ASMDATA\ASMDISK03
C:\ORADATA\ASMDATA\ASMDISK02
---
--- Now we can create diskgroup with fake ASM disks...
---
SQL> create diskgroup DGROUP1 external redundancy disk
  2  'C:\ORADATA\ASMDATA\ASMDISK01',
  3  'C:\ORADATA\ASMDATA\ASMDISK02',
  4  'C:\ORADATA\ASMDATA\ASMDISK03',
  5  'C:\ORADATA\ASMDATA\ASMDISK04';

Diskgroup created.
--
-- And final check...
--
SQL> select group_number, name, total_mb, state, 
     database_compatibility from v$asm_diskgroup;

GROUP_NUMBER NAME              TOTAL_MB STATE       DATABASE_COMPAT
------------ --------------- ---------- ----------- ---------------
           1 DGROUP1               1952 MOUNTED     10.1.0.0.0

HugePages (Linux) and Large Pages (Windows) references

With the arrival of “cheap” Intel/AMD based servers with 64-bit CPU’s and large amount of memory, I think the DBA managing Oracle on Linux/Windows has to be aware of kernel features that allows better handling of otherwise, vast amount of standard memory pages (4k on Linux and Windows). Lately I was doing some research of the available articles on Metalink about Linux and Windows approaches to handle larger than default (4k) memory pages.

While finding documentation about HugePages feature on Linux was easy, the lack of the same information for Windows equivalent, Large Pages mechanism, was somehow a frustrating experience – I hope Oracle will refresh some of the existing notes that covers NT architecture with the information about Large Pages. The concept behind the HugePages & Large Page are very similar, but as we know, usually the devil is hiding in the details.

Below are references that I used during my research.

Linux – HugePages


Metalink Notes:

  • Note:361323.1 “HugePages on Linux: What It Is… and What It Is Not…”
  • Note:361468.1 “HugePages on 64-bit Linux”
  • Note:401749.1 “Shell Script to Calculate Values Recommended HugePages / HugeTLB Configuration”
  • Bigpages Linux kernel feature was replaced by HugePages in 2.6 backported to 2.4), for those of you who are “stuck” on older kernel version (such as RHAS 2.1), two Metalink notes:

    • Note:275318.1 “The Bigpages Feature on Linux”
    • Note:261889.1 “Bigpages vs. Hugetlb on RedHat Linux”

    Other references:

    Windows Server 2003 (x86, EMT64)


    Oracle introduced support for Large Pages in Windows 2003 (SP1) in Oracle 10g R1.

    I would expect to find the necessary information in the following two Metalink notes:

    • Note:46001.1 “Oracle Database and the Windows NT memory architecture, Technical Bulletin”
    • Note:46053.1 “Windows NT Memory Architecture Overview”

    …unfortunately not.

    The Chapter 7, Tuning Windows to Optimize Oracle Database in Oracle Database Platform Guide 10g Release 2 (10.2) for Microsoft Windows (x64) is much more helpful. This is all you need to setup Oracle 10g/11g to use Large Pages on Windows 2003.

    Microsoft official documentation:

    Other sources:

    My personal side notes about “Large Pages” on Windows 2003:

    • Which Windows versions has support for Large Pages? I’m not 100% sure I know the answer. According to Wikipedia the Large Pages support is available on Windows 2003 SP1, but not on Windows XP/Vista. I don’t think this is entirely correct, since Windows XP is mentioned in Windows Internals book on page 383 (see reference above)
    • don’t use Oracle LOCK_SGA in conjunction with Large Page, instead refer to PRE_PAGE_SGA parameter, if you wish to pre-allocate large pages in memory at instance startup
    • user account under which process that wants to use Large Pages is running, needs “Lock Pages in Memory” system privilege. Oracle process by default runs under System account which already has this privilege…[this is false, by default no user account has this privilege, hence adding “System” account (or dedicated user account, if used!) is mandatory]
    • not running Oracle service under dedicated user (such as local user oracle) means that service will run under account SYSTEM. If we authorize SYSTEM account to use “Lock Pages in Memory” privilege, we’re giving this privilege to several other services. This brings some security/stability concerns to the table. Shouldn’t we mandatory run Oracle service under some user account, rather than SYSTEM, if we’re going to use Large Pages?
    • memory pages allocated via Large Page are pinned in memory and doesn’t swap to the pagefile, make sure you’re not allocating too much memory (for example, over allocating SGA) and thus taking away the memory from the regular VM space that is needed for client sessions (Oracle shadow “processes”)
    • each Large Page must consist of contiguous memory, so for example if the size of the page is extremely large it can happen that due to the memory fragmentation, the process can not allocate all requested large pages (the potential for the problem rise with the number of different running processes and the frequency of starting/stopping the process that is using Large Pages)
    • once allocated, the memory pinned as Large Page is not released until the process stops
    • Windows settings that control Large Page behavior are stored under registry key:
      HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory
    • according to “Windows Internals” book, the default large page sizes depends on architecture used:
      x86 = 4MB (2MB if PAE is enabled)
      x64 = 2MB
      IA64 = 16MB

Which free software do I use?

To continue in the spirit of my last blog entry, I thought it might be interesting to share with you the list of my favorite free software that I’m using. I’m using some of the listed tools on a daily basis (some of them even right now, while writing this blog entry!), others less often but when I need them, they’re nevertheless essential for me. I would also like to emphasize on word free – I don’t want to exclude free, but at the same time closed source software from the list. I’m not OSS purist, I’m well aware of the legal as well as business constraints in some cases, due to which, original authors decided to give us free software without giving away source code. When I’m looking for a tool, I always prefer an open source program over a closed source one. Only when I can’t find good open source application (usually under GPL license) I settle for closed one.

So, here is the List of my favorite free software. It’s not a final compilation of my free software tools by any means – rather than trying to write it down in one hop, I’ll add categories and items as time goes by.

Last but not least, a fair warning:

  • I’m not the person to contact if you have question about particular tool,
  • don’t expect from me to help you install particular tool or give you an advice on how to use it,
  • if you think you know a better tool for the particular task, you can let me know and if I found it good, I’ll include the item on the list with appropriate credit.

A decade that belongs to OSS

I just read an interesting Interview with Eric S. Raymond in January 2008 issue of Linux Journal. I liked his view on the reasons for Microsoft (obvious) fiasco with Vista (imho, we could say the same for MS Office 2007 as well), a quote from the interview:


‘Here’s an example of the sort of thing I mean: the Vista flop. Completely predictable, didn’t surprise me for a nanosecond, and not because I think Microsoft is staffed by incompetents either. It’s not; it hires some of the brightest programmers in the world. But, as I’ve been explaining for ten years, there’s a scale regime above which closed-source development is unsustainable as the ratio between productive work and complexity-management overhead rises. Microsoft was bound to reach it; the only question was when.


and later on, he continues:


The only thing I’m sure of is that Microsoft’s days of being able to ship competitive software from closed source are numbered, let alone its days of maintaining monopoly lock-in. The Vista stall-out, and the scaling phenomena beneath it, guarantee that.


How true! I remember a vivid debate, a couple of years ago, with my friend in the local pub (yes, usual geek talk after a couple of beers;-). He argued against my opinion that this decade will not be remembered by Bill Gates, Larry Ellison, Steve Jobs and the likes – I firmly believe that this decade will be remembered by free Open Source Software and the foundation that is based on OSS – just think about it; I’m sure Google could not succeed without OSS — can you imagine using something like MSN with Microsoft Passport, instead of Google? Or some locked-in service from Apple, hidden behind the pretty (userinter)face and accessible from (Apple only) approved gadget? I don’t think so.

On one side we have proprietary silos from major software players with Microsoft standing on the top of the hill, others are trying to climb over each other to the top of this hill as well, lurking us to abandon Microsoft silos and move to their proprietary realm. Don’t get me wrong, I’m not against a fairly priced software at all – as long as it doesn’t lock my data in any proprietary format and/or as long I have a choice to pick a (better) product from a competitor – I’m happy as long as I have a choice and a fair price!

In my opinion this decade will be remembered the most by alternatives that Open Source software movement brought to the table.

I’ll remember 80’s as the period of micro computers (Commodore, ZX Spectrum , Atari, Amiga…) that changed the way we work (and play:). Cheap micro computers allowed masses to get in touch with computing for the first time. The next rising celebrity of 80’s was a “dull” PC.

I’ll remember 90’s as the period, when we all helped to build Bill’s Kingdom. We were all busy building our local area networks and connecting the local area networks to the Net – a holy grail of computing, so far. Back then, the growth of the Net surprised most, if not all big IT players, including such “luminaries” as Bill & Steve. On the other hand, it was the growth of the Net, that allowed truly global, community based software development, something unthinkable a decade before. Still, in the 90’s most of the old-style, closed source companies were in a denial phase — in a line: “…no way OSS can compete with our pricey shinny products, … , and what about the “enteprise level” support, bla, bla, bla….“. What a mistake?

I’ll remember 00’s (did I write this correctly?;-) as the decade when we get back some control of the software that we’ll use. We got back a choice. I’m not using OSS (and free non-OSS software as well) because it’s free, I’m using it, when it’s better than proprietary one! Being free is only a minor bonus.