http://goo.gl/EmKxy0

Fresh Batch for Replication Server Admin Training starting from 25th Jan,2014. Please reach us sybanva@gmail.com.

SAP ASE 16 – Design for Extreme Transaction Processing

April 7th, 2014 No comments

SAP ASE 16 Launched Recently : Lot of New Features and Extreme Transaction Ready

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.

SAP ASE 16 Overview white paper

SAP SCN

Huge Page Support in Linux – To Increase Database Performance.

January 19th, 2014 No comments

Memory Management internally uses TLB cache to map the Virtual address to physical address.
If the TLB cache is small (TLB Miss) (since page size is small), it will need to refer the Page table. Page Table look ups are costly as compare to TLB cache.
That’s reason the applications ( Like Database) which have heavy memory demand can be configured to Huge TLB Pages so that Page Table access can be reduced  and overall application performance can be increased.
Linux has had support for huge pages since around 2003 where it was mainly used for large shared memory segments in database servers.
ASE Database performance can be increased bt 2-7% by using huge page on Linux Platform. You can check Huge Page Support on Linux :

cat /proc/meminfo | grep Huge
HugePages_Total: XXX
HugePages_Free:  XXX
HugePages_Rsvd:   XXX
Hugepagesize:     2048 kB

Source: http://linuxgazette.net/155/krishnakumar.html

From a memory management perspective, the entire physical memory is divided into “frames” and the virtual memory is divided into “pages”. The memory management unit performs a translation of virtual memory address to physical memory address. The information regarding which virtual memory page maps to which physical frame is kept in a data structure called the “Page Table”. Page table lookups are costly. In order to avoid performance hits due to this lookup, a fast lookup cache called Translation Lookaside Buffer(TLB) is maintained by most architectures. This lookup cache contains the virtual memory address to physical memory address mapping. So any virtual memory address which requires translation to the physical memory address is first compared with the translation lookaside buffer for a valid mapping. When a valid address translation is not present in the TLB, it is called a “TLB miss”. If a TLB miss occurs, the memory management unit will have to refer to the page tables to get the translation. This brings additional performance costs, hence it is important that we try to reduce the TLB misses.

On normal configurations of x86 based machines, the page size is 4K, but the hardware offers support for pages which are larger in size. For example, on x86 32-bit machines (Pentiums and later) there is support for 2Mb and 4Mb pages. Other architectures such as IA64 support multiple page sizes. In the past Linux did not support large pages, but with the advent of HugeTLB feature in the Linux kernel, applications can now benefit from large pages. By using large pages, the TLB misses are reduced. This is because when the page size is large, a single TLB entry can span a larger memory area. Applications which have heavy memory demands such as database applications, HPC applications, etc. can potentially benefit from this.

Source : https://lwn.net/Articles/374424/

Memory Mgmt uses Translation Look Buffer(TLB) Cache to map Virtual to physical address, The amount of memory that can be translated by this cache is referred to as the “TLB reach” and depends on the size of the page and the number of TLB entries.

If the TLB miss time is a large percentage of overall program execution, then the time should be invested to reduce the miss rate and achieve better performance.
Using more than one page size(Huge Page) was identified in the 1990s as one means of reducing the time spent servicing TLB misses by increasing TLB reach.
Broadly speaking, database workloads will gain about 2-7% performance using huge pages whereas scientific workloads can range between 1% and 45%.
Huge pages are not a universal gain, so transparent support for huge pages is limited in mainstream operating systems
it is possible that huge pages will be slower if the workload reference pattern is very sparse and making a small number of references per-huge-page.
Many modern operating systems, including Linux, support huge pages in a more explicit fashion, although this does not necessarily mandate application change. Linux has had support for huge pages since around 2003 where it was mainly used for large shared memory segments in database servers such as Oracle and DB2

Configuring sqsh – Interactive database shell- replacement for isql

January 7th, 2014 No comments

Sqsh (pronounced skwish) is short for SQshelL (pronounced s-q-shell), it is intended as a replacement for the venerable ‘isql’ program supplied by Sybase.

Sqsh is much more than a nice prompt, it is intended to provide much of the functionality provided by a good shell, such as variables, aliasing, redirection, pipes,back-grounding, job control, history, command substitu-tion, and dynamic configuration. Also, as a by-product of the design, it is remarkably easy to extend and add functionality.

