Sybase Blog -Anything About Sybase ASE,REP,IQ.

Wednesday, December 29, 2010

Vi Editor – Part 2

Problem 6
———
How to copy range of lines from a file to another?

Solution 6
———-
Suppose i want to copy 50 lines from line number 15 to 64, then open file in vi editor in command mode then follow below command
:15,64w file2.txt

Additionally,
For single line –> :10w file2.txt
For current line where cursor is positioned –> : .w file2.txt
For last line –> :$w file2.txt
For current line to end –> : .,$w file2.txt

Problem 7
———-
What are repeat factor and how to use in navigation?

Solution 7
———
k — move cursor up
j — move cursor down
h — move cursor left
l — move cursor right

if want to move 5 lines up then use “5k” this is called repeat factor.

Problem 8
———
how to navigate among words in a line?

Solution 8
———-


Problem 9
———
How to do “copy and paste” in vi editor?

Solution 9
———-
Open a file in vi editor in command mode,
y — copy single character
yy — copy current line
15yy — copy current line and 14 lines below

p – paste text on right
P – paste text on left

NOTE: p and P paste text on right and left when delete single character of line. However, same keys paste “below” and “above” when delete complete line.

Problem 10
————
How to join lines?

Solution 10
————
Use “J” in command mode. Additionally, if want to join current line and 5 lines below current line then use “6J” (called repeat factor)

Problem 11
———–
How to discard all changes in a line before moving away from the line.

Solution 11
———–
Use “U” in command mode

Problem 12
———–
How to repeat last command?

Solution 12
———–
Use “.” in command mode. For e.g. if you have deleted 3 lines using “3dd” then you can delete 3 lines again and again by pressing “.”

Vi Editor – Part 1

Basic Vi Editor commands
————————
Problem 1
———
How to do the undo in Vi editor?

Solution 1
———-
Go to command mode and press “u” to undo the last action.

Problem 2
———
How to convert lines into comments?

Solution 2
———
Use “I” and “A”
“I” inserts at the beginning of line.
“A” appends at the end of line.
So press “I” and type /* then [Escape] and then press “A” and type */ then [Escape]. Due to this each line can be converted to comment.

Problem 3
———
How to insert lines above and below the current line without placing the cursor at the start and end of line?

Solution 3
———-
Use “o” and “O”
open a file in command mode and press “o” which inserts a new line below the current line.
Open a file in command mode and press “O” which inserts a new line above the current line.

Problem 4
———
What is the difference between s,S,r,R in command mode?

Solution 4
———
r –> Replaces a single character with one character.
R –> Replaces all text on the right of the cursor position.
s –> Replaces a single character with many.
S –> Replaces the entire line irrespective of cursor position.

Problem 5
———
How to save and quit in one character?

Solution 5
———
Use “:x” in command mode.

Performance Tuning – Good For Developers – Part 2

Scene 1 — If you are suppossed to search range of values then use clustered index because in range search values will be at consecutive location in sorted order after clustered index creation. So effort for engine would be reduced.

Scene 2 — Use stored procedure instead of individual queries because
- It reduces the network traffic
- Query plan got created once for same query which could be re-used instead of creating again and again.
- Stored procedure can be invoked by passing different parameters instead of sending newly created query again and again.

Scene 3 – Make sure there are no table scan on large tables.

Performance Tuning – Good For Developers – Part 1

Performance Tuning – Part 1

1. Indexes improve select performance.

2. While writing queries few things must be considered – Use operators =,>,<,>=,<=,like,between. 3. Replace the BETWEEN with >= and <= operators because BETWEEN in turn converted to mentioned oprators. So with we can reduce one step.

4. Don’t use functions in the WHERE clause. For e.g. select col1 from Table1 where upper(col1) = col2 — If we are having index created on columns col1 and col2 then because of function query engine will not use the index in select operation.

5. Similarly don’t use the mathematical expression in WHERE clause. For e.g. select col1 from Table1 where (col1 * 3) = col2

6. One of the most common pitfall is mismatch in datatype on both side of join. for e.g. select col1 from table1 where col1=col2 — if datatype of col1 and col2 are different then it reduces the performance of query.

sybsyntax database – Very Helpful to DBAs & Developers

Installation steps:

sybsyntax database require 3 to 5 mb space.

1. Create the device as below :
1> disk init name=”sybsyntaxdev”,physname=”c:\sybase\sybsyntaxdev.dat”,size=”200M”
2> go
1> sp_helpdevice sybsyntaxdev
2> go
device_name physical_name
description
status cntrltype vdevno vpn_low vpn_high
———— ————————–
—————————————————————————————–
—— ——— —— ——- ——–
sybsyntaxdev c:\sybase\sybsyntaxdev.dat
file system device, special, dsync off, directio on, physical disk, 200
.00 MB, Free: 200.00 MB
2 0 6 0 102399

(1 row affected)
dbname size allocated vstart lstart
—— —- ——— —— ——

(1 row affected)
(return status = 0)
2. Create the database sybsyntax on above device.

1> create database sybsyntax on sybsyntaxdev=”200M”
2> go
CREATE DATABASE: allocating 102400 logical pages (200.0 megabytes) on disk
‘sybsyntaxdev’ (102400 logical pages requested).
Database ‘sybsyntax’ is now online.

3. Install the sybsyntax database with the script as below
C:\Sybase\ASE-15_0\scripts>isql -Usa -iins_syn_sql -w9999 -oins_syn_sql.out
Password:
4. Check the syntax help, using sp_syntax for any sql keyword

1> sp_syntax
2> go
Msg 17970, Level 16, State 1:
Server ‘TESTPC’, Procedure ‘sp_syntax’, Line 74:
sp_syntax provides syntax help for Sybase products.
Msg 17971, Level 16, State 1:
Server ‘TESTPC’, Procedure ‘sp_syntax’, Line 78:
These modules are installed on this Server:

Module
——————–
ESP
System Procedure
Transact-SQL
UNIX Utility
Windows NT Utility
dbcc Procedure

Msg 17972, Level 16, State 1:
Server ‘TESTPC’, Procedure ‘sp_syntax’, Line 85:
Usage: sp_syntax command [, module [, language]]
(return status = 0)
1> sp_syntax “dbcc”
2> go
Syntax Help

