56
TEN VITAL TIPS FOR ORACLE RAC PERFORMANCE ZEKERİYA BEŞİROĞLU EXPERT CONSULTANT&INSTRUCTOR BİLGİNC IT ACADEMY ISTANBUL TURKİSH ORACLE USER GROUP ORACLE OPEN WORLD 15 SAN FRANCİSCO

Oracle Rac Performance Tunning Tips&Tricks

Embed Size (px)

Citation preview

Page 1: Oracle Rac Performance Tunning Tips&Tricks

TEN VITAL TIPS FOR ORACLE RAC PERFORMANCE

ZEKERİYA BEŞİROĞLU EXPERT CONSULTANT&INSTRUCTOR BİLGİNC IT ACADEMY ISTANBUL TURKİSH ORACLE USER GROUP ORACLE OPEN WORLD 15 SAN FRANCİSCO

Page 2: Oracle Rac Performance Tunning Tips&Tricks

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

WHO I AM

▸ Oracle Ace Database Management & Performance

▸ OCP since 2002

▸ OCE Rac Expert

▸ Exadata Specialist

▸ President of TROUG

▸ Expert Consultant & Oracle University Instructor

Page 3: Oracle Rac Performance Tunning Tips&Tricks

BILGINC IT ACADEMY —- WWW.BILGINC.COM

Page 4: Oracle Rac Performance Tunning Tips&Tricks

TEN VITAL TIPS▸ CAPACITY & ARCHITECTURE

▸ SQL TUNING

▸ PARALLEL QUERY TUNING

▸ TUNING DATABASE

▸ TUNING NETWORK

▸ RECOVERY TUNING

▸ GLOBAL CACHE TUNING

▸ TUNING STORAGE

▸ TUNNNG CLUSTERWARE

▸ TOOLS

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 5: Oracle Rac Performance Tunning Tips&Tricks

1-CAPACITY & ARCHITECTURE

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 6: Oracle Rac Performance Tunning Tips&Tricks

CAPACITY & ARCHITECTURE▸ Building Balanced Hardware Configuration

▸ High Throughput

▸ You should consider configuring the following hardware components in order to create a balanced system:

▸ Number and speed of CPUs

▸ Memory size

▸ Number and size of disks

▸ Number and speed of the I/O bandwidth components, such as:

▸ Host Bus Adapters(HBAs)

▸ Switches

▸ Disk Controllers

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 7: Oracle Rac Performance Tunning Tips&Tricks

CAPACITY & ARCHITECTURE

▸ per Cpu Core avg 100-300 mb/per second

▸ Core = HBA

▸ Fiber switch avg 800 mb/per second

▸ One Disk Array avg 200 mb/per second

▸ Small 15000 rpm disk. 10 disk one array

▸ 4 gb memory per core / 8 gb Compress.

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 8: Oracle Rac Performance Tunning Tips&Tricks

CAPACITY & ARCHITECTURE▸Estimating Size of Database Objects

▸ SELECT * FROM TABLE(dbms_space.object_growth_trend(object_owner => 'SH', object_name => 'SALES', object_type => 'TABLE'));

▸DBMS_SPACE.CREATE_TABLE_COST(‘USERS’,30(avgrowsize),100000000(rowcount),10(pctfree),ub,ab);

▸DBMS_OUTPUT.PUT_LINE('Used Bytes = ' || TO_CHAR(ub));

▸DBMS_OUTPUT.PUT_LINE('Allocated Bytes = ' || TO_CHAR(ab));

▸END;

▸ /

▸Used Bytes = (100GB)

▸Allocated Bytes = (100GB)

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 9: Oracle Rac Performance Tunning Tips&Tricks

CAPACITY & ARCHITECTURE

▸Size Interconnect for aggregated throughput – approx 1Gb/sec per 32 cores

▸10Gb/sec or IB generally good for database consolidations and large SMP nodes Bonded 1GbE solutions with load balancing are supported Use same type NICs for LB and failover

▸Use Jumbo frames wherever possible

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 10: Oracle Rac Performance Tunning Tips&Tricks