Sqsh was developped by Scott C. Gray, and is currently maintained by Michael Peppler (mpeppler@peppler.org) and also by Martin Wesdorp (mwesdorp@users.sourceforge.net).

You can download sqsh from Source Forge.

Sqsh is held under the GNU General Public License (GPL) and therefore may be freely distributed under the terms of this license.

Basic instructions for Setup :

1. Download the sqsh from here.
sqsh-1

2. Extract  the sqsh tar :
sqsh-2
3. After extract , you will have following directories :
sqsh-3
4.  Move to sqsh directory and create the installation dir with permission to sybase user (in my case installation dir /opt/sqsh). After that execute ./configure –prefix=”/opt/sqsh”sqsh-4
5. Run the make in same dir as below sqsh-5
6. Now finally run the make install sqsh-6
7. Install the manual pages for sqsh as
sqsh-7
8. Move to /opt/sqsh/bin and try to connect data server using sqsh
[sybase@LinuxServer ~]$ cd /opt/sqsh
[sybase@LinuxServer sqsh]$ cd bin
[sybase@LinuxServer bin]$ pwd
/opt/sqsh/bin
[sybase@LinuxServer bin]$ ls -ltr
total 588
-rwxr-xr-x. 1 sybase sybase 599071 Jan  7 15:51 sqsh
[sybase@LinuxServer bin]$ sqsh -v
sqsh-2.4
[sybase@LinuxServer bin]$ sqsh -U sa -S LINUX_PROD
sqsh-2.4 Copyright (C) 1995-2001 Scott C. Gray
Portions Copyright (C) 2004-2013 Michael Peppler and Martin Wesdorp
This is free software with ABSOLUTELY NO WARRANTY
For more information type ‘\warranty’
Password:
[4] LINUX_PROD.master.1> select @@servername,getdate();
 ———————————————————— ——————-
 LINUX_PROD                                                   Jan  7 2014  3:58PM

(1 row affected)
[5] LINUX_PROD.master.1>

You can configure sqsh prompt using /opt/sqsh/etc/sqshrc.  Like in sqshrc file I changed my prompt as ;
#\set prompt=’[$histnum] ${DSQUERY}.${database}.${lineno}> ‘
\set prompt=’${DSQUERY}.${database}.${lineno}> ‘

Now see the prompt of sqsh with history , also I suppressed the banner message using -b
[sybase@LinuxServer bin]$ sqsh -b -SLINUX_PROD -Usa
Password:
LINUX_PROD.master.1> select @@servername,getdate()
LINUX_PROD.master.2> go
———————————————————— ——————-
LINUX_PROD                                                   Jan  7 2014  4:06PM
(1 row affected)
LINUX_PROD.master.1>

Link from Rob Tricks with sqsh & Manual Page for sqsh

Happy New Year !!!

January 2nd, 2014 No comments

Happy New Year 2014!!

In 2014, we’ll talk a lot about Sybase ASE on version 15.7.x.

We will also talk about data replication with SAP Sybase Replication Server, SAP Sybase IQ and SAP HANA.

Stay Tuned in new year !!

Team,
sybaseblog.com

Isolation Levels by example

December 28th, 2013 No comments

For Earlier post on Isolation Level please refer here.

Understanding Isolation Level “1″ : Avoids Dirty Reads (Default isolation level for ASE)

Transaction T1 (Session 1)modifies a data item. Another transaction T2 (Session 2)then reads that data item before T1 performs a COMMIT or ROLLBACK. If T1 then performs a ROLLBACK, T2 has read a data item that was never committed and so never really existed.

 Session1  Session 2   Remarks
1> select @@isolation “Isolation Level”
2>go
 Isolation Level
 —————
               1
(1 row affected)
1> insert into pmtmaster values(1,100)
2> go
1> begin tran
2> update pmtmaster set id2=200 where id1=1
3> go
1>
   

In Session1, updating the row with id2=1
 
 1> print “Session 2″
2> go               
Session 2           
1> select @@isolation “Isolation Level”
2> go
 Isolation Level
 —————
               1