——————————————————————————
System Procedure
sp_plan_dbccdb – Recommends suitable sizes for new dbccdb and dbccalt
databases, lists suitable devices for dbccdb and dbccalt,
and suggests a cache size and a suitable number of
worker processes for the target database.
sp_plan_dbccdb [dbname]

Transact-SQL
dbcc checkalloc [(database_name [, fix | nofix])]
dbcc checkcatalog [(database_name)]
dbcc checkdb [(database_name [, skip_ncindex])]
dbcc checkstorage [(database_name)]
dbcc checktable({table_name|table_id}[, skip_ncindex])
dbcc checkverify [(database_name)]
dbcc complete_xact (xid, {“commit” | “rollback”})
dbcc forget_xact (xid)
dbcc dbrepair (database_name, dropdb)
dbcc engine( {offline , [enginenum] | “online” })
dbcc fix_text ({table_name | table_id})
dbcc indexalloc ({table_name | table_id}, index_id
[, {full | optimized | fast | null}
[, fix | nofix]])
dbcc rebuild_text (table [, column
[, text_page_number]])
dbcc reindex ({table_name | table_id})
dbcc tablealloc ({table_name | table_id}
[, {full | optimized | fast | null}
[, fix | nofix]])|
dbcc { traceon | traceoff } (flag [, flag ... ])
dbcc tune ( { ascinserts, {0 | 1 } , tablename |
cleanup, {0 | 1 } |
cpuaffinity, start_cpu {, on| off } |
des_greedyalloc, dbid, object_name,
” { on|off }” |
deviochar vdevno, “batch_size” |
doneinproc { 0 | 1 } |
maxwritedes, writes_per_batch } )

grant dbcc – Assigns permissions for dbcc commands
grant dbcc {dbcc_command [on] {all | database_name}]
[, dbcc_command [on {all | database}],…]}
to {user_list | role_list}

revoke dbcc – revokes permissions for dbcc commands
revoke dbcc {dbcc_command [on] {all | database_name}]
[, dbcc_command [on {all | database}],…]}
from {user_list | role_list}

dbcc Procedure
sp_dbcc_alterws – Changes the size of the specified workspace to a specified
value, and initializes the workspace.
sp_dbcc_alterws dbname, wsname, “wssize[K|M]“

sp_dbcc_configreport – Generates a report that describes the configuration
information used by the dbcc checkstorage operation for the
specified database.
sp_dbcc_configreport [dbname]

sp_dbcc_createws – Creates a workspace of the specified type and size on the
specified segment and database.
sp_dbcc_createws dbname, segname, [wsname], wstype,
“wssize[K|M]“

sp_dbcc_deletedb – Deletes from dbccdb all the information related to the
specified target database.
sp_dbcc_deletedb [dbname]

sp_dbcc_deletehistory – Deletes the results of dbcc checkstorage operations
performed on the target database before the specified date and time.
sp_dbcc_deletehistory [cutoffdate [, dbname]]

sp_dbcc_differentialreport – Generates a report that highlights the changes
in I/O statistics and faults that took place between two dbcc
operations.
sp_dbcc_differentialreport [dbname [, objectname]],
[db_op] [, "date1" [, "date2"]]

sp_dbcc_evaluatedb – Recomputes configuration information for the target
database and compares it to the current configuration information.
sp_dbcc_evaluatedb [dbname]

sp_dbcc_faultreport – Generates a report covering fault statistics for the
dbcc checkstorage operations performed for the specified object
in the target database on the specified date.
sp_dbcc_faultreport [report_type [, dbname
[, objectname [, date ]]]]

sp_dbcc_fullreport – Runs sp_dbcc_summaryreport, sp_dbcc_configreport,
sp_dbcc_statisticsreport, and sp_dbcc_faultreport short for
database..object_name on or before the specified date.
sp_dbcc_fullreport [dbname [, objectname [, date]]]

sp_dbcc_runcheck – Runs dbcc checkstorage on the specified database, then
runs sp_dbcc_summaryreport or a report you specify.
sp_dbcc_runcheck dbname [, user_proc]

sp_dbcc_statisticsreport – Generates an allocation statistics report on the
specified object in the target database.
sp_dbcc_statisticsreport [dbname [, objectname
[, date]]]

sp_dbcc_summaryreport – Generates a summary report on the specified database.
sp_dbcc_summaryreport [dbname [, op_name]]

sp_dbcc_updateconfig – Updates the dbcc_config table in dbccdb with the
configuration information of the target database.
sp_dbcc_updateconfig dbname, type, “str1″ [, "str2"]

(return status = 0)
1> sp_syntax “select”
2> go
Syntax Help

——————————————————————————
Transact-SQL
select – Retrieves rows from database objects.
select ::=
select [ all | distinct ] select_list
[into_clause]
[from_clause]
[where_clause]
[group_by_clause]
[having_clause]
[order_by_clause]
[compute_clause]
[read_only_clause]
[isolation_clause]
[browse_clause]
[plan_clause]
select_list ::=
For details, see “Keywords and options” in the SAG
into_clause ::=
into [[database.]owner.]table_name
[ lock {datarows | datapages | allpages } ]
[ with into_option [, into_option] …]
into_option ::=
| max_rows_per_page = num_rows
| exp_row_size = num_bytes
| reservepagegap = num_pages
| identity_gap = gap
from_clause ::=
from table_reference [,table_reference]…
table_reference ::=
table_view_name | ANSI_join
table_view_name ::=
[[database.]owner.] {table_name | view_name}
[as] [correlation_name]
[index {index_name | table_name }]
[parallel [degree_of_parallelism]]
[prefetch size ][lru | mru]}
[holdlock | noholdlock]
[readpast]
[shared]
ANSI_join ::=
table_reference join_type join table_reference join_condition
join_type ::= inner | left [outer] | right [outer]
join_conditions ::= on search_conditions
where_clause ::=
where search_conditions
group_by_clause ::=
group by [all] aggregate_free_expression
[, aggregate_free_expression]…
having_clause ::=
having search_conditions
order_by_clause ::=
order by sort_clause [, sort_clause]…
sort_clause ::=
{ [[[database.]owner.]{table_name.|view_name.}]column_name
| select_list_number | expression }
[asc | desc]
compute_clause ::=
compute row_aggregate(column_name)
[, row_aggregate(column_name)]…
[by column_name [, column_name]…]
read_only_clause ::=
for {read only | update [of column_name_list]}
isolation_clause ::=
at isolation
{ read uncommitted | 0 }
| { read committed | 1 }
| { repeatable read | 2 }
| { serializable | 3 }
browse_clause ::=
for browse
plan_clause ::=
plan “abstract plan”