2-SQL TUNING

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 11: Oracle Rac Performance Tunning Tips&Tricks

SQL TUNING

▸Optimizing Third Normal Form: Power, Partitioning, Parallelism

▸ Power

▸ Partition : Range- Hash partition

▸ Hash count cpus X 2

▸ Paralel degree power X 2 and goal parallel partition-wise join

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 12: Oracle Rac Performance Tunning Tips&Tricks

SQL TUNING

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 13: Oracle Rac Performance Tunning Tips&Tricks

SQL TUNING▸ Reduce long full-table scans in OLTP systems.

▸ Use Automatic Segment Space Management (ASSM).

▸ Increase sequence caches.

▸ Use partitioning to reduce interinstance traffic.

▸ Avoid unnecessary parsing.

▸ Minimize locking usage.

▸ Remove unselective indexes.

▸ Configure interconnect properly.

▸ In Memory-Parallel Query

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 14: Oracle Rac Performance Tunning Tips&Tricks

SQL TUNING▸ How to avoid “Write Hot Spots” in applications

▸ Frequent transactional changes to the same data blocks in all instances may result in “write hot spots”

▸ in 99% of OLTP performance issues write hot spots occur on indexes

▸ Use non-ordered & cached sequences if sequence is used to generate primary key

▸ ALTER SEQUENCE E1 ... CACHE 10000+

▸ Consolidate applications to use only one server and route via services

▸ Place redo logs on fast storage & Separate disks for logs from other IO busy disks

▸ Schema tuning only involves minimal modification

▸ Global hash partitioned indexes

▸ Locally partitioned indexes

▸ Drop unused indexes

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 15: Oracle Rac Performance Tunning Tips&Tricks

3- PARALLEL QUERY TUNING

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 16: Oracle Rac Performance Tunning Tips&Tricks

PARALLEL QUERY TUNING

▸ Parallel execution improves performance for the following:

▸ Queries that perform a full table scan

▸ Fast full index scans

▸ The creation of large indexes

▸ DML operations doing bulk inserts, updates, and deletes

▸ Aggregations and copying

Partitioned index scans

Database recovery

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 17: Oracle Rac Performance Tunning Tips&Tricks

4-TUNING DATABASE

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 18: Oracle Rac Performance Tunning Tips&Tricks

TUNING DATABASE

▸ Distribution of data using data partitions

▸ Distribution of data access using database services

▸ Distribution of workload based on resource availability

▸ Accessing data from a database using indexes

▸ Tuning parameters to help improve performance

▸ Partition pruning

▸ Partition-wise joins

▸ Parallel DML

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 19: Oracle Rac Performance Tunning Tips&Tricks

TUNING DATABASE

▸Sequence Numbers

▸Row level locking causing high contention. Getting and maintaining sequences can cause enqueue contention on the sequence enqueue and latches.

▸Due to the non-recursive nature of the transaction, in high INSERT intensive applications, updates to the table can be queued.

▸There could be serious concurrency issues when this method is used.

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 20: Oracle Rac Performance Tunning Tips&Tricks

5-TUNING NETWORK

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 21: Oracle Rac Performance Tunning Tips&Tricks

TUNING NETWORK

▸ListenersThere are two types of listeners in an Oracle Database 11g Release 2 RAC configuration.

▸SCAN Listeners

▸Database Listeners

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 22: Oracle Rac Performance Tunning Tips&Tricks

TUNING NETWORK▸For example, the following SDU settings in the TNS connection descriptor will set the value of the SDU

to 16K:

▸ORCL =

▸ (DESCRIPTION =

▸ (SDU = 16384) (FAILOVER = ON) (ADDRESS = (PROTOCOL = TCP)(HOST = oradb.istanbul.com)(PORT = 1521))

▸ (LOAD_BALANCE = YES)

▸ (CONNECT_DATA = (SERVER = DEDICATED)

▸ (SERVICE_NAME = ORCL)

▸ (FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 10)(DELAY = 3))) )

