Quantcast
Channel: SCN : Blog List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all 173 articles
Browse latest View live

You Asked, We Delivered. SAP ASE 16: Scale, Speed, Security, Simplicity.

$
0
0

Next month, we are very excited to launch SAP ASE 16.  It is the culmination of significant efforts of the integrated SAP and Sybase engineering teams and the first major release since the SAP acquisition of Sybase.

 

SAP ASE 16 enables companies to power a new class of extreme transactional applications by providing scalability and speed to support higher throughput and lower latency, with growing data and users in the cloud and on premise; security to deliver extreme transactional performance securely, while providing data privacy; and, simplicity of database operations to maximize operational efficiency and lower costs.

 

What’s new? SAP ASE 16 delivers increased scalability and speed with extensive optimization in its transaction concurrency management, query plan execution, data compression and utilization of computing resources in large SMP servers. Internal benchmarks show near linear scalability with transaction throughputs as high as one million transactions per minute. Security enforcement and system auditability have been augmented to provide customers more flexibility to adapt to their specific regulatory compliance needs. A broader integration with SAP Control Center and a wealth of other enhancements delivers simplified management of SAP ASE installations reducing its overall cost of ownership. And, we’ve significantly improved the integration with other SAP products, such as SAP Business Suite and SAP HANA, further enhancing performance, manageability and interoperability in SAP-centric installations.

More exciting news! Along with ISUG, the International Sybase Users Group, we are hosting a special ISUG-Tech Conference in Atlanta, GA April 14-17. At the event you’ll experience the first exclusive look at the new features in SAP ASE 16, and get to talk with the engineers and experts who worked to deliver it. I hope that you will join us!


SYB ASE 15.7 - best practise / lessons learned

$
0
0

Hello database experts,

 

more and more people are interested in Sybase ASE as new database solution for their SAP systems in cause of unknown future of MaxDB and the high prices of databases and features of RDBMS like Oracle and DB2.

But how performant is Sybase ASE?

How big is the migration effort?

How good is the compression?

How big is the administration effort?

 

I will clarify some aspects and bring a little bit light into the darkness or more or less bad documented areas.

 

 

Migration

 

Prerequisites

Test scenario:


Source System NW731 SPS10 (distributed)

MaxDB 7.9

Windows 2012

Physical Size 2TB

Logical Size 1.7TB

40GB RAM

Target System NW731 SPS10 (distributed)

Sybase ASE SP110

Windows 2012

40GB RAM

 

Export/Import

  1. At first all notes and new kernel/migration tools have to be updated on the source system to run a clean export
  2. Second step is to run the SMIGR_CREATE_DDL to create the needed SQL files for the BW tables
  3. check dictionary and other steps described in the system copy guide
  4. Run the export with migration optimized settings (depends on each source database type)
  5. Create the target DB (setup parameters, configuration of CPU, caches, pools and update to SP110 => best practise note 1680803 )
  6. Start the import manually! That is important to control and setup the config and may be seperated index creation with own parameter setup
  7. standard postprocessing described in the system copy guide

 

Issues during Sybase migration

1. R3load issue trunc log issue


[ASE Error SQL1105]Can't allocate space for object 'syslogs' in database '<SID>' because 'logsegment' segment is full/has no free extents.


Solution


It is mandatory to use at least the following component versions to run a migration:

- ODBC 15.7.0.508

- DBSL 720_EXT UC 64, pl 431

- R3load 720_EXT UC 64, pl 402

 

Note: log segment must be big enough to handle the I/O that the checkpoint can be triggered in this time

=> increase size of the log segment or decrease parallel degree (=import jobs)

 

 

2. Partitioning issue


number of partitions > 8000 partitions, no official statement how many partitions are supported! My tests results show a working number of 1500 partitions.

Report RS_BW_PRE_MIGRATION: A buggy display of size => that are only 6GB not 6TB!

 

So we have 2 options because if I import this table with 8172 partitions, because I get an error while import the data:

(SYB_IMP) ERROR: DbSlPrepare/BegModify  

failedrc = 99, table "/BIC/FZSDM1CS3"

SQL error 30046)

errormessagereturnedbyDbSl:

[ASE Error SQL21][SAP][ASE ODBC Driver][Adaptive Server Enterprise]WARNING - Fatal Error 702 occurred


Solution


Option 1

Collapse the cube to at least 1500 requests (=> 1 REQ = 1 Partition)


Option 2

Create an entry on the source system in table rsadmin (1691300 - SYB: Unpartitioned F fact tables for InfoCubes) with :

ObjectValue
SYBASE_UNPARTITIONED_F_FACT_01ZSDM1CS3

 

Note:

=> Table must be exported again with new run of SMIGR_CREATE_DDL, because the new table creation statement without partitioning must be written to the sql files.

=> so please analyze this before you start the export! Collapse or export with rsadmin option!

 

 

3. Index creation issue (sorted creation)

 

Index creation fails with:

SQL error 1530: Create index with sorted_data was aborted because of a row out of order.

 

If index creation fails due to data being out of order, the DDL template file mapping is wrong for the respective package.

 

Solution

Map the failing package to DDLSYB_LRG.TPL to omit the sorted_data option for the creation of the SAP primary keys. If the R3load task files have already been generated, modify the corresponding command file (<package name>__DT.cmd).

 

Sybase documentation to this option:

The sorted_data option can reduce the time needed to create an index by skipping the sort step and by eliminating the need to copy the data rows to new pages in certain cases. The speed increase becomes significant on large tables and increases to several times faster in tables larger than 1GB.

If sorted_data is specified, but data is not in sorted order, Adaptive Server displays an error message, and the command fails.

Creating a nonunique, nonclustered index succeeds, unless there are rows with duplicate keys. If there are rows with duplicate keys, Adaptive Server displays an error message, and the command fails.

 

 

Tips for migration

Increase migration performance with seperated data import and index creation, with different DB settings. All settings therefore are described in the best practise migration guide.

 

 

Summary

 

Compression

Compression ratio like MSSQL (no wonder because MSSQL based on Sybase source code) but not as good as e.g. Oracle 11g compression for OLTP, but this is only my impression, because I have no 1:1 example on Oracle.

 

In Oracle we have normally a block size of 8k and there the block compression takes place. A index compression and a secure file (LOB files) compression.

 

With Sybase we have a row compression to compress away empty spaces/zeroes in fixed length columns.

Both page dictionary and page index compression strategies are used at the page/block level and last but not least the LOB compression for large objects.

This all happens with a SAP standard block/page size of 16k.

 

Compared to MaxDB this is a quantum jump not only the fact that you save disk space, you also increase the efficiency of your data cache.

 

Performance

Here are a bit more tests required to take a significant statement. SAP tests results in a performance boost of 35-40% compared to MaxDB.

 

MeasurementMaxDBSybase
Startup time of DB12min>30sec
Data compression

no - still 1700GB

770GB
Backup Compression176GB219GB (only SID DB, not master or other)
Partitioningnoyes (up to about 1500 partitions)
GUI Administrationyes (Database Studio)yes (SCC)
Shadow DB solutionyesyes
auto. configuration checkyesno
in memory ablenoyes (currently not supported by SAP BS)
db verifyyesyes, with backup or dbcc
shrinking data filesyesyes (note 1881347 since SP100)

 

Migration effort

Not more effort compared to another DB. You just have to read the migration best practise of SAP and notice the mentioned known errors.

 

It is definitively in cause of the compression and partitioning features a lot of faster than MaxDB and a good alternative for all other more expensive DBs. It fits into the concept of SAP for the next years.

Not all functions and features are as good documented/integrated as wished for the customers but SAP keeps going on to improve this things.

 

Administration effort

The integration of the tools in dbacockpit are pretty good, but such a nice colorful and gladly clickable interface like the database studio is not integrated in Sybase ASE. The people who already familiar with the commandline based administration like Oracle or DB2 are learning fast the new commands/stored procedures. The procedures are nearly the same like MSSQL - no surprise or?

A automated configuration check or script for the whole configuration would be really helpful. I have written my own scripts because I don't want waste time to copy paste over 100 parameters for each DB which I'm going to install.