(return status = 0)
1>

Sunday, December 19, 2010

Intelligent Partitioning with Sybase ASE

Guys,

Gud writeup for Intelligent Partitioning with Sybase ASE.
Source : sybase.com & IDC

http://www.sybase.com/files/Product_Overviews/ASE-Partitions-Web-Seminar.pdf

Happy Learning!

Monday, December 6, 2010

Atharva – Tapas

Hi Guys,
Last week on 27th Nov 2010, I m blessed with a baby boy – Atharva (Tapas).
I became father now- one new role,new zeal, new dreams, new life…god bless to Atharva.

Cheers

Thursday, October 7, 2010

SYBASE AND CLOUD COMPUTING



Hi,

Came across this new technology trends "Cloud Computing" and trying to acquaintance with it .

Its very basis article but no doubts it will clear your doubts about it:

Source : wikipedia, sybase web site , www.


Q: What is Cloud Computing?
A: Wikipedia defines cloud computing as follows:
Cloud computing is a style of computing in which dynamically scalable and often virtualized resources are provided as a service over the Internet. Users need not have knowledge of, expertise in, or control over the technology infrastructure "in the cloud" that supports them.
The concept incorporates infrastructure as a service (IaaS), platform as a service (PaaS) and software as a service (SaaS) as well as other recent technology trends that have the common theme of reliance on the Internet for satisfying the computing needs of the users. Cloud computing services usually provide common business applications online that are accessed from a web browser, while the software and data are stored on the servers.
The term cloud is often used as a metaphor for the Internet, based on how the Internet is depicted in computer network diagrams, and is an abstraction for the complex infrastructure it conceals.


Q: What is a Public Cloud?
A: Wikipedia defines a public cloud as follows:
Public cloud or external cloud describes cloud computing in the traditional mainstream sense, whereby resources are dynamically provisioned on a fine-grained, self-service basis over the Internet, via web applications/web services, from an off-site third-party provider who shares resources and bills on a fine-grained utility computing basis.


Q: What is a Private Cloud?
A: Wikipedia defines a private cloud as follows:
Private cloud and internal cloud are neologisms that some vendors have recently used to describe offerings that emulate cloud computing on private networks. These (typically virtualization automation) products claim to "deliver some benefits of cloud computing without the pitfalls", capitalizing on data security, corporate governance, and reliability concerns.


Q: How are enterprises using cloud computing?
A: Enterprises are typically using cloud environments for the purposes of testing or to accommodate systems with variable workloads. For example, they want to do simulations or implement a POC but don’t want to make the capital investment in infrastructure to construct these environments.


Q: What are the benefits from using cloud-based solutions?
A: Cloud computing is a potentially cost-efficient model for provisioning processes, applications and services while making IT management easier and more responsive to the needs of the business. These services - computation services, storage services, networking services, whatever is needed - are delivered and made available in a simplified way - "on demand" regardless of where the user is or the type of device they're using.
The cloud improves resource utilization through the power and flexibility of virtualization. It helps to quickly deliver standardized services through IT service automation, delivering and accessing resources as a service and reducing system and application management costs.
In summary, the benefit of cloud computing is often summarized as follows:
Reduced Cost – Public Cloud technology is paid incrementally through usage or time-based models, potentially saving organizations money. Complete abstraction of hardware and software resources also saves costs by eliminating server and storage management costs.
Flexibility - Cloud computing offers much more flexibility than past computing methods because of the ability to easily add extra capacity.


Q: What is an Amazon Machine Image (AMI)?
A: An Amazon Machine Image (AMI) is a pre-built package of software which can be used to create a virtual machine within the Amazon EC2. An AMI forms the basic unit of deployment for services delivered using EC2 and typically includes the operating system and additional software necessary to deliver a service.


Q: What are Production AMIs and how do they differ from Development AMIs?
A: Production AMIs can be used for all development and production purposes. Unlike Development AMIs they can use used for revenue generating activities and can be used by all developers and customers. Development AMIs are for development and testing only and are provided at no charge to customers and developers.


Q: What is Sybase’s Cloud Computing initiative?
A: This initiative is targeting developers that will enable enterprises to exploit the cloud computing model for various classes of applications including transactional, analytics and mobile applications, enabling organizations to take advantage of cost- and resource-efficiencies associated with Cloud Computing.
Sybase data management, analytics and mobile technologies will enable robust and secure private cloud computing environments in partnership with infrastructure, storage and virtualization technology vendors.
Sybase will enable developers to extend their existing software development environments onto public cloud computing environments such as the Amazon Elastic Compute Cloud (Amazon EC2) environment.


Q: Which other technology vendors are you currently working with?
A: As part of our overall strategy, we are working with storage virtualization vendors such as Symantec and its Veritas Storage Foundation to optimize Sybase’s Virtualized Resource Managementtm (VRM) technology framework found in ASE Cluster Edition for this storage environment to build robust and reliable cloud computing environments.


Sybase is working with industry leaders in infrastructure, storage and virtualization to optimize technologies for delivery into public and private cloud environments that provide greater technology availability and flexibility to Sybase customers looking to Unwire their Enterprise.


Sybase is also working with Amazon Web Services to allow developers to quickly extend their development environments to Amazon Elastic Computer Cloud (Amazon EC2). Sybase is providing customers and partners with freely available development editions of its technologies as Amazon Machine Images (AMI).

Thursday, September 30, 2010

sybaseblog on blogger!

Dear Folks,
Now I have  hosted the sybase blog on blogger as
So keep rolling the ball n happy learning sybase..!
Cheers!!

Wednesday, September 22, 2010

Sybase ASE 12.5 to 15 Upgradation Steps -II

Upgrade Steps:

Before proceeding with any further steps , please make sure preupgrade step is clean  and you have backup of all databases, tables etc.

1. Make sure you are in ASe 15 enviorment, ( by executing .profile_15)

