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 &c.
Only applies to
512k – 1mb – Try 700k as a start.
Potentially best improvement
< 700k => 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).
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).
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 />
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 />Freefoto.com<br />Credits<br /><ul><li>www.sysinternals.com