▸Similar settings should also be made to the listener to ensure that the bytes received by the server are also of a similar size. SID_LIST_LISTENER =

▸ (SID_DESC =

▸ (SDU=16384) (SID_NAME = ORCL)))

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 23: Oracle Rac Performance Tunning Tips&Tricks

6-RECOVERY TUNING

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 24: Oracle Rac Performance Tunning Tips&Tricks

FAST START PARALLEL ROLLBACK

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 25: Oracle Rac Performance Tunning Tips&Tricks

RECOVERY PARALLELLISM

▸ SQL>RECOVER PARALLEL 4;

▸ SQL>RECOVER TABLESPACE SALES

▸ SQL>RECOVER DATAFILE /u01/app/IST/sales.dbf PARALLEL (DEGREE 4);

▸ SQL>RECOVER DATABASE PARALLEL ; -- default DOP is used.

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 26: Oracle Rac Performance Tunning Tips&Tricks

REDO SIZE

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 27: Oracle Rac Performance Tunning Tips&Tricks

CHECKPOINT

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 28: Oracle Rac Performance Tunning Tips&Tricks

7-GLOBAL CACHE TUNING

Data is either stored ‣ 1.  Locally (local cache) " access time: nanoseconds ‣ 2.  Remote (global cache) " access time: micros. ‣ 3.  “On disk”

Flash cache"access time: microseconds Disk controller cache"access time: micros. Spinning disk"access time: milliseconds

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 29: Oracle Rac Performance Tunning Tips&Tricks

▸ Global cache optimization

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 30: Oracle Rac Performance Tunning Tips&Tricks

GLOBAL CACHE SCENARIOS

There are several scenarios for single block reads: ‣ Read from Disk

‣ Read – Read

‣ Read – Write

‣ Write – Write

‣ Write – Read

‣ Write to Disk

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 31: Oracle Rac Performance Tunning Tips&Tricks

GLOBAL CACHE SCENARIOS

‣ Instance A

‣ Instance B

‣ Instance C

‣ Instance D-resource master

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 32: Oracle Rac Performance Tunning Tips&Tricks

READ FROM DISK

‣ Instance A

‣ Instance B

‣ Instance C ——Request to obtain a shared resource

‣ Instance D-resource master

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 33: Oracle Rac Performance Tunning Tips&Tricks

READ FROM DISK

‣ Instance A

‣ Instance B

‣ Instance C

‣ Instance D-(RM)request is granted

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 34: Oracle Rac Performance Tunning Tips&Tricks

READ FROM DISK

‣ Instance A

‣ Instance B

‣ Instance C Read Request

‣ Instance D-(RM)request is granted

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 35: Oracle Rac Performance Tunning Tips&Tricks

READ FROM DISK

‣ Instance A

‣ Instance B

‣ Instance C Read Request —- SCN 1000

‣ Instance D-(RM) Request is Granted

‣ Database-SCN 1000 -Block image Delivered

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 36: Oracle Rac Performance Tunning Tips&Tricks

READ WRITE CACHE FUSION

‣ Instance A

‣ Instance B Request to obtain resource

‣ Instance C SCN 1000

‣ Instance D-(RM)

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 37: Oracle Rac Performance Tunning Tips&Tricks

READ WRITE CACHE FUSION

‣ Instance A

‣ Instance B Request to obtain resource

‣ Instance C SCN 1000

‣ Instance D-(RM) Instruct to transfer the block to B

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 38: Oracle Rac Performance Tunning Tips&Tricks

READ WRITE CACHE FUSION

‣ Instance A

‣ Instance B Request to obtain resource ——SCN 1000

‣ Instance C SCN 1000-Send Block image to instance B

‣ Instance D-(RM) Instruct to transfer the block to B

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 39: Oracle Rac Performance Tunning Tips&Tricks

WRITE WRITE CACHE FUSION

‣ Instance A

‣ Instance B Request to obtain resource ——SCN 1000-write SCN 1001

‣ Instance C SCN 1000-Send Block image to instance B