2. cd to sample resource files directory.

3. copy the sql server resource file with new name before modifying original file.

4. Edit the resource file for the old sybase home dir (ASE 12.5),for reserver word check yes and update the resource file as per your enviorment.

5. No need to shutdown your ASE 12.5 server, sqlupgradres will take care all the things.

6.  Only execute this command once you have done with all above steps and you have taken all backup. (MOST IMPORTANT)

sqlupgraderes again perform preupgrade, before actual upgrade.( you can modify its behaviour in resource file).

sqlupgraderes will copy automatically the interface file, cfg file , run server file in ase 15x.

Execute the following command with resource file: sqlupgraderes -r <resource_file_name>

Copying interfaces file entry to new directory...

The interfaces file entry has been copied to the new directory.

Running preupgrade program...

The preupgrade program has completed successfully.

Checking reserved words in each database...

No reserved word conflicts were found.

Checkpointing all databases...

All databases have been checkpointed.

Copying configuration file to new directory...

The configuration file has been copied to the new directory.

Updating RUN_SERVER file...

The RUN_SERVER file has been updated.

Doing pre-upgrade modifications...

Pre-upgrade modifications succeeded.

Restarting Adaptive Server....

Adaptive Server has been restarted.

Running upgrade program...

The upgrade program has completed successfully.

Restarting Adaptive Server....

Adaptive Server has been restarted.

Running installmaster script...

installmaster: 10% complete.

installmaster: 20% complete.

installmaster: 30% complete.

installmaster: 40% complete.

installmaster: 50% complete.

installmaster: 60% complete.

installmaster: 70% complete.

installmaster: 80% complete.

installmaster: 90% complete.

installmaster: 100% complete.

The installmaster script has been successfully installed.

Running installcommit script...

The installcommit script has been successfully installed.

Installing common character sets (Code Page 437, Code Page 850, ISO Latin-1,

Macintosh and HP Roman-8)...

Character sets installed.

Restarting Adaptive Server....

Adaptive Server has been restarted.

Done



6. Log in the server, check the current version with @@version, @@boottime, database/device status.



Post-upgrade tasks:



1. Installing 15x stored procedures after upgrade depending which function is being used on the server.

installsecurity – Run this script if the Adaptive Server Auditing functionality was enabled in your earlier installation.

installhasvss – Run this script if the HA functionality is enabled and the HA feature is currently in use in the upgraded installation of        Adaptive Server.

Installmodel

instmsgs.ebf

Check the installation script version using sp_version by logging in ASE.

2. Compare sp_configure output to see if there is any difference. Verify procedure cache allocation after upgrading. Verify data cache has no change.

3. Make sure license file is used.

save the license files with a .lic file name extension to the SYSAM-2_0/licenses directory of the license server installation.

Modify the variable in .profile for any instances on the same box.

For example:

LM_LICENSE_FILE=servername.lic

If you not having lic file, it will run under grace period of 1 months, you will get same warning in errorlog.

4. Reboot the instance

5. Reenabling auditing if needed.


Tuesday, September 21, 2010

Sybase ASE 12.5 to 15 Upgradation Steps -I

Friends,

Just trying to make out the Sybase ASE 12.5 to ASE 15.0 upgrade check list.
If any point is missing,any recommendation/suggestions. please comment it out below.


Thanks n Happy Learning Sybase.

Cheers!!

PS: Please take the backup of  tables, files, dirs before making any changes. Below steps can be changed for working environment/platform. Before doing on Prod, first proceed with dev env.




ASE 15.x Intsallation :

1. Please first read all the plateform requirement, os patch level before ASE15x installation.
If any patch is recommended, please get it apply with Unix team.


2. Install Adaptive Server 15x into its installation directory other than ASE 12.5.

3. run ./setup to install ASE15x – Just install Binary – do not create any Instance.
run ./setup –console in command mode, do not create any instance here.


Pre Upgrade Tasks:

1. Please run dbcc checkdb, dbcc checkalloc and dbcc checkcatalog in single user mode with fix option,
and make sure that there is no Errors from the check, if there is any Error, Please Fix the problem. It is critical for successful migration.


2. Backup database and Dump Transaction Logs.

3. bcp system tables out
syslogins, sysloginroles, sysusages, sysservers, sysdatabases, sysdevices


4. Ensure that Instance has sybsystemdb if it does not exist, create it.

5. Disable auditing using Command
Sp_Configure 'auditing', 0


6. Save the current audit settings for the pre-15.0.2 Adaptive Server using the command:

sp_displayaudit

7. There are recommendation to set allow password downgrade' to 1 – in case we want to downgrade from 15.0.2 to 12.5.4 again – but not required in my case.
Because encryption algo is changed in ASE 15.


8. Extract databse devices and databases creation scripts using ddlgen,Sybase Central.

9. Save sp_configure output.

10.Save data cache information.

11. Make sure, ASE is configured with enough lock structures for the upgrade process to complete successfully,
it is strongly recommended that you perform the following steps:


a) In every user database, execute the following query:
1> select 2 * (count(*)) + 100 from systabstats
2> go
b) Record the highest value returned


c) If the value from Step 2 above is less than the current number of configured lock structures,
then increase the configured value to the value from Step 2, as shown below:


1> sp_configure ‘number of locks”,
2> go


12. Take the backup of cronjobs and comment out/suspend all the dba maint jobs and application jobs in cron/autosys.

13. Please make sure there is no user activity on the server.

14. Lock all the User and Application ID, functinal ids, system ids: repserver dbo.

Must take the bcp out of syslogins before changing it.

USE master
go
EXEC sp_configure 'allow updates to system tables',1
go
select 'update syslogins set status = 2 where name = "' + name+'"' from syslogins
where name not in ("hauser","probe","probe_sybase","sa")
order by name
go


15. Setup black out/define green zone to avoid alerts. (optional).

16. Create a new profile named as .profile_15 in sybase home directory by copying ASE 15x SYBASE.sh .
Verify that your SYBASE environment variable points to the location of the new Adaptive Server software files you just installed.
set the OLDSYBASE, OLDSYBASE_ASE, and OLDSYBASE_OCS environment variables to the location of the server you are upgrading,
to avoid any possibe error during sqlupgraderes.


17. Make a backup of existing .profile and move it with .profile_12.5

