http://goo.gl/EmKxy0

Archive

Archive for November, 2011

K21– ASE’S KERNEL DESIGN FOR THE 21ST CENTURY – ASE 15.7’s THREADED KERNEL K21

November 29th, 2011 No comments

Basic Difference :

Process Kernel:

Pre-15.7 kernel (except Windows)
Each engine is a separate process

Retained in 15.7 for risk mitigation

Threaded Kernel:

Default kernel for 15.7

Each engine is a thread of a single process

Additional threads for handling I/O, etc.

ASE on Windows has always been thread based

http://www.sybase.com/files/Product_Overviews/ASE-15.7-New-Threaded-Kernel.pdf

http://blogs.sybase.com/tradingandrisk/2011/11/highly-consistent-response-times-with-new-threaded-kernel-in-ase-15-7/

Categories: ASE, News Tags: , , , , ,

How to run sybase query in different databases in one run

November 24th, 2011 No comments

I would suggest to run SQL via shell script as below.

database.txt

————

database1

database2

database3

 

query.txt

———

select col1, col2 from table

go

write shell script

multiple_database_query.sh

————————–

while read LINE

do

database=$LINE

isql -S “” -D “${database}” -i “query.txt”

done < database.txt

 

Database load error

November 24th, 2011 No comments

Sometime “database is in use” error encounters while loading the database, this could be due to in-memory db tables might still active for the named database. So use the dbcc commands to clear those and reload the database.

How to know what are the spids using given database

November 24th, 2011 No comments

Use below command

 

dbcc dbreboot(‘report’,’dbname’)

go

It will give you all spids which are using given database.

How to remove duplicate rows from a file in unix

November 24th, 2011 No comments

use

cat <filename> | sort | uniq -c

 

Note: “sort” command is required before “uniq” because uniq command matches the next line with previous one. If file is not sorted then duplicate rows unlikely be filtered.

How to avoid locking on system tables in tempdb

November 24th, 2011 No comments

1. tempdb database is shared among all databases in a server, so it is heavily used. It causes lock contention on sysobjects, syscolumns and sysindexes tables. To reduce the contention try to use “select…insert” instead of “select into””, because former is fully logged operation which slow down the process and provide a solution to locking problem.

2. Try to use data only locking scheme in place of allpages.

“Pushd, popd and cd -” unix commands

November 21st, 2011 No comments

pushd:- This command acts similar to “cd” command.

popd:- This command is used to return to previous directory.

cd -:- This command is also used to return to previous directory.

NOTE Both “popd” and “cd -” works similar but they differ primarily that “cd -” acts like a loop i.e.

                                                     cd -                  cd -       cd -      cd -

Directory X ——> Directory A ——–> Directory B ——-> Directory A ——–> B ——->A —–> B

However,

                                                popd       popd

Directory X ——> Directory A —> Directory B ——-> A———> X

Categories: ASE, Developement, Start Sybase, UNIX Tags: ,

getopts unix command

November 21st, 2011 No comments

getopts is an unix command to fetch argument and argument values. OPTARG and OPTIND are two variables to hold argument values and index.

usage:

suppose we have define command usage as below

test.ksh [-s <server name>] [-d <database name>] [-u <user name>] [-p <password>]

so usage is

while getopts s:S:d:D:u:U:p:P i

do case “$i” in

        s|S) SERVER="$OPTARG";;
        d|D) DATABASE="$OPTARG";;
        u|U) USER="$OPTARG";;
        p|P) PASS="$OPTARG";;
        ?) usage;;
   esac

done

Categories: ASE, Developement, Start Sybase, UNIX Tags: ,

Basic awk concepts

November 21st, 2011 No comments

Awk is basically a tool for text processing and report generation which is having features of programming language like C. Let see below how awk happens to be useful tool while writing shell scripts.

$ awk ‘{ print }’ /etc/passwd

When we executed awk, it evaluated the print command for each line in /etc/passwd, in order. All output is sent to stdout, and we get a result identical to catting /etc/passwd. Now, for an explanation of the { print } code block. In awk, curly braces are used to group blocks of code together, similar to C. Inside our block of code, we have a single print command. In awk, when a print command appears by itself, the full contents of the current line are printed.

$ awk ‘{ print $0 }’ /etc/passwd

In awk, the $0 variable represents the entire current line, so print and print $0 do exactly the same thing.

$ awk ‘{ print “” }’ /etc/passwd

Whenever you pass the “” string to the print command, it prints a blank line. If you test this script, you’ll find that awk outputs one blank line for every line in your /etc/passwd file. Again, this is because awk executes your script for every line in the input file. Here’s another example:

$ awk ‘{ print “hiya” }’ /etc/passwd

Print different fields – Fields are separated by colon “:”

  • ======================*

$ awk -F”:” ‘{ print $1 }’ /etc/passwd

$ awk -F”:” ‘{ print $1 ” ” $3 }’ /etc/passwd –> It will print first and third fields with a space between them.

 

[edit]========================

Reference: http://www.ibm.com/developerworks/linux/library/l-awk1/index.html

Categories: ASE, Developement, Start Sybase, UNIX Tags:

Nice difference between Sybase and Oracle – Sybase outperforms Oracle

November 21st, 2011 No comments

Survey among Sybase and Oracle customers.

1. License fees: 75% of respondents thought that Sybase ASE was less expensive, by an average of 28%.

2. Support costs: 78% of respondents thought that Sybase ASE was less expensive, by an average of 32%.

3. Number of database administrators: nobody thought that Oracle required fewer DBAs and 61% thought that Sybase required fewer DBAs. On average the saving was 32%.

4. Frequency of security patches: again, nobody thought that this was less frequent in the case of Oracle while 68% thought that this was the case with Sybase, with an average reduction of 22%.

5. Issue resolution: 73% thought that Sybase was faster at resolving issues, typically being 21% faster.

Reference: http://www.sybase.com/files/White_Papers/SYBASE_ASE_Bloor_Research_TCO_vs_Oracle.pdf

Categories: ASE Tags: