Running Oracle Effectively <br />
On Windows<br />
1993<br />
Oracle 7.0<br />
1995<br />
You are not alone<br />
Managing Resources<br />
v$process<br />X$KSUPR <br />
Thread vs Process structures<br /><br />procexp<br />vmmap<br />procdump<br />
Drilling into a Problem from the O/S<br />
Downsides<br />
Threads vs Processes<br />
createThreadsyscall<br />Allocates 1mb stack space. <br />
Potential Workarounds<br />
/userva<br />
/PAE<br />
BUFFER CACHE only<br />
orastack<br />
createThread(...,stacksize)<br />
Produces non standard .exe <br />
Unpredictable failure mode<br />
ORA-03113<br />
Note 46001.1<br />
64bit Windows<br />
But What About<br />
Device Driver<br />
Maturity<br />
OK Then<br />Mixed 32/64bit not allowed<br />No 32bit MDAC <br />No 32bit AV<br />
OK Then<br />The 64-bit shell cannot load 32-bit Inproc shell extensions<br />
OK Then<br />I.E cannot use 32bit activeX ! <br />
NTFS<br />
Never The Same<br />
sectors<br />
clusters<br />
Cluster size<br />
db_block_size<br />
Data Compression<br />
Summary<br />Use 64bit Windows<br />Concurrency primarily limited by thread architecture<br />You are not alone. <br />I/O...
Public Domain or royalty free images Thanks to:  <br />Wikipedia<br />AletheaKontis<br />Mrbill<br />Office of the Preside...
Upcoming SlideShare
Loading in …5

Oracle on windows


Published on