18. preugrade test : preupgrade is need to run for upgrade elibibilty test for fixing error/warning before actual upgrade;

preupgrade is exe which is loacted under /ase15_0/upgrade/.
i)If you are in 12.5 enviorment ( by executing .profile_12.5), go in the below mentioned dir and issue the below command.


/ASE-15_0/upgrade> preupgrade -S -Usa

ii) If you are in 15x env, (by executing .profile_15), please copy the interfaces filefrom 12.5 dir to 15x dir.
Then run the above command.


19. Run Preupgrde test: It may recommends lot of warning, errors for your databases and config params.

Please fix all these errors until all is not resolved and get it confirm with preupgrade test.

20. Fix all reported errors and repeat preupgrade process until no error. And see the sentence as below.

Preupgrade of Adaptive Server to 15.0 is complete.
Upgrade eligibility test succeeded.

Wednesday, September 1, 2010

Renaming the Adaptive Server - ASE

Before doing any step ;

i) Please take the backup of master database, including all other important critial databases.
ii) Please take the backup of all files which you are modifying to backout in case of any issue.
iii) Stop the client/app activity on the server.

1. First modify the sysservers table in master database and shutdown the dataserver.
Enable allow update on system table, modify sysservers for srvname and srvnetname with new server.

2. Copy the RUN Server file with new name.

3. Modify the new RUN server file for new server name, errorlog file name(optional), config file name (optional).

4. If you are modifying any cfg file name in new RUN server file, please copy the old cfg file with new name.

5. Take the backup of the interfaces file, after that modify the new servername are just add the new server name with different port number.

6. Now restart your dataserver with new RUN server file.

7. Verify the connection from isql/app team.

Same step we can repeat for the Sybase backup Server.

Thanks!!

Tuesday, August 17, 2010

Wednesday, August 11, 2010

Usage of #! /usr/bin/ksh..

I came across with below article for the usgae of #!/usr/bin/ksh.

Just Sharing....

Source : www

Originally, we only had one shell on unix. When you asked to run a command, the shell would attempt to invoke one of the exec() system calls on it. It the command was an executable, the exec would succeed and the command would run. If the exec() failed, the shell would not give up, instead it would try to interpet the command file as if it were a shell script.
Then unix got more shells and the situation became confused. Most folks would write scripts in one shell and type commands in another. And each shell had differing rules for feeding scripts to an interpreter.
This is when the "#! /" trick was invented. The idea was to let the kernel's exec() system calls succeed with shell scripts. When the kernel tries to exec() a file, it looks at the first 4 bytes which represent an integer called a magic number. This tells the kernel if it should try to run the file or not. So "#! /" was added to magic numbers that the kernel knows and it was extended to actually be able to run shell scripts by itself. But some people could not type "#! /", they kept leaving the space out. So the kernel was exended a bit again to allow "#!/" to work as a special 3 byte magic number.
So
#! /usr/bin/ksh
and
#!/usr/bin/ksh
now mean the same thing. I always use the former since at least some kernels might still exist that don't understand the latter.
And note that the first line is a signal to the kernel, and not to the shell. What happens now is that when shells try to run scripts via exec() they just succeed. And we never stumble on their various fallback schemes.

- Senior Unix SA

Tuesday, August 10, 2010

HVAR Technology for Replication..Server..

New Release of Replication Server Includes Patent Pending Technology for High Volume, Immediate Data Transfer Requirements


http://www.sybase.com/detail?id=1081513&contentOnly=true

Sybase, Inc., an SAP company (NYSE: SAP), and industry leader in delivering enterprise and mobile software, today announced transformative new features for the latest version of Sybase® Replication Server®, Sybase’s database replication product supporting change data capture, data distribution and synchronization of data across heterogeneous database environments for real-time analytics, reporting, distributed operations and disaster recovery. Sybase Replication Server innovation dramatically reduces latency with moving data between enterprise information stores, addressing challenges with the ever accelerating pace of business.

This latest release includes the following capabilities:

Real Time Loading for Sybase IQ – empowering organizations to deliver real-time analytics from ASE to Sybase IQ and through continuous change data capture (CDC) technology.

Advanced Performance Services – providing high-volume transaction replication using HVAR technology, significantly reducing transaction latency.

New Heterogeneous Capabilities – improving performance in heterogeneous database environments operating Sybase ASE, Oracle®, IBM® DB2® and Microsoft® SQL Server database servers, with parallel Data Server Interface (DSI). Enterprises can also now maintain warm standby applications for Oracle databases.

In-Memory Database Replication – enabling ASE on-disk databases to be replicated to ASE in-memory databases.

Cheers,

sybanva

Sybase Community Forum...

Hi All,