It is also easy to update the Sybase ASE with a GUI wizzard, but to set all the additionally parameter for performance which are not described in the configuration note, you will need some time to size the perfect values.

 

 

I hope I could show you some new interesting facts of Sybase ASE. It is a definitively a good alternative to MaxDB and must now accept the challenge against Oracle, DB2, MSSQL etc. SAP has still some work to do to fully integrate all functions.

 

 

If you have any further questions, don't hestate to comment the blog or contact me or one of my colleagues at Q-Partners ( info_at_qpcm_dot_de )

 

Best Regards,

Jens Gleichmann

Technology Consultant at Q-Partners (www.qpcm.eu)

It’s here: SAP ASE 16 – Extreme Transaction Ready

$
0
0

SAP ASE 16 provides scalability and speed to support higher throughput and lower latency; security to ensure data privacy and system auditability; and, simplicity of database operations to maximize operational efficiency and lower costs.

 

Scalability, speed, security, simplicity…these were the guiding principles for our engineers. We’ve increased scalability and speed with extensive optimization in its transaction concurrency management, query plan execution, data compression and utilization of computing resources in large SMP servers. Security enforcement and system auditability have been augmented to provide customers more flexibility to adapt to their specific regulatory compliance needs. And SAP Control Center delivers simplified database management helping to reduce overall cost of ownership.

We invite you to read the SAP ASE 16 Overview white paper to learn more about the many new features that enable you to power a new class of extreme transactional applications.

 

And don’t forget, we’ll be at the ISUG-Tech Conference in Atlanta April 14-17th to give you a firsthand look at the new features in SAP ASE 16. I hope you will join us.

SAP at the Red Hat Summit

$
0
0

Next week is a landmark week for SAP Adaptive Server Enterprise, we will be announcing the launch of SAP ASE 16, our foundational release for eXtreme OLTP innovations. SAP, has also been hard at work with it’s partners to drive key innovations in the database market which we are preparing to announce next week.

 

SAP is a key sponsor at two industry events next week, the SAP Independent User Group (http://my.isug.com/p/cm/ld?fid=902) and the Red Hat Summit (http://www.redhat.com/summit ) where we are gold Sponsors. At both of these events we will be launching SAP ASE 16 and our innovations that we have been driving with our partners.

 

In SAP’s session at the Red Hat Summit on Simplified IT & real-time business management with SAP, I will be discussing our overall Data Management Portfolio Strategy, the SAP ASE 16 Launch, partner innovations, what we are doing for developers / Open Source and of course SAP HANA.

 

We will also have a significant presence at the Red Hat event as gold sponsors. Come by our booth, in the partner pavilion to see our innovations and ASE 16 in action. In attendance will be database and SAP experts who are ready to answer any question you have on SAP, whether it is about our Strategy or a technical or something technical you would like to know.

 

Look forward to seeing you at the Red Hat Summit and come and join our session.

Appliance for SAP Adaptive Server Enterprise hits the market

$
0
0

Today, Fujitsu announced the GA of an appliance for SAP ASE, our XOLTP database engine and will initially be offered in 3 sizes, built together with SAP's Partners, Fujitsu, Violin, LSI.

 

The appliance is based on BYOL for SAP ASE licenses, and shipped with a per-configured SAP ASE with a 90 day trial license. Below is a summary of the 3 sizes that Fujitsu are shipping.

 

Appliance
ServerStorageOS
Entry

PRIMERGY RX300S8,

8 cores, 256 GB RAM

1 TB database on

local flash storage,LSI Nytro WarpDrive

Red Hat ELS 1-2SOC 4G
Mid

PRIMERGY RX300S8,

16 cores, 256 GB RAM

5 TB database

Violin V6212, flash memory array

Red Hat ELS 1-2SOC 4G
Enterprise

PRIMERGY RX600S6,

32 cores, 384 GB RAM

10 TB database

Violin V6224, flash memory array

Red Hat ELS PREM 4SOC 4G

 

For more details of the appliance please and release information, please refer to the following press release and documentation :- http://www.fujitsu.com/fts/about/resources/news/press-releases/2014/CEMEAI-140415-Fujitsu-Power-Appliance-for-SAP-Adaptive.html

Register now! Technical Webinar Series: Introducing SAP ASE 16

$
0
0

Looking for the techncial details on SAP ASE 16? Join the 5-part webcast series to learn about the new innovations in this latest release. Our experts will guide you through the new features and functions, demonstrate linear scalability capabilities, and show you how to simplify management of the database.  Register here for the series.

 

Part 1: Overview of SAP ASE 16 and Future Directions

Tuesday, April 22, 2014 10:00 AM PT/1:00 PM ET

 

Part 2: Achieving Linear Performance Scalability in Large Multi-core Systems with SAP ASE 16

Tuesday, May 13, 2014 10:00 AM PT/1:00 PM ET

 

Part 3: Extreme Transaction Processing: Ensuring Competitiveness & Agility in a World of Constant Motion

Tuesday, May 27, 2014 11:00 AM PT/2:00 PM ET

 

Part 4: Simplifying Development and Management in SAP ASE 16

Tuesday, June 10, 2014 10:00 AM PT/1:00 PM ET

 

Part 5: Enabling True “Zero Data Loss” with SAP ASE 16 and Replication Server

Tuesday, June 24, 2014 10:00 AM PT/1:00 PM ET

 

 

Register for the series or selected sessions. 

SAP ASE IMDB: Is this fast is the fastest?

$
0
0

At last I have been able to start working on yet another exiting project - SAP ASE IMDB for custom application, with ~1 TB DB as an IMDB template...

 

I agree, working with IMDB is pretty much fun - most of the operations are cut in time drastically.  E.g., for the DBA-driven system activities, you may expect reducing the time spent on your operation to 1/6-th.  Cool. 

 

A note to the engineers, though.  On start up, IMDB reads the template DB from the disk before releasing the DB to general use and as it looks, it does it - single  threaded.  Since IMDB is always built from scratch, one must have though about the start-up time with a more critical eye, I think.  It takes about half an hour to recreate IMDB DB of ~1 TB from its DRDB template - which sound reasonable time to wait for the in-memory replica to become available.  But imagine that the start up has been done reading the DRDB DB devices in parallel (DB is not accessible anyway to the DB users until the IMDB DB for which DRDB is the template is brought online).  One might have cut the start up time drastically - 5-15 minutes?. 

 

Anyone from the SAP ASE engineering team here can pick up the challenge and speed up the start up process?   Seems like something not so hard to implement... 

 

Guys, I love your product.  It beats all the competitors so far.  But since you at SAP love to be challenged and make the product shine even more - here is an FR for you...

 

If you need client-side cooperation, be my guest...

 

ATM.

Determining How ASE Shutdown From An Errorlog

$
0
0

If you find your ASE server unexpectedly not running, the errorlog can provide some useful clues as to how it shutdown.

 

Obligatory anecdote:

Many years ago, I once worked a support case with a customer who had ended up with hard corruption in their database.  Their errorlog showed that ASE had repeatedly rebooted, roughly 20 times over the course of the previous night.  Their host was setup to automatically boot ASE when the OS started up.  Each time there was no indication of why ASE had shutdown.  I expressed the opinion that the lack of shutdown messages made me think the most likely cause was power being repeatedly shut off. A check of the OS logs confirmed that the host had also been rebooted many times with no indication of a polite shutdown.  The problem was soon tracked down to new cleaning staff turning the power on and off in the computer lab.  We didn't investigate the corruption further, the assumption being that a hard drive abruptly losing power while writing was a reasonable cause (and the corrupt data was clearly gibberish that didn't resemble formatted data).

 

Behavior for TSQL "shutdown" command (commonly called a 'polite shutdown'):

00:0006:00000:00012:2013/07/22 09:33:58.10 server  Shutdown started by user 'sa'. SQL text: shutdown
00:0006:00000:00012:2013/07/22 09:34:00.10 server  ASE shutdown by request.
00:0006:00000:00012:2013/07/22 09:34:00.10 kernel  ueshutdown: exiting
00:0000:00000:00000:2013/07/22 09:34:00.10 kernel  Main thread performing final shutdown.
00:0000:00000:00000:2013/07/22 09:34:00.19 kernel  Blocking call queue shutdown.
00:0000:00000:00000:2013/07/22 09:34:00.20 kernel  SySAM: Checked in license for 1 ASE_CORE

 