(1 row affected)
1> select * from pmtmaster where id1=1
2> go
^C^C
[CanCan]
 In Isolation Level 1, that is default mode, we can not read dirty data as it is still not committed by other tran.
     So Isolation Level 1, avoids dirty reads.

Understanding Isolation Level “0″

Session1 Session 2 Remarks
1> select @@isolation “Isolation Level”
2>go
Isolation Level
—————
1
(1 row affected)
1> insert into pmtmaster values(1,100)
2> go
1> begin tran
2> update pmtmaster set id2=200 where id1=1
3> go
1>
   Same as Above , In Session1, updating the row with id2=1
 
1> print “Session 2″2> goSession 2
1> set transaction isolation level 0
2> go
1> select @@isolation “Isolation Level”
2> go
Isolation Level
—————
0
(1 row affected)
1> begin tran
2> select * from pmtmaster where id1=1
2> go
id1         id2
———– ———–
1         200
(1 row affected)
 
 Now with isolation level 0 , I am trying to read data and it is allowing dirty reads.
 rollback    If Session 1  rollbacks, session will have inconsistent.

Understanding Isolation Level “2″ : Avoid Repeatable Reads

What is Repeatable Reads?

Transaction T1 (session 1) reads a data item. Another transaction T2 (session 2) then modifies or
deletes that data item and commits. If T1 then attempts to reread the data item, it receives a modified                                      value or discovers  that the data item has been deleted.

Session1 Session 2 Remarks
 

1> select @@isolation “Isolation Level”
2> go
Isolation Level
—————
1
(1 row affected)
1> begin tran
2> select * from pmtmaster where id2=200
3> go
id1         id2
———– ———–
1         200
2         200
(2 rows affected)
 
 Transaction T1 (session 1) reads a data item.
 Session1 Continues..  

 1> begin tran
2> update pmtmaster set id2=300 where id1=2
3> go
1> commit
2> go
 Another transaction T2 (session 2) then modifies.
 1> select * from pmtmaster where id2=200
2> go
 id1         id2
 ———– ———–
           1         200
(1 row affected)
 
 If T1 then attempts to reread the data item, it receives a modified value/different result set in same transaction. This is issue in repeatable reads. Lets review how can we avoid it.

How to avoid Repeatable Reads?

 

1> set transaction isolation level 2
2> go
1> select @@isolation “Isolation Level”
2> go
 Isolation Level
 —————
               2
(1 row affected)
1> begin tran
2> select * from pmtmaster where id2=200
3> go
 id1         id2
 ———– ———–
           1         200
           2         200
(2 rows affected)
To avoid Repeatable read problem, enable the isolation level 2
 Session1 Continues…
 1> begin tran
2> update pmtmaster set id2=300 where id1=2
3> go
^C^C
[CanCan]
 Now Transaction T2 will not allow to modify the restult set which was read earlier tran 1(Session 1)
 1> select * from pmtmaster where id2=200
2> go
id1         id2
———– ———–
1         200
2         200
(2 rows affected)
 
 Still T1 will get same number of rows.

but still it has problem of Phantom Read?

Transaction T1 reads a set of data items satisfying some . Transaction T2 then creates data items that satisfy T1’s and commits. If T1 then repeats its read with the same ,  it gets a set of data items different from the first read.

1> begin tran
2> insert into pmtmaster values (3,200)
3> go
1> commit
2> go  
You can not modifies the result set but still you can insert new values and affect the result set.
1> select @@isolation “Isolation Level”
2> go
Isolation Level
—————
2(1 row affected)
1> select * from pmtmaster where id2=200
2> go
id1         id2
———– ———–
1         200
2         200
3         200
(3 rows affected) 
 Now you can see the same session 1 is still returning different number of result set. This is called as Phantom Reads.
   
 To Avoid Phantom Reads enable isolation level 3 as below.

Understanding Isolation Level “3″ : Avoid Phantom Reads

 1> set transaction isolation level 3
2> go
1> select @@isolation “Isolation Level”
2> go
Isolation Level
—————
3
(1 row affected)
1> begin tran
2> select * from pmtmaster where id2=200
3> go
id1         id2
———– ———–
1         200
2         200(2 rows affected)
To Avoid Phantom Reads , Lets enable isolation level 3
 
1> begin tran
2> update pmtmaster set id2=300 where id1=2
3> go
^C^C
[CanCan] 
 Now you can not modify the result set.
  1> begin tran
