Jason Wong Applications Manager DBA/Developer Programmer …. 20+ years IS&T, DEV,

Preview:

Citation preview

Jason Wonghttp://usa.redirectme.net/repriser/

Applications Manager

DBA/Developer

Programmer

….

20+ years IS&T, DEV, DBA

MS Mech Eng. MBA

Got Database !

Processor/OS …. blade, x64, x86

Memory …. ?

SAN …. scalable

Disk …. space, I/O speed

RAID …. 10, 5,

Backup ….full, diff, log. SLA

Network …. Gb/s, fibre channel

D.R. mirroring, log shipping, replication, backup-restore

Hardware …. $$$

Software …. $$$DBA cost …. ~~~~

Monitoring cost ….

Hidden cost …. ?

Upgrade …. $$$$$$

Got money !

Performance?

(six months later)

Application slow …. Code efficiency, if, case

Database slow …. Defrag, index, cache

Network slow …. Bandwidth

User slow …. Problem between keyboard and chair

…. Ha, DB blocking !!!!

What is blocking anyway?

Isolation level(Transaction ACID, read book by Thomas Kyte)

• Read uncommitted (the lowest level where transactions are isolated only enough to ensure that physically corrupt data is not read)

• Read committed (Database Engine default level)• Repeatable read• Serializable (the highest level, where transactions are

completely isolated from one another)

Isolation Level• A lower isolation level increases the ability of many users to access data at

the same time, but increases the number of concurrency effects (such as dirty reads or lost updates) users might encounter. Conversely, a higher isolation level reduces the types of concurrency effects that users may encounter, but requires more system resources and increases the chances that one transaction will block another. Choosing the appropriate isolation level depends on balancing the data integrity requirements of the application against the overhead of each isolation level.

• The highest isolation level, serializable, guarantees that a transaction will retrieve exactly the same data every time it repeats a read operation, but it does this by performing a level of locking that is likely to impact other users in multi-user systems.

• The lowest isolation level, read uncommitted, may retrieve data that has been modified but not committed by other transactions. All of the concurrency side effects can happen in read uncommitted, but there is no read locking or versioning, so overhead is minimized.

Concurrency side effects enabled by isolation levels

Isolation level Dirty read Nonrepeatable read Phantom

Read uncommitted Yes Yes Yes

Read committed No Yes Yes

Repeatable read No No Yes

Snapshot No No No

Serializable No No No

Perfmon.exe• Physical disk: %idle, %read, %write, avg queue 2,

30% free

• CPU idle time: 30%

• Buffer cache ratio: 99%

• Pages/s: 1• Memory: available bytes, private set, working set,

virtual memory used

• Network: Traffic Bytes/s

• Full scan/s, Trace, Execution plan, Index

Recommended