Behavior for TSQL "shutdown with nowait" command (commonly called an 'abrupt shutdown'):

00:0002:00000:00014:2013/07/22 09:30:11.14 server  Shutdown started by user 'sa'. SQL text: shutdown with nowait
00:0002:00000:00014:2013/07/22 09:30:11.14 server  Shutdown with nowait detected - ASE process level execution bindings will be cleared on startup.
00:0002:00000:00014:2013/07/22 09:30:11.16 server  ASE shutdown by request.
00:0002:00000:00014:2013/07/22 09:30:11.17 kernel  ueshutdown: exiting
00:0000:00000:00000:2013/07/22 09:30:11.18 kernel  Main thread performing final shutdown.
00:0000:00000:00000:2013/07/22 09:30:11.28 kernel  Blocking call queue shutdown.
00:0000:00000:00000:2013/07/22 09:30:11.80 kernel  SySAM: Checked in license for 1 ASE_CORE

 

Behavior for OS "kill <pid>" command:

00:0006:00000:00000:2013/07/22 09:36:07.02 kernel  ueshutdown: exiting
00:0000:00000:00000:2013/07/22 09:36:07.02 kernel  Main thread performing final shutdown.
00:0000:00000:00000:2013/07/22 09:36:07.23 kernel  Blocking call queue shutdown.
00:0000:00000:00000:2013/07/22 09:36:07.23 kernel  SySAM: Checked in license for 1 ASE_CORE

 

Behavior for spid-fatal error while holding a spinlock:

00:0014:00000:02998:2014/01/20 03:10:23.62 kernel Spinlocks held by kpid <kpid#>
[...fatal error, typically with a stack trace...]
00:0014:00000:02998:2014/01/20 03:10:23.62 kernel Spinlock Resource-><spinlock name> at address <address> owned by <kpid#>
00:0014:00000:02998:2014/01/20 03:10:23.62 kernel End of spinlock display.
[... typically another stack trace ...]
00:0014:00000:02998:2014/01/20 03:10:23.62 kernel end of stack trace, spid <spid>, kpid <kpid>, suid <suid>
00:0014:00000:02998:2014/01/20 03:10:23.62 kernel ueshutdown: exiting
[On a server running in threaded mode rather than process mode, the following additional line is also output:]
00:0000:00000:00000:2014/01/20 03:10:23.62 kernel Main thread performing final shutdown.

Behavior for an OS Panic:

00:0006:00000:00000:2013/07/22 09:36:07.02 kernel Engine 0 (os pid <pid> has died, server is performing emergency shutdown
[...]
stacktrace containing the function keipanic+0x8c (offset may vary by platform)
[...]
00:0006:00000:00000:2013/07/22 09:36:07.02 kernel ueshutdown: exiting
00:0006:00000:00000:2013/07/22 09:36:07.02kernel end of stack trace, kernel
service process: kpid 1114129

 

Behavior for OS "kill -9 <pid>" command:

[no output added to log].

 

Behavior for UNIX OS shutdown and reboot:

[no output added to log]

 

Behavior for abrupt power shutoff:

[no output added to log]

 

Other possible causes (not exhaustive) of no shutdown-related information in the errorlog:

a) Errorlog's file system filled before the shutdown
b) Errorlog file disconnected from file descriptor used by ASE.
   For example, errorlog copied to another file, original file deleted, copy renamed.
   A possible hint for this is an unusual lack of entries preceeding the shutdown.
c) Errorlog could have been edited to remove information.

 


SAP ASE 16.0 Scalability in a Virtualized Environment

$
0
0

You've heard that SAP ASE 16 offers significant new functionality to boost speed and scalability as we've shared benchmarks supporting this claim in previous blogs.  And in case you missed ISUG-TECH, the China Academy of Railways folks described their constantly growing ticketing system, processing 3+ billion transactions a day and praised the scale-up functionality in SAP ASE 16 - achieving linear scalability with the new release in their physical environment.  Today, I'm excited to share new test results that show SAP ASE 16 scalability in a virtualized environment.

 

SAP ASE 16 has been tested on VMware Vsphere 5.5, the leading server virtualization platform and the results prove once again that SAP ASE delivers excellent scalability.  In a VMware Vsphere environment using RHEL 6.x, SAP ASE achieved linear scalability with high performance throughput with absolutely zero tuning of the database - I know....I know.....I am not saying there is no need for SAP ASE DBAs anymore.....it is just that SAP ASE is getting more efficient and it has learned to do self-tuning.  SAP ASE scaled linearly from a 16 core environment to a 64 core environment with high performance throughput as the CPU count increased. 

 

The table and the graph below show the normalized values obtained during the testing efforts.  We think these results are just additional proof of the scalability and speed benefits you can gain with SAP ASE 16.  We hope you agree.

 

Well.....what are you waiting for.....try it out for yourself along with the many other cool features in ASE 16!!!!

 

 

 

                                            

Transformables: From Warm Standby to Active-Active MSA with Zero Downtime...

$
0
0

How often in your career do you have a chance to dismantle the old architecture in its entirety and build it again - completely redesigned?  Usually, a company upgrades the hardware once in a three-four years cycle, while the "backbone" architecture outlives the hardware upgrades and lives dozens of year intact.

 

I have been "lucky" to work for a company long enough to rethink its backbone DBMS architecture twice:  once about ten years ago, when I transformed an old asymmetric architecture into an elegant Warm Standby topology (SAP Sybase Replication Server).  This later grew into a heterogeneous replication topology spanning 7 DBMS systems, some ASE others MSSQL, replicating transactions seamlessly across distant cities.  Now this is the second time I will have a chance to transform the "backbone" of the site:  from active-passive WS topology to an active-active MSA architecture.

 

Once WS was a thing to contemplate with satisfaction:  simple to setup.  Simple to maintain (although I did have to build a couple of tools to make the administration more failure-proof).  It has proven itself to be vital and stable - close to 10 years of stability - don't remember any failures that resulted from architecture shortages. It was the most simple and elegant alternative for a site that loos for a solution with two available ASEs which may be exchanged without much hassle (I discount storage replication here, which too has its advantages - although its architecture today bears similarity to DBMS transactional replication).  Today, warm standby is bulky, constrained, somewhat out-dated alternative, suffering from SPF which needs to be taken care of by out-of-the-box solutions.  Especially when compared to an alternatives available around - from the same vendor.

 

As opposed to it, today MSA replication is considered a "piece of cake."  It is easy to setup.  Easy to maintain.  It gives you most of the things WS has given you once ago, and with much simpler setup. More than that, it is possible to integrate warm standby as a single logical unit within MSA topology - for those in love the the logical connection concept.

 

In the coming weeks I will be privileged to witness a live transformation of the old good warm standby topology into a new MSA-based topology.  Good by my old good friend - I loved to work with you for years.  Loved the stability of it.  Loved the advantages it gave once.   Welcome my new acquaintance.  I hope I will live to love you even more.

 

It has been quite a challenge to think through the architectural redesign.   How do you move the heterogeneous replication with 7 sites, some MSSQLs, to an MSA solution with minimal downtime (seconds alone)?  As of replication server documentation, the same ASE instance cannot participate in different replication server domains.  Not to say that different replication server domains cannot interact or exchange transactions.  A tale to be told.  But this is over now.  This coming weekend the ground will begin to move:  the old good pair of M5 servers hosting a set of 15.7 ASEs with a logical axis of 24/7 DBMS instances that distributed data down the stream will start to merge into a brand new pair ot T54 servers hosting a set of 15.7 ASEs united in an MSA replication topology, including a pair of IMDB replicas.

 

