Become a Bilingual DBA Oracle for the SQL Server DBA Randy Knight January 22, 2011
Randy Knight MCITP, MCDBA, MCTS, MCSE … 20 Years experience with Microsoft technology, focusing on SQL Server for the last 14. Worked in a variety of settings, including six years as a Database Architect for match.com Owner and Principal Consultant, SQL Solutions Group Not an Oracle DBA, didn’t sleep at a Holiday Inn Express last night
Objectives Translation between the worlds Understand Terminology Differences Understand the Similarities between the two platforms Understand the Differences between the two platforms Understand some of the SQL Differences
SQL Server Terminology Instance Installation of SQL Server Includes physical files and in-memory processes What you connect to Database Collection of Objects (Tables, Views, Procs…) Has physical file storage Schema Grouping of database objects Login Credential used to access the instance User Database Level Object which provides access Mapped to a Login
Oracle Terminology Instance Database Schema User Processes used to access data What you connect to Database Physical files used to store data Schema Collection of objects (Tables, Views, Procs …) User Credentials used to access a database Tied to a particular schema 1:1 relationship with a schema
Mapping the Terminology Instance Database + Instance Database Schema Schema ? Login User User ?
Similarities Relational Database Optimizer Service you connect to Normalization, Indexing, Design matter in both Bad Data Model = Bad Data Model Good Data Model = Good Data Model Optimizer Cost based Execution Plans Service you connect to Listener Instance
Similarities Features SQL Replication Mirroring / Log Shipping SQL Server Peer to Peer Oracle MultiMaster Mirroring / Log Shipping Types of Data Guard SQL Mostly the same Fight over ANSI-92!
Differences Locking Methodology Clustering Multi-Platform Optimistic vs. Pessimistic Think Snapshot Isolation Level Clustering RAC is true Active/Active SQL is Failover Multi-Platform Pros and Cons Tons of Configuration Options Complexity
Differences (cont.) Data Types Built-In Functions Too many to list Google is your friend You should also know how each platform maps to SSIS Data Types Built-In Functions Also too many to list Example: MSSQL: GETDATE() Oracle: SYSDATE
SQL Language Differences T-SQL is T-SQL In Oracle, SQL <> PL/SQL PL/SQL is the procedure language SQL is vanilla DML language The difference between the two is a big deal to Oracle DBAs Performance impact of using PL/SQL
Example Differences Need for Dual() table AutoNumber / Identity INSERT UPDATE DELETE
Dual() MSSQL: select getdate(); Oracle: select sysdate from dual;
Auto Numbering MSSQL IDENTITY Property Oracle Sequence create table t1 ( col1 int identity(1,1) col2 int); insert t1(col2) values(3); Oracle Sequence create table t1 (col1 integer, col2 integer); create sequence t1_seq increment by 1 start with 1; insert into t1 values (t1_seq.nextval, 3);
INSERT INTO not optional MSSQL: Oracle: insert mytable values('more text'); Oracle: insert into mytable values('more text');
UPDATE No UPDATE FROM MSSQL: Oracle: update t1 set t1.col2 = t2.col2 from t1 inner join t2 on t1.col1 = t2.col1; Oracle: update (select t2.col2 as src_2, t2.col2 as tgt_2 from t1 inner join t2 on t1.col1 = t2.col1 ) set tgt_2 =src_2;
DELETE Oracle requires FROM MSSQL: Oracle: DELETE MyTable; DELETE FROM MyTable;
Tools Oracle has nothing similar to SSMS Command Line PL/SQL Developer? Command Line SQL*Plus SQLCMD Really requires 3rd Party Toad seems to be popular Others No SQL Profiler Equivalent
Integration Linked Server / Database Links Linked Server to Oracle is Easy Other Direction depends on platform and Oracle Products SSIS works great with Oracle BI Stack Analysis Services Reporting Services Oracle Drivers / Clients 32-bit vs. 64-bit Gets funs with BIDS
Resources Oracle Technology Network Twitter http://www.oracle.com/technetwork/dbadev/index. html Twitter #sqlhelp #sqlpass #sqlblog #sqlsat @randy_knight
Thank You! http://speakerrate.com/speakers/11314 Randy Knight SQL Solutions Group (801) 285-0251 randy@sqlsolutionsgroup.com www.sqlsolutionsgroup.com/blog Linked In: www.linkedin.com/in/randyknight Twitter: randy_knight Skype: randy.knight2 http://speakerrate.com/speakers/11314