sql server knowledge-session (sql server vs oracle, and performance)
TRANSCRIPT
SQL ServerRijswijk, june 2016
01-05-20232
Agenda
Who am I SQL Server vs Oracle Backups Monitoring Performance Support Future Questions?
SQL Server
01-05-20233
Who am I
Pierre van der Ven
Working since 1998 in ITStarted as programmer, switched to DBAAssigned with several big customersLast years mainly focus on SQL Server
I am a nerd
SQL Server
01-05-20234
Oracle vs SQL Server
Language
SQL T-SQL (Transact SQL) PL/SQL
SQL Server
01-05-20235
Oracle vs SQL Server
Naming the ‘objects’
SQL Server
Database Instance / DatabaseSchema Database and database owner (DBO)Tablespace FilegroupUser UserRole Group/RoleTable TableTemporary tables Temporary tablesCluster N/AColumn-level check constraint Column-level check constraintColumn default Column defaultUnique key Unique key or identity property for a
columnPrimary key Primary key
Oracle SQL Server
01-05-20236
Oracle vs SQL Server
Naming the ‘objects’
SQL Server
Foreign key Foreign keyIndexes Indexes
PL/SQL Procedure Transact-SQL (T-SQL) stored procedure
PL/SQL Function T-SQL stored procedurePackages N/AAFTER triggers TriggersBEFORE triggers Complex rulesTriggers for each row N/ASynonyms N/AIdentity Identity property for a columnSnapshot (table-based) Snapshot (database-based)View View
Oracle SQL Server
01-05-20237
Oracle vs SQL Server
Naming the ‘objects’ (DBA)
SQL Server
TEMP-tablespace tempdbUndo-tablespace tempdb
RAC Always On
Flashback Snapshots ...
Oracle SQL Server
01-05-20238
In Oracle, not in SQL Server
Packages Triggers for each row Synonyms Snapshots Flashback
SQL Server
01-05-20239
In SQL Server, noy in Oracle
Pluggable databases (since 12c in Oracle) Auto-increment values (since 12c in Oracle)
SQL Server
01-05-202310
Transaction Control
SQL Server
SQL ServerCommits on default after every command. It is complex to change this behavior.
OracleCommits when you commit. More control.
01-05-202311
Transactionlog
SQL Server
OracleArchivelog / noarchivelogOracle is using redo-logs. When a redo-log is full, it makes a copy to a archivelog and rotates to the next member of the redo-log.
SQL ServerFull Recovery / simple modeSQL Server writes transaction-data to the transactionlog. In full recovery it maintains this data until a backup has been made. In simple mode it maintains the transaction-log data during the transaction.
01-05-202312
Transactionlog
SQL Server
Oracle
01-05-202313
Transactionlog
SQL Server
SQL Server
01-05-202314
Backups
SQL Server
Oraclermantool from supplier
SQL ServerVia SSMS (SQL Server Management Studio)tool from supplier (ie NetBackup SQL client)
01-05-202315
Monitoring
Oracle: Oracle Enterprise Manager (OEM) / Grid Control
SQL Server: - Alerts- System Centre Operations Manager (SCOM)
In OEM you can modify settings of the database, in SCOM that is not possible. SCOM is only for monitoring. If you want to change settings, use SSMS.
SQL Server
01-05-202316
What is hammering my instance
SQL Server
01-05-202317
What is hammering my instance
Always start with the activity monitor:
SQL Server
01-05-202318
What is hammering my instance
Check the task manager:
SQL Server
01-05-202319
What is hammering my instance
Ga na of er blocking locks zijn:
SQL Server
Z
01-05-202320
What is hammering my instance
Kijk of er blocking locks zijn:
SQL Server
Z
Search for queries with a lot of physical reads:
01-05-202321
What is hammering my instance
SQL Server
Perfmon
Microsoft’s definition:
‘A handy tool built into Windows®, an assist you in diagnosing the problem’
01-05-202322
What is hammering my instance
SQL Server
Perfmon
01-05-202323
What is hammering my instance
SQL Server
Perfmon
01-05-202324
What is hammering my instance
SQL Server
PerfmonFirst make a Data Collector Set, save it and change it afterwards to get the screen below:
01-05-202325
What is hammering my instance
SQL Server
Page Life Expectency (PLE)
PLE is the time in seconds how long the page stays in the bufferpool. This is related to the memory-pressure. If the page has been flushed from the bufferpool, it needs to be loaded from disk.
01-05-202326
What is hammering my instance
SQL Server
Page Life Expectency (PLE)
01-05-202327
What is hammering my instance
SQL Server
Page Life Expectency (PLE)
In the past: If below 300 seconds, add more memory
Nowadays:
01-05-202328
What is hammering my instance
SQL Server
SQL Server ProfilerYou only get this option if you install the add-ons for SSMS.
01-05-202329
What is hammering my instance
SQL Server
SQL Server Profiler
01-05-202330
What is hammering my instance
SQL Server
SQL Server Profiler
01-05-202331
What is hammering my instance
SQL Server
SQL Server Profiler
01-05-202332
What is hammering my instance
SQL Server
Indexes
• Missing indexes• Unused indexes• Fragmented indexes
01-05-202333
What is hammering my instance
SQL Server
Maintenance
Automatic (initial setup needed)• Reorganize indexes• Rebuild indexes• Refresh statistics• Cleanup logging
Manual• Create missing indexes• Drop unused indexes
Ola Hallengren
01-05-202334
Support
SQL Server
Bron: http://sqlserverupdates.com/
01-05-202335
Future
SQL Server
Questions?