I count myself to be really lucky to be able to push the architecture once again to the forefront of DBMS (and HW) technology.   In-memory computing today is something that begins to knock on every door (though few still trust the technology or see its full potentials).  Active-active topology too today is something the customers require more and more consistently.  Every company today requires its DBMS systems to be available 24/7, to run queries super fast, and to require little to no DBA intervention to "fail-over."  IMDB allows you to do things you have stopped to dream about long ago with a ridiculous ease (I don't know of any other DBMS solution that has been as seamlessly integrated into a DBMS product as IMDB - big thumbs to SAP/Sybase product engineers - lovely solution).  I have been able to relieve customer's pains strained to meet deadlines waiting for nasty reporting jobs running historically over hours and days with the help of IMDB.  We are talking about cutting time from over 48 to 2 hours and less.  IMDB is fast - too fast sometimes.  Close to zero downtime and close to zero SPF solution is catered by MSA (with all the advantages and disadvantages of transactional replication).

 

To cut things short - if you have the guts and the vision it takes about 20 minutes and a set of simple, non-intrusive steps to upgrade your whole architecture from warm standby to an active-active MSA topology...  If you wont dream - you wont learn to fly.

 

architectural-sketch-6-mih3m

 

Pff....   20 minutes in a lab....

 

In the real life with TBs of data and site scattered miles away it will take as many hours...

 

Days?....

 

Time will tell.

 

ATM.

Reminder SAP Data Management Forum London 10 July 2014

$
0
0

Join us for the UK launch of the SAP Data Management Forum, where we can't wait to tell you about the latest SAP Data Management solutions with new capabilities to solve your most demanding data management challenges.

 

You’ll hear about SAP’s vision and roadmap for data management solutions, including SAP ASE, IQ, ESP HANA etc. that offers revolutionary opportunities to your business while requiring a fraction of the IT infrastructure and an evolutionary path for your applications.

 

To Register please click http://events.sap.com/gb/sap-data-management-forum/en/home/

Use of LIO Ratio (LIOs/CPU Time) to measure performance

$
0
0
  • ElapseTime = CPU Time + WaitTime

 

A crude form to account for CPUTime would be something like this

 

  • CPUTime = Time to perform LIOs + Time to Parse and Compile + CPU Spins because of spinlock contention

 

Now from monProcessActivity we do get CPUTime + Logical IOs for a given SPID.

 

We had a number of challenges when we converted our servers to ASE157 with respect to performance. We had extensive data collectors and had minute by minute deltas for monProcessActivity. From this data we started analyzing the LIORatios for different applications (program_name). We noticed that for some of the applications the LIORatio was very low.

 

On investigation we found the following:

 

  • The parse and compile times for some of the high frequency queries was way high and this is the reason for the low LIO Ratio

 

Now this begs the question as of why the parse and compile times are high.

 

  • We do use statement cache for all servers
  • However we have disabled statement cache for queries with temp tables (TF- 467)

 

Here are the reasons why statement cache would not effectively

 

  • Data type mismatch
    • insert into myTables (col1,col2) values(1.0,1.1)
    • insert into myTables(col1,col2) values(0,0)

         

          In the above example the statement cache engine does not know the datatype of the columns when it is caching these statements. So based on the literal values passed it will created different sets of statements in the cache. For some of the table with many numeric columns we see that the number of cached statements was higher than 10000. It means the reuse count of the cached statements is very low.

 

  • Literals in the select clause
    • select '123' as col1 from myTable
    • select '234' as col2 from myTable

    

     Though 'auto literal parametrization' is turned on if there were to be a literal in a select clause it does not convert such literals into parameters

 

  • Literal parameters in derived tables
    • select * from (select '123' as col1 from myTable) a
    • select * from (select '234' as col1 from myTable) a

 

     The literals in derived tables as shown above are not parameterized. So there will 2 different statements in the statement cache

 

  • LIKE clause
    • select * from emp where lname like 'GP%'

 

     In this case too the literal is not parametrized

 

  • TEMP Tables (TF - 467)
    • This is an interesting case. When you too many short lived connections which use temp tables then TF-467 is something you may want to consider.
    • If the connections you have to the dataserver persist for too long then TF-467 can hurt you

 

In conclusion the parse and compile time for queries in ASE157 can be signficantly higher than the older versions. Statement cache usage is imperative to good performance. However need to be cognizant about the scenarios where statement cache would be not effective.

 

LIO Ratio is a good way to start investigating some such problems.

 

We have also used LIO Ratio to solve some of the issues with with spinlock contention and will discuss about this in the next post.

SAP ASE 16 New On Demand Resources

$
0
0

On Demand Technical Webcasts Feature New Capabilities in Latest Release

 

We’ve just concluded a very successful 5-part webcast series on SAP ASE 16.  The series covered the new features in this latest release and described in detail how customers can benefit from the new capabilities.  All of the webcasts are now available for viewing.

 

SAP ASE 16 Webcast Series On Demand

 

  1. Overview of SAP ASE 16 and Future Directions
  2. Achieving Linear Performance Scalability in Large Multi-core Systems with SAP ASE 16
  3. Extreme Transaction Processing: Ensuring Competitiveness & Agility in a World of Constant Motion
  4. Simplifying Development and Management in SAP ASE 16
  5. Security and Auditing in SAP ASE 16

 

For additional resources on SAP ASE 16 check out the SAP ASE 16 launch page:    http://fm.sap.com/ase16/

 

SAP & Simplicity: While Some Struggle to Embrace It, Others Are Fortunate to Enjoy It Already

$
0
0

Hey,

 

Whoever submits a google search for SAP & SIMPLICITY will find himself/herself showered with conflicting opinions:

 

  • SAP & Simplicity?  Prffff.  Give me a break....
  • SAP & Simplicity?  Yeah!   SAP embraces simplicity as a way of thinking!....

 

I have been exposed to some of SAP application packages.  From what I have seen there still are things to simplify or modernize.  This is my "novice" opinion only.  Haven't been exposed to it for a prolonged period of time.  But I know of at least one subset of SAP application package where simplicity has always been a status quo.  And as for my opinion - the situation in this sector has improved even more with the latest releases.  I am talking about SAP Sybase portfolio, as you might have guessed.

 

I have just finished a very intensive week of working on a project of moving a 24/7 site from an old architecture that relied on a bunch of replication servers (15.0, 15.2 - Warm Standby, Replicate Sites with & without rep agents) connecting 7 heterogeneous sites (ASE&MSSQL) to a new architecture connecting the same heterogeneous sites - but in a simplified and more robust manner (MSA - flat and simple).   Whoever has had a chance of working with Sybase Replication server in its pre-MSA versions probably still remembers the hard work he or she has been subjected to.   True, it has not been SO difficult to manage, but for a topology with over 2k tables, managing subscription to numerous replicated sites has been quite a challenge.  In order to make my life easier I have built a dedicated software to embrace all the flexibility the environment I was responsible for required.  It has been a great fun still (both writing the tool and managing the site).  Replication server in those versions still has been pretty well worked out to allow an organization to run 24/7 unimpeded.  Warm standby as the central axis (to manage heavy administrative tasks and basic DR requirements, for example).  Ability to attach standby of the flight.  Efficient transaction-based replication.  It has been very stable to run a decade without a single failure.

 

Still, the setup has been lengthy and cumbersome.  Waiting for 2k replication definitions to be built (and WS needed it as well for more efficient communication between active and standby sites)... Waiting for 2k-x-sites subscriptions to get defined...  The setup (leaving aside the dump/load sequence) has been a matter of hours.

 

No longer.  With MSA and 15.7 RA and RS releases the whole setup for a multi-site replication topology is a matter of minutes.  If your systems are synchronized and all you are required to do is to setup replicated topology - the time you need to set everything up is the time it takes you to run a short list of SQL commands against your replication server.   If you are diligent enough to set up POC version of your topology, generate and save all the scripts, and then run the same scripts (easily changed) to set up you real environment, the whole thing fits neatly into a couple of minutes.

 

I really have to express my gratitude to SAP Replication Server engineers.  Loved the software once - it has been very stable and flexible.  Love it even more now - it has added a true flavor of simplicity to it (never used GUI setup though - so I cannot comment on it).

 

If other software packages from the same house have been as simple to set up and manage, I thing there has been much less disagreement about SAP & Simplicity.  As far as SAP Replication Server 15.7 is concerned - simplicity IS one of its strong features - without compromising stability or flexibility.  I do not know how simple it is to manage replication to/from SAP HANA, but to manage replication to SAP Sybase ASE IMDB in-memory DMBS is a piece of cake (another gem from the same house).

 

Been there.  Done this.

 

SAP_REPLICATION

 

KITS.

 

Keep IT Simple...

 

My appreciation for that.

 

ATM.

ASE 16 & Managing VLDB’s with VLH (Very Large Hardware)

$
0
0

VLDB’s….it seems when discussing these, everyone focuses on the data volume aspect and the operational concerns.  These, of course, are very valid points.  However, when working with VLDB’s, we also often are working with “Very Large Hardware” - machines with very high core counts - or at least very large amounts of memory …and this can lead to some not-so-entertaining pain points if the DBA’s are not aware of what this means - and can mean that the VLDB implementation suffers - even more than the challenges with respect to backup and recovery, creating indexes online, etc.

 

Last week I was at a customer site (I don't get to do this much any more - so it was a very enjoyable experience) and the lead DBA manager made a comment to me after looking at the results of some performance tests we were running.  To paraphrase, what he said was:

 

“In the old days, we focused on tuning physical IO’s - it looks like now we need to focus on spinlocks.  Back then, with low [available] memory, we did a lot of physical reads.  Today, on the larger memory footprints, spinlocks and memory contention is a bigger problem”

 

He made that observation after we had changed several different spinlock configuration values as well as changed some cache configurations and bindings to also help eliminate spinlock contention.  The system we were testing was 40 cores/80 threads and ~450+GB of memory in which all the current day’s data (which was being analyzed) easily fit into memory with no physical reads (the remaining days data, of course, on disk).  This is typical - how many of our systems do we proudly state have 95-98% cache hit ratios with only 1/10th of the memory of the full database size???  Probably most.

 

At this customer - like many others - a massively parallel operation ran at least periodically during the day (multiple times per hour I suspect).  The reason for massive parallelism was simple - the volume of data to be processed simply precluded a single threaded process.  I have seen this all too often - with healthcare claims and billing processes as well as FSI close market processes, etc. all  running high 100’s or 1000's of concurrent sessions all doing the same logical unit of work - but dividing the workload among the concurrent sessions.  Simply put, single threaded solutions don’t work in VLDB - and the application developers quickly resort to massive parallelism to try to get all the work done within the desired timeframe.  The quicker the better.

 

As was this customer’s case.  His problem was that as he ramped ASE 15.7 up beyond 24 engines, severe spinlock contention (>50%) resulted in exponentially increasing response times.  Fortunately, we were running ASE 15.7 sp110 which had monSpinlockActivity - which makes it much, much easier to diagnose spinlock issues.  If you have never used this table…..you are really missing something - it has become a key table for me - much like monOpenObjectActivity.

 

Net result was that a process that should have ran in 10-20 seconds wasn’t finishing in well over 5 minutes when running 64 cores and scaling the number of concurrent sessions....in fact it was taking so long they were simply aborting the test.

 

Ouch.

 

Unfortunately, we were not running ASE 16.

 

Why do I say that??  Because at least two of the spinlocks causing problems were the DES and IDES spinlocks.  However, the first spinlock that was causing contention reminded me why VLDB’s should be using DOL locking - datarows preferably.  That spinlock was the Address Lock spinlock.  Yes, this is configurable via “lock address spinlock ratio”….which mystifyingly is set to 100 by default.  Now, that may be fine for pubs2, but any decent sized database with a large number of tables and things get ugly quickly.  Specifically, this spinlock is used for indexes on APL tables.  Now, I hear quite often about the supposed penalties of DOL locking - with memcopy, etc. - but one trade-off that you need to consider when it comes to concurrency and contention:

 

  1. is it better to make it tunable to reduce the contention, or…
  2. is it better to avoid the contention to begin with by using local copies

 

AHA!  Never thought of that did you?  Yes, APL tables (in my mind) have a much bigger scalability issue in that you can’t avoid address locks.  Hmmmm….yeah, we can set “lock address spinlock ratio” to 5…but what exactly does that do??  Well a quick doc search reveals:

 

For Adaptive Servers running with multiple engines, theaddress lock spinlock ratiosets the number of rows in the internal address locks hash table that are protected by one spinlock.

Adaptive Server manages the acquiring and releasing of address locks using an internal hash table with 1031 rows (known as hash buckets). This table can use one or more spinlocks to serialize access between processes running on different engines.

Adaptive Server’s default value foraddress lock spinlock ratiois 100, which defines 11 spinlocks for the address locks hash table. The first 10 spinlocks protect 100 rows each, and the eleventh spinlock protects the remaining 31 rows. If you specify a value of 1031 or greater foraddress lock spinlock ratio, Adaptive Server uses only 1 spinlock for the entire table.

 

Don't ask me why the docs cite the last example when in reality we are always trying to LOWER this value vs. raise it.  Soooo…when we set it to 5, we get 1031/5=206.2 or 207 spinlocks (rounding up) - 206 guarding 5 rows each and 1 spinlock on the last hashtable row.  It helped….although occasionally, we still saw periods of 2% or 5% spinlock contention.  Could we set it to 1?  Theoretically.  Might use quite a few resources on all those spinlocks though.  However, remember, the spinlocks are on the hash buckets...the address locks are in the hash chain so even at 1 you still could have contention if the address locks you are after are in the same hash bucket.  BTW, DOL locked tables don’t use address locks on the indexes - so the whole problem is avoided - reason - address locks are part of the lock manager and the implementation for DOL avoids that part….I wonder if not due to the memcopy aspect or the index latching…hmmmm….  Getting back to the supposed penalty for DOL locking…when is a penalty not a penalty???

 

When the alternative has an even bigger side effect.

 

For other considerations on DOL locking, see my friend and colleague Cory Sane’s blog on DOL locking at http://scn.sap.com/docs/DOC-52752.

 

How much of a difference did this make???  Well, we dropped from a never-ending soon number at 64 engines to something less than 5 minutes.

 

Now, back to the DES and IDES.  Similar to address locks, these also can be tuned via “open object spinlock ratio”, “open index spinlock ratio” and “open index hash spinlock ratio”.  Of course, if using partitions, one should also consider “partition spinlock ratio”.  In true P&T characteristic, as soon as we eliminated the address lock spinlock problem, these guys who were hiding suddenly popped up at 30-40% spinlock contention.  Remember - 10% spinlock contention usually triggers a search and destroy mission ….sooo…even though 30-40% was less than the 50%, we are still suffering mightily.  Once again, we simply set the ratios to 5 …or was it 10….sigh…getting older…memory fail…

 

Anyhow, you can find a full description of what these things do in the white paper “Managing Workloads withASE: Techniques for OLTP Scaling…” …which admittedly is a bit dated as it was based on 15.5, but it has a very good description of ASE metadata and some of the components in a descriptor.  Of course, it was plagerized heavily from an even earlier work by David Wein who was very instrumental in the ASE kernel....but the advantage of being co-workers is plagerism is allowed as long as we give credit where credit is due.....

 

This is where ASE 16 shines.  The descriptors in memory are NOT used for query compilation or optimization.  More critically, the descriptors contain address locations for where indexes are in memory, etc. along with OAM and GAM pages - which makes finding them faster.  In addition, they also are used to track concurrency such as keep counts and performance metrics - an example of the latter is that the IDES is the location of the metrics that monOpenObjectActivity collects.  Now, in pre-ASE 16, any time any of these counters were modified, ASE grabbed the spinlock.  Which spinlock???  Oh, yeah - the one that not only protects the current object descriptor - but because of the open object spinlock ratio also protects 99 more.

 

Ouch.

 

If I had different users running concurrent queries against different objects that just soooo happened to be protected by the same spinlock…. welllllllll…. hmmm…. that is what was happening.  ASE 16 does this a lot better.  Instead of using spinlocks as a concurrency implementation, ASE 16 leverages several different lockless structures such as “Compare & Swap” that are now actually implemented in modern CPU’s.  In addition, some metadata cache optimizations, such as pre-caching systypes and other similar system table information helps reduce systables lookups…more on this in a minute.  For more on some of these changes, you maywant to watch the replay of Stefan Karlsson’s webcast  “Achieving Linear Performance Scalability in Large Multi-core Systems with SAP ASE 16” @ http://event.on24.com/r.htm?e=775357&s=1&k=223D966FF0E5C249A1FD8ACECA0B91F7.  I know he and the SPEED team also have a white paper on this coming out - I am reviewing it at the moment and when he comes back in August from vacation, he will likely shake his head at all my recommended changes....  So look for it in September maybe.

 

Back to our performance test.  We were now down to something like 3 minutes.  Yayyyyyyy!!!

 

But here is where we hit a harder nut to crack - data cache spinlock contention.

 

Yes, the cache was partitioned. But…..

 

So the first thing we did is a common trick - move the system tables to a separate named cache.  A lot of folks think (mistakenly so) that the metadata cache is a system table cache.  NOT.  Query parsing/normalization often involves looking up column names, datatypes, etc.  Query optimization often involves reading systabstats & sysstatistics.  Both are even slower if we have to read those tables from disk...and by default, they are in default data cache and treated just like any other table....which means that big wonking table scan just bumped them out of cache.

 

If you bind the system tables to a separate cache with a relaxed cache strategy and then look at monDataCache for LogicalReads or CacheSearches, you will get a very interesting picture of how many LRU -> MRU relinkages just the system tables were causing in default data cache.  In some runs, we were seeing a high of 100,000 over ~2 minutes execution time - which is ~1000/sec - or 1 every millisecond.  Not claiming they take a millisecond….but it
is a bit of work that can be saved and reduces cache contention on cache spinlocks.  Of course, binding systypes in ASE 16 might be less of a concern due to the aforementioned fact that now it is fully cached as part of the metadata cache…but....why not?

 

By this time, we were down to 1.5 minutes of execution at 64 engines.  A huge drop from the starting point.  We then noticed that one of the key tables was in a separate named cache, but the others were cluttered along with everything else in default data cache.  To prove a point that it was LRU->MRU relinkages that was helping to drive the contention, we moved the tables to another named cache with a relaxed cache strategy.  This dropped us down to 1 minute total
execution.  However, we still noticed 10%-15% cache spinlock contention even on the relaxed cache strategy.

 

While we are still not where we would like to be, it proved several important considerations for VLDB management:

 

  • DOL tables have an advantage over APL in reducing address lock spinlock contention - which can be severe in high engine count configurations.
  • pre-ASE 16 requires a lot more tuning around object and index descriptor spinlocks - which helps - whereas ASE 16’s lockless modifications avoid many of these issues
  • LRU->MRU relinkage plays a role in data cache contention - even when partitioned.  Using separate caches splits the load and using relaxed cache strategy where possible helps even more.  As the customer noted, perhaps more careful consideration for the sp_sysmon recommendations for using ‘relaxed cache strategy’ on named caches other than default data cache is deserved vs. ignoring it as in the past.

 

There still is some contention with this app keeping us from hitting the perfect state - but again, I think to reduce it further will be a SQL change from a slightly unoptimal query that is the root cause of the rest of the cache contention (yes - table scans DO cause other problem...not the problem here, but a 1 million page table scan means 1 million LRU -> MRU relinkages and the associated spinlock issues...sometimes ya just gotta fix the problem vs. tuning around it)....but it was an interesting segue into how some of the future changes such as transactional memory in a future release of ASE will help.

 

The lesson...when running VLDB's on VLH...you might want to consider upgrading to ASE 16 sooner rather than later....in the meanwhile, you might want to look at your memory tuning/named caches and spinlock ratios.  That "everything" in one big default data cache.....that is soooo 1990's.


HugePages for Sybase / SAP ASE databases on linux

$
0
0

Hello SYB DBAs,

 

 

you may be noticed a message in your DB log which looks like this:

"Could not allocate memory using Huge Pages. Allocated using regular pages. For better performance, reboot the server after configuring enough Huge Pages."

 

 

Don't worry about it, if no Huge Pages are available, the system automatically switch back to the normal page size of the OS.

For example in Linux the regular memory page size is 4KB. The huge page size you can find out via command:

 

cat /proc/meminfo | grep Hugepagesize
Hugepagesize:       2048 kB


Hugepages speed up the memory management.

Hugepages allocated in one piece and can't be paged out into the paging space.

So you can ensure that the DB memory never be paged out.

 

Please read also this notes about HugePages and Sybase/SAP ASE:

2021541 - SAP ASE runs slow due to table scans with regular page allocation

1805750 - SYB: Usage of huge pages on Linux Systems with Sybase ASE

 

 

For example if the sybase instance need 10GB without Hugepages:

 

10*1024*1024/4kb=2621440  (4kb Pages)
Every Page needs a 8byte entry in the page table 2621440 * 8byte = 20971520 => 20MB

 

For example if the sybase instance need 10GB with Hugepages:

 

10*1024*1024/2048kb=5120 (2mb Pages)
Every Page needs a 8byte entry in the page table 5120 * 8byte = 40960 => 40KB

 

This values need to be multiplicated with the user processes, but the shared memory must be considered!

 

If you need more information about the Page Table, TLB and Huge Pages you should have a look at Stefan Koehlers blog which is regarding oracle but however the facts are the same:

http://scn.sap.com/community/oracle/blog/2013/06/17/oracle-myths-and-common-misconceptions-about-transparent-huge-pages-for-oracle-databases-on-linux-uncovered

 

 

If you want to use HugePages follow this steps as root

 

1) calculate the needed memory

 

select cast(sc.name as varchar(30)) as name, (scc.value*2/1024) as MB
from sysconfigures sc, syscurconfigs scc
where sc.name like 'total%memory' and sc.config = scc.config
go
name                           MB
------------------------------ -----------
total logical memory                  6028
total physical memory                 6400

 

=> Round the ASE "max memory" (total physical memory) setting up to the next closest 256MB, divide by the Hugepagesize, and configure at least that many huge pages. "

=> 6400 / 256mb = 25 => OK

2) calculate the needed HugePages