After long time, new posting...:(

Just sharing..may be some folks aware with it...Recently came across the Sybase's own  community forum, supported by Team Sybase....

Its having very good technical discussion, troubleshooting...tips fo ASE, IQ, Replication and many more...

http://www.sybase.com/detail_list?id=11507

Tuesday, April 20, 2010

directio,dsync & sync , async IO

All,

I came across very conceptual article about the sybase device io.

If you have any questions and suggestions please let me know. Thanks.

Source: Sybase Blogs, www, sybooks, sybase white paper for direct io.

ASYNCHRONOUS I/O:

  • Asynchronous I/O allows the process issuing the I/O to continue executing while OS completes the request.

  • Dataserver process does not block on this request till its completion.


SYNCHRONOUS I/O:

  • Synchronous I/O blocks the I/O issuing process from continuing executing while OS completes the request.

  • The process is blocked till the request is completed. This generally results in poor throughput.




DSYNC :

  • In 12.0 sybase introduced the dsync flag – shorthand for “Data Synchronous.”

  • When the dsync setting is on, Adaptive Server opens a database device file using the UNIX dsync flag.

  • The dsync flag in ASE directly translates to the O_DSYNC open(2) flag. That is to say, when ASE opens a device that has the dsync flag set, ASE will pass O_DSYNC to open(2).

  • This flag tells the file system that a write to that file must pass though the cache and be written to disk before the write is considered complete.

  • In other words, for writes we throw away the cache efficiency and make sure the data goes to disk.

  • This way if the system crashes, everything that we thought had been written to disk has in fact been written to disk.




Is DSYNC “synchronous"??

  • This is not true.

  • This synchronous / asynchronous conflict is at a different level. With async i/o we are talking about the context in which the i/o is executed, i.e. whether the i/o blocks the caller or if it is done in a different context.

  • With dsync we are talking about when the write() is considered complete.

  • These are not mutually exclusive, and you can asynchronously do a data synchronous i/o.

  • The async portion is as always: the application issues an i/o and later polls (or is notified) for completion. The dsync portion means that the application won’t be told that the I/O has completed until the data has made it to disk.


DIRECT IO

  • Direct I/O is another kind of file system i/o, introduced in ASE15.

  • In the direct i/o model the file system cache is completely bypassed.

  • Using direct i/o, writes are naturally safe because they bypass the cache and go straight to disk.

  • Direct i/o is very, very similar to raw i/o.

  • The main difference is that in direct i/o the structure of a file system still exists, easing manageability.

  • With raw i/o, no file system exists. The performance of raw and direct i/o should be very similar.


Also like to add :

  • The dsync and directio are mutually exclusive. Both cannt be turn on same time on the device. Both dsync and directio provide the full recoveribility.



  • If you gone through the full article, the next question is, which would be best in raw device and filesystem device with direct io, both are bypassing the file system cache.

Monday, March 29, 2010

Dataserver Health Check Script

Hi Folks,

This is going to be first post of month march, was busy due to relocation.  Now new topic health check...

In our production support environment we need do the health check on our data server on time to time basis, such as after the any long activity, in the production monitoring, after the server restart, and there are lot of many more cases.

I have tried to compile the Hc script v 1.0 as below , I am still trying to improve it , your suggestions and thoughts most welcome...

/***************************************************************
## Dataserver Health Check - Version 1.0
## Intial Drafted by - sybanva for SYBASETEAM.COM
## Date - 19th Feb 2010
****************************************************************/

print "#########################################################"
set nocount on
go
print "--------------------------------------------------------"
print " DataServer Checks"
print "--------------------------------------------------------"
go
select @@version "DATASERVER VERSION"
go
select @@servername "Instance Name", @@maxpagesize " Page Size of Instance"
go
select getdate() "Current Date", @@boottime "Instance Startup date"
go
print "--------------------------------------------------------"
print " Active Trace Flags"
print "--------------------------------------------------------"
dbcc traceon(3604)
go
dbcc traceflags
go
print "--------------------------------------------------------"
print " Process Status"
print "--------------------------------------------------------"
select spid SPID,cmd COMMAND,cpu "CPU Usage",physical_io "PHYSICAL IO",ipaddr "IP ADDRESS",loggedindatetime "LOGGED IN DATE",hostprocess "Host PROCESS ID" from sysprocesses where physical_io>0 or cpu >0
go
print "--------------------------------------------------------"
print " Long Running Process Status"
print "--------------------------------------------------------"
If exists (select count(1) from syslogshold where spid <> 0)
print "<<<<<<<< NO LONG RUNNING TRANS AT THIS MOMENT >>>>>>>>>"
else
select dbid "Database ID",spid SPID,starttime "START TIME",name NAME from syslogshold where spid <> 0
go
print "--------------------------------------------------------"
print " Blocking Process Status"
print "--------------------------------------------------------"
go
If not exists (select count(1) from sysprocesses where blocked > 0)
select spid SPID,cmd COMMAND,cpu "CPU Usage",physical_io "PHYSICAL IO",ipaddr "IP ADDRESS",loggedindatetime "LOGGED IN DATE",hostprocess "Host PROCESS ID" from sysprocesses where blocked > 0
else
print "<<<<<<<< NO BLOCKING PROCCESS AT THIS MOMENT >>>>>>>>>"
go
print "--------------------------------------------------------"
print " Checks for Zombie SPIDs"
print "--------------------------------------------------------"
go
if exists(select spid from master..syslogshold slh where slh.spid <> 0 and slh.spid not in(select spid from master..sysprocesses))
select spid from master..syslogshold slh where slh.spid <> 0 and slh.spid not in(select spid from master..sysprocesses)
else
print "<<<<<<<< NO ZOMBIE SPIDS AT THIS MOMENT >>>>>>>>>"
go
print "--------------------------------------------------------"
print " Check for Engines"
print "--------------------------------------------------------"
go
sp_configure 'number of engines'
go
select engine "Engine No",osprocid "OC Proc ID",status "STATUS",starttime "START TIME" from sysengines
go
print "--------------------------------------------------------"
print " Checks for Database Status"
print "--------------------------------------------------------"
go
select name "DB NAME",dbid "DBID",status "STATUS",crdate "CRATION DATE",dumptrdate "LAST DUMP TRAN DATE" from sysdatabases
go
print "--------------------------------------------------------"
print " Checks for Suspect/OFFLINE Database Status"
print "--------------------------------------------------------"
go
if exists(select name from sysdatabases where status in (-32768,64,256,32))
select name, status from sysdatabases where status in (-32768,64,256,32)
else
print "<<<<<<<< ALL DBS STATUS IS NORMAL >>>>>>>>>"
go
print "--------------------------------------------------------"
print " Checks for Servers"
print "--------------------------------------------------------"
select srvname "SERVER NAME",srvnetname "SERVER N/W NAME" from sysservers
go
print "--------------------------------------------------------"
print " Checks for Backup Server"
print "--------------------------------------------------------"
go
SYB_BACKUP...sp_who
go
print "--------------------------------------------------------"
print " Checks for Monitor config"
print "--------------------------------------------------------"
go
sp_monitorconfig "max memory"
go
sp_monitorconfig "number of locks"
go
sp_monitorconfig "number of open indexes"
go
sp_monitorconfig "number of open objects"
go
sp_monitorconfig "number of user connection"
go
sp_monitorconfig "procedure cache size"
go
Same Thread @ http://www.sybaseteam.com/dataserver-health-checkout-qa-script-t-684-3.html

Sunday, February 28, 2010

Tuesday, February 16, 2010

New domain name for your fav Blog : http://sybaseblog.com

Friends,

Today, I have registered new domain name for my fav blog as its title name http://sybaseblog.com.
Earlier wordpress domain will still work parallel.
So keep rocking sybase and happy learning n fun!!!!!

Thanks.

Friday, February 5, 2010

Sybase Acquires Aleri!!!

After the ASE 15.5 release and Sybase Q4 result, one more good news for all Sybase Guys...

4th Feb 2010, Sybase, Inc. (NYSE: SY), an industry leader in enterprise and mobile software, today announced that it has finalized an Asset Purchase Agreement with Aleri Inc. Aleri is a leading provider of enterprise-class complex event processing (CEP) technology and CEP-based solutions.

"With this transaction Sybase positions itself as a clear market leader in CEP. We have strengthened our real-time analytics platform, by adding Liquidity Risk Management and the industry leading Liquidity Management Suite," said Dr. Raj Nathan, Senior Vice President and CMO of Sybase. "Our customers increasingly expect Sybase to provide a broad analytics portfolio to meet their growing needs and we are committed to continue to deliver on this vision."

Keep Rocking sybase!!!

Source : http://www.sybase.com/detail?id=1067153 & http://www.aleri.com/developers/blogs/sy...leri-staff

About Aleri

According to Forrester Research, "The Aleri platform is a strong product backed by a strong strategy." Aleri is recognized as a standout leader in CEP in the Forrester Research, Inc., independent report published August 4, 2009 --"The Forrester Wave™: Complex Event Processing (CEP) Platforms," Q3 2009. The full report can be found at http://www.forrester.com.

Aleri is focused on providing tools and solutions that deliver Continuous Intelligence ™ - allowing businesses to make better decisions through more timely insight and respond quickly to changing conditions. The centerpiece of this effort is Aleri's Complex Event Processing (CEP) technologies, designed for high speed real-time analysis of data streams, with tools for rapid application development and deployment. Aleri offers a range of solutions to common business problems, with CEP at the core of all solutions. In March of 2008, Aleri merged with Coral8, another leading provider of CEP technology enabling the company to offer a complete suite of tools and solutions focused on continuous intelligence and business agility in a fast paced business environment. Founded in 1999 and headquartered in Chicago, Aleri was privately held at the time of the transaction.

Saturday, January 30, 2010

Cleaning Shared Memory Segment and semaphore, for the ASE startup..

Panic dataserver, stopping it manually, and on restart showing issues with memory , meanwhile business people wants updates in every 5 mins...The situation is really worst for a DBA.

This posting is related to shared memory problem, for cleaning the shared memory:

When we shutdown the Sybase dataserver abruptly, by using the kill -9 or kill -12(or due to any reason automatically).

During the restart, sometime it gives the problem unable to create shared memory region, as below:

os_create_region: shmget (0x%x): %s

os_create_region: Shared memory segment %d is in the way

os_create_region: uninitialized shared memory descriptor

os_create_region: shmat (%d): %

Killing Process may left behind the System V semaphore or shared memory left behind instead of being cleaned up automatically. To eliminate unneeded semaphores or shared memory segments, we need to release semaphore or shared memory segment manually.

For the Semaphores:

Run the command ipcs -sa, it will give all semaphores active in the UNIX box, look for the value "0" in the column NSEMS. 0 values indicate that unused semaphore, find all semaphore for the Sybase user and remove them using command ipcrm -s

testinghostname:(/sybase)=>ipcs -sa
IPC status from as of Thu Sep 17 08:50:11 EST 2007
T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME
Semaphores:
s 201326671 0xc103d804 --ra-ra-ra- patrol dba patrol dba 2 8:45:15 0:00:08
s 201326668 0xc103d80e --ra-ra-ra- sybase dba sybase dba 0 8:50:08 0:00:00

testinghostname:(/sybase)=>ipcrm -s 201326668

For the Shared Memory:

To cleanup the Shared memory segment, which are assigned at OS level but not in use, run ipcs -ma command.

testinghostname:(/sybase)=>ipcs -ma
IPC status from as of Thu Sep 17 08:50:24 EST 2007
T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME
Shared Memory:
m 654311446 0x4103d80e --rw-rw-rw- patrol dba patrol dba 0 2304 1766 1766 8:50:18 8:50:18 0:00:08
m 671088657 0x4103d80d --rw-rw-rw- sybase dba sybase dba 0 1792 1766 1762 8:45:15 8:45:15 0:00:08
m 671088650 0x4103d80b --rw-rw-rw- root root root root 0 768 1766 1766 8:50:18 8:50:18 0:00:08
m 671088648 0x4103d80a --rw-rw-rw- sybase dba sybase dba 1 1280 1766 1766 8:50:18 8:50:18 0:00:08
m 654311548 0x4103d809 --rw-rw-rw- sybase dba sybase dba 0 256 1766 1766 8:50:08 8:50:08 0:00:08

Now look in the NATTCH field for 0, if it 0 zero for Sybase user , it is unneeded, but still assigned at OS level. Remove it ipcrm -m by providing the id.

testinghostname:(/sybase)=>ipcrm -m 671088657 -m 654311548

Now Start the dataserver....

Same case with backup server, if u get any error with shared memory..!

Thanks.

Source : Sybooks and UNIX Manuals on wwww.
Same Thread @ http://www.sybaseteam.com/cleaning-shared-memory-segment-semaphore-for-ase-startup-t-715.html

Thursday, January 28, 2010

Sybase Delivers Best Quarter in Company History in 25 yrs!!!

All,

Very Good News for Sybase Folks!!!!

Sybase, Inc. Sybase reported record results for the quarter and full year ended Dec. 31, 2009. Among the company's records were Q4 revenue of $331.7 million, annual revenue of $1.17 billion, and record operating margins and cash flow from operations. The company's strong Q4 performance completes the best year in Sybase’s 25-year history.

Sybase Delivers Best Quarter in Company History, Resulting in Third Consecutive Year of Record Revenue!!

Cheers!!!

Source : http://www.sybase.com/detail?id=1067077
Same thread @ http://www.sybaseteam.com/sybase-strong-q42009-performance-completes-best-year-its-t-714.html

Sybase ASE 15.5 Meets Extreme Performance, Efficiency & Service Level Demands of Next-Generation Transaction Processing Systems

Source : www & http://www.sybase.com/detail?id=1067065.
:)
New Version Includes In-Memory Database Option to Enable Data Virtualization in Cloud and Grid Environments