2> insert into pmtmaster values (3,200)
3> go
^C^C
[CanCan]
 You can not create data items to affect the result set
 1> select * from pmtmaster where id2=200
2> go
id1         id2
———– ———–
1         200
2         200
(2 rows affected)
 
 All the time you will get same result set.

SAP Recognized as a Market Leader by Gartner, Inc. in Operational Database Management Systems Magic Quadrant

November 17th, 2013 No comments

As per Gartner:

SAP

Located in Walldorf, Germany, SAP (www.sap.com) has several DBMS products that are used for transaction systems: SAP Sybase Adaptive Server Enterprise (ASE), SAP Sybase iAnywhere and SAP Hana. Both ASE and iAnywhere are available as software only, while SAP Hana is marketed as an appliance.

Strengths
  • Vision leadership — Moving into DBMS technology, SAP has introduced SAP Hana as an in-memory platform for hybrid transaction/analytical processing (HTAP) and acquired Sybase to add to the DBMS product line.

  • Strong DBMS offerings — In addition to SAP Hana, SAP Sybase ASE continues to support global-scale applications and was first to introduce an in-memory DBMS (IMDBMS) version.

  • Performance — References cited performance (scalability and reliability) as a major strength (one of the highest scores), mostly for SAP Sybase ASE.

Source : http://global.sap.com/corporate-en/news.epx?category=ALL&articleID=21912&searchmode=C&page=1&pageSize=10

& http://www.gartner.com/technology/reprints.do?id=1-1MNA5V2&ct=131105&st=sb

 

 

SAP® Sybase® Adaptive Server® Enterprise Gains Momentum With Rapid Customer Adoption

November 17th, 2013 No comments

 

In less than 18 months since the offering’s release in April 2012, more than 1,000 customers have chosen to run SAP Business Suite on SAP Sybase ASE and there are more than 2,000 customer installations. Both new and existing SAP customers can run a high-performance relational database management system (RDBMS) optimized for SAP Business Suite that helps improve operational efficiency and significantly reduce overall costs. The announcement was made at the SAP Database and Technology Partner Summit in Barcelona.

Source :: http://www.prnewswire.com/news-releases/sap-sybase-adaptive-server-enterprise-gains-momentum-with-rapid-customer-adoption-229819941.html

http://www.hispanicbusiness.com/2013/11/5/sap_sybase_adaptive_server_enterprise_gains.htm

Trick to unhide the sqltext of a procedure

August 2nd, 2013 1 comment

One fine morning  you want to see the code for a stored procedure but what happen if the text of the proc is hideen through sp_hidetext ?
I am sure you guys know that, once a stored proc is hidden through sp_hidetext, this can not be reverse .

This will even get worse if you do not have a OS level file backup of that proc any where on your server machines or local machines . Even your DBA friends do not have the back up on their desktops/laptops.  This seems to be a very rare scenario but some times it happens :)
I was in this challenging  scenario … was able to find a crack to unhide the code for a hidden proc . Sharing on this forum.
 

Here you GO!

 
1>Shutodwn <sybase_server>

2>Start sybase server on diagnostic mode.

$SYBASE/ASE-15_0/bin>  diagserver -usa -s<sybase_server> -p”password” -d<Master_device_path>

3>use <database_name>

create table #m( id int)
go
insert into #m values(object_id(“proc_name”))
go

dbcc _unhide_text(‘#m’)
go
sp_helptext “proc_name”    ———You can see the proc text now !!! HURRY!!!
go

4> checkpoint
Shutdown the sybase_server

5>Start sybase_server in normal mode

 Note – Pls. do not try this on your production set up as this is not  documented…but you are open to load your production data on UAT/dev and explore.

Categories: ASE Tags:

Real Time HANA Replication from ASE Using SAP Sybase Replication Server

July 31st, 2013 No comments

SAP® Sybase® IQ Software Smashes Previous Results and Sets World Record for Fastest Loading of Big Data

July 27th, 2013 No comments

SAP® Sybase® IQ Software Smashes Previous Results and Sets World Record for Fastest Loading of Big Data

http://finance.yahoo.com/news/newsbyte-sap-sybase-iq-software-130000253.html