2 Oracle Database on Windows: Best Practices and Future Directions Alex KehPrincipal Product Manager, Server Technologies, Oracle
3 Agenda Oracle Database 11g: New Features Supported Operating Systems Database ArchitectureBest Practices for Windows (32-bit and 64-bit)DiagnosabilityOptimize CPU usageOptimize NetworkOptimize File I/OBest Practices for 32-bit WindowsBest Practices for 64-bit Windows
4 <Insert Picture Here> Oracle Database 11g: New Features
5 Best Price/Performance on Windows #1 TPC-C Price/Performance amongst all platformsOracle Database 11g on Windows…And Oracle has the #1 TPC-C Performance alsoTPC-C by Price/Performance g SQL 2005Highest Ranking Benchmark 1st 3rdPrice/tpmC $ $0.84tpmC , ,774Publication Date /12/ /27/07As of 11/29/07: HP ProLiant ML350G5, 102,454 tpmC, $.73/tpmC available 12/31/07. HP Integrity Superdome Server, 4,092,799 tpmC, $2.93 tpmC, available 8/6/07(#1 TPC-C performance). Source: Transaction Processing Performance Council (TPC)
6 Active Directory and Windows Security Database Registration and Name ResolutionSupport authenticated connection to Active Directory using OS authenticationKerberos AuthenticationStronger encryption algorithms (DES3, AES, RC4)Support default encryption type supported by MS KDCUse DNS Domain Name as Kerberos REALM name by defaultKerberos authentication to Oracle database in a MS cross-domain setupRemoval of 30 character limit on the Kerberos user name
7 Oracle VSS WriterOracle Volume Shadow Copy Service (VSS) writer is transparently integrated with Windows VSSOracle writer installed automatically with Oracle DBAutomatic online point-in-time copy of Oracle database using VSS requestorSimple backup and recovery procedureOffload backup and reporting to another server using transportable snapshotsIntegrated with Recovery Manager (RMAN) and Flash Recovery areaIntelligent post restore operations on restored filesE.g. file recovery, instance startup in mount/nomount mode after creating necessary directoriesAutomatic deletion of archive logs that are shadow copied by VSS framework
8 Direct NFS Client on Windows Network Attached Storage (NAS) use Network File System (NFS)Oracle Database 11g allow direct Windows NFS v3 accessPart of DB kernel in Oracle Disk Manager libraryCommon Oracle NFS interface for potentially all host platforms and NFS serversTailored for the specific I/O patterns that Oracle usesBypasses a lot of software layers in OSSpecially useful for Windows as Kernel NFS is not natively supported on WindowsBenefits: faster performance, easier manageability, simplified tuning, and better diagnostics
9 Direct NFSLinear scalability of direct NFS can be achieved with inexpensive NICsDoes not require expensive switches which support link aggregation…Oracle does load balancing rather relying on a switchParallel network paths – More NICs – more bandwidthDirect NFS is a good solution from low to high end database servers
10 Grid Control for Microsoft Servers Systematic way to extend system coverage Key Benefit: Centralize ManagementEnable GC to monitor and manage new componentsWindows Host ManagementMOM ConnectorMicrosoft plug-ins:ExchangeSQL ServerActive Directory.NET FrameworkIIS
11 GC for Microsoft Exchange Server New with Grid ControlAutomatically included with Management AgentNo download from OTNDiscoveryOrganization, Routing Groups, Exchange ServersMonitoringInbound/Outbound MTA/SMTP/Information Store connectionsMessage trafficInbound/outbound queuesResource usage
12 GC for Microsoft Exchange Server ReportingOut of the boxConfiguration DataExchange LinkExchange ConnectorExchange Cluster ResourceActive Directory
14 Management Connector for Microsoft Operations Manager (MOM) Enables selective forwarding of MOM alerts to Enterprise ManagerAutomatic and manual alert forwarding (using Event Rules and Resolution State)Enterprise Manager is automatically updated when changes in MOM occurFlexible modeling options inside Enterprise ManagerGeneric MOM Managed Host targetMap MOM computers to individual targets in EMAssociate MOM alerts with existing EM targets
15 <Insert Picture Here> Windows Operating Systems Supported
16 Windows 32-bit Platform Support Operating System9i R210g R110g R211gWindows 2000YesWindows XP ProfessionalWindows Server 2003Windows VistaNoWindows Server 2008PlannedPlanned – Latest DB patchset available at the time
17 Windows 64-bit Platform Support Operating System9i R210g R110g R211gWindows Server 2003 for ItaniumYesTBDWindows XP & Windows Server 2003, x64 EditionsNoWindows Vista for x64 systemsPlannedWindows Server 2008 for x64 SystemsWindows Server 2008 for ItaniumTBD – To be determined. Will be announced later.
18 <Insert Picture Here> Oracle Database on Windows Architecture
19 Architecture: Thread Model Oracle process3GBor8TBtotalCodeSGASGA containsDB buffers,log buffersshared pool,other memoryallocationsEach threadconsists ofPGA, stack,Background and foreground threadsOracle on Windows runs as a single process. As depicted in the slide above, all memoryFor the Oracle RDBMS on Windows comes out of that single process address space.This memory includes: Process overhead (code for oracle.exe)The SGA for the instanceAll user threadsAll user PGA memoryThe process address space on 32-Bit Windows is 4GB. However, Microsoft reserves2GB for OS kernel memory, leaving a default of 2GB for a user process (eg ‘oracle.exe’).The /3GB boot switch can be added to the boot.ini to change that dynamic and allowA user process to address 3GB of memory (by restricting the OS/kernel to only 1GB of memory).The slide above depicts a 3GB memory limit, assuming that the /3GB switch is in place.This 3GB limit can be a sever limitation on the Oracle RDBMS, and setting this switch canHave consequences on the OS side as well (see Note# ).On 64-Bit platforms, the addressable memory limit per process jumps to 8TB, effectively removingThis memory obstacle on Windows platforms.
20 Database Architecture Thread modelNot a straight port of Oracle’s process architecture3GB (32-bit) or 8TB (64-bit) maximum memory per database instanceVLM support allows more than 3GB on 32-bitRuns as a Windows service processNo limits on memory, connections, resources except those imposed by the operating system
21 Oracle Enhancements for Windows Server 2003 Large Page supportFor instances with large memory requirements, large page support can improve performanceSet Registry parameter ORA_LPENABLE to 132-bit – 4KB default – 2MBItanium – 8KB default – 16MBx64 – 8KB default – 2MBNUMA support for memory/schedulingDatabase intelligently allocates memory and schedules threads based on node configurationBest Practice: For NUMA on AMD patch to a minimum P5
22 <Insert Picture Here> Best Practices for 32-bit and 64-bit Windows
23 11g Client Diagnosability Integrated with ADROCI and Net tracing and logging uses ADR by defaultMultithreaded client-side diagnosability context supportFirst Failure CaptureClient and Server trace file correlationReduce one-off diagnostic patchesStructure Dump Facility
24 Client Characteristics V$SESSION_CONNECT_INFO/GV$_SESSION_CONNECT_INFCLIENT_CHARSET (NLS character set)CLIENT_CONNECTION (Homogeneous/heterogeneous)CLIENT_OCI_LIBRARY (Home-based, Instant Client Full/Light)CLIENT_VERSION (client RSF version)CLIENT_DRIVER (OCI/JDBC/other)OCI_ATTR_DRIVER_NAME to set third party driverDBAs can look at data dictionary to find out what clients are connecting and what they are using
25 CPU Tuning Oracle uses all processors available through the OS ORACLE_AFFINITY Registry value can be set to tell Oracle which threads to run on which processors (same setting for all instances)Use Database Resource Manager to set CPU usage for different classes of usersFor example, one can configure the DB to use 50% CPU for gold customers, 30% for silver, and 20% for restThread priorities can be set in the Registry using the ORACLE_PRIORITY variable
26 CPU Tuning – Diagnosing High CPU Process Explorer: drill down to threadsGet thread ID of high CPU thread and then do querySELECT a.spid, b.username FROM v$process a, v$session b WHERE a.addr= b.paddr AND a.spid = <thread number>
27 Networking Best Practices Use one listener per systemThe default queue-size for Windows Server is 50 – increase using QUEUESIZE parameter in LISTENER.ORA – prevents errors during login stormsListener Logon Storm HandlerConfigurable on server side in LISTENER.ORA (RATE_LIMIT = <max conn/sec>)Use only if you have logon storm issuesCheck Listener log file: if the number of requests per second exceeds the queue-size values, increasing the queue-size recommended.
28 Networking Best Practices Increase SDU_SIZE in SQLNET.ORA or TNSNAMES.ORAControls SQL*Net packet sizeDefault SDU_SIZE in 11g is now 8KFor bulk data transfer scenarios, increase SDU_SIZE in sqlnet.ora or tnsnames.oraSize can be increased up to 32KAny mix of 11g and 10g clients and servers will set SDU_SIZE to lower of the two peers (pre-11g default is 2K)For 10g, increase SDU_SIZE to 8K or higherCommon misperception: Should not be set to match MTU!Check Listener log file: if the number of requests per second exceeds the queue-size values, increasing the queue-size recommended.
29 Networking Best Practices: Shared Server vs. Dedicated Server Dedicated server gives very best performanceEach client connection has it’s own threadMemory usage is 2-4 MB per server threadOracle uses dedicated server for OLTP benchmarksCan hit scalability limits due to memory useShared server saves a lot of memory!Idle connections will not consume much memoryLatency because dispatcher hands request to shared serverGood for large number of connections with many idle
30 Networking Best Practices: Shared Server vs. Dedicated Server RecommendationUse dedicated server if you have enough physical memoryOtherwise, use shared for all sessions that may be idle for some timeContinue to use dedicated server for a small number of high performance connections/queries
31 Networking Best Practices: Using Shared Server Client connections share pre-spawned server threadsNo dedicated idle threads wasting resourcesEnable Shared Server on client in tnsnames.ora:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))(CONNECT_DATA= (SERVICE_NAME=sales.us.acme.com)(SERVER=shared) ))Modify init.ora parameters on server to enable shared serversRough guidelines: 20 or 30 Shared Servers per 500 sessions, then tune from thereUse 1 dispatcher for every sessionsSee Net Admin Guide for more details
32 Networking Best Practices: Database Resident Connection Pool Pools Oracle Dedicated ServersShares server side connection pool across mid tier systems and processesCo-exists in all server configurationsDedicated Servers, Shared Servers, RACMost useful when you have many thousands of client processes connecting to a database server and each process needs to hold on to the database server session for a short timeIn test environment, we were able to support more than 10,000 connections to a 2 GB Database ServerPooling is optionally enabled by DBA on ServerClient connect string also needs to have (SERVER=POOLED)
33 Networking Best Practices: Connection Timeouts Client Side connection timeouts: Achieve fast failover when you have multiple addresses in connect stringTCP.CONNECT_TIMEOUT – 11g feature - it can be a few seconds – Not set by defaultSQLNET.OUTBOUND_CONNECT_TIMEOUT – 10gR2 and later – Not set by defaultThese two timeouts can be used individually or at the same timeServer Side connection timeouts:SQLNET.INBOUND_CONNECT_TIMEOUT – 10gR1 and later - default 60 secs for 10gR2 and 11g, not enabled by default for 10gR1Can also be used along with the client side timeouts aboveCheck Listener log file: if the number of requests per second exceeds the queue-size values, increasing the queue-size recommended.
34 Networking Best Practices SQLNET.AUTHENTICATION_SERVICES=(NTS)This is a default value in SQLNET.ORA, needed for OS authentication (connect / as SYSDBA)It should be left at default on server sideUse SecureFile LOBsNET stack optimizations provide very high throughput limited only by the underlying hardwareCheck Listener log file: if the number of requests per second exceeds the queue-size values, increasing the queue-size recommended.
35 File System Best Practices Use ASM – whether single-instance or RAC – use or higherBenefitsDon’t need to move datafiles aroundDon’t need to take tablespaces offlineAdd disks with no downtimeCheck Listener log file: if the number of requests per second exceeds the queue-size values, increasing the queue-size recommended.
36 Memory Best Practices11g: Use MEMORY_TARGET for automatic management of combined SGA and PGA10g and earlier:Control SGA Memory by using SGA_TARGET parameterControl PGA Memory by using PGA_AGGREGATE_TARGET parameter
37 <Insert Picture Here> Best Practices for 32-bit Windows
38 32-bit Memory Best Practices Increase addressable memory available to the Oracle process by adding /3GB switch to boot.ini file:multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /fastdetect /3GBReboot server to enableMust monitor kernel memory closely to prevent instability of operating systemSee Metalink Notes andSee Microsoft KB article
39 Monitoring Memory Key Items to Monitor for Memory Usage: Perfmon - Virtual Bytes for oracle.exe to see total memory used by the processTotal Pool Non-Paged Bytes – Memory CounterIf grows close to 128MB, operating system instability will occurIf this grows too high, look for memory leaksFree System Page Table Entries (PTE’s) – Memory CounterShould never fall below 7500 or so/USERVA=2560 switch in boot.ini will help prevent this
40 Using ORASTACKEach thread within Oracle process is provided 1 MB reserved stack spaceReduce to 500 KB without consequence on most systems:C:\ orastack tnslsnr.exeC:\ orastack oracle.exeBe sure to run on BOTH tnslsnr.exe and oracle.exeStop processes before running OrastackIf you apply a patch, you must re-run OrastackMake sure to test your system to be sure 500 KB is OKSee Metalink Note for more information
41 32-bit: VLM Support Rest of Windows Server 2003 RAM SGACodeRestofRAMFor O/S, other apps3GBWindows Server 2003Memory Limits (32-bit)Standard Edition:4GBEnterprise Edition:32GBDatacenter Edition:64GBdatabase threads/memoryIn 32-Bit Windows, even though a single process can only address up to 4GB of RAM, it is still possible to haveMuch more RAM than that on a single machine. The slide above depicts the total memory supported by different flavorsOf the Windows 2003 operating system. On machines that have more than 4GB of RAM, this memory can still beTaken advantage of by multiple processes, as each process has its own separate address space. This means thatIf you have two different Oracle instances, each will have its own ‘oracle.exe’, and each oracle.exe will be able toSeparately address its own 3GB of user address space.Aside from this, it is also possible for a single process (single oracle.exe) to address memory beyond its 4GBLimit by taking advantage of VLM (Very Large Memory) support on Windows. This is also known asAddress Windowing Extensions, or AWE.
42 32-bit: VLM Support Extended memory available for DB buffers via AWE callsMemory from AWE callsused for DB buffers only.The amount of AWEmemory allocatedequals db_block_sizetimes db_block_buffers.RestofRAMFor O/S, other appsWindow on DBbuffers in AWE memOracle operating system process. Normally limited to 3GB of address space. With VLM, Oracle can get up to 12GB of database buffers.3GBOracle takes advantage of Address Windowing Extensions by allowing the database block buffers toBe accessed indirectly through a window in the 3GB address space. The size of this window in the 3GB addressSpace is defined by the Oracle Registry value: AWE_WINDOW_MEMORY, which defaults to 1GB.Through this window, the rest of the buffer cache, which can be up to 64GB, can be mapped from the extended area of memory.Note# discusses the implementation of VLM/AWE on Windows in more detail.SGA minus DB buffersCode
43 Implementing AWEUse AWE with Oracle by adding initialization parameter USE_INDIRECT_DATA_BUFFERSUse DB_BLOCK_BUFFERS instead of DB_CACHE_SIZEWith AWE, database buffer cache can be increased up to roughly 12 GBDefault value for AWE_WINDOW_MEMORY is 1 GBSee Metalink Note for more information
44 Best Practices for 32-Bit Memory Use Automatic Workload Repository (AWR) to monitor cache hit ratios and shared_pool stats, etc. Make sure that values are not too highWhen implementing AWE be aware that using AWE disables Automatic Memory Management features (SGA_TARGET cannot be used when USE_INDIRECT_DATA_BUFFERS is set).
45 <Insert Picture Here> Best Practices for 64-bit Windows
46 64-bit Best PracticesUse SP 2 for Windows Server 2003 to avoid Windows performance bugRun correct 64-bit version of Oracle for the architecturei.e. 64-bit Oracle for AMD64/EM64T or 64-bit Oracle for Itanium32-Bit Oracle DB not supported on 64-bit platforms32-bit client is supported on Windows x64Enable Large Pages
47 Oracle on Windows Customers ““““““We've tested a 23-node [Oracle] RAC cluster in a Windows environment without any issues.With Oracle we were able to provide best-in-class performance while deploying a system that has increased our capabilities significantlyOracle has a more scalable and reliable database product... As a result, we've achieved high-end clustering capabilities for a relatively low cost”“Thanks to Oracle Enterprise Manager Grid Control, one person is able to manage all of the databases in all of the data centers.`”””Daniel Beuoy, Director of DB TechnologyRuss Donnan, CIOPete Goutmann, Vice President, TechnologyRuss Donnan, CIO
48 More Information Windows Server Center Windows and .NET Blog Windows and .NET BlogFor more questions
49 The preceding is intended to outline our general product direction The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remain at the sole discretion of Oracle.