Sybase, Inc. (NYSE: SY), an industry leader in enterprise and mobile software, today announced the availability of Sybase® Adaptive Server® Enterprise (ASE) 15.5, the newest version of its high-performance, mission-critical enterprise database management system.

Sybase ASE 15.5 features the addition of two new options: ASE In-memory Databases (IMDB) and Advanced Backup Services. With these enhancements, ASE 15.5 continues to deliver unparalleled performance and manageability for data intensive environments that require very low response times and high throughput.

The IMDB option in Sybase ASE 15.5 enables data virtualization and scaling critical to meeting the needs of high data volume and high concurrent user organizations, whether deployed in public cloud or private data center environments. Unlike other in-memory products, the ASE 15.5 IMDB is fully integrated within ASE, eliminating the need for application changes and providing the flexibility that allows in-memory databases to be configured to meet application requirements.

“In-memory DBMS is an important dimension of the DBMS landscape, and will become more so in the coming years,” said Carl Olofson, Vice President of Research at IDC. “The Sybase developments that provide transparent in-memory database management show clear leadership in the DBMS field.”

ASE 15.5 also increases efficiency in the data center with the integration of the ASE Backup Server with Tivoli® Storage Manager (TSM) from IBM. With this support, ASE databases can be backed up on any TSM supported media, providing faster backups and restores with less network and storage resources required. This new integration provides a cost effective solution for storage management.