When ASE uses huge pages, it will allocate memory to the nearest multiple of 256Mb so don’t configure the ASE exactly to the maximum number of huge pages, but leave a small amount unused (e.g. 300/400 Mb). In case a small increase in size is needed due to the change of a Sybase config you will not get into trouble.

6400+400=6800
6800*1024/2048=3400
vi /etc/sysctl.conf
vm.nr_hugepages=3400

 

3) activate the kernel settings, if enough memory is available

sysctl -p

 

 

if the memory is not free, restart the server or add memory

 

4) Allow Sybase ASE owner to make use of available HugePages

vi /etc/security/limits.conf<Sybase ASE OS owner>   soft memlock unlimited<Sybase ASE OS owner>   hard memlock unlimited

5) check the config

cat /proc/meminfo | grep Huge
HugePages_Total:    3400
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

 

6) start the Sybase/SAP ASE and you will see this message in the logs

 

"Allocated memory using Huge pages."

 

 

 

 

7) after DB start

cat /proc/meminfo | grep Huge
HugePages_Total:    3250
HugePages_Free:     1655
HugePages_Rsvd:     1605
HugePages_Surp:        0
Hugepagesize:       2048 kB

 

If you get the same error as before extend the HugePages.

 

more offical info:

1805750 - SYB: Usage of huge pages on Linux Systems with Sybase ASE

 

