12.07.2015 Views

Why use ASE 15.0 - Sybase

Why use ASE 15.0 - Sybase

Why use ASE 15.0 - Sybase

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Act Now: Simplify &Protect your DatabaseEnvironment withAdaptive ServerEnterprise 15!Juan VegaPrincipal Consultant<strong>Sybase</strong> Belgium & Luxembourg<strong>Sybase</strong> Symposium15 November 2007Diamant Brussels


<strong>Sybase</strong>'s Unwired Enterprise VisionData Services<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels2


<strong>ASE</strong> <strong>15.0</strong><strong>ASE</strong> <strong>15.0</strong>• <strong>15.0</strong> GA Released: 15 September 2005• Current latest version: <strong>15.0</strong>.2 esd#1• Various customers already in production on <strong>ASE</strong> <strong>15.0</strong>• Major migration projects under way / being started<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels3


<strong>ASE</strong> 12.5.x & 15.x Road Map*<strong>ASE</strong> 12.5.4 ESD#NEOL: 31-Dec-2009<strong>ASE</strong> <strong>15.0</strong>.2Released June 2007• Encrypted Columns (Phase 2)• Object Level Recovery• SQL Scalar UDF• Instead of Triggers• Auto Query Tuning• …much more….<strong>ASE</strong> <strong>15.0</strong>.x SMP*• Partition Enhancements?• Security Enhancements?• SQL Statement Replication?• SQL Table UDF’s?<strong>ASE</strong> <strong>15.0</strong>.1 CE*Q2’07• <strong>ASE</strong> Cluster Edition (Sun & Linux 64 bit only)Q3'07 Q4’07 Q1’08 Q2’08 Q3’08Q4’08Q1’09*Future release dates and functionality are estimates only<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels4


<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?• Performance• Redesigned query processing engine for better DSS performance• Semantic partitions for better OLTP performance and reducedmaintenance window• Security• Column encryption: protect data from 3 rd parties and from your own DBA• Developer features• DBA featuresOverall: reduced TCO, better performance<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels5


<strong>Why</strong> redesign <strong>ASE</strong> query processing?<strong>ASE</strong> pre-15 was 'hard-wired' for OLTP• Nested-loop joins only• Not good enough for DSS queries• Query optimizer costing model needed improvement<strong>ASE</strong> 15 execution engine based on the "Volcano"model• More flexibility to add new access methods• Based on state-of-the art academic research• 'Stream'-oriented approach<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels6


Benefits of Query Processing ChangesDramatic performance improvements for DSS / mixedworkload• New join methods (hash join, improved merge join)• Many new or improved processing algorithms• Example: star/snowflake schemasOLTP improvements (optimizer and execution engineare aware of semantic partitions)Better optimizer• Optimization goals (allrows_mix, allrows_dss)• Improved costing model<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels7


<strong>ASE</strong> <strong>15.0</strong> Join Methods<strong>ASE</strong> <strong>15.0</strong> supports four join methods:• Nested-Loop Join (NLJ)• Same as in pre-<strong>15.0</strong> - Typically the best join method for OLTP• N-ary NLJ• A variant of NLJ patented by <strong>Sybase</strong>; run-time improvement• Merge Join (MJ)• Improved from <strong>ASE</strong> 12.0 implementation - Often <strong>use</strong>ful for DSS-typequeries• Hash Join (HJ)• Hash-based join method - Often <strong>use</strong>ful for DSS-type queries<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels8


<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?• Performance: DSS - completely redesigned query processinginfrastructure• For DSS workload: major potential performance gains due to new joinmethods and many optimizations• Important: no code changes required to benefit from <strong>ASE</strong> 15• Bank (London): most frequently <strong>use</strong>d queries became factor 85 and 54faster in <strong>ASE</strong> 15• Bank (London): one stored procedure ran 644 times faster in <strong>ASE</strong> 15• Telco (NL): removed 8 hours from their batch processing window• Other customers reports significant DSS performance improvements<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels9


<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?• Performance: OLTP - semantic table partitions• Semantic partitioning enables OLTP throughput improvements• Smaller maintenance window due to partition-oriented maintenance• NB: semantic partitioning is an <strong>ASE</strong> optional license feature• Also:• Truly row-locked system tables (OLTP; <strong>15.0</strong>.2)• Solution for classic tempdb contention problems• 'delayed commit' (for batch processing)• BCP (fast BCP into indexed tables) (<strong>15.0</strong>.2)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels10


