from oracle to sql server

Upload: jc

Post on 01-Jun-2018

246 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 From Oracle to SQL Server

    1/22

    Practical SQL Server 2008 for Oracle ProfessionalsSQL Server Technical Article

    Published: October 2008

    Applies to: SQL Server 2008

    Summary: This white paper reviews many of the key comparisons between SQL Server 2008databases and Oracle databases. t hi!hli!hts SQL Server and Oracle database architect"reand provides information on the latest feat"res in SQL Server 2008. This paper is intended forOracle professionals lookin! to e#tend and "se their Oracle knowled!e to mana!e SQL Server.Topics covered in this doc"ment incl"de back"ps$ database sec"rity$ mana!ement options$ andhi!h availability options .

  • 8/9/2019 From Oracle to SQL Server

    2/22

    %ontentsntrod"ction ................................................................................................................... 4

    Oracle&s mplementation of nstances and 'atabases .........................................................4

    SQL Server&s mplementation of nstances and 'atabases ..................................................5Stora!e (rchitect"re ....................................................................................................... 6

    'atabase )appin! .........................................................................................................7

    Lo!!in! )odel ................................................................................................... ........... 8

    *ack"p and +ecovery ........................................................................................ .......... 10

    Logical Backups..................................................................................................... 10

    Physical Backups................................................................................................ ... 10

    Consistent/Cold Backups.................................................................................... 11

    Inconsistent/ nline Backups.................................................................. ............ 11

    Inc!e"ental Backups..........................................................................................1#

    'atabase Sec"rity .............................................................................................. ......... 1$

    %!anspa!ent &ata 'nc!yption................................................................................. 14

    Logins.................................................................................................................... 14

    (uthentication....................................................................................................... 15

    Pass)o!ds.............................................................................................................. 16

    Scalability and ,i!h (vailability ......................................................................................17

    &yna"ic *e"o!y *anage"ent.............................................................................17

    Pa!allel +,L +tate"ents................................................................................ ........ 17

    &i!ect-Path Inse!ts................................................................................................. 18

    +ha!ed +e! e!s o!"e!ly *%+ ............................................................................ .18

    2esu"a3le +pace (llocation................................................................. .............. ..18

    (ccess *ethods..................................................................................................... 18

    +u""a!y *anage"ent.................................................................................. ....... 1

    *ultiple Block +i es............................................................................................... 1' te!nal %a3les................................................................................................. ..... 1

    2(C........................................................................................................................ 1

    %a3le Pa!titioning................................................................................................... #0

    2eplication............................................................................................................. #0

    +tand3y &ata3ase................................................................................................. #0

    #

  • 8/9/2019 From Oracle to SQL Server

    3/22

    ( ' +uppo!t....................................................................................... .............. .... #0

    64-Bit +uppo!t.................................................................................................. ..... #1

    SO( ............................................................................................................ .............. #1

    +,L +e! e! +e! ice B!oke!.....................................................................................#1

    !acle +t!ea"s (d anced ,ueuing.......................................................................##

    %oncl"sion ..................................................................................................................##

    $

  • 8/9/2019 From Oracle to SQL Server

    4/22

    Introduction*oth Oracle and )icrosoft "se the defined concepts of instances and databases. They share alot of similarities and provide their own "ni-"e approaches. Since the prod"cts have been in the

    marketplace for many years and they contin"e to improve$ some terms /server$ /systems$/instance$ and /database 1 have been "sed to describe one in comparison to another. ven thevendors have been !"ilty of addin! to the conf"sion. Oracle&s 'atabase is more than 3"st a setof database files for a sin!le instance to "se. Similarly$ the prod"ct name )icrosoft4SQL Server4 does not limit a sin!le instance to r"n on the physical comp"ter server.

    Oracle’s Implementation of Instances and Databases (n implementation of the Oracle 'atabase consists of a set of binaries. These incl"de thee#ec"table files for the software$ network files$ and administration tools. /'atabase files arealso installed. These items consist of control files$ tablespace files$ and lo! files.

    5hen an instance of Oracle is started on a 5indows4 server$ it accesses the initiali6ation filesSP7 L or init.ora1 to determine the parameters necessary to be!in the service. Oracle then

    reserves an amo"nt +() from the operatin! system into a special b"ffer named the Systemlobal (rea S (1. Then Oracle mana!es back!ro"nd processes. These back!ro"nd

    processes "se 5indows threads to provide code e#ec"tions to the system processors andprovide isolation from other applications r"nnin! on the system. Once the instance is r"nnin!$the database can be mo"nted by readin! information from the database control file. 7inally$ thedatabase can be opened for client re-"ests. ( database does not have to be opened or evenmo"nted. The instance remains r"nnin! and can listen to network re-"ests.

    (n instance may be associated with only one database. n some environments$ the desi!nmi!ht be set to have a sin!le database be mo"nted to more than instance. 5ith the power oftoday&s comp"ter systems$ it often makes sense to provide m"ltiple instances on the system.These m"ltiple instances are separate processes and memory allocations in the operatin!system to provide isolation and sec"rity benefits. The limitations to the n"mber of instancesr"nnin! on sin!le systems are dependent on the processin! power and memory si6e on thebo#. Of co"rse$ common sense sho"ld be "sed in applyin! reso"rces. The additional instancescan be started by "sin! the same set of e#ec"tables provided by a sin!le installation. )"ltipleinstallations can be "sed to separate the access of specific binaries and versions of the prod"cton a sin!le system.

    ( sin!le instance may s"pport the transactions of more than 3"st one e#ternal application. t isimportant to introd"ce some topics that distin!"ish an Oracle and a SQL Server sol"tion fromeach other. n order to provide m"ltiple "sers and application s"pport$ Oracle has providedschemas to its architect"re. ( schema is simply a collection of ob3ects f"lfillin! a commonp"rpose. 7or databases$ it is a collection of lo!ical str"ct"res of data s"pportin! an operation or"ser. The prod"cts also provide mana!ement and sec"rity options. )ost often a schema$ which

    4

  • 8/9/2019 From Oracle to SQL Server

    5/22

    is associated with a specific "ser acco"nt$ is "sed to separate different applications from eachother. The ob3ects of the schema are many and varied in Oracle.

    The most obvio"s and "sed ob3ect by database administrators '*(s1 and developers is thetwo9dimensional table ob3ect. Other ob3ects "s"ally s"pport the "se of tables. The tablerepresents a sin!le entity that is described by it attrib"tes or col"mns1. (dditionally$ it isrepresented by separate instantiations of the entity$ by providin! specific information associatedwith the abstract attrib"tes. These are often referred to as rows.

    SQL Server’s Implementation of Instances and Databases (n instance created by SQL Server is a set of binaries isolatin! the SQL Server 'atabase

    n!ine services from other applications. Separate database files are also "sed. The binariesprovide the e#ec"tables$ network files$ and administrative tools necessary to e#ec"te or r"n adatabase on a 5indows system. 5hen an instance is e#ec"ted$ it !athers its confi!"rationval"es and allocates memory pools b"ffers1 into +() and !enerates threads to provide the

    %P: with instr"ctions sets.

    ( sin!le comp"ter may have m"ltiple SQL Server instances. The primary ob3ective behind them"ltiple instance architect"re is to help in the isolation of reso"rces for different kinds ofdatabase activity within the same physical system. very instance independently "tili6es thememory and processor reso"rces available on the system. SQL Server 2008 s"pports "p to ;0instances on the Standard and nterprise editions.

    'oes this so"nd familiar< t sho"ld. Oracle and SQL Server are both relational databasemana!ement systems +'*)Ss1$ a variation of the '*)S type of sol"tions. 'espite thesimilarities of the two prod"cts as described so far$ there are some differences. :nlike Oracle$

    where the same binaries may be "sed for m"ltiple instances$ SQL Server re-"ires a separateset of binaries to be installed for each instance. )icrosoft has decided to protect not 3"st theprocesses and memory of separate instances b"t also the physical file in order to provideisolation in case of media problems directed at the stora!e location holdin! the set of binaries.

    (nother protection is for instances that mi!ht re-"ire an "p!rade or placement of a specific fileto them. This can be accomplished witho"t affectin! other instances& binaries$ and in t"rn$applications that have not been tested with the "pdate or may have no need for the chan!e.

    (n instance is not associated with only one database. n fact$ each instance installed has itsown set of fo"r /system databases$ which store specific confi!"ration parameters for thatinstance. These databases provide similar f"nctionality as the control files do in Oracle. t can

    be viewed as a /container for one or more databases. 'oes this so"nd familiar as well< f yo"are startin! to think of databases as the e-"ivalent to schemas$ yo" wo"ld be partially correct.

    SQL Server '*(s will install an instance onto a comp"ter. Then they may create a database$separate from the system databases mentioned earlier. This database will have ob3ects in it$incl"din! tables. These ob3ects will s"pport some specific f"nctionality. The isolation of activityprovides mana!ement and sec"rity benefits. This isolation is not 3"st for the data files b"t alsofor the transactions of each database. Oracle "ses the redo lo!s to capt"re transaction activities

    5

  • 8/9/2019 From Oracle to SQL Server

    6/22

    for the instance and its one database. Like Oracle$ every database is re-"ired to "se a file$ thelo! file$ to track and mana!e transactions. Therefore$ every database has its own "ni-"etransaction lo! system.

    Stora e ArchitectureThe introd"ction into blocks$ e#tents$ and se!ments evokes two -"estions. 5hat are theconse-"ences of havin! a fi#ed block si6e of 8 kilobytes =*1$ and what is the effect of a fi#ede#tent si6e of >? =* with respect to internal fra!mentation d"e to varyin! e#tent si6es< Thistopic is of ma3or concern for the '*(.

    !i ure " 'atabase n!ine or!ani6ation for Oracle compared to SQL Server

    n Oracle$ since e#tents are variable in si6e$ data may at times be written nonconti!"o"sly. nSQL Server$ since all e#tents are the same si6e >? =*1$ data can be written and retrieved fromone location on the disk instead of readin! and writin! the data in n"mero"s locations.7ra!mentation within the tablespace file!ro"p in SQL Server1$ a hotly debated topic in theOracle world$ is eliminated in SQL Server by the "se of fi#ed si6e e#tents.

    Oracle has introd"ced ("tomatic Stora!e )ana!ement (S)1$ facilitatin! disk drivemana!ement. (S) allows the "se of raw file system files and a"tomates file mana!ement foran Oracle database. (S) provides mana!ement of the hard drive space as well as makin!

    6

  • 8/9/2019 From Oracle to SQL Server

    7/22

    addin! and removin! disks an easy process with Oracle rebalancin! striped data devices aschan!es occ"r.

    n both Oracle and SQL Server$ the space needed for the definition and "sa!e of many of theschema ob3ects tri!!ers$ proced"res$ etc.1 and system9level ob3ects "sers$ roles$ etc.1 comeo"t of the data dictionary.

    Database #appinach SQL Server instance has two database str"ct"res$ model and msdb $ that do not have an

    e-"ivalent in Oracle. The model database forms the template that is "sed to create newdatabases. This is ro"!hly analo!o"s to how a starter schema can be created "sin! Oracle&sdatabase confi!"ration "tility. The msdb database is "sed by the SQL Server (!ent applicationfor storin! information on 3obs$ events$ sched"les$ operators$ etc. This database combines thef"nctionality fo"nd in Oracle&s +'*)S@AO*S '*)S@AO* and '*)S@S%, ':L +1 and the

    ntelli!ent (!ent repository.

    The followin! table lists tablespaces in Oracle and the e-"ivalent stora!e str"ct"res in SQLServer$ where applicable.

    Table " Oracle Tablespaces and SQL Server Stora!e Str"ct"res with -"ivalent 7"nction

    SQL Server Oraclemaster database System tablespacemaster database Sysa"# tablespace+eso"rce database hidden B +eadOnly1 SystemCSysa"# tablespacetempdb database Temporary tablespaceTransaction lo! :ndo +ollback1 tablespaceTransaction lo! Online +edo lo!D(pplicationD database9D'ataD file!ro"p D(pplication *i!file 'ataD tablespaceD(pplicationD database9D'ataD file!ro"p D(pplication 'ataD tablespaceD(pplicationD database9D'ataD file!ro"p D(pplication nde#D tablespacemodel database Eot available in Oraclemsdb database Eot available in Oracle

    t is not possible to cate!ori6e each of the databases in a SQL Server instance as inte!ral orself9contained in the same sense as an Oracle databases. 7ollowin! are e#amples of a"tonomyas well as that of dependence on central str"ct"reF

    • n SQL Server$ each database has its own transaction lo! files$ which combine thef"nctions of the Oracle online redo lo!s and "ndoCrollback se!ments.

    • ach SQL Server database has its own sec"rity str"ct"res s"ch as "sers$ privile!espermissions1$ and roles.

    • ach SQL Server database has its own administrative roles that bestow privile!es onthe specific database alone.

    7

  • 8/9/2019 From Oracle to SQL Server

    8/22

    • n SQL Server$ the system catalo!$ which is analo!o"s to the Oracle data dictionary$ isbroken "p amon! the individ"al databases$ the master database$ and the hidden andread9only1 +eso"rce database.

    • The temporary space tempdb in SQL Server and temporary tablespace in Oracle1 is

    common to the entire instance.

    Tablespaces and file!ro"ps provide the ability to better distrib"te data across m"ltiple files forthe p"rposes of performance. The !ro"pin! also aids administration in terms of back"p andrecovery$ maintenance flippin! the stat"s to offlineConline for chosen tablespaces1$ and othertechni-"es s"ch as table partitionin!.

    Lo in #odelOnline redo lo!s are "sed by Oracle to record transactional chan!es ')L and ''L1 made tothe database before those chan!es are committed to the database files. n SQL Server$ the

    redo lo!s are called transaction lo!s. Oracle also "ses "ndo tablespaces to capt"re an ima!e of data before it is chan!ed before9ima!es1 to facilitate transaction rollback$ recovery$ and readconsistency m"lti9version conc"rrency1.

    arlier releases of Oracle 'atabase "sed rollback se!ments to store "ndo information. OracleGiintrod"ced a"tomatic "ndo mana!ement$ which simplifies "ndo space mana!ement byeliminatin! the comple#ities associated with rollback se!ment mana!ement.

    Oracle "ses two or more fi#ed si6e online redo lo!s. 5hen a redo lo! is filled "p$ a checkpoint isinitiated and the database starts writin! transaction records to the ne#t online redo lo!. n themeantime$ all dirty database b"ffers related to the records in the filled lo! are applied to the

    database by a database writer '*5+1 process. (s well$ a copy of the redo lo! can be madewhen "sin! archivelo! mode to s"pport f"t"re database recovery.

    The transaction lo! in SQL Server combines the f"nctionality of the Oracle redo lo!s and the"ndo se!ments. ach database in SQL Server has one or more transaction lo! files. Thetransaction lo! is a wrap9aro"nd lo! file. f the lo! contains m"ltiple physical files$ portions ofeach physical lo! file are "sed in a ro"nd9robin manner to lo! transactions and wrap back to thestart of the first physical lo! file.

    SQL Server se!ments each database lo! file internally into a n"mber of /virt"al lo! files . Hirt"allo! files vary in si6e$ and there is no fi#ed n"mber of virt"al lo! files for a physical lo! file.SQL Server chooses the si6e of the virt"al lo! files dynamically while creatin! or e#tendin! lo!files. SQL Server tries to maintain a small n"mber of virt"al files. The si6e or n"mber of virt"allo! files cannot be confi!"red or set by administratorsI it is determined dynamically bySQL Server internally.

    8

  • 8/9/2019 From Oracle to SQL Server

    9/22

    !i ure $ SQL Server transaction lo! architect"re

    Eew lo! records$ identified by lo! se-"ence n"mbers LSEs1$ are added at the end of thetransaction lo!. Lo! records for data modifications record either the lo!ical operation performedor before and after ima!es of the modified data. Lo! records are stored in a serial se-"ence asthey are created. ach lo! record is stamped with the ' of the transaction to which it belon!s.7or each transaction$ all lo! records associated with the transaction are sin!ly9linked in a chain"sin! backward pointers that speed the rollback of the transaction.

    !i ure % SQL Server transaction lo! wrap9aro"nd

    Similar to "ndo se!ments in Oracle$ virt"al lo! entries can be overwritten if the correspondin!transactions are committed. The f"nction and administrative iss"es with transaction lo!s inSQL Server are a combination of the iss"es and f"nctions associated with "ndo se!ments andredo lo!s in Oracle. 5hen the lo! activity wraps aro"nd to the be!innin! of the lo!$ space canbe re"sed only if transactions have committed as in "ndo se!ments1$ checkpoints haveocc"rred s"ccessf"lly as in redo lo!s1$ and data has been removed from the virt"al lo! filesthro"!h a *ack"p Lo! activity similar to a switch1. The *ack"p Lo! f"nction tr"ncatescommitted data. (s tr"ncation operations occ"r$ the records in the virt"al lo!s$ before the LSE of the first lo! ima!e record$ or minim"m recovery lo! se-"ence n"mber )inLSE1 are deleted.Proper sched"lin! of back"ps like sched"lin! (rchive Lo! 3obs1 can provide an effective seriesof wrap9a9ro"nds witho"t any contention.

    n SQL Server$ it is a best practice to si6e the transaction lo! appropriately. SQL Server&sa"to!row feat"re sho"ld be enabled to allow the lo! files to !row sho"ld the database r"n o"t of lo! space$ allowin! databases to contin"e r"nnin! d"rin! hi!h or "ne#pected transactionalactivity between back"ps when the '*( has not si6ed the lo! appropriately. ("to!row kicks inonly after the lo! has completely r"n o"t of space$ so it is better to monitor the lo!&s free spaceand man"ally !row the lo! before yo" act"ally need it. The a"toshrink option sho"ld typically notbe "sed. t will ca"se the lo! files to shrink$ only to have the a"to!row f"nctionality increase the

  • 8/9/2019 From Oracle to SQL Server

    10/22

    space a!ain. These options are similar in f"nctionality to the "ndo se!ment feat"res$a"toe#tend$ and shrink.

    &ac'up and (ecovery

    n Oracle$ back"p methods can be cate!ori6ed at a hi!h level as physical and lo!ical back"ps.There are two ways to perform Oracle back"p and recoveryF +ecovery )ana!er +)(E1 and"ser9mana!ed back"p and recovery. Oracle offers several options for complete recovery froman instance or disk fail"reF the redo lo!$ "ndo records$ a control file$ and database back"ps.

    +)(E is "sed to back "p$ restore$ and recover databases.

    (nother approach is the "ser9mana!ed back"p and recovery$ which is e#ec"ted thro"!h theoperatin! system for back"ps and then "ses SQLJPl"s for recovery. Oracle se!ments itsback"ps by consistent and inconsistent states. These can also be viewed as cold or hotback"ps.

    SQL Server offers f"ll$ differential$ partial$ transaction lo!$ and tail back"ps$ which aid incomplete recovery of databases d"rin! disk$ server$ or instance fail"re. There are a variety ofhot and cold back"ps available in SQL Server to s"it any b"siness environment. SQL Serverdatabases can also be -"ickly detached and the files copied$ and then they can be attached toanother instance.

    Logical BackupsThe !oal of a lo!ical back"p is to be able to recover at the individ"al schema ob3ect level. nOracle$ lo!ical back"ps are mainly performed "sin! the #port "tility. This "tility e#ports theschema ob3ects into a binary file$ which can only be read by the mport "tility and imports the

    schema ob3ects into a database.n SQL Server$ individ"al schema ob3ects can be backed "p to flat files in any of the s"pported

    file formats. Then flat files can be restored "sin! tools s"ch as the bcp "tility a command9linetool that "ses the *"lk %opy Pro!ram$ or *%P$ (P 1$ the *:L= ES +T command$ the mportand #port 5i6ard$ or the SQL Server nte!ration Services tools.

    Physical BackupsPhysical back"ps are copies of the physical database files. n Oracle$ these files incl"de datafiles$ control files and$ if the database is in (+%, H LO )O' $ archived redo lo! files.

    The process is similar in SQL Server. enerally$ a back"p in SQL Server is viewed to be at thedatabase level. Lar!er databases can "tili6e file!ro"p or file back"ps to back "p sections of adatabase. These are typically implemented to red"ce back"p time andCor data vol"me.Transaction Lo! back"ps hold the transaction lo!s. mportant sec"rity components like theService )aster =ey$ 'atabase )aster =ey$ 'atabase ncryption =ey$ and %ertificates can bebacked "p in SQL Server.

    10

  • 8/9/2019 From Oracle to SQL Server

    11/22

    Consistent/Cold Backupsn Oracle$ a consistent back"p of a database or part of a database is a back"p in which all

    readCwrite datafiles and control files are checkpointed with the same System %han!e E"mberS%E1 which is a "ni-"e val"e assi!ned to every committed Oracle transaction. %old back"ps

    are not an option in most mission9critical environments with hi!h availability re-"irements$ since

    they re-"ire system downtime.

    n Oracle$ to create a consistent whole database back"p$ the database m"st be sh"t down withthe EO+)(L$ )) ' (T $ or T+(ES(%T OE(L options. The ne#t step is to make the back"pwhile the database is closed.

    SQL Server databases can be backed "p while the database is online. The f"ll online databaseback"p offers f"nctionality similar to Oracle&s consistent or cold back"p. This method will back"p the entire database and part of the transaction lo!. ,owever$ it does not re-"ire the databaseto be offlineI the database can have active connections while the back"p is bein! done. (fterrestorin! from this back"p$ a database recovers to a consistent state and can be opened for

    access if yo" do not need to apply s"bse-"ent transaction lo! back"ps. n SQL Server$ f"ll back"ps represent the database at the time the back"p completed. ( f"llonline back"p by itself is s"fficient in all respects for a consistent database recovery inSQL Server. The back"p represents the state of the database at the point when the back"pcompleted.

    Inconsistent/Online Backups5ith today&s demand for 2?#K availability$ it is diffic"lt to take an entire database offline. n thesesit"ations$ Oracle may perform an online back"p. (n online back"p capt"res the database in aninconsistent state where not all chan!es have been made to the S%E. Settin! the mode of the

    database to (+%, H LO allows the '*( to define different tablespace and control file back"psched"les. This sta!!ers the back"p over a period of time and provides the benefit of onlyaffectin! specific tablespaces vers"s all of them and allows individ"al back"ps to proceedfaster. This can be very important when the window of low "sa!e a!ainst the back"ps is lessthan the time necessary to do a whole back"p. 5hen "sin! Oracle +)(E to perform the onlineback"p$ it is not necessary to place the tablespaces in back"p mode.

    5ith SQL Server$ a f"ll online database back"p contains the complete database and incl"despart of the transaction lo!. 7"ll$ differential$ and partial file and file!ro"p back"ps can be made"sin! the *(%=:P '(T(*(S statement or thro"!h SQL Server )ana!ement St"dio.Transaction lo!s can be backed "p separately as well. ( f"ll database back"p does not clear the

    transaction lo!. ( back"p process sho"ld be initiated to clear the lo! periodically to prevent thelo! from fillin! "p. :s"ally$ a !ood back"p strate!y will incl"de periodic transaction lo! back"ps$which will miti!ate this iss"e. (ny transactions that were in pro!ress will be incl"ded in theback"p.

    *ackin! "p the transaction lo!s also allows yo" to s"bse-"ently recover the database to anypoint in time.

    11

  • 8/9/2019 From Oracle to SQL Server

    12/22

    Incremental BackupsPhysical incremental back"ps are performed to capt"re only the chan!ed blocks$ therebyred"cin! the time and space needed for the back"ps. ncremental back"ps are performed afteran initial complete back"p has been performed. (ltho"!h recovery takes lon!er$ incrementalback"ps are pop"lar beca"se of the red"ction in time to perform the back"p and the decreased

    back"p space re-"ired.

    n Oracle$ incremental back"ps can be performed "sin! +)(E or third9party tools. n the caseof +)(E$ datafiles are scanned and only those blocks that have chan!ed are backed "p tostora!e. +)(E offers two different types of incremental back"ps incremental or differential.

    ncremental back"ps level M1 affect only the data modified since the last f"ll level 01 orincremental level M1 back"p. ( differential back"p also a level M1 !athers all data modifiedsince the last f"ll back"p level 01.

    5ith SQL Server$ the followin! back"ps are somewhat analo!o"s to Oracle&s incrementalback"psF

    • Transaction lo bac'ups NSQL Server transaction lo! back"ps serve the samep"rpose as incremental back"ps in Oracle. This type of back"p stores all thetransactions that have occ"rred since the last transaction lo! back"p.

    • Differential bac'ups NSQL Server will capt"re all the data chan!ed since the last f"llback"p. 'ifferential back"ps are c"m"lative from the last f"ll back"p onlyI they are notincremental. 'ifferential back"ps do not allow point9in9time recovery or marked lo!recovery.

    • Partial bac'ups NSQL Server also has partial back"ps$ which contain only the data in

    the Primary and readCwrite file!ro"ps of the database. Partial back"ps do not archiveread9only file!ro"ps. Specifyin! + ('@5+ T @7 L +O:PS in the *(%=:Pstatement backs "p only the readCwrite file!ro"ps and omits the read9only ones$ass"min! yo" already have back"ps of those.

    ach back"p type has benefits and potential drawbacks based on yo"r environment. 5henimplementin! a back"p sol"tion$ yo" m"st take into acco"nt several factors incl"din! time$vol"me$ and recoverability. 7or instance$ a partial back"p can be performed in a shortermaintenance window than a f"ll back"p$ and it may eliminate the need for more fre-"enttransaction lo! back"ps. ,owever$ it cannot be "sed for complete or point9in9time recoveries.

    Similarly$ partial differential back"ps may take less time than partial back"ps$ b"t d"rin!recovery both the partial back"p and the differential back"p may need to be "sed$ increasin!the time and comple#ity re-"ired for recovery operations.

    1#

  • 8/9/2019 From Oracle to SQL Server

    13/22

    Database Security'atabase sec"rity is a layered approach with vario"s mechanisms in place to re!"late access tothe database$ the data dictionary$ ob3ects$ and data. This section presents these mechanismsavailable in Oracle and compares them to the ones in SQL Server.

    Oracle s"pports several important sec"rity concerns in the enterprise like data inte!rity andprivacy$ a"thentication$ sin!le si!n9on SSO1$ and access a"thori6ations. The "bi-"ito"s Sec"reSockets Layerin! SSL1 is available as well as an Oracle Eet native encryptor to provide dataencryption. Stron! a"thentication is a m"st and is implemented thro"!h standards s"ch as=erberos$ smart cards$ and di!ital certificates.

    n SQL Server$ stron! a"thentication mechanisms and data encryption are b"ilt into the system.SQL Server provides data encryption$ password protection to access databases$ certificates fore#ec"tin! stored proced"res$ SSO$ and$ of co"rse$ =erberos and SSL for protocol encryption.

    SQL Server sec"res data with a hierarchical encryption and key mana!ement infrastr"ct"re.

    ach layer sec"res the layer below it$ "sin! a combination of certificates$ asymmetric keys$ andsymmetric keys. The dia!ram ill"strates the approach.

    !i ure ) SQL Server data encryption

    1$

  • 8/9/2019 From Oracle to SQL Server

    14/22

    SQL Server 2008 e#pands "pon this key mana!ement by allowin! the keys to be retrieved froman e#ternal key mana!ement =)1 so"rce$ perhaps hardware or software. This allowsSQL Server to fit seamlessly into an enterprise9wide key mana!ement infrastr"ct"re.

    Transparent Data Encryption

    Oracle and SQL Server "se encryption to help protect data. SQL Server 2008 introd"cesTransparent 'ata ncryption T' 1$ and Oracle provides a form of T' tho"!h the definition ofa master key and a wallet. Oracle defines its "se of T' thro"!h table definitions and sets it atthe col"mn level.

    n SQL Server 2008$ T' encrypts the data$ lo!$ and back"p files of the whole database. Thisprevents a malicio"s person from obtainin! the database files and simply attachin! them toanother SQL Server instance. The files are encrypted via a certificate$ and the database canonly be accessed with that certificate. The act"al encryptionCdecryption occ"rs as the pa!es ofthe data or lo! files are written to or read from the CO system. The data inside SQL Server&scache is in normal plainte#t while the data on the disk is in encrypted form.

    Once T' is enabled$ the entire database and lo! is then encrypted by back!ro"nd threads$and pa!es will be encrypted as they flow fromCto the disk. The impact on the performance willvary dependin! on the access patterns of yo"r database. The tempdb database will beencrypted if any database on the instance is encrypted$ so performance may be impacted byany tempdb "sa!e.

    Of co"rse$ it is very important to back "p the database&s encryption certificate. 5itho"t thecertificate$ it is impossible to access the database or restore it. The back"p of the certificatem"st be handled sec"rely. (s with any set of keys and locks$ the data is only as sec"re as thekey itself.

    Logins*oth Oracle and SQL Server provide lo!ins for a"thori6ed "sers to connect to the database. nOracle$ a lo!in is referred to as the "ser or "sername. n SQL Server$ this is called the lo!inidentifier or simply lo!in. (ny operation the "ser can perform is controlled on the privile!es!ranted to the lo!in.

    There are three types of "sers in an Oracle databaseF

    • Schema ownersN"sers who create and maintain ob3ects related to an application

    • (pplication "sersN"sers or systems1 who manip"late data in the ownin! "sers& tables

    • (dministrative "sersN"sers with special roles s"ch as database administrator$ orsec"rity administrator

    n SQL Server$ the lo!in enables a "ser to connect to an instance. ,owever$ access to otherdatabases within the instance is not a"tomatic and is controlled by additional acco"nts called"sers1 that are created in each of the databases to which the lo!in re-"ires access. Theprivile!es at the instance level are assi!ned to the lo!in$ and privile!es inside a database are

    14

  • 8/9/2019 From Oracle to SQL Server

    15/22

    !iven to the related database "ser. ( database "ser is mapped back to an instance lo!in$tho"!h the "ser&s name in any !iven database can take on a pse"donym. ( SQL Server lo!inserves as an a"thentication mechanism$ whereas a database "ser s"pplies a"thori6ationaccess to database ob3ects.

    SQL Server "sers can also be classified into the same three types as OracleF

    • Schema owners "sers who create and maintain ob3ects related to an application.

    • (pplication "sers N"sers or systems1 who manip"late data in the ownin! "sers& tables.

    • (dministrative "sers 9 "sers with special roles s"ch as database administrator$ orsec"rity administrator.

    The acco"nt and privile!e re-"irements for each of the three types differ. 7or administrators ofthe instance$ a lo!in will s"ffice$ b"t administrators of databases will need "ser acco"nts in thetar!et database.

    'atabase ob3ect owners in SQL Server will need a lo!in for the server and a "ser acco"nt ineach of the databases that they will be creatin! ob3ects in. Similarly$ application "sers will needa lo!in for the server and a "ser acco"nt in databases they will be accessin!.

    ( special "ser called dbo& for database owner is present in every SQL Server database and hasthe privile!es to perform any activity inside the database. (n administrative lo!in with sysadminrole is mapped inside each database to the dbo "ser. This can be viewed as bein! similar to theway a "ser connectin! to an Oracle database as S S'*( or S SOP + is a"tomaticallyconnected as S S. SQL Server lo!ins can also be mapped to the dbo "ser in a database$thereby !ivin! them administrative privile!es in that database.

    Authentication ("thentication is the process of verifyin! that the lo!in ' or "sername s"pplied by a "ser toconnect to the database belon!s to an a"thori6ed "ser. *oth Oracle and SQL Server allowa"thentication thro"!h the operatin! system or thro"!h the database server1. n SQL Server$the operatin! system mode is called 5indows ("thentication$ and the database mode is calledSQL Server ("thentication.

    Oracle (dvanced Sec"rity s"pports the followin! a"thentication methodsF

    • =erberos

    • +(' :S

    • SSL

    • ntr"stCP=

    15

  • 8/9/2019 From Oracle to SQL Server

    16/22

    SQL Server s"pports =erberos ("thentication as part of the 5indows Server4 (ctive 'irectory4 domain installation. ndpoints in SQL Server can also be confi!"red tos"pport =erberos a"thentication.

    SQL Server can "se SSL to encrypt all data transmitted between an application comp"ter and aSQL Server instance on a database comp"ter. The SSL encryption is performed within the SQLEative %lient Eet9Library and applies to all intercomp"ter protocols s"pported by SQL Server.

    n addition$ nternet Protocol sec"rity Psec1 encryption is s"pported by the 5indows operatin!system and is confi!"red within the operatin! system itself and not within SQL Server. The three

    T7 standards9based a"thentication methods to establish tr"st between comp"ters are asfollows. (ll of the followin! types of encryption are s"pported in 5indowsF

    • =erberos v;.0 a"thentication provided by the 5indows domain

    • P"blicCPrivate =ey si!nat"res "sin! certificates

    • Passwords$ termed preshared a"thentication keys$ "sed strictly for establishin! tr"stNnot for application data packet protection

    PasswordsOracle passwords have the followin! feat"res and f"nctionalityF

    • +estrictions on composition and comple#ity of passwords

    • 7"nction9based comple#ity enforcement

    • Password a!in! and e#piration settin!s

    • Password life9cycle enforcement re"se$ and other attrib"tes1

    • (cco"nt lockin! based on failed attempts$ password e#piration$ etc.

    • Password encryption

    Since the SQL Server sec"rity architect"re is desi!ned to levera!e 5indows sec"rity$ it is ti!htlyinte!rated with the 5indows a"thentication and a"thori6ation mechanism. Therefore$ when yo""se 5indows a"thentication in SQL Server$ yo" can take advanta!e of the password protection$composition$ e#piration$ profile$ failed attempts$ and encryption enforcements. SQL Server 2008

    stren!thens SQL Server a"thentication. SQL Server also makes "se of theEetHalidatePasswordPolicy (P $ available in 5indows Server 200 and later$ to enforce the5indows password policies of the comp"ter on which SQL Server is r"nnin!.

    The followin! options are available to stren!then SQL Server lo!insF

    • %, %=@POL %

    • %, %=@ RP +(T OE

    16

  • 8/9/2019 From Oracle to SQL Server

    17/22

    • ):ST@%,(E

    The options can be set with the %+ (T LO E ''L statement or by "sin! SQL Server)ana!ement St"dio.

    Scalability and *i h AvailabilityScalability is the ability to s"pport very lar!e databases HL'*1 andCor lar!e9vol"me OLTP. Thesi6e of the HL'*s may be d"e to a few lar!e tables or a lar!e n"mber of smaller tables or acombination of both. OLTP scalability is meas"red in the n"mber of "ser connections$ responsetime$ and transaction thro"!hp"t.

    n a broader sense$ scalability is also meas"red in the scale9"p or scale9o"t capabilities of the"nderlyin! architect"re. Scale9"p refers to increasin! the capacity of server or system by addin!more reso"rces s"ch as processors and memory.

    Some of the scalability feat"res available in Oracle and SQL Server$ startin! with databaseinternal facilities and str"ct"res and pro!ressin! to ma3or feat"res$ are disc"ssed in thefollowin! sections.

    Dynamic emory anagementOracle and SQL Server each have the ability to dynamically resi6e the components offered bytheir respective memory pools to handle varyin! workloads. This red"ces the chances ofpa!in!. SQL Server&s releases any "n"sed memory when re-"ested by the operatin! system$and this allocation "s"ally !oes onto the free list. f the operatin! system is not "tili6in! all of thememory for itself or other applications$ SQL Server will assi!n the memory into its b"ffer cacheas re-"ired. n SQL Server$ the minim"m amo"nt of memory that needs to be allocated for a

    -"ery e#ec"tion can also be specified by the "ser. This "ser9confi!"rable val"e can ran!e from;M2 =* to 2 !i!abytes *1 for a -"ery.

    Parallel !"L !tatementsParallel SQL statements are dynamically s"bdivided into distinct tasks distrib"ted amon!m"ltiple processors. These parallel operationsF

    • (re s"pported in symmetric m"ltiprocessin! S)P1$ massively parallel processin! )PP1and cl"stered systems.

    • Offer performance !ains for -"eries$ inde# creation$ b"lk operations ')L and data

    loads1$ a!!re!ations$ copyin!$ and creatin! a table "sin! S L %T ETO statement.• S"pport intra9operation and inter9operation parallelism.

    Oracle and SQL Server have very similar architect"res for parallel SQL operations. Oracle andSQL Server optimi6ers are parallel9aware and "se parallel -"ery slaves and worker threads$respectively$ to carry o"t the e#ec"tion plan.SQL Server a"tomatically determines the de!ree ofparallelism 'OP1 for each -"ery$ m"ch like Oracle.

    17

  • 8/9/2019 From Oracle to SQL Server

    18/22

  • 8/9/2019 From Oracle to SQL Server

    19/22

    !ummary anagementThe 'ata 5areho"sin! feat"re in Oracle consists of mechanisms to create$ "se$ anddynamically mana!e s"mmary tables and transparently rewrite -"eries to "se the s"mmariestho"!h an intelli!ent -"ery rewrite mechanism. This facility a"tomatically redirects -"eriesa!ainst detail tables to make "se of e#istin! s"mmary tables.

    SQL Server offers inde#ed views$ which provide the capability to materiali6e s"mmaryinformation. The optimi6er a"tomatically determines whether inde#ed views can be "sed toresolve all or part of a -"ery that references this information.

    ultiple Block !i*esOracle s"pports m"ltiple block si6es 2=*C?=*C8=*CM>=*C 2=*1 within the database so thatob3ects can be placed in the ri!ht set of files for improved CO performance. This ability to fine9t"ne CO does inc"r mana!ement costs$ since movin! tables may re-"ire f"ll e#portCimportoperations even with transportable tablespaces if the block si6es are different.

    SQL Server "ses a fi#ed block si6e as a pa!e of 8 =*. 5hile it red"ces a '*(&s ability to fine9t"ne CO operations$ it does provide for !reater transportability and a"tomation. 5ith a fi#edblock si6e$ SQL Server can a"tomatically optimi6e CO operations and memory "tili6ation since italso knows e#actly how m"ch space is "tili6ed with each CO operation.

    E+ternal Ta)les#ternal tables are read9only tables whose data is stored in flat files o"tside the database. They

    provide a way to access data in e#ternal nondatabase1 so"rces as if it were within the databasewitho"t havin! to load the data into the database. This is a val"able tool for TL operations indata wareho"sin!.

    SQL Server can reference e#ternal data so"rces thro"!h linked servers or "sin! theOP E'(T(SO:+% command.

    #ternal files$ s"ch as flat files$ can be read "sin! the OP E+O5S T *:L= 1 commandfrom SQL Server )ana!ement St"dio or "sin! command prompt commands with SQL Server)ana!ement St"dio&s SQL%)' mode. Linked servers allow connections to be made to vario"sdata so"rces$ incl"din! spreadsheets and te#t files. :sers can then perform insert$ "pdate$ anddelete operations "sin! SQL statements a!ainst these data so"rces.

    (ACThe Oracle +eal (pplication %l"ster +(%1 architect"re$ in the conte#t of scalability feat"res$

    delivers hi!h performance and increased thro"!hp"t by hori6ontally scalin! the database on toa cl"stered set of servers. The server nodes access a sin!le shared database$ sharin! thestora!e and database reso"rces$ while "sin! their own memory and %P:. +(% distrib"tes thework amon! the servers. The new %ache 7"sion technolo!y minimi6es performance problemsd"e to cache pin!in! synchroni6ation1.

    SQL Server "ses federated database servers architect"re and distrib"ted partitioned views'PHs1 to implement a scale9o"t$ shared9nothin! sol"tion. ( federation of database servers

    1

  • 8/9/2019 From Oracle to SQL Server

    20/22

    facilitates spreadin! of the process load across a !ro"p of servers by hori6ontally partitionin!the data in a SQL Server database. These servers are mana!ed independently$ b"t theycooperate to process re-"ests on the database.

    Ta)le Partitioning

    Table and inde# partitionin! addresses availability$ mana!eability$ and enhanced performanceiss"es of very lar!e tables providin! the followin!F

    • Smaller "nits of data mana!ement

    • asier placement of data on disk for improved performance

    • (vailability d"rin! fail"res or mana!ement operations

    • ncreased parallelism d"rin! data load$ "pdate$ and batch operations

    • ncreased performance thro"!h the partition9co!ni6ant optimi6er$ which performspartition pr"nin!$ partition9wise 3oins$ and parallel ')L on partitions

    (ll partition f"nctionalities at table and inde# level are available in SQL Server 2008 and Oracle.

    SQL Server f"rther s"pports a partitioned view$ which is a :E OE (LL view of hori6ontallypartitioned data stored in tables in the same or separate databases on the same or separateservers1. The view is created with check constraints$ which is similar to the partitioned viewsoffered by Oracle prior to the partitionin! technolo!y.

    (eplication+eplication is a !reat way of scalin! applications especially over a 5(E. ,owever$ this

    techni-"e is scalable only when the materiali6ed views are "sed for -"eries only. The m"lti9master replication Oracle1 and peer9to9peer replication SQL Server1 techni-"es$ which allow"pdates at any master site$ will work well if there is a hori6ontal partitionin! of data modified ateach site that can be propa!ated asynchrono"sly rather than synchrono"sly. Transactionalreplication and mer!e replication in SQL Server also permit flow of chan!es from the S"bscriber back to the P"blisher. SQL Server replication permits propa!ation of schema alterations as well.

    !tand)y Data)asen Oracle and SQL Server$ the scalability9related f"nction of standby databases is their "se for

    read9only p"rposes$ thereby offloadin! reso"rce9intensive operations$ s"ch as reportin! anddecision s"pport$ from the prod"ction database. The lo!ical standby database in Oracle allowsadditional schema ob3ects to be created in the standby database$ which makes it morecond"cive to s"ch operations. The SQL Server standby database$ a database snapshot$ cannotbe modified in any way.

    A,E !upportSQL Server and Oracle on 5indows can be (5 9enabled$ which allows them to referencephysical memory beyond the ?9 * process limit on 29bit systems.

    #0

  • 8/9/2019 From Oracle to SQL Server

    21/22

    -.#Bit !upportThe >?9bit architect"re has ma3or !ains from the hardware and the operatin! system thatpositively impact scalability and performance. 5ith the pro!ression from 89bit to M>9bit and 29bit systems$ we have already e#perienced these !ains. The scalability comes from bein! able to"se >?9bit memory or an address space of M> million *. The file si6es have !rown from 2 *

    in M>9bit file system to ? * in 29bit file system and M> e#abytes *1 in >?9bit file system.*eca"se this lar!e amo"nt of memory can hold more data$ there are fewer COs to disk andred"ced pa!in! and swappin!$ res"ltin! in improved performance. Similar !ains are obtainedfrom the processors performin! >?9bit inte!er and floatin!9point operations$ thereby vastlyimprovin! the thro"!hp"t. The n"mbers mentioned here are theoretical in nat"re. n reality$ thesi6e of addressable and direct memory access is limited by the operatin! system and thehardware architect"re.

    The only difference between Oracle and SQL Server 2008$ "sin! the same code base for both29bit and >?9bit versions of the database software$ is in the compilation. The feat"res of the

    two versions are similar. SQL Server 2008 s"pports ()' s >?9bit Opteron and (thlon >?processors as well as ntel s Reon with ntel #tended )emory >? Technolo!y )T>?1. On >?9bit systems$ SQL Server can s"pport "p to 2 terabytes T*1 of memory. SQL Server alsos"pports hyper9threaded and m"lti9core processors.

    SOAService Oriented (rchitect"re SO(1 provides the advancements in applications by havin!loosely co"pled$ asynchrono"s applications for better scalability and improved performance.Some of the SO( desi!n principles are -"e"in!$ messa!es$ and services.

    !"L !er$er !er$ice BrokerSQL Server 200; introd"ced SQL Server Service *roker$ which provides vario"s capabilities forb"ildin! SO(9based applications. Service *roker providesF

    • ( rob"st asynchrono"s pro!rammin! model "sin! Service *roker services$ -"e"es$ andconversations messa!es1.

    • Q"e"in! and reliable messa!in! "sin! Service *roker -"e"es.

    (pplications and stored proced"res Transact9SQL or %L+1 can take advanta!e of Service*roker. Typically an application or a stored proced"re s"bmits a messa!e into a Service *rokerservice this process starts a conversation1. The service then p"ts the messa!e to therespective -"e"e$ and then the -"e"e activates the defined stored proced"re which thende-"e"es and processes the messa!e1. The stored proced"re can be "sed to validate themessa!e and sends a response back to the application and end the conversation. Theapplication receives the response and ends the dialo!. Service *roker provides theinfrastr"ct"re for reliable and sec"re messa!e ro"tin!$ conversations$ -"e"es$ services$ andactivation.

    SQL Server Service *roker provides the followin! advanta!esF

    #1

  • 8/9/2019 From Oracle to SQL Server

    22/22

    • )essa!es can be processed as a SQL Server transaction to ens"re data inte!rity.

    • )essa!es are !"aranteed to be processed only once$ and in the same order.

    • Service *roker provides reliable delivery.

    • %onversations alon! with the data are maintained thro"!h system restarts$serverCinstance failover$ and network o"ta!es.

    • t s"pports fle#ible and rapid application development by inte!ratin! s"pport for Service*roker within SQL Server )ana!ement St"dio.

    • t is easy to monitor by "sin! System )onitor co"nters and r"ntime dia!nostics "tilities.

    Oracle !treams Ad$anced "ueuingSimilar to the capabilities of Service *roker$ Oracle provides Oracle Streams (dvanced Q"e"in!

    (Q1. 5ithin an Oracle Streams (Q$ prod"cers en-"e"e a messa!e$ and cons"mer applicationsde-"e"e messa!es. These messa!es may "nder!o transformations d"rin! en-"e"eCde-"e"e.Oracle Streams (Q provides the necessary s"pport for en-"e"e$ de-"e"e$ propa!ation$transformation$ sec"rity$ sched"lin!$ flow9control$ and (synchrono"s Eotifications. The Oracle

    nte!rated 'evelopment nvironment provides s"pport for developin! Oracle Streams (Qbased applicationsI vario"s monitorin! capabilities are b"ilt into the )ana!ement tools.

    +onclusion)icrosoft SQL Server 2008 is a complete end9to9end data mana!ement sol"tion empowerin!"sers across the enterprise by providin! them with a sec"re$ consistent$ and prod"ctive platform

    for !lobal data and b"siness intelli!ence * 1 applications. SQL Server 2008 contin"es the)icrosoft tradition of deliverin! powerf"l and familiar tools to information technolo!yprofessionals and end "sers with !oals to increase b"siness val"e thro"!h red"ced Total %ostof Ownership T%O1$ ease of "se$ and broad inte!ration capabilities. SQL Server 2008 alsoenhances its services and infrastr"ct"re by e#tendin! b"siness intelli!ence systems withsi!nificantly red"ced development and inte!ration effort.

    ##