Before and after process details

Here are the before and after effects regarding the dataserver (sybase DB process under unix) after a fresh restart:

Before:

pmap <sid>
START               SIZE     RSS     PSS   DIRTY    SWAP PERM MAPPING
0000000000400000  32736K  15460K  15460K      0K      0K r-xp /sybase/SMP/ASE-16_0/bin/dataserver
00000000025f7000   5692K   2664K   2664K    216K      0K rwxp /sybase/SMP/ASE-16_0/bin/dataserver
0000000002b86000   2488K   1196K   1196K   1196K      0K rwxp [heap]
0000000142df4000 6291456K 1507196K 1507196K 1507172K      0K rwxs /SYSVba156435
00007fffed33e000     20K     16K      2K      0K      0K r-xp /lib64/libnss_dns-2.11.3.so
[...]
Total:           6507456K 1530568K 1528772K 1509564K      0K

 

ps auxw | head -1; ps auxw | grep <sid>
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
sybsmp   31464 15.5  9.2 6507456 1516852 ?     Ssl  08:56   0:24 /sybase/SMP/ASE-16_0/bin/dataserver -sSMP -d/sybase/SMP/sybsystem/master.dat -e/sybase/SMP/ASE-16_0/install/SMP.log -c/sybase/SMP/ASE-16_0/SMP.cfg -M/sybase/SMP/ASE-16_0 -i/sybase/SMP -N/sybase/SMP/ASE-16_0/sysam/SMP.properties