<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?• Security: column encryption• Encrypt data per column, using strong encryption (256-bit AES)• Schema-level encryption, application transparent with grant decrypt• Especially in <strong>15.0</strong>.2, with decrypt_default• Replicate encrypted data without ever encrypting• Protect data from the DBA (<strong>15.0</strong>.2)• Query encrypted data without performance impact• Search/join on encrypted columns does not slow down (exception: rangequeries on encrypted column).• NB: encryption is an <strong>ASE</strong> optional license feature<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels11


<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?• Developer features• Computed columns & function indexes• XML enhancements• XML, Java, WebServices, XFS, DTM included in the core <strong>ASE</strong> 15 product• New datatypes: bigint, unitext, unsigned int/smallint/bigint• Scrollable cursors• SQL <strong>use</strong>r-defined functions (<strong>15.0</strong>.2)• Instead-of triggers (<strong>15.0</strong>.2)• Statistical aggregates: stddev(),stddevp(),var(),varp() (<strong>15.0</strong>.2)• Built-in hash functions: hashbytes()/hash() for MD5, SHA, SHA1 (<strong>15.0</strong>.2)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels12


<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?<strong>Why</strong> <strong>use</strong> <strong>ASE</strong> <strong>15.0</strong> ?• DBA features:• Smaller maintenance windows (with semantic partitions)• Archive Databases (<strong>15.0</strong>.2)• Offline DBCC, directly on the dump file• Cheap & quick way to bring a database dump online• New built-in datachange() tells you the %-age of rows changed• Can be <strong>use</strong>d to trigger update statistics• Larger data volume: up to 1 Exabyte/<strong>ASE</strong> server• Increased size of database device: 4Tb; max 32767 devices/server• Application tracing (<strong>15.0</strong>.2)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels13


Upgrading toAdaptive ServerEnterprise 15<strong>Sybase</strong> Symposium15 November 2007Diamant Brussels


Upgrading to <strong>ASE</strong> <strong>15.0</strong>Upgrading to 15: no code changes to existingapplications required• Well, some changes may be needed in order to benefit the most from <strong>ASE</strong> 15• Some SQL changes are required (but these are usually in tools, not in applications):• Any home-grown SQL referring to built-ins like rowcnt(), data_pgs() etc.• Replace by new functions row_count(), data_pages() etc.• Any home-grown SQL referring to sysdevices/sysusages• New column vdevno defines the relation btween these tables<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels15


Upgrading to <strong>ASE</strong> <strong>15.0</strong>Possible SQL changes in existing applications• When using semantic partitions, this may impact schema and queries• Define a meaningful partition key• Queries should reference the partition key for best performance• Existing data may need to be partitioned (may take long for big tables)• The new query processing (hash joins etc) depends on proper <strong>use</strong> of 'optimizationgoals'• allrows_oltp, allrows_mix (default), allrow_dss• Important: pick the right goal server-wide (no change to existing SQL!)• When a particular session or query needs a different optimization goal (than server-wide)for best performance, small changes to existing SQL may be needed• Add set plan optgoal statements<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels16


Upgrading to <strong>ASE</strong> <strong>15.0</strong>Upgrading to 15: not different from any other majorversion upgrade• Same procedures apply• Same upgrade methods (in-place, dump-load, quiesce-DB-and-device-copies)• New DBA aspects:• SySAM license manager• Some new configuration parameters• More procedure cache required 2 or 3 times <strong>ASE</strong> 12.x recommended<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels17


Highlights:SQL User-DefinedFunctions (<strong>15.0</strong>.2)<strong>Sybase</strong> Symposium15 November 2007Diamant Brussels


SQL User-Defined FunctionsSQL UDFs: perhaps the #1 customer request• UDFs are possible since 12.0 by using Java classes as functions• Since 12.5, a Java class can be 'hidden' behind a function name-- first: load Java class 'MyClass' into this database…create function MyFunc(p1 int)returns java.lang.Stringlanguage java parameter style javaexternal name 'MyClass.MyMethod'goselect MyFunc(my_column) from MyTablego<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels19


SQL User-Defined Functions<strong>Why</strong> SQL UDFs?• Some functionality naturally maps to a function• A SQL UDF can be <strong>use</strong>d wherever an expression is allowed• Perform complex SQL operations while maintaining set-oriented processingselect dbo.f_complex_formatting (my_column)from my_tablewhere dbo.f_complex_formatting (my_column) =dbo.f_complex_formatting (your_column)• Without SQL UDFs, this probably requires a loop-based algoritm :• Loop through result set of:select my_column, your_column from my_tablefor every row:exec sp_complex_formatting my_columnexec sp_complex_formatting your_column…do further processing…<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels20


SQL User-Defined Functions<strong>15.0</strong>.2: UDFs in SQL -- no Java needed• <strong>15.0</strong>.2 supports scalar-valued UDFs (i.e. return a single value):create function f1 (@p int)returns int asreturn @p * 10select dbo.f1(my_column) from my_table• We're considering table-valued UDFs are for a post-<strong>15.0</strong>.2 releasecreate function f2 (@p int)returns table asreturn select c1, c2from t1, t2 where t1.cx = t2.cx and t2.cy = @pselect * from dbo.f2(…parameter values…)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels21


SQL User-Defined FunctionsExamples: my favorite date format: dd-MMM-yyyycreate function my_datefmt (@d datetime)returns char(11)asreturn str_replace( convert(char(11), @d, 106), ' ', '-')goselect dbo.my_datefmt('Apr 24 2007') returns string '24-Apr-2007'select dbo.my_datefmt(crdate) from sysobjects returns formatted crdate values<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels22


SQL User-Defined FunctionsExamples:create function greatest (@p1 int, @p2 int)returns intasreturn case when @p1 > @p2 then @p1 else @p2 endgoselect dbo.greatest(2,3)returns 2select dbo.greatest( dbo.greatest(2,3), 4) returns 4<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels23


SQL User-Defined FunctionsExamples: Format an integer in binary format:create function int2bin (@n bigint) returns varchar(80)asdeclare @i bigint, @temp bigint, @s varchar(80)set @i = @n, @s = ''while (@i > 0)beginset @temp = @i % 2set @i = @i /2set @s = char(48 + @temp ) + @sendreturn @sgoselect dbo.int2bin(1234567890123456789)returns'1000100100010000100001111010001111101111010011000000100010101'<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels24


SQL User-Defined FunctionsRestrictions on SQL UDFs• Some SQL statements are disallowed in UDFs, to avoid sideeffects:• DML, DDL• select or fetch statements returning data to the client• only allowed: select @var= or fetch…into @var• transaction control (begin tran, commit, etc)• output parameters not allowed• print, raiserror• getdate(), rand(), newid()• exec not allowed (both for stored procs and exec-immediate)• only extended stored procs (xp_*) may be executed• but not if they return a result set, like xp_cmdshell• dbcc<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels25


SQL User-Defined FunctionsRestrictions on SQL UDFs• <strong>Why</strong> these restrictions?• A UDF is executed as part of a statement• This is quite different from a stored proc, which is a sequence ofstatements itself• Without these restrictions on UDFs, unpredictable behaviour couldresult• Currently, UDFs must therefore be deterministic• we're looking at supporting nondeterministic UDFs• Note that execution of a UDF is not guaranteed!• When a UDF is <strong>use</strong>d in a WHERE-cla<strong>use</strong>, it may never be executed(subqueries have the same issue)• Order of execution of UDFs is undefined<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels26


SQL User-Defined FunctionsSQL UDFs can be <strong>use</strong>d in computed columns, defaultscreate table t ( a int default dbo.MyFunc() )create default dft1 as dbo.MyFunc()create table t ( a int, b as dbo.MyFunc(a) materialized)create index ix1 on t ( dbo.MyFunc(a) )select * from twhere dbo.MyFunc(a) = 10NB: a materialized CPC better be deterministic, otherwise CPCs andfunction indexes are pointless…so a SQL UDF in a CPC should also be deterministic<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels27