“The database management features offered by Sybase ASE 15.5 coupled with the storage management features offered by IBM® TSM provide a powerful solution to overcome the challenges of data protection faced in today’s business environment.” said Richard Vining, Product Marketing Manager, IBM Tivoli Storage. “We are pleased to provide Sybase ASE with the Ready for Tivoli software designation, which shows customers that the solution meets or exceeds IBM compatibility criteria and successfully integrates with one or more IBM Tivoli Software products.”

"In data centers, the IT challenge is to increase efficiency and availability while lowering data center costs. At the same time, application deployments in grid and cloud computing environments are increasing the requirements of transaction processing systems to support large volumes of concurrent users with high transaction rates,” said Brian Vink, vice-president, data management products, Sybase. “ASE 15.5 addresses these extreme requirements by delivering increased data throughput and greater concurrent activity while elevating productivity and uptime.”

Saturday, January 23, 2010

How to check the Replication Latency manually?

Hi Folks,
For the checking latency between Primary and Replicated DBs , we have several methods.

Here, I am posting the manual method for checking the replication latency. If you have any more thoughts, please comment it out.

Rite Now I am travelling to Delhi, my train got late, so I am spending my time with my fav, with new posting in blog.

For calculating the latency, we can make two tables in PDB and RDB with column as defaut datetime, and setup replication between these two tables.

Before excuting the batch of your's queries, insert the id (only for reference for the point, where we executed the insert statement) and it will update the primary_datetime by default current system date.

After the completing the batch, insert the the next id, automaticaly it will get the finish date in default column.

Now go to RDS and check the diff between primary_datetime and replicate_datetime.

1. IN PDS/PDB Create one table as
create table timer_table(id int, primary_datetime datetime default getdate())

2. In RDS/RDB create same table with one extra coloum
create table timer_table(id int,primary_datetime datetime,replicate_datetime default getdate())

3. Setup the replication between both.

4. Before executing the batch insert the value in table as
insert into timer_table (id) values(100)

5. Execute your batch for queries.

6. After completion, execute the insert statement as
insert into timer_table (id) values(101)

7. Now go in the replicated dataserver(RDS/RDB) and check the diff between primary_datetime and replicate_datetime.
select datediff(ss,min(primary_datetime),max(replicate_datetime)) from timer_table

With the help of id you can check the latency upto that point. Even,You can customize this method for checking the latency.

Thanks,
Source : www & sybooks.
Same Thread @ : http://www.sybaseteam.com/how-to-test-latency-t-692.html

Monday, January 18, 2010

Sybase India Names Inflow Technologies As National Distributor

Sybase Software (India) Pvt. Ltd, the Indian subsidiary of Sybase, Inc., a provider of enterprise infrastructure and mobile software, today announced that it entered into a master reseller agreement with Inflow Technologies Pvt. Ltd in India.

The agreement will enable Inflow Technologies to extend the benefits of Sybase's offerings, particularly analytics and enterprise mobility, to the growing market in India, said a press release.

Inflow Technologies, part of the US$ 5 billion Datatec Group, has presence in more than 12 locations across India and Sri Lanka.
Sources : news, www.

Saturday, January 16, 2010

Basic Working of Sybase Replication Server

Hey Guys,

Its my first post of New Year 2010. I am trying to put the basic understanding of Replication Server and whys it needs more monitoring. Hoping you will enjoy it!

Wishing you great new year 2010 ahead !

Basic Working of Replication Server

PDS : Primary Data Server
PDB : Primary Data Base

RDS : Replicated Data Server
RDB : Replicated Data Base

PRS : Primary Replication Server
RRS : Replicated Replication Server

RSSD : Replication System Database

1. RepAgent reads the record from transation log of the PDB for the tables which are marked for replication.

2. Logs into the PRS and write transactions in inbound queue of PDB in stable device.

3. Holds Data in inbound queue , untill it recieves commit.

4. Uses subscription information in its RSSD to decide what to do with the each transaction, after the commit:

i Discards the rans if there is no subscription.
ii Writes the transaction to the out bound queue if there are subscription.

5. Writes commited trans only in outbound queue according to subscription.

6. Sends transactions to their destination, it depends upone two things

i) if Replicated Database is managed by PRS
Apply changes to RDB using the DSI thread our the connection.

ii) If their are two server, RRS is managing RDB
Send commited trans to RRS over route.
RRS apply that changes in RDB

7. If apropriate, uses function string information in RSSD to compose command to submit to replicate database.

Source : sybooks and www.

As you people are seeing, there are lot of movement of trans/record , and for these trans movements Replication Server uses lot of threads(DSI,RSI,SQT,SQM etc).

If any one of thread stops , replication ceases , even it can hamper PDB performance.

Thats why it is little bit difficult to manage, not difficult, we can say, its need better monitoring.

If I am missing any thing , please add in comments.

Thanks.
AnVa
Same Thread at : http://www.sybaseteam.com/basic-working-of-replication-server-t-675.html