Presentation given to UKOUG User Group

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Hi and thanks for coming, finding your way into the bowels of Hall 9. I’m Niall Litchfield and the bio slide that isn’t here would tell you that I work as an Oracle Consultant for a company called Maxima – that means you can hire me – and that I am a member of the OakTable Network – that means you can find me upstairs or online and chat to me about Oracle related stuff. Today we’re going to be talking about running Oracle Effectively...
  • Er, oh dear what happened there.
  • Yep, running Oracle Effectively on the Windows platform. You might well be wondering what anyone is doing running the Oracle database on the Microsoft Windows platform. After all everyone knows that “blue screen” we just saw. That can’t be a reliable platform for Mission Critical Databases now can it. What we need is something like this.
  • After all, surely all serious databases run on some proprietary variety of UNIX , or else on Linux platform. All serious DBAs are only happy with a screen that looks like this.
  • On a computer that looks like this.
  • . When it comes to database environments, surely the Windows environment is just a sideshow.
  • Well before we get stuck in let me take you back to 1993. A time of some uncertainty
  • People were wondering whether Steve Jobs would ever manage to sell software – since he had clearly failed at hardware, first at Apple and then at Next..
  • Islamic terrorists were trying to blow up the World Trade Centre in New York.
  • But it was also a time of new beginnings. A smooth talking liberal president had just been elected in the US, promising much.
  • Czechoslovakia bloodlessly became 2 independent states.
  • And Oracle 7.0 out a year or so got a brand new platform . Put simply, Oracle was the first relational database available on the Windows platform with Release 7 in 1993.
  • You had to wait till 95 to get
  • A Database coded by Microsoft on Microsofts flagship o/s.
  • Since then Oracle has released the first 64bit DBMS on Windows, the first with support for .Net stored procedures, a complete Oracle environment integrated into the Visual Studio IDE and I’m sure a gazillion other things on Oracle’s marketing slide.
  • Because of all this it may also surprise you to know how well Oracle competes on windows with SQL Server. Industry Figures are hard to get Actually they are easy to get by paying IDC $3.5k) but I am able to give you relative sales figures for SQL server and Oracle (on windows) from a couple of years ago now. That’s a 3rd of Oracle’s database revenue for that year.
  • So if you are tasked with managing Oracle on Windows. Not only can it be done. It is being done, and being done in large numbers. This presentation isn’t really about how Windows is a core platform for Oracle though, its about how various decisions that Oracle and Microsoft have taken mean that resource management is a little different on Windows than on Unix alike platforms.
  • As well as showing that I’m an old man a little earlier, now we’re going to show that I can be somewhat simplistic. The focus of today is on managing server resources
  • As everyone with a cursory understanding of computer science is aware, there are four main resources that a computer operating system manages on behalf of the applications running on it. These are:The  CPUMemoryStorageThe  NetworkI’m only going to talk about the 3 in the diagram though – primarily for 2 reasons. I suck pretty bad at networks. And The implementation of tcp/ip is fairly standard on Windows.
  • In system troubleshooting, you will usually be concerned about the usage of one or more of these scarce resources. We’ll manage hopefully to get through the 3 resources. Most of our focus however will be on the implications for CPU and memory usage and optimisation, particularly of some core design choice that differentiates Oracle on Windows from Oracle on every other platform.
  • From within Oracle all looks much the same as on any other platform, on startup Oracle still allocates a process table per instance (controlled by the processes parameter) externalized as X$KSUPR. (Kernel Services User PRocess ).
  • On windows each process executes in its own private virtual address space including the allocation of minimum and maximum working set sizes; opens handles to system objects and files; is governed by a security context a priority class and environment variables (if you’ve ever wondered why you don’t need to set Oracle SID when calling SQLPLUS on a single homed machine this is why);, and at least one thread of execution.
  • A thread on the other hand is a much more lightweight object. (despite the diagram above). In particular thread creation and destruction is a relatively low cost operation.
  • Just dump using livekd... Warn that this *may* kill the server.
  • We will need a handy kitbag of available tools, at least partly because Microsoft historically have been poor at providing resource monitoring tools – though the underlying performance counter architecture is actually quite good.
  • We have a veritable treasure trove of os level tools. Task manager – simple, basic available everywhere, Performance and Availability Monitor – more advanced – Windows 2008/Vista/Window 7Tlist – Windows debugging tools (and in some versions of resource kit) – which process has oci.dll open!!! Performance Monitor – build your own counter collections.
  • We also have database level tools Sqldeveloper – demo the active sessions tool. Sql*plus .
  • Talk about each – still no good free thread level monitor. Intel have a thread monitor as part of a commercial application profiling product, though it may not work with Oracle.
  • DemoScripts on server Find_my_processGenerate_load
  • So threads are , relatively, lightweight, fast to create, and provide easy access to shared memory
  • As a direct result as you scale up the number of processes on 32bit windows your available working space for SGA and PGA gets smaller and smaller – typically somewhere around the 500 concurrent processes mark you’ll start hitting ORA-4030.
  • Userva – user virtual address space bcd option – may know it as the /3gb boot ini switch. Increases userland memory to up to 3gb .
  • The /3gb switch is not therefore useless, though it is obviously still limited. Rhetorical Question – server with 4gb or less ram.
  • Remember thisAlso done by O/S2 – Windows Mobile &amp;c.
  • Only applies to
  • 512k – 1mb – Try 700k as a start.
  • Potentially best improvement
  • &lt; 700k =&gt; not safe
  • 64 bit only
  • Ah, so you are direct attaching the web cam to your serverOr the printer.Or installing a consumer graphics card. Or building your own database server from components.
  • It’s been out ten years!
  • 2 top are the important ones
  • 2 top are the important ones
  • 2 top are the important ones
  • Physical disk sectors – usually but not always 512bytes
  • Spaceallocation unit size power of 2 of sectors
  • Chosen by volume size but usually 4k on windows boxes (medium sized business).
  • 8k.
  • Linux per old OTN Install Guide – Note time dominated by waits on log buffer space. – couldn’t determine test now – 7 years since I did it.
  • Direct IO missing from howto – especially important for redo log writes.
  • By contrast to the area of addressable memory, Windows-based systems have enjoyed an historic advantage over UNIX- and Linux-based systems in the area of disk I/O. Two particular facilities are of importance in designing a high-throughput system such as a database server: are asynchronous I/O and appropriate use of caching.
  • Comment on idea of compressed NTFS for test/dev boxes – yes there’s a performance penalty – though not as much as you might think and yes
  • Always 16 clusters
  • Compressed Reads into an os buffer where it is uncompressed for both application and filesystem cache (doesn’t matter for us).
  • Oracle on windows

    1. 1. Running Oracle Effectively <br />
    2. 2.
    3. 3. On Windows<br />
    4. 4.
    5. 5.
    6. 6.
    7. 7. 1993<br />
    8. 8.
    9. 9.
    10. 10.
    11. 11.
    12. 12. Oracle 7.0<br />
    13. 13. 1995<br />
    14. 14.
    15. 15.
    16. 16.
    17. 17. You are not alone<br />
    18. 18. Managing Resources<br />
    19. 19.
    20. 20.
    21. 21. v$process<br />X$KSUPR <br />
    23. 23.
    24. 24. Thread vs Process structures<br />
    25. 25.
    26. 26.
    27. 27.
    28. 28.<br />procexp<br />vmmap<br />procdump<br />
    29. 29. Drilling into a Problem from the O/S<br />
    30. 30. Downsides<br />
    31. 31.
    32. 32. Threads vs Processes<br />
    33. 33. createThreadsyscall<br />Allocates 1mb stack space. <br />
    34. 34.
    35. 35. Potential Workarounds<br />
    36. 36. /userva<br />
    37. 37.
    38. 38. /PAE<br />
    39. 39.
    40. 40.
    42. 42. BUFFER CACHE only<br />
    43. 43. orastack<br />
    44. 44. createThread(...,stacksize)<br />
    45. 45.
    46. 46. Produces non standard .exe <br />
    47. 47. Unpredictable failure mode<br />
    48. 48. ORA-03113<br />
    49. 49. Note 46001.1<br />
    50. 50. 64bit Windows<br />
    51. 51.
    52. 52. But What About<br />
    53. 53. Device Driver<br />
    54. 54. Maturity<br />
    55. 55. OK Then<br />Mixed 32/64bit not allowed<br />No 32bit MDAC <br />No 32bit AV<br />
    56. 56. OK Then<br />The 64-bit shell cannot load 32-bit Inproc shell extensions<br />
    57. 57. OK Then<br />I.E cannot use 32bit activeX ! <br />
    58. 58.
    59. 59. NTFS<br />
    60. 60. Never The Same<br />
    61. 61. sectors<br />
    62. 62. clusters<br />
    63. 63. Cluster size<br />
    64. 64. db_block_size<br />
    65. 65.
    66. 66.
    67. 67. FILESYSTEMIO_OPTIONS<br />
    68. 68. Data Compression<br />
    69. 69.
    70. 70.
    71. 71. Summary<br />Use 64bit Windows<br />Concurrency primarily limited by thread architecture<br />You are not alone. <br />I/O Far less trouble than Unix. <br />Think about filesystem cluster size. <br />
    72. 72. Public Domain or royalty free images Thanks to: <br />Wikipedia<br />AletheaKontis<br />Mrbill<br />Office of the President of the United States<br />Jeff Kubina<br />Mark.Sze<br /><br />Credits<br /><ul><li>
    73. 73.
    74. 74. Windows Internals 5th Edition</li></li></ul><li>Thank You<br /><br />@nlitchfield<br /><br />