After:

pmap <sid>
START               SIZE     RSS     PSS   DIRTY    SWAP PERM MAPPING
0000000000400000  32736K  16096K  16096K      0K      0K r-xp /sybase/SMP/ASE-16_0/bin/dataserver
00000000025f7000   5692K   2664K   2664K    216K      0K rwxp /sybase/SMP/ASE-16_0/bin/dataserver
0000000002b86000   2648K   1244K   1244K   1244K      0K rwxp [heap]
00002aaaaac00000 6291456K      0K      0K      0K      0K rwxs /SYSVba156435
00007fffed33e000     20K     16K      0K      0K      0K r-xp /lib64/libnss_dns-2.11.3.so
00007fffed343000   2044K      0K      0K      0K      0K ---p /lib64/libnss_dns-2.11.3.so
00007fffed542000      4K      4K      4K      4K      0K r-xp /lib64/libnss_dns-2.11.3.so
00007fffed543000      4K      4K      4K      4K      0K rwxp /lib64/libnss_dns-2.11.3.so
00007fffed544000     48K     20K      0K      0K      0K r-xp /lib64/libnss_files-2.11.3.so
00007fffed550000   2044K      0K      0K      0K      0K ---p /lib64/libnss_files-2.11.3.so
[...]
Total:           6507616K  24056K  22094K   2440K      0K


 

 

 

vmsaplnx02:~ # ps auxw | head -1 ; ps auxw | grep <sid>
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
sybsmp    1716  9.6  0.1 281536 22712 ?        Ssl  09:12   0:20 /sybase/SMP/ASE-16_0/bin/dataserver -sSMP -d/sybase/SMP/sybsystem/master.dat -e/sybase/SMP/ASE-16_0/install/SMP.log -c/sybase/SMP/ASE-16_0/SMP.cfg -M/sybase/SMP/ASE-16_0 -i/sybase/SMP -N/sybase/SMP/ASE-16_0/sysam/SMP.properties
root      1796  0.0  0.0   4532   560 pts/1    S+   09:16   0:00 grep 1716

 

 

 

If you compare the RSS/VSZ of the 2 ouput you will see the benefit.

 

Hope this howto helps you to use your memory ressources optimal.

 

Thanks for reading and sharing!

Please feel free to ask or get in contact directly if you need if you need assistance.

 

Best Regards,

Jens Gleichmann

Technology Consultant at Q-Partners Consulting und Management GmbH (www.qpcm.eu)

ASE 16: Data & Index Compression

$
0
0

Okay, so data compression isn’t new to ASE 16 - SAP first supported data compression in ASE 15.7.  Index compression is new in ASE 16, but perhaps it takes a bit of background in data compression as a bit of a primer before we can really understand the full considerations.

 

Data compression in ASE 15.7 was implemented at 3 basic levels:

 

  • Row compression - which tried to compress the storage of each row through basic compression techniques such as reducing duplicate characters, etc.
  • Page compression - which used the industry standard dictionary compression techniques to replace data on the page with tokens.
  • LOB compression - which used standard industry ZLib type compression on large LOB objects, which would not lend themselves well to page compression.

 

Before we get into index compression, let’s discuss page compression a bit more because it is the style used in index compression and there is a lot of FUD about it.  First of all, dictionary compression is extremely common in analytic systems.  As noted, SAP ASE simply looks at each column value, determines if there is already an encoded dictionary token, and if so, simply replaces that data element in the storage row with the encoded token.  If the value is not in the dictionary, a new token is assigned to the new value and then it is replaced in the row.

 

In the DBMS industry, there is a lot of noise about page vs. table level dictionary compression and who has better compression, etc.  Some vendors argue that table level dictionaries are more effective as you don’t have to store the dictionary of encoded values on every page.  This nets them slightly better compression ratios.  However, what they don’t explain is the trade-offs - such as the fact that page level compression is more likely to resolve any data value to a low cardinality value which can be encoded using a single byte (or less) whereas table level is more likely to consider data elements as high cardinality and need more bytes for encoding.  Consider for example, the data element “city”.  In a typical database page, there likely will be at most 10’s to low 100’s of distinct values - easily represented in a single byte.  However, in the full table, there could be 10’s of thousands, needing 2 bytes for encoding - possibly 3.

 

The other consideration is that the dictionary table has to be maintained.  This can be a source of potential bottleneck.  For example, at a table level, multiple concurrent writers would need access to the dictionary table and likely would need to be sequenced.  A similar problem pops up with other compression techniques in which adjacent rows are included and the same set of values for a set of columns is replaced with a single data encoded value for the multiple rows.  Yes, it improves compression.  But at an interesting cost for subsequent DML operations that need to modify one of those values as now that single value for multiple rows needs to be replaced with an encoded value for each row…a bit of an escalation from attempting to modify a single row and ending up having to modify several others.

 

As a consequence, ASE’s page compression is a trade-off in which maximum compression is not the goal, but rather a balance between data compression and user concurrency.  One aspect to keep in mind is that data is compressed both on disk as well as in-memory.  This has benefits as well as trade-offs.  For example, one benefit is that it is likely that more data will fit into memory, thus reducing the number of physical reads.  However, it also means that logical reads for previously cached data will be slow as each logical read will have to re-uncompress the data.

 

That last point is a bit of a concern as the overhead can be considerable.  While SAP is looking at ways to reduce this overhead, any reduction would come at a cost of increased memory consumption - which could lead to other problems.  As a result, the most effective solution is to minimize the amount of logical reads that any query needs to perform.

 

 

I will put it in plain English:  You need better indexing.

 

 

But doesn’t adding indexes consume even more space??  …the very thing we are trying to reduce???

 

Yes, but, let’s face it - any frequently executed query (other than an aggregate) that does 100’s or 1000’s of LIO’s - even if all cached/in memory - per row returned is a good candidate for better indexing.    Any penalty from compression is a side issue at that point and just serves to magnify an already bad situation.  For example, on an early SAP system migration, we found a query that ran every 2 seconds that did a table scan of 200,000 pages in ASE.  Yep, completely in memory.  Yep, noticeably slower than when not compressed.  But was compression the real issue??  Nope - the real issue was the in-memory tablescan of 200,000 pages that with a proper index might have been only 10’s of pages of LIO.  Adding the index to  support the query would not only fix the penalty of compression - but also run orders of magnitude faster than it did previously.

 

Now, that doesn’t mean you will be adding an index or 10 to every table.  However, it does mean that you will need to carefully monitor for queries that are running slower and then consider adding better indexing.  Probably it will mean 1-2 additional indexes on a few tables.  Do the 1-2 additional indexes add extra overhead for DML operations?  Yes.  But not enough to be really measurable, unless you don’t have any indexes to begin with.  However, of course, it will add space - as well as perhaps extra maintenance time with respect to dbcc’s, reorgs, updatendex statistics and other operations.

 

But let’s talk about space for a minute.  First of all, this discussion will focus on DOL tables.  Yeah, I know, there are tons of legacy systems out there still using APL tables.  Sorry.  Too many variances with that to get into.

 

Now, then DOL indexes from the very beginning did two really interesting tricks to try to reduce space consumption:

 

  • Index suffix compression on intermediate nodes - Intermediate nodes only contained enough of the index prefix to be able todetermine B-tree traversal
  • Non-unique index duplicate RID lists.  In a non-unique index, at the leaf level, if a key value had multiple rows associated with it, rather than storing the key value(s) multiple times (once for each leaf row), the key value(s) would be only stored once with a list of RIDs that it pointed to.

 

