2. Agenda
Who am I
SQL Server vs Oracle
Backups
Monitoring
Performance
Support
Future
Questions?
11-7-2016
SQL Server
2
3. Who am I
Pierre van der Ven
Working since 1998 in IT
Started as programmer, switched to DBA
Assigned with several big customers
Last years mainly focus on SQL Server
I am a nerd
11-7-2016
SQL Server
3
4. Oracle vs SQL Server
Language
SQL
T-SQL (Transact SQL)
PL/SQL
11-7-2016
SQL Server
4
5. Oracle vs SQL Server
Naming the ‘objects’
11-7-2016
SQL Server
5
Database Instance / Database
Schema Database and database owner (DBO)
Tablespace Filegroup
User User
Role Group/Role
Table Table
Temporary tables Temporary tables
Cluster N/A
Column-level check constraint Column-level check constraint
Column default Column default
Unique key
Unique key or identity property for a
column
Primary key Primary key
Oracle SQL Server
6. Oracle vs SQL Server
Naming the ‘objects’
11-7-2016
SQL Server
6
Foreign key Foreign key
Indexes Indexes
PL/SQL Procedure
Transact-SQL (T-SQL) stored
procedure
PL/SQL Function T-SQL stored procedure
Packages N/A
AFTER triggers Triggers
BEFORE triggers Complex rules
Triggers for each row N/A
Synonyms N/A
Identity Identity property for a column
Snapshot (table-based) Snapshot (database-based)
View View
Oracle SQL Server
7. Oracle vs SQL Server
Naming the ‘objects’ (DBA)
11-7-2016
SQL Server
7
TEMP-tablespace tempdb
Undo-tablespace tempdb
RAC Always On
Flashback Snapshots ...
Oracle SQL Server
8. In Oracle, not in SQL Server
Packages
Triggers for each row
Synonyms
Snapshots
Flashback
11-7-2016
SQL Server
8
9. In SQL Server, noy in Oracle
Pluggable databases (since 12c in Oracle)
Auto-increment values (since 12c in Oracle)
11-7-2016
SQL Server
9
11. Transactionlog
11-7-2016
SQL Server
11
Oracle
Archivelog / noarchivelog
Oracle 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 Server
Full Recovery / simple mode
SQL 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.
15. 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.
11-7-2016
SQL Server
15
17. What is hammering my instance
Always start with the activity monitor:
11-7-2016
SQL Server
17
18. What is hammering my instance
Check the task manager:
11-7-2016
SQL Server
18
19. What is hammering my instance
Ga na of er blocking locks zijn:
11-7-2016
SQL Server
19
Z
20. What is hammering my instance
Kijk of er blocking locks zijn:
11-7-2016
SQL Server
20
Z
Search for queries with a lot of physical reads:
21. What is hammering my instance
11-7-2016
SQL Server
21
Perfmon
Microsoft’s definition:
‘A handy tool built into Windows®,
an assist you in diagnosing the problem’
24. What is hammering my instance
11-7-2016
SQL Server
24
Perfmon
First make a Data Collector Set, save it and
change it afterwards to get the screen below:
25. What is hammering my instance
11-7-2016
SQL Server
25
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.
26. What is hammering my instance
11-7-2016
SQL Server
26
Page Life Expectency (PLE)
27. What is hammering my instance
11-7-2016
SQL Server
27
Page Life Expectency (PLE)
In the past:
If below 300 seconds, add more memory
Nowadays:
28. What is hammering my instance
11-7-2016
SQL Server
28
SQL Server Profiler
You only get this option if you install the add-
ons for SSMS.
29. What is hammering my instance
11-7-2016
SQL Server
29
SQL Server Profiler
30. What is hammering my instance
11-7-2016
SQL Server
30
SQL Server Profiler
31. What is hammering my instance
11-7-2016
SQL Server
31
SQL Server Profiler
32. What is hammering my instance
11-7-2016
SQL Server
32
Indexes
• Missing indexes
• Unused indexes
• Fragmented indexes
33. What is hammering my instance
11-7-2016
SQL Server
33
Maintenance
Automatic (initial setup needed)
• Reorganize indexes
• Rebuild indexes
• Refresh statistics
• Cleanup logging
Manual
• Create missing indexes
• Drop unused indexes
Ola Hallengren
This presentation covers two major topics: SQL Server vs Oracle, and ‘what is hammering my instance’.
SQL is a ANSI/ISO-standard for a rdbms. In both environments the standard SQL-commands work
T-SQL (Transact SQL) quite easy to use, but less powerful
PL/SQL is complex in use, but also powerful
Triggers for each row is possible in SQL Server, but it is quite complex to program
In SSMS you create the backup-commands, you can also use SSMS to execute those backup-commands.
Check if there are remarkable sessions, ie high waittime
To be sure that not something else then SQL Server is hammering the machine, check the taskmanager
If you find a the root-session that caused it, try to kill it (off course first ask around if this is acceptable)
Just a first view of perfmon, details will be shown later
There are a lot of counters you can select. First select the category, and then select the counters you want to see. There are also specific SQL Server categories.
Use perfmon to have a look at the PLE. While looking at the black line, it is clear that something is not ok there. Investigate it further.
In the past: a simple definition was sufficient, nowadays it is quite complex to have one definition that is good enough for everybody.
When live, this screen is scrolling, and scrolling, and scrolling ...
Zoom in to a specific query
It is quite easy to find the missing indexes, unused indexes or fragmented indexes.