Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
2
votes
1
answers
160
views
Find efficient way of migration 2TB GBK table in SybaseIQ to UTF-8 files
My project need to migrate more than 2TB raw data from SybaseIQ to another Database. SybaseIQ using GBK, the target Database using UTF-8, the target database can only load from UTF-8 files. We use [The Extract Options][1] to extract data to GBK files first, then convert data into UTF-8, the converti...
My project need to migrate more than 2TB raw data from SybaseIQ to another Database. SybaseIQ using GBK, the target Database using UTF-8, the target database can only load from UTF-8 files.
We use The Extract Options to extract data to GBK files first, then convert data into UTF-8, the converting is very slow because it's single processor only.
Can anyone tell me the efficient way of extract data from SybaseIQ and convert charset and encode to UTF-8?
Jaugar Chang
(131 rep)
Oct 11, 2014, 01:24 AM
• Last activity: Jul 21, 2025, 07:10 PM
-4
votes
1
answers
127
views
Migration from Sybase to IBM-DB2 or Oracle?
We are planning to modernize our robust power builder /sybase application , that has around 500+ stored procedures,300+ tables. PB application produces 300+ reports, nothing but datawindows which has no PDF printing facility. We are debating whether our new modern database must be DB2 or Oracle ? Bo...
We are planning to modernize our robust power builder /sybase application , that has around 500+ stored procedures,300+ tables. PB application produces 300+ reports, nothing but datawindows which has no PDF printing facility. We are debating whether our new modern database must be DB2 or Oracle ? Both database is legally bought and available for use with our company. Any thoughts ?
user7507266
(1 rep)
Mar 17, 2022, 05:39 PM
• Last activity: Jul 9, 2025, 02:46 PM
0
votes
1
answers
199
views
Sybase SQL Anywhere 17 - Can a database trigger call a system command?
I have a Sybase SQL Anywhere 17 server running on Linux, and I was wondering if it is possible to create a database trigger to execute a local operating system system command when an UPDATE is down on a particular database record? Essentially, if a database table.field is updated to "complete", exec...
I have a Sybase SQL Anywhere 17 server running on Linux, and I was wondering if it is possible to create a database trigger to execute a local operating system system command when an UPDATE is down on a particular database record?
Essentially, if a database table.field is updated to "complete", execute /usr/local/bin/notify
I have done this previously with other database systems, but looking over the SQLAW17 documentation, I can't find any references on how to do this (the trigger documentation seems to refer to stored procedures etc, not clear if I can or should do this as a stored procedure, etc).
Any advice would be appreciated!
Peter Alexander
(1 rep)
Oct 3, 2023, 03:01 PM
• Last activity: Jun 28, 2025, 03:02 PM
2
votes
2
answers
2574
views
Processes can not be terminated on Sybase ASE
In 2 days, 1494 processes can not be terminated. This transactions, select data from IQ from ASE using by services. IQ was stopped yesterday and 1494 processes was occured. I killed `kill spid` but it was not terminated. what should i do to close, kill or stop these processes? I increase a parameter...
In 2 days, 1494 processes can not be terminated. This transactions, select data from IQ from ASE using by services. IQ was stopped yesterday and 1494 processes was occured. I killed
kill spid
but it was not terminated. what should i do to close, kill or stop these processes? I increase a parameter sp_configure 'max cis remote connections',1800
because service can not retrieve data from IQ to ASE... What should i do? Thanks
CpuTime SPID DBName column4 HostName BlockingSPID SecondsWaiting WaitTime MemUsageKB SQLText RowsAffected StartTime
---------- ------- --------- ---------- --------------------- --------------- ----------------- ----------- ------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------- -----------------------
356 3247 tempdb my2u weblogic2.localdomain (null) 91339 91519500 54 DYNAMIC_SQL dyn145: create proc dyn145 as select x, y from mytable where ID = 55728914 0 2018-09-24 09:53:10.843
56 3819 tempdb my2u weblogic2.localdomain (null) 91491 91671600 48 DYNAMIC_SQL dyn138: create proc dyn138 as select x, y from mytable where ID = 4572954 0 2018-09-24 09:50:39.043
55 4124 tempdb my2u weblogic1.localdomain (null) 90587 90767900 68 DYNAMIC_SQL dyn156: 0 2018-09-24 10:05:42.746
55 4169 tempdb my2u weblogic2.localdomain (null) 91570 91750000 70 DYNAMIC_SQL dyn246: 0 2018-09-24 09:49:20.646
54 4681 tempdb my2u weblogic3.localdomain (null) 90077 90257500 68 DYNAMIC_SQL dyn156: 0 2018-09-24 10:14:13.146
54 3621 tempdb my2u weblogic2.localdomain (null) 92437 92617400 70 DYNAMIC_SQL dyn162: 0 2018-09-24 09:34:53.243
54 5083 tempdb my2u weblogic3.localdomain (null) 89846 90026700 82 DYNAMIC_SQL dyn656: 0 2018-09-24 10:18:03.946
53 3158 tempdb my2u weblogic2.localdomain (null) 91798 91978800 48 DYNAMIC_SQL dyn138: create proc dyn138 as select x, y from mytable where ID = 63213
...
sp_who 3247
fid spid status loginame origname hostname blk_spid dbname tempdbname cmd block_xloid
0 3247 terminating my2u my2u weblogic2.localdomain 0 MYDB tempdb SELECT 0
I realized that my tran logs increasing from 1 Mb to 500 Mb... syslogshold result:
dbid reserved spid page xactid masterxactid starttime name xloid
------- ----------- ------- -------- ------------ --------------- ----------------------- ------------------------------------------------------------------- --------
7 0 0 1129 000000000000 000000000000 2013-03-24 17:36:13.36 $replication_truncation_point 0
9 0 3995 41965187 02805683000b 000000000000 2018-09-24 10:24:13.546 $chained_transaction 7990
9 0 0 41965187 000000000000 000000000000 2018-09-25 12:47:15.303 $replication_truncation_point 0
select object_name (id),* from master..syslocks where spid = 3995
GO
id dbid page type spid class fid context row loid partitionid nodeid
259567215 9 0 4 3995 Non Cursor Lock 0 0 0 7990 0 (null)
546266866 9 0 4 3995 Non Cursor Lock 0 0 0 7990 0 (null)
451567899 9 0 4 3995 Non Cursor Lock 0 0 0 7990 0 (null)
579568355 9 0 4 3995 Non Cursor Lock 0 0 0 7990 0 (null)
1676634085 9 0 4 3995 Non Cursor Lock 0 0 0 7990 0 (null)
Melih
(284 rep)
Sep 25, 2018, 07:30 AM
• Last activity: Jun 5, 2025, 06:06 PM
0
votes
1
answers
816
views
sybase errors - meaning and resolution
We have a server that connects to 40+ different remote computers which are running Sybase 11.0.1.2596. Our server is hosted on an aws ec2 AMI Linux instance, and the connections are set up using FreeTDS. The server has several different command-line PHP scripts that use PDO with dblib to connect and...
We have a server that connects to 40+ different remote computers which are running Sybase 11.0.1.2596. Our server is hosted on an aws ec2 AMI Linux instance, and the connections are set up using FreeTDS. The server has several different command-line PHP scripts that use PDO with dblib to connect and select data. 99+% of the time everything works, but sometimes I get these errors:
SQLSTATE[HY000]: General error: PDO_DBLIB: dbresults() returned FAIL
SQLSTATE[HY000]: General error: 20047 TDS: unexpected token 56 (severity 1) [(null)]
SQLSTATE[HY000]: General error: 20047 DBPROCESS is dead or not enabled
They seem to happen randomly, and I can't figure out what is causing them or how to fix it. If I just wait, it will start working again. It also seems if I use tsql to connect it will start responding:
tsql -S -U
Any advice is greatly appreciated.
raphael75
(244 rep)
Mar 28, 2017, 06:06 PM
• Last activity: May 30, 2025, 10:04 PM
1
votes
1
answers
392
views
Problem creating subscriptions on Replication Server version 15.7.1
if anyone knows what is the error? `Can not use active or standby connection names for subscriptions` I got this error when I'm trying to create my subscriptions. I have already created a repdef `WITH PRIMARY AT pb1.customer` and when I tried to run my subscription, `WITH REPLICATE AT pb2.customer`....
if anyone knows what is the error?
Can not use active or standby connection names for subscriptions
I got this error when I'm trying to create my subscriptions. I have already created a repdef WITH PRIMARY AT pb1.customer
and when I tried to run my subscription, WITH REPLICATE AT pb2.customer
. It is showing the error. I have also created a logical connection pb1.customer
for dump/load db.
pb1 and pb2 are both ASE, ASE15.5 and ASE15.7 respectively.
Please advise.
Tittus
(33 rep)
Mar 15, 2018, 09:38 AM
• Last activity: May 9, 2025, 06:01 AM
0
votes
1
answers
471
views
Clarification on steps creating Database Replication Definition
I am being asked to create database replication definitions for a couple of databases (around 20 databases). I just wanted to clarify is the below-mentioned steps are the correct steps to be carried out? Let's says 'customer' is one of my database. 1. Set ddl in tran to true `sp_dboption customer,"d...
I am being asked to create database replication definitions for a couple of databases (around 20 databases). I just wanted to clarify is the below-mentioned steps are the correct steps to be carried out?
Let's says 'customer' is one of my database.
1. Set ddl in tran to true
sp_dboption customer,"ddl in tran", true
2. Mark the primary database using sp_reptostandby
sp_reptostandby customer,'all'
3. Set the RepAgent parameter send warm standby xacts to true
sp_config_rep_agent customer,'send warm standby xacts', 'true'
4. Create db repdef/subs
`create database replication definition db_repdef_customer
with primary at DS.customer
replicate DDL
replicate system procedures
go`
`create subscription db_sub_customer
for database replication definition db_repdef_customer
with primary at DS.customer
with replicate at DS2.customer1
without materialization
go`
(Note: DS.customer and DS2.customer1 are ASE-ASE replication)
After I have followed the above steps to create db repdef/subs, I hit a lot of permission issues on my replication ID to do INSERT/UPDATE/DELETE operators on those tables I did not setup table replication yet. Further check on these tables in my 'customer' database (ex. I tried to do insert/update/delete operations manually on tables without setting table repdef, I realised that the data replication is working for all the tables under the 'customer' database with/without I setup table replication. Is this normal? Any steps I have missed out? Please help.
Tittus
(33 rep)
Mar 13, 2018, 03:00 AM
• Last activity: Apr 11, 2025, 04:05 AM
-1
votes
1
answers
53
views
RUNNING SQL file taking longer
We are getting a .sql file with 152K records and when trying to run this file using unix script with below command, is taking almost an hour. is there any way to reduce the time. SQL FileName : Running_Long.sql Content : around 152k records like below go if exists (select * from table1 where id = 11...
We are getting a .sql file with 152K records and when trying to run this file using unix script with below command, is taking almost an hour. is there any way to reduce the time.
SQL FileName : Running_Long.sql
Content : around 152k records like below
go
if exists (select * from table1 where id = 11111) update table2 set id2 = 66666 where id = 55555
go
if exists (select * from table1 where id = 22222) update table2 set id2 = 77777 where id = 44444
go
...
...
go
if exists (select * from table1 where id = 33333) update table2 set id2 = 88888 where id = 99999
go
sql command running from the script: Sybase
isql -Uuser -Ppass -e -n -i Running_Long.sql -o logfile
Thank you
Venu Vakul
(1 rep)
Feb 6, 2025, 01:27 AM
• Last activity: Feb 6, 2025, 08:22 AM
0
votes
1
answers
132
views
SQL Anywhere 17 Silent Installation
My requirement is, Administration Tools (32-bit) and SQL Anywhere 32-bit (Server as well as client enabled) I have passed the silent installation command in my Dockerfile setup.exe /s ....... So on Regkey etc and SA32=1 AT32=1 It gets installed successfully, but server 32-bit is not enabled because...
My requirement is, Administration Tools (32-bit) and SQL Anywhere 32-bit (Server as well as client enabled)
I have passed the silent installation command in my Dockerfile
setup.exe /s ....... So on Regkey etc and SA32=1 AT32=1
It gets installed successfully, but server 32-bit is not enabled because when I verified dbeng dbserv all these files are missing in Bin32 folder
There are no additional commands to enable the SQL Anywhere 32-bit (server) feature, and client is by default enabled.
What do I do? Please share your knowledge!
fathima farwa
(1 rep)
Dec 21, 2024, 10:04 PM
• Last activity: Dec 24, 2024, 03:13 AM
4
votes
2
answers
890
views
Options to migrate large database from Sybase ASE to SQL Server with minimum downtime
The problem: Our server database contains 1TB of data. It runs on a Sybase ASE 15.7 server and shall be migrated to SQL Server 2014. The servers will be located in the same data center during migration; an acceptable downtime is 6 hours. We have considered using Sybase Replication Server, as we unde...
The problem:
Our server database contains 1TB of data. It runs on a Sybase ASE 15.7 server and shall be migrated to SQL Server 2014. The servers will be located in the same data center during migration; an acceptable downtime is 6 hours.
We have considered using Sybase Replication Server, as we understand it, this product supports heterogeneous database replication from ASE to SQL. However; we do not have experience with this. Snapshot and transactional replication might be a possible solution.
We have some experience with SQL Server Migration Assistant and have successfully migrated the database objects and data in a test environment. However based on 8% test data, we have estimated that a complete migration of production database will take about 7 days. We can only have 6 hours downtime, and are not sure if this product can be used for data migration in our case. For database objects, this product has worked fine.
Do you have some recommendations to solve this problem?
Oyvind
(41 rep)
Jan 19, 2016, 02:39 PM
• Last activity: Aug 26, 2024, 01:45 PM
4
votes
1
answers
2034
views
Sybase ASE to Microsoft SQL Server Replication
I am currently working on several projects to migrate legacy applications from a Sybase ASE (12.5 and 15.0) to a Microsoft SQL Server 2014 platform. There will be a need to replicate data in both directions while the old and new applications are being developed. I was looking for advice regarding ho...
I am currently working on several projects to migrate legacy applications from a Sybase ASE (12.5 and 15.0) to a Microsoft SQL Server 2014 platform.
There will be a need to replicate data in both directions while the old and new applications are being developed.
I was looking for advice regarding how others have approached this problem.
Some ideas we're looking into:
1. Sybase Replication Server (Expensive)
2. Third party Apps (Not sure if it will be stable?)
3. Custom Stored Procedures in Sybase for Update, Insert and Delete and configure those to be called when the data comes in. (Reliability and difficulty of supporting)
Super1337
(171 rep)
May 23, 2017, 03:05 PM
• Last activity: Aug 26, 2024, 01:44 PM
0
votes
1
answers
105
views
on-prem sybase to aws aurora
I want to migrate from on-Prem Sybase to AWS Aurora Postgres database. I came across tools like AWS SCT and AWS DMS, but I am not sure , if the source Sybase database should be in AWS cloud as a pre-requisite for the AWS tools to initiate the migration. What are the other options we have in case we...
I want to migrate from on-Prem Sybase to AWS Aurora Postgres database. I came across tools like AWS SCT and AWS DMS, but I am not sure , if the source Sybase database should be in AWS cloud as a pre-requisite for the AWS tools to initiate the migration.
What are the other options we have in case we want to migrate from On-Prem Sybase to AWS Aurora Postgres database.
Pavankumar
(3 rep)
Nov 29, 2023, 08:36 AM
• Last activity: Dec 19, 2023, 09:24 PM
1
votes
1
answers
392
views
Migration from Sybase to a different platform
How feasible it is move the Sybase database to a different more popular platform such SQL Server or any other. Which one is preferred? Is it feasible in the first place?
How feasible it is move the Sybase database to a different more popular platform such SQL Server or any other. Which one is preferred? Is it feasible in the first place?
tesla747
(1910 rep)
Jul 14, 2015, 10:43 AM
• Last activity: Sep 3, 2023, 11:11 AM
0
votes
1
answers
1767
views
Get Updated_At for any change in row on Sybase?
I am working with a Sybase SQL Anywhere table that has horrible tracking of changes. I have a windows service that queries multiple tables every 5 minutes looking for changes, but one particular table doesn't have any timestamps. In addition to that, when I added a new record, it was given an ID in...
I am working with a Sybase SQL Anywhere table that has horrible tracking of changes. I have a windows service that queries multiple tables every 5 minutes looking for changes, but one particular table doesn't have any timestamps. In addition to that, when I added a new record, it was given an ID in the middle for some reason. There are 15,000 records and the new ID was 6775, so simply asking for records that have an ID greater than the last won't work.
I know in MySQL I could alter the table with something like:
ALTER TABLE
customer
ADD updated_at
DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
Which would auto update that value any time anything was changed. That doesn't work with Sybase, so my next thought was to create a second small table:
CREATE TABLE customers_getting_updated(
customer_id int,
updated_at DATETIME,
PRIMARY KEY(patient_id)
)
and then set a trigger to create / update records in that table. There are currently 150 columns in the table. I tried creating a trigger like this:
create TRIGGER "customer_record_updated" AFTER INSERT ON customer
for each row begin
INSERT INTO customers_getting_updated (patient_id, updated_at)
VALUES(:NEW.customer_id, NOW());
end;
I am running this on a dual processor 6 core with 64GB memory on a SSD and the query has taken 15 minutes and still hasn't finished.
Assuming this will finish eventually (I saw someone say one took them 70 minutes????), since I didn't get an error up front, is there a better way since most computers that need to run this will have substantially less hardware power.
FYI - I tried doing a AFTER INSERT OR UPDATE
but got an error on the OR
, so I assume I will have to write separate triggers.
Alan
(207 rep)
Sep 4, 2018, 04:45 PM
• Last activity: Apr 1, 2023, 11:04 AM
0
votes
1
answers
1376
views
How to mark a Sybase ASE DB as offline for startup
I need to load a database dump into a target database, on Sybase ASE 16. In order to do that, the target database must be offline. Sybase ASE doesn't have a command to put a database offline, so my only possibility is to stop the DB server and restart it, taking care that the target database is not...
I need to load a database dump into a target database, on Sybase ASE 16. In order to do that, the target database must be offline. Sybase ASE doesn't have a command to put a database offline, so my only possibility is to stop the DB server and restart it, taking care that the target database is not brought online during startup. This is my question: which command/option do I need to set so that a specific database is not brought online at server startup? I couldn't find it in the official documentation :-(
Lupuss
(103 rep)
Aug 10, 2020, 12:01 PM
• Last activity: Feb 2, 2023, 12:04 PM
0
votes
0
answers
55
views
Unusual SQL query execution behavior
I am optimizing my SQL script and when i tried to run it i noticed the following; 1. Script full query execution (end to end) took more than 2hours to complete 2. Script query-by-query execution took 44 mins to complete I'm just wondering, why is my script full query execution took so much runtime t...
I am optimizing my SQL script and when i tried to run it i noticed the following;
1. Script full query execution (end to end) took more than 2hours to complete
2. Script query-by-query execution took 44 mins to complete
I'm just wondering, why is my script full query execution took so much runtime than the same script query-by-query execution? Is there some hidden process happening inside the DB? Or any special case for those execution scenario?
Tried to ask our DBA, but he seem to avoid the question maybe he doesn't know. I hope ill got some answers/leads here.
Thanks
Kryle Quimpo
(1 rep)
Nov 24, 2022, 03:46 AM
3
votes
1
answers
2154
views
How compatible are Sybase and SQL Server clients connecting to the alternate back end?
Given the shared history of the Sybase and SQL Server products, and their use of a similar (identical?) wire protocol in [TDS][1], what definite statements can be made, if any, about cross compatibility. If I have a legacy system (binary, no source) that was written against a Sybase 11 back end, is...
Given the shared history of the Sybase and SQL Server products, and their use of a similar (identical?) wire protocol in TDS , what definite statements can be made, if any, about cross compatibility.
If I have a legacy system (binary, no source) that was written against a Sybase 11 back end, is it likely to run against SQL Server 2008?
Similarly, if I have a Windows binary, linked against sybase libs, would it *just work* against a Sybase server, in general or of specific vintage/versions?
sdg
(195 rep)
Nov 23, 2012, 09:27 PM
• Last activity: Oct 11, 2022, 08:03 AM
0
votes
1
answers
655
views
Reliable way(s) of finding home directory of Sybase DB (ASE) on Linux and Windows
I need to write a script that finds Sybase installation on a system if there's any. For testing I've installed ASE 16 on CentOS system, but the installer is apparently based on InstallAnywhere (Java). This is one of the installation methods apparently, I'm not sure if there are more ways to install...
I need to write a script that finds Sybase installation on a system if there's any.
For testing I've installed ASE 16 on CentOS system, but the installer is apparently based on InstallAnywhere (Java).
This is one of the installation methods apparently, I'm not sure if there are more ways to install ASE like installing RPM package.
Anyway, there's this
SYBASE.sh
script for sourcing environment variables in the ASE installation that contains home directory. It's obviously catch-22 situation: in order to find this script I need to know the home directory of ASE to start with.
Yes, I can check in the usual locations like /sysdba
or /opt/sap
. The interactive installer obviously allows ASE to be installed anywhere of course, so that's not good enough.
What's the best way to find it? I'm willing to do stuff like tracking running processes to their executables etc., just anything that would help me find where ASE is installed. For reasons I won't go into even finding it just when it's running would be good.
I can run the script as root or Administrator, no problems with that.
LetMeSOThat4U
(513 rep)
Sep 12, 2022, 04:23 PM
• Last activity: Sep 14, 2022, 04:58 PM
0
votes
1
answers
1216
views
SQL Anywhere 12 - exporting data to Excel
Do I need to install MS Office Excel on machine where is SQL Anywhere 12 server for below code to work? Or SA 12 or Windows have MS Excel Driver builtin? SELECT * FROM SalesOrders; OUTPUT USING 'Driver=Microsoft Excel Driver (*.xls); DBQ=c:\\test\\sales.xls; READONLY=0' INTO "newSalesData";
Do I need to install MS Office Excel on machine where is SQL Anywhere 12 server for below code to work?
Or SA 12 or Windows have MS Excel Driver builtin?
SELECT * FROM SalesOrders;
OUTPUT USING 'Driver=Microsoft Excel Driver (*.xls);
DBQ=c:\\test\\sales.xls;
READONLY=0' INTO "newSalesData";
BlueMark
(247 rep)
Mar 2, 2016, 08:46 PM
• Last activity: Jun 19, 2022, 06:53 PM
107
votes
7
answers
45883
views
Why use both TRUNCATE and DROP?
In the system I work on there are a lot of stored procedures and SQL scripts that make use of temporary tables. After using these tables it's good practice to drop them. Many of my colleagues (almost all of whom are much more experienced than I am) typically do this: TRUNCATE TABLE #mytemp DROP TABL...
In the system I work on there are a lot of stored procedures and SQL scripts that make use of temporary tables. After using these tables it's good practice to drop them.
Many of my colleagues (almost all of whom are much more experienced than I am) typically do this:
TRUNCATE TABLE #mytemp
DROP TABLE #mytemp
I typically use a single
DROP TABLE
in my scripts.
Is there any good reason for doing a TRUNCATE
immediately before a DROP
?
user606723
(1526 rep)
Jul 27, 2011, 05:36 PM
• Last activity: Oct 18, 2021, 09:26 AM
Showing page 1 of 20 total questions