Presentation - Oracle Net Services
Presentation - Oracle Net Services
Presentation - Oracle Net Services
Program
Overview of Oracle Net Why Optimize Oracle Net? 11g New Features Best Practices
Operating System and Network Database Client Net Listener Database Server
Primary Communication Foundation for DB Formerly known as SQL*Net Oracles Family of Networking Features:
Oracle Net Oracle Net Listener Connection Manager Configuration Tools Net Manager NetCA
System Performance
Increase Network bandwidth utilization Lower database CPU utilization
High Availability
Better respond to database/host/network failures
Network Scalability
Scale better with more client connections Load-balance to improve application experience
Network Manageability
Simplify deployment and configuration
Network Security
Protect and recover from Denial of Service attacks
sqlnet.ora
Main Oracle O Net configuration f file f On both Client and Server
listener.ora
Configuration C fi ti f for th the N Net t Li Listener t On Server only
tnsnames.ora
Contains Connect Name to Descriptor mappings Used by the TNSNames Naming adapter On both Client and Server
IPv6 (11.2.0.1)
Support for all features and components in single-instance mode Support for single listener address across all IP(v4/v6) interfaces
IPv4-only Server IPv4-only y Client Dual-stack Client IPv6-only IPv6 only Client Supported pp ( (v4) ) Supported (v4) Not Supported Dual-stack Server Supported pp ( (v4) ) Supported (v4,v6) Supported (v6) IPv6-only Server Not Supported pp Supported (v6) Supported (v6)
O Operating ti System S t
Tuning
Why is OS tuning critical? Key role in data transmission! Some default OS configurations cannot handle modern Ethernet speeds Bandwidth x Delay Product (BDP)
Amount of data on the wire wire at any given point in time Default OS buffers not large enough to handle this data For example, with 40 Mbits/sec bandwidth, 25 msec delay, BDP = (40 1000 8 Kb Kbytes/sec) t / ) (0.025 (0 025 sec) ) ~ 128 Kb Kbytes t
10
Tune TCP Max Memory Tune the socket buffer sizes Ensure that TCP Performance features are enabled
/proc/sys/net/ipv4/tcp_sack /proc/sys/net/ipv4/tcp sack /proc/sys/net/ipv4/tcp_window_scaling /proc/sys/net/ipv4/tcp_timestamps
11
Vista / Server 2008 supports TCP auto-tuning g For other versions, tuning necessary under RegKey
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\Tcpip\Parameters
12
Use Jumbo Frames for GigE g networks Use NICs with TCP off-loading capabilities Monitor switches and OS for packet loss
Causes numerous issues
13
14
Set send and receive socket buffer sizes in tnsnames.ora or sqlnet.ora using:
SEND_BUF_SIZE OS send buffer size RECV_BUF_SIZE OS receive buffer size
Set this size to accommodate the BDP (2x) Also set on the server Large buffer sizes help
Application queue more data to the OS Have more data on the wire Better utilize available bandwidth In WAN deployments
15
Set in
sqlnet.ora: DEFAULT_SDU_SIZE tnsnames.ora: SDU in address
16
SDU Recommendations
Optimal SDU varies with application Increase SDU on both client and server
SDU for a connection negotiated down to the lower of the two p peers
Increase SDU to 8k
Good default value for most users
17
18
19
Easy Connect
Example:
sqlplus scott/tiger@sales-server/sales
Useful when no connect descriptor customization is necessary No need for any client side configuration files
sales-server/sales
is equivalent to
(DESCRIPTION (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales)))
20
Support for IPv6 hostnames and addresses Use URL syntax to specify IPv6 addresses
[2001:fe8::12]:1522/sales.us.example.com:dedicated/inst1
is equivalent to
(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=2001:fe8::12)(PORT=1522)) (CONNECT DATA=(SERVICE (CONNECT_DATA (SERVICE_NAME NAME=sales.us.example.com) sales.us.example.com) (INSTANCE_NAME=inst1) (SERVER=dedicated)))
21
Naming Recommendations
Use Easy y Connect whenever possible If Descriptors do not change often, use tnsnames.ora
Best for small deployments TNS_ADMIN can be on a shared file system
22
23
Configurable at connect string level Can be used individually y or at the same time
Outbound Connect Timeout must be greater than TCP Timeout
24
25
Primary y
Standby
RAC backup-2
sales-scan=(sales-1,sales-2)
backup-scan=(backup-1,backup-2)
26
(DESCRIPTION_LIST = (LOAD BALANCE ff)(FAILOVER (LOAD_BALANCE=off)(FAILOVER=on) ) (DESCRIPTION = (LOAD_BALANCE=on) (ADDRESS (PROTOCOL tcp)(HOST sales scan)(PORT 1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales-scan)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales.example.com))) (DESCRIPTION = (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=tcp)(HOST=backup-scan)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales.example.com))))
27
(DESCRIPTION_LIST = (LOAD BALANCE ff)(FAILOVER (LOAD_BALANCE=off)(FAILOVER=on) ) (DESCRIPTION = (ADDRESS_LIST= (LOAD BALANCE=on) (LOAD_BALANCE on) (ADDRESS=(PROTOCOL=tcp)(HOST=sales-1)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales-2)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.example.com))) (DESCRIPTION = (ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS (PROTOCOL t )(HOST b k (ADDRESS=(PROTOCOL=tcp)(HOST=backup-1)(PORT=1521)) 1)(PORT 1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=backup-2)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.example.com))))
28
29
Thin-JDBC Tuning
30
N t Li Net Listener t
Scalability. HA. Security.
31
First process that clients talk to Brokers client requests, handing them off to service handlers
Dispatchers Dedicated servers Connection Broker DRCP (11g)
Receives R i l load d updates d t f from th the d database t b Does server side load-balancing across instances in RAC Does server side failover across nodes in RAC Can listen on multiple end-points or protocol addresses Also supports other presentations HTTP, FTP
32
By default PMON connects to listener on port 1521 Automatically A t ti ll setup t with ith RAC
33
34
Logon storm
Sudden spike in incoming connection rate Normal middle-tier reboot Abnormal DoS attack Storms cause CPU starvation for existing sessions
Set the Rate Limit to a value that matches your machine capabilities
35
RATE_LIMIT = no
Sessions s
RATE_LIMIT = 3/sec
CPU U Usage %
36
37
D t b Database Server S
Scalability
38
Choosing g the right g server architecture is critical to meeting scalability requirements Oracle O l Database D t b S Server supports t three th architectures hit t
Dedicated Server (default) Shared Server aka MTS Database Resident Connection Pool (11g)
39
Dedicated Servers
Each client connection has its own process (thread on Windows) Dedicated process ensures lower latencies Have to start a new process on connect Have to tear down a process on disconnect Scalability limits
Memory Number of Processes
40
Each server handles multiple clients Dispatchers relay requests and responses between clients and servers Idle connections will not consume much memory Good for large number of connections with many idle Latency increase due to manin-the-middle
41
Pooled dedicated servers shared h d across client li t systems and processes Low connect/disconnect costs t Server locked on connect Server released on disconnect Low-latency performance of dedicated servers Extreme scalability with a DRCP-capable client driver
42
43
Shared:
sales-server/sales.us.example.com:shared
Rough guidelines:
20 or 30 Shared Servers per 500 sessions, then tune from there 1 dispatcher p for every y 50-100 sessions
44
Using DRCP
In test environment, we were able to support more than 20,000 connections to a 2 GB Database Server
Excellent scalability y for Shared servers and DRCP Enabled by default for DRCP To enable, set in server sqlnet.ora
USE_ENHANCED_POLL = on
46
D t b Database Server S
Security
47
Limits the time taken for a client to connect and authenticate SQLNET.INBOUND_CONNECT_TIMEOUT SQLNET INBOUND CONNECT TIMEOUT
Controls timeout for Database server processes
INBOUND_CONNECT_TIMEOUT_listener_name
Controls C t l ti timeout tf for the th listener li t
Available from 10gR1 onwards Default value of 60 seconds in 10gR2 and above Independent of client-side timeouts
48
Use CIDR notation and wildcard format for ease of configuration whenever possible Invited I i d nodes d takes k precedence d over excluded l d d To enable, set in sqlnet.ora
VALIDNODE O _C CHECKING C G = YES S TCP.INVITED_NODES = (hostname1, hostname2) TCP.EXCLUDED_NODES = (hostname3, hostname4)
49
50