‣ Instance D-(RM) Instruct to transfer the block to B

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 40: Oracle Rac Performance Tunning Tips&Tricks

WRITE WRITE CACHE FUSION

‣ Instance A-request to write

‣ Instance B SCN 1001

‣ Instance C SCN 1000

‣ Instance D-(RM)

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 41: Oracle Rac Performance Tunning Tips&Tricks

WRITE WRITE CACHE FUSION

‣ Instance A-request to write

‣ Instance B SCN 1001

‣ Instance C SCN 1000

‣ Instance D-(RM)——Instruct to transfer to instance A

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 42: Oracle Rac Performance Tunning Tips&Tricks

WRITE WRITE CACHE FUSION

‣ Instance A-request to write ——SCN1001

‣ Instance B SCN 1001—-Copy To Buffer

‣ Instance C SCN 1000

‣ Instance D-(RM)——Instruct to transfer to instance A

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 43: Oracle Rac Performance Tunning Tips&Tricks

WRITE WRITE CACHE FUSION

‣ Instance A-request to write ——SCN1001 ———SCN 1002

‣ Instance B SCN 1001—-Copy To Buffer

‣ Instance C SCN 1000

‣ Instance D-(RM)——Instruct to transfer to instance A

‣ Database-SCN 1000

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 44: Oracle Rac Performance Tunning Tips&Tricks

8-TUNING STORAGE

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 45: Oracle Rac Performance Tunning Tips&Tricks

▸ Types of I/O Operations

▸ Read vs. writeSingle-block vs. multi-block Random vs. sequentialSynchronous vs. asynchronous

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 46: Oracle Rac Performance Tunning Tips&Tricks

▸ I/O Access Patterns

▸ Sequential access

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 47: Oracle Rac Performance Tunning Tips&Tricks

▸ I/O Access Patterns

▸ Random access

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 48: Oracle Rac Performance Tunning Tips&Tricks

▸ How Many Disk Groups?

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 49: Oracle Rac Performance Tunning Tips&Tricks

9-TUNING CLUSTERWARE

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 50: Oracle Rac Performance Tunning Tips&Tricks

10-TOOLS

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 51: Oracle Rac Performance Tunning Tips&Tricks

REMOTE DIAGNOSTIC AGENT

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 52: Oracle Rac Performance Tunning Tips&Tricks

RAC DIAG

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 53: Oracle Rac Performance Tunning Tips&Tricks

ORACHK

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 54: Oracle Rac Performance Tunning Tips&Tricks

OLS$ ./ols.pl

The Cluster Nodes are : "NodeA, NodeB, NodeC, NodeD"

The Local Node is : "NodeA"

The Remote Nodes are : "NodeB, NodeC, NodeD"

Major Clusterware Version is : "12.1.0.1.0"

CRS_HOME is installed at : "/u01/app/12.1.0/grid"

CRS_BASE is installed at : "/u01/app/crsusr"

CRS_OWNER is : "crsusr"

CRS_GROUP is : "oinstall"

ORACLE_HOMES[0] is installed at : "/u01/app/crsusr/product/12.1.0/dbhome_1"

ORACLE_BASES[0] is installed at : "/u01/app/crsusr"

ORACLE_OWNERS[0] is : "crsusr"

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 55: Oracle Rac Performance Tunning Tips&Tricks

TEN VITAL TIPS▸ CAPACITY & ARCHITECTURE

▸ SQL TUNING

▸ PARALLEL QUERY TUNING

▸ TUNING DATABASE

▸ TUNING NETWORK

▸ RECOVERY TUNING

▸ GLOBAL CACHE TUNING

▸ TUNING STORAGE

▸ TUNNNG CLUSTERWARE

▸ TOOLS

TEN VITAL TIPS FOR REAL APPLICATION CLUSTER PERFORMANCE ZEKERIYABESIROGLU.COM

Page 56: Oracle Rac Performance Tunning Tips&Tricks

ZEKERİYA BESİROGLU BILGINC IT ACADEMY ISTANBUL