SQL User-Defined FunctionsPossible applications• Endless possibilities:• Create a real-life soundex function• Adjust for timezones• < your favorite UDF idea here>• Combine with UDF-in-indexed-computed-column for fast lookup• Create UDFs against system tables• index_name(table_name, index_id)• has_histogram(table_name, column_name)• Make life easier in the RSSD with handy UDFs• truncate_table_enabled() (for a repdef)• nr_of_subscriptions() (for a repdef)• triggers_enabled() (for a connection)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels28


Highlights:Encrypted Columns(phase 2, <strong>15.0</strong>.2)<strong>Sybase</strong> Symposium15 November 2007Diamant Brussels


Column encryption enhancements• Column encryption was orginally introduced in 12.5.4 and<strong>15.0</strong> esd#2 ("phase 1")• Phase 2 is now released in <strong>15.0</strong>.2Highlights:• Protect data from DBA with sa_role, sso_role• 100% application transparency with decrypt_default• New system role keycustodian_role• More datatypes can be encrypted• bigint, bit, date/time, money, unichar, univarchar• Features for better managing encryption keys• Features to recover lost encryption keys<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels30


100% application transparency'Decrypt default': defines a value to be returned when the <strong>use</strong>r has no decryptpermission on an encrypted columncreate table Ccard (custname char(30),decrypt_default 'xxxx-xxxx-xxxxxxxx')cardtype char(10),cardno char(19)grant select on Ccard to publicencrypt with cc_keygrant decrypt on Ccard(cardno) to three_letter_agency_role• When someone without decrypt permission selects fromCcard.cardno, there's no error, but 'xxxx-xxxx-xxxx-xxxx' is returned• With decrypt_default, 100% application transparency can be achieved<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels31


100% application transparencyA SQL UDF can be <strong>use</strong>d for a decrypt_default:create function my_funcreturns varchar(19)asif s<strong>use</strong>r_name() = "jsmith" return "xxxx-xxxx-xxxx-xxxx"return "yyyy-yyyy-yyyy-yyyy"gocreate table Ccard (custname char(30),cardtype char(10),cardno char(19)encrypt with cc_keydecrypt_default dbo.my_func() )<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels32


Protecting encrypted data from theDBAFrequently heard customer requirement:"we want to protect data from the DBA"• In pre-<strong>15.0</strong>.2, sa_role automatically makes you DBO…• … and therefore you'd automatically have decrypt permission on all encryptedcolumns• In <strong>15.0</strong>.2, an encryption key can be protected by a password• to encrypt or decrypt with such a key, the password must be specified• this way, even the DBA cannot access encrypted data without knowledgeof the key's password<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels33


Protecting encrypted data from theDBA•Associate a password with a key; grant select access on the key toDBO:create encryption key k1 with passwd ‘Xgd4370561’grant select on k1 to dbo•DBO creates table with credit card column encrypted by key 'k1':create table accounts (ccard char(15) encrypt with k1, …)grant decrypt on accounts (ccard) to bill•Key owner shares k1’s password with Bill•Before Bill can decrypt accounts.ccard he must supply the password:set encryption passwd ‘Xgd4370561’ for column accounts.ccardselect * from accounts<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels34


Protecting encrypted data from theDBA•So our data is protected from the DBA, but now you need toremember this password…•Solution: instead of using this explicit password, the key ownerprotects the key with a password based on a login's encryptedpassword (as stored in syslogins.password):alter encryption key k1with password ‘Xgd4370561’add encryption for <strong>use</strong>r billfor login_association•When Bill logs in:• the encrypted password of Bill is <strong>use</strong>d to enable the encryption key for Bill…• …while Bill doesn't have to know, or specify, the password 'Xgd4370561'<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels35


Column encryption enhancementsNew system role 'keycustodian_role'• Encrypted columns highlighted the need for better separation of roles• sa_role / sso_role isn't good enough anymore (if you're security-serious)• keycustodian_role is allowed everything related to encryption keys• but nothing else: no data access permissions, no other sso_rolepermissions• keycustodian_role can be decoupled from sso_role• sso_role includes keycustodian_role by default• Separation of responsabilities to 3 (or more) logins with different roles:• sa_role - DBA (with no sso_role)• sso_role - auditing and universal decrypt permission (but no data accessrights)• keycustodian_role - handle encryption keys (and nothing else)• multiple logins can be granted keycustodian_role, to manage differentsets of encryption keys (in different databases, for example)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels36