While this reduced the unnecessary space consumption, the more indexes you have and the more distinct the keys, the more space is necessary to store them.

 

Now, then, along comes ASE 16 and its support for index compression.  ASE 16 supports index compression for leaf pages only (non-leaf intermediate nodes still have suffix compression) and uses a technique of index prefixcompression.  The simple solution would be to compress each index key column individually as a whole unit - and this would work well for multi-key indexes.  For example, in a 4 column index key, the first 3 are likely highly repetitive within any given index leaf page.   However, this might not reduce space at all for many single column indexes - or for multi-key indexes in which the last index key had lengthy prefixes.   For example, an index on city name - with the names sorted, often the first multiple characters of the index key values are identical - e.g. Jackson (as in Jackson, MS) and Jacksonville (as in FL).  This doesn’t only affect character data - consider datetime columns in which the date values - and perhaps the hours, minutes and possibly even seconds are identical with the only difference in milliseconds.  Of course, the datetime isn’t stored as character - it is a structure of two integers - a date component and time component.  But likely the date component and the first multiple bytes of the time component may be identical and could be compressed.

 

There are a couple of problems with that….consider a numbering sequence with numbers 100001, 100002, 100003, 100004, … and so forth.  It would appear that looking at a prefix of a partial column, I might be able to compress out the first 5 digits.  Not so fast.  Remember, we are looking at the numeric representation.  What is stored is the binary representation.  On big endian systems (e.g. IBM Power series), this still works out as 100001=0x000186a1, 100002=0x000186a2, 100003=0x000186a3, 100004=0x000186a4,….    However, on little endian systems (such as Intel x86), the LSB ordering of the bytes results instead in 100001=0xa1860100, 100002=0xa2860100, 100003=0xa3860100, 100004=0xa4860100,….  Ugh!  This also impacts datatypes that are derived from numeric types as ’04 Aug 2014’ = 0x7da30000 and ’05 Aug 2014’ = 0x7ea30000 on x86 LSB platforms where IBM Power and other MSB chips would store them as 0x0000a37d and 0x0000a37e respectively - which lends itself much better to prefix compression.

 

The second problem is that most DBMS’s internally store data in fixed length columns first internal structure and then variable length columns.  This reduces the amount of overhead for each row and thus saves some space.  For example, when the data is stored in column order and there are variable length columns, each row would need a column offset table specifying where each column began.  By storing the fixed length columns first, the table structure can simply have single offset table that is used for every row for the fixed length columns and a much smaller column offset table for the variable length columns.  Consider for example an index on columns {col1, col2, col3, col4} in which columns col1, col2 and col4 are fixed length.  If the internal structure was {col1, col2, col4, col3}, then I would only need a column offset table for a single column. This is fixed length first column reorganization internally is why some DBMS’s often suggestion specifying fixed length columns first for a table anyhow.

 

This impacts prefix compression as I would need to make sure that the columns are re-ordered into the correct column sequence as specified in the index key.  Unfortunately, this means that now the larger column offset table takes up more space in the index row than it previously did - which means the index format for index prefix compression could be even larger than it is today.  However, once compression kicks in, the prefix compression is extremely efficient at reducing index size as the typical leading columns of a multi-key index are identical and can be replaced with a single token.

 

A second aspect is that not all indexes may compress very well.  Consider a single column index on a monotonically increasing key - such as an identity column, order number, trade dates, etc.  If the index is unique (e.g. an identity or pseudo-key column), then the prefix might not be very repetitious at all - especially on x86 platforms in which the leading bytes are byte swapped to the end.  If we then arbitrarily apply page compression, each distinctive value would have an entry in the dictionary, plus the token - which means that that we would still need the same amount of space for the dictionary values - but we would also have double the space for the tokens.

 

This leads to the following observations about index compression:

 

  • Multi-column indexes will likely have much greater compression ratios than single column indexes.
  • Indexes with distinctive leading columns (e.g. timestamp) may not compress well.
  • Single column indexes on monotonic increasing values (e.g. order number) may not compress well - especially on little endian (LSB) platforms such as x86.
  • Big endian (MSB) platforms such as IBM Power series might have better compression ratios.

 

With those kind of considerations, how do you decide whether to compress a table and/or its indexes or not??   This is where SAP Control Center 3.3 tries to help with the new Compression Advisor feature - which is pretty neat.  What it does is:

 

  • Allow you to specify the data, LOB and index compression you wish
  • Override the compression on individual columns or indexes as desired
  • Specify a sampling size (default 10%)

 

Then it makes a copy of the table structure, loads it with the sample size data volume, then applies the compression attributes you’ve selected and finally runs a reorg rebuild to compress the existing data in the table.  The reason I like this wizard is that it does two things:

 

  • Produces a fairly reliable compression ratio for space savings
  • Gives a good indication of how long the actual compression will take

 

The first version simply reported an overall space savings and compression ratio for the entire table.   As noted, this might include indexes that shouldn’t be compressed - or rather might not compress well.  There is an enhancement coming in the near future that I have been playing with that actually breaks down the compression by index and provides a result similar to:

 

compression advisor.jpg

 

If you want to play around with index compression, you can download the developer’s edition of ASE 16 from http://scn.sap.com/community/developer-center/oltp-db.  In addition, there was a webcast about compression and other features that you can watch the replay of at http://event.on24.com/r.htm?e=775360&s=1&k=D1FE610794ECF6A138793A50967D48D4.  Finally, there is a demo of the SCC Compression Advisor at https://www.youtube.com/watch?v=XiQW_Xl6bVU&feature=youtu.be.

Which wash buffer needs tuning?

$
0
0

Greetings fellow DBAs,

 

I am trying to reduce the 'Buffers Washed Dirty' for my system's default data cache  (as seen in sp_sysmon: Data Cache Management->cache: Default Data Cache->Buffer Wash Behavior section). 

 

I have varied the wash sizes in my 2K, 4K, and 16K pools with inconsistent results.  Is there a way to determine which pool requires a bigger wash setting?

 

Thanks!

Doug

Msg 3121 on restore, created with dbisql client

$
0
0

I'm running on ASE 15.5 ESD 5[.2, etc] Linux RHEL 6, 64bit, and had an amusing experience with restore you might want to know about.

 

I restored a database I have been building on another server, and got several instances of this message:

 

Recovery of database 'rt_test' will undo incomplete nested top actions

Msg 3121, Level 16, State 1:

Index Broker_BrokerCategory.pk_Broker_BrokerCategory (objid=44524161,indid=2) may be invalid. It uses CHAR or VARCAHR columns in its key and was created under a different sort order ID (0)  or charset ID (0) that the ones on this server (SortOrd=50,CharSet=1)

 

Strangely, both the test server above and the production server where this database was created have the SortOrd 50 and CharSet 1 as their defaults.  On the production server, I dropped and recreated the primary key constraints (in the production copy) using isql, and now dumps of the production database and loads on the test server no longer exhibit this error.

 

I think what I originally did was use dbisql to issue the commands to create the primary key constraints on these tables - the tables were empty at the time the constraints were added.  I strongly suspect that the dbisql/jdbc session produced a different result than the same commands issued using isql. 

 

You have been warned  :-)

UKSUG hosts Technical Data Management Event in London – November 20th, 2014

$
0
0

If you are a data management professional working with SAP’s Database and Technology products in the UK or Europe don’t miss TechSelect 2014 on November 20th in London. Hosted by UKSUG, this full day event will include technical sessions on SAP ASE, SAP IQ, SAP Replication Server and SAP HANA. The event will kick-off with a keynote by Irfan Khan, Chief Technology Officer of SAP's Global Customer operations, followed by a presentation by Peter Thawley, VP, SAP Database & Technology, Office of the CTO who will discuss the key architectural directions of the SAP Data Management Platform.  After the keynote presentations there will be sessions on the latest product innovations and roadmaps.

 

  

 

For more information and to register: http://uksug.com/events/techselect-2014

 

UKSUG TechSelect 2014
November 20th
The Hotel Russell
London

Viewing all 173 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>