Stricter permission checks for decrypt• Traditional <strong>ASE</strong> permission checking mechanism:• If a stored proc P is owned by <strong>use</strong>r X• … and table T is owned by <strong>use</strong>r X• … and proc P accesses table T• … then anyone having execute permission on P also has access to TAlso: a table owner automatically has decrypt permission on any encryptedcolumn• For encrypted data, customers want stricter security• option: <strong>use</strong> password-protected encryption keys or login-associated keys(see before)• New config parameter in <strong>15.0</strong>.2:sp_configure 'restricted decrypt permission'• When set to 1 (default=0), decrypt permission must have been grantedexplicitly to the <strong>use</strong>r accessing an encrypted column, thus overriding thedefault mechanism above• includes logins with 'sa_role' (but without 'sso_role')• this way, the granted decrypt permission is visible in sysprotects<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels37


Legal disclaimerLegal Disclaimer:This session contains product futures informationfor several <strong>Sybase</strong> products. The roadmap andtimelines shown in this session do not represent acommitment on the part of <strong>Sybase</strong> to deliver thesefeatures as shown. They are forward looking andactual delivery of features and technologies issubject to change.Thank you for understanding!<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels38


<strong>ASE</strong> Cluster Edition(<strong>ASE</strong> <strong>15.0</strong>.1 CE)<strong>Sybase</strong> Symposium15 November 2007Diamant Brussels


<strong>ASE</strong> 12.5.x & 15.x Road Map*<strong>ASE</strong> 12.5.4 ESD#NEOL: 31-Dec-2009<strong>ASE</strong> <strong>15.0</strong>.2Released June 2007• Encrypted Columns (Phase 2)• Object Level Recovery• SQL Scalar UDF• Instead of Triggers• Auto Query Tuning• …much more….<strong>ASE</strong> <strong>15.0</strong>.x SMP*• Partition Enhancements?• Security Enhancements?• SQL Statement Replication?• SQL Table UDF’s?<strong>ASE</strong> <strong>15.0</strong>.1 CE*Q2’07• <strong>ASE</strong> Cluster Edition (Sun & Linux 64 bit only)Q3'07 Q4’07 Q1’08 Q2’08 Q3’08Q4’08Q1’09*Future release dates and functionality are estimates only<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels40


Future: <strong>ASE</strong> Cluster Edition<strong>ASE</strong> Cluster Edition will be new High Availabilityoffering from <strong>Sybase</strong>• Multiple <strong>ASE</strong> servers, operating against the same databasespresent themselves as a single <strong>ASE</strong> server to the application• Transparent server-side and client-side failover• Workload distribution• GA planned for 1H 2008<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels41


<strong>ASE</strong> Cluster EditionWhat is <strong>ASE</strong> Cluster Edition?• Shared Disk Cluster (SDC) implementation of <strong>ASE</strong>• Multiple <strong>ASE</strong> servers (called “instances” in Cluster Edition) cooperate tosimultaneously manage the same set of data.• Cluster of instances present themselves as a single system, with all dataavailable on all instances.• All clusterware is built into <strong>ASE</strong>. No external cluster management softwarerequired.• An easy to manage solution that provides near continuous availability alongwith horizontal scalability (for well designed applications)• Sophisticated workload management can be tailored for each deployment,maximizing performance and availability<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels42


<strong>ASE</strong> Cluster Edition<strong>Why</strong> <strong>ASE</strong> Cluster Edition?• New High Availability offering from <strong>Sybase</strong>• Supports an unlimited number of failovers• No functionality limitations during failback• Runs within the data center; typically, one <strong>ASE</strong> instance on a blade in arack• Transparent server-side and client-side failover• Suitable for applications which have:• read-only or read-mostly characteristics• partitioned application streams (i.e. non-overlapping data sets)<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels43


<strong>ASE</strong> Cluster EditionWhen will <strong>ASE</strong> Cluster Edition be released?• Currently, GA planned for 1H 2008• Currently planned for 64-bit Linux & Solaris only• This will be a license option<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels44


<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels45


<strong>Sybase</strong> Symposium 2007 – November 15 - Brussels46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!