Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

0 votes
1 answers
1322 views
How do I change the usage of a device_fragment?
As can be seen below an index `device_fragment` usage is log only when it should be data only, and a log `device_fragmen`t usage is data only when it should be log only. name db_size owner dbid created durability lobcomplvl inrowlen status -------- ------------- -------- ---- ------------ ----------...
As can be seen below an index device_fragment usage is log only when it should be data only, and a log device_fragment usage is data only when it should be log only. name db_size owner dbid created durability lobcomplvl inrowlen status -------- ------------- -------- ---- ------------ ---------- ---------- --------- ------------------------------------------------------------------------ a0000023 76000.0 MB a0000023 4 Sep 05, 2017 full 0 NULL select into/bulkcopy/pllsort, trunc log on chkpt, allow nulls by default device_fragments size usage created free kbytes ------------------------------ ------------- -------------------- ------------------------- ---------------- a0000023_data000 250.0 MB data only Sep 6 2017 9:37AM 86 a0000023_index000 500.0 MB data only Sep 6 2017 9:37AM 126 a0000023_log000 100.0 MB log only Sep 6 2017 9:37AM not applicable a0000023_data000 500.0 MB data only Sep 6 2017 9:37AM 56 a0000023_index000 500.0 MB data only Sep 6 2017 9:37AM 2554 a0000023_data000 300.0 MB data only Sep 6 2017 9:37AM 70 a0000023_index000 700.0 MB data only Sep 6 2017 9:37AM 422 a0000023_data000 1000.0 MB data only Sep 6 2017 9:37AM 126 a0000023_index000 1000.0 MB data only Sep 6 2017 9:37AM 0 a0000023_log000 548.5 MB log only Sep 6 2017 9:37AM not applicable a0000023_log000 0.5 MB data only Sep 6 2017 9:37AM 272 a0000023_log000 1.0 MB data only Sep 6 2017 9:37AM 0 a0000023_data000 2449.0 MB data only Sep 6 2017 9:37AM 112 a0000023_data000 2.0 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 2422.5 MB data only Sep 6 2017 9:37AM 84 a0000023_index000 0.5 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 3.0 MB data only Sep 6 2017 9:37AM 0 a0000023_data000 2997.0 MB data only Sep 6 2017 9:37AM 322 a0000023_data000 4.0 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 1995.5 MB data only Sep 6 2017 9:37AM 658 a0000023_index000 0.5 MB data only Sep 6 2017 9:37AM 510 a0000023_index000 5.0 MB log only Sep 6 2017 9:37AM not applicable a0000023_log000 345.5 MB log only Sep 6 2017 9:37AM not applicable a0000023_log000 0.5 MB data only Sep 6 2017 9:37AM 0 a0000023_log000 4.0 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 1495.5 MB data only Sep 6 2017 9:37AM 602 a0000023_index000 0.5 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 5.0 MB data only Sep 6 2017 9:37AM 0 a0000023_data000 5495.0 MB data only Sep 6 2017 9:37AM 518 a0000023_data000 5.0 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 1620.0 MB data only Sep 6 2017 9:37AM 28 a0000023_index000 5.0 MB data only Sep 6 2017 9:37AM 0 a0000023_data000 6995.0 MB data only Sep 6 2017 9:37AM 352250 a0000023_data000 3.0 MB data only Sep 6 2017 9:37AM 0 a0000023_index000 7747.0 MB data only Sep 6 2017 9:37AM 1638 a0000023_data000 6000.0 MB data only Sep 6 2017 9:37AM 140 a0000023_index000 2000.0 MB data only Sep 6 2017 9:37AM 56 a0000023_data000 4000.0 MB data only Sep 6 2017 9:37AM 98 a0000023_index000 15000.0 MB data only Sep 6 2017 9:37AM 6856024 a0000023_data000 10000.0 MB data only Sep 6 2017 9:37AM 10200000 -------------------------------------------------------------------------------------------------------------- log only free kbytes = 1018706
terry (1 rep)
Sep 6, 2017, 03:43 PM • Last activity: Jun 25, 2025, 03:07 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
0 votes
1 answers
870 views
Replication Server version 15.7.1 - Sybase ASE 15.5, how to change primary data server in RSSD?
Recently, I am requested to migrate the current Sybase data server to a new Sybase data server (let's say, from pub1 to pub2). To do this, I need to rebuild all the RepAgents which have been set up previously in pub1. Is there any primary data server I would need to set in the RSSD? Because I could...
Recently, I am requested to migrate the current Sybase data server to a new Sybase data server (let's say, from pub1 to pub2). To do this, I need to rebuild all the RepAgents which have been set up previously in pub1. Is there any primary data server I would need to set in the RSSD? Because I could see when I run the command 'connect' without any option, it will connect to (pub1.repserver) instead of (pub2.repserver). Is there any configuration required on the RSSD to make it (pub2.repserver)? Also, I actually have setup one RepAgent (pub2.db_lotte), the setup process using rs_init was successful, but seems the RepAgent connection is down after the setup process (admin who_is_down), the connection couldn't bring up and no error is captured in the replication log. Appreciate if anyone could help. Thanks.
Tittus (33 rep)
Nov 9, 2017, 09:49 AM • Last activity: Apr 8, 2025, 11:15 PM
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
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
1 answers
657 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
1079 views
Size of Log Backup is not reducing from past three days
Recently we implemented Incremental(Enabled allow incremental dumps) and Log Backup(Disabled trunc Log on chkpt) for Sybase ASE(15.7 SP139) running on HP-UX Itanium server and to our great surprise, Size of Log backup is increasing from past 3 days continuously. Even after Full/Cumulative backup, si...
Recently we implemented Incremental(Enabled allow incremental dumps) and Log Backup(Disabled trunc Log on chkpt) for Sybase ASE(15.7 SP139) running on HP-UX Itanium server and to our great surprise, Size of Log backup is increasing from past 3 days continuously. Even after Full/Cumulative backup, size of the Log file kept on increasing at disk and even size at database is not clearing. Checked logsize at different interval by running command sp_helpsegment logsegment within database and noticed that used_pages is constantly increasing and free_pages is on decline. We even checked dbcc gettrunc to get details however it was of no use. Below is size of files Log Size We are using 2 stripe for database dump and compress 5 for compressing size on disk while taking dump. Replication is running on this database and is working fine. Appreciate if I can get expert advise on this issue.
Learning_DBAdmin (3924 rep)
Jul 29, 2018, 09:04 AM • Last activity: May 30, 2022, 01:56 AM
0 votes
1 answers
530 views
How many databases does a sybase instance have?
I'm a newbie to sybase and could not find the clear answers on Sybase tutorials/docs - How many databases can one Sybase instance have? Oracle has one instance which corresponds to only one database, is it the same with Sybase ? - What is a master database, is it a db that holds metadata? Does each...
I'm a newbie to sybase and could not find the clear answers on Sybase tutorials/docs - How many databases can one Sybase instance have? Oracle has one instance which corresponds to only one database, is it the same with Sybase ? - What is a master database, is it a db that holds metadata? Does each instance have one master database ? - What is a user database ? Is it similar to a tenant db in sap hana ?
user5844653 (1 rep)
May 13, 2020, 02:23 AM • Last activity: Feb 22, 2022, 07:05 AM
1 votes
1 answers
1243 views
SQL query output to Sybase temp table
I need to query a MSSQL 2008 db for 4 columns of data where one column (an ID) is used to join a number of tables from a Sybase ASE 15 database then output all 4 columns from the SQL query with a number of columns from 5 other tables in Sybase. Currently we query SQL and output to a csv, then load t...
I need to query a MSSQL 2008 db for 4 columns of data where one column (an ID) is used to join a number of tables from a Sybase ASE 15 database then output all 4 columns from the SQL query with a number of columns from 5 other tables in Sybase. Currently we query SQL and output to a csv, then load that data to an Access db. Then use that to Access table to query the Sybase tables using a join on the ID from the SQL query. I need to take Access out of the equation and have all this run either in MSSQL or Sybase and have that triggered by a SSRS report to display the final Sybase query in a SSRS report. I am able to make a linked server from SQL to Sybase or vise versa, and am able to use openquery from SQL to query Sybase. How do I use my results from the SQL side to then query the Sybase side, I need the small subset of IDs from the SQL query to pull from the Sybase tables but cannot seem to get the SQL results to the Sybase side in a temp table or anything to then query from Sybase with the openquery call. Is my only option to use a SQL bcp command to output the query to a csv file then use a separate bcp (Sybase version) to load the SQL csv to Sybase then return the results? If so how can that be done from SSRS? What are my options here, am I missing an opportunity?
S.G. (11 rep)
Jun 22, 2017, 04:30 PM • Last activity: Nov 5, 2021, 07:04 AM
0 votes
1 answers
1294 views
Problem replicating IDENTITY columns from Sybase ASE 15.5 to Sybase ASE 15.5
I am trying to perform replication from `Sybase ASE 15.5` to `Sybase ASE 15.5` for a list of given tables via replication definitions and subscriptions defined in `Replication Server(REP) Version 15.7.1`. I found out that there is a table with one of the columns defined as `IDENTITY`. After creating...
I am trying to perform replication from Sybase ASE 15.5 to Sybase ASE 15.5 for a list of given tables via replication definitions and subscriptions defined in Replication Server(REP) Version 15.7.1. I found out that there is a table with one of the columns defined as IDENTITY. After creating the replication definition and subscription for that table, I am getting the below error messages in replication server: Message from server: Message: 584, State 1, Severity 16 -- 'Explicit value specified for identity field in table 'customers' when 'SET IDENTITY_INSERT' is OFF'. I have tried to run SET IDENTITY_INSERT customers ON on both of my primary and replicate database, but no luck. Appreciate if you could help. Thanks!
Tittus (33 rep)
Feb 12, 2018, 06:33 AM • Last activity: May 10, 2021, 09:09 AM
0 votes
0 answers
122 views
Sybase lead blocker in chain
What would be a query to list a blocking chain in Sybase ASE 16? In SQL server I'd use something like this: https://blog.sqlauthority.com/2015/07/07/sql-server-identifying-blocking-chain-using-sql-scripts/
What would be a query to list a blocking chain in Sybase ASE 16? In SQL server I'd use something like this: https://blog.sqlauthority.com/2015/07/07/sql-server-identifying-blocking-chain-using-sql-scripts/
PeterJL (95 rep)
Feb 16, 2021, 03:40 PM
0 votes
1 answers
1689 views
Map login to user in restored database in SYBASE ASE 16
After restoring a database from other environment is there a way to map a user in the database to a login in the server. I can drop and recreate or alias but in **MS SQL Server** there is a way: `EXEC sp_change_users_login 'Auto_Fix', 'user'` I was looking for something similar in **SYBASE ASE 16**
After restoring a database from other environment is there a way to map a user in the database to a login in the server. I can drop and recreate or alias but in **MS SQL Server** there is a way: EXEC sp_change_users_login 'Auto_Fix', 'user' I was looking for something similar in **SYBASE ASE 16**
PeterJL (95 rep)
Jan 8, 2021, 05:01 PM • Last activity: Jan 9, 2021, 12:56 AM
0 votes
2 answers
1704 views
Lock a table in Sybase ASE 15.5
I would like to lock a table to only allow users to perform read operation in Sybase ASE 15.5, how can I do it? I have tried the below command, but seems there is some confusion. Any idea? Session A: Perform below commands and after that try to perform insert operation. New records can still insert...
I would like to lock a table to only allow users to perform read operation in Sybase ASE 15.5, how can I do it? I have tried the below command, but seems there is some confusion. Any idea? Session A: Perform below commands and after that try to perform insert operation. New records can still insert into locked table (but I think it is not commit the transaction yet). Can still select record from the locked table. begin transaction lock table testB in share mode Session B: Cannot select data from the locked table.
Tittus (33 rep)
Aug 1, 2018, 09:20 AM • Last activity: Dec 29, 2020, 07:34 PM
1 votes
1 answers
227 views
CREATE TABLE and transactions
Is there a way to use `CREATE TABLE` inside of a transaction in Sybase?
Is there a way to use CREATE TABLE inside of a transaction in Sybase?
Igor (247 rep)
Nov 2, 2020, 09:01 AM • Last activity: Nov 2, 2020, 03:39 PM
0 votes
2 answers
1127 views
Why Are Table Scans Bad?
At my work, I am often told that I shouldn't do a table scan because it could negatively impact the database and the app using the database. What exactly do they mean by "negatively impact"? One negative impact I can think of is that a table scan would use up a lot of the disk's time, blocking other...
At my work, I am often told that I shouldn't do a table scan because it could negatively impact the database and the app using the database. What exactly do they mean by "negatively impact"? One negative impact I can think of is that a table scan would use up a lot of the disk's time, blocking other requests from using the disk. Is there a way to do a table scan without any negative impacts? Sometimes I need to do a table scan for one off checks (for routine things, I would of course make an index).
JRG (170 rep)
Aug 26, 2020, 03:37 AM • Last activity: Aug 26, 2020, 01:13 PM
4 votes
2 answers
1315 views
Numbered stored procedures: introduction and deprecation?
SQL Server and Sybase ASE both support the highly dubious feature of grouping stored procedures by appending a number: CREATE PROCEDURE Foo;1 AS ... CREATE PROCEDURE Foo;2 AS ... The only tangible benefit is that `DROP PROCEDURE Foo` will drop all of these procedures together -- and that's it; to ca...
SQL Server and Sybase ASE both support the highly dubious feature of grouping stored procedures by appending a number: CREATE PROCEDURE Foo;1 AS ... CREATE PROCEDURE Foo;2 AS ... The only tangible benefit is that DROP PROCEDURE Foo will drop all of these procedures together -- and that's it; to call them you still need to append the number explicitly. The drawbacks of allowing a semicolon to be part of a procedure name and having non-obvious DROP semantics should be obvious, and indeed many tools don't (properly) support this format and things like contained databases outright forbid them. In what version of SQL Server and/or Sybase ASE was this feature introduced, and from what version onwards was it deprecated? I'd consult the documentation, but documentation that goes back far enough does not appear to be available. I've found the following: * [SQL Server Books Online 2005](https://www.microsoft.com/download/details.aspx?id=4152) already mentions them as deprecated. * [SyBooks Online for ASE 12.5](http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc36272_1251/html/commands/X52197.htm) mentions it as being available there as well, but having a flag to disallow them. This leads me to think the feature might have existed in very early versions indeed, possibly before the split between Sybase and Microsoft, but still doesn't tell me what the earliest introduction and deprecation was. The asteroid to kill this dinosaur is still in orbit, but how old is the dinosaur?
Jeroen Mostert (183 rep)
Apr 24, 2018, 10:59 AM • Last activity: Jul 21, 2020, 11:54 PM
1 votes
0 answers
528 views
Sybase and SQL injection
I am maintaining a legacy system that uses Sybase ASE as the database. Because the system is a legacy system, the only way to create an SQL query is string concatenation (prepared statements are not possible*). Is the below scheme sufficient for preventing SQL injection on "string" columns: 1. Repla...
I am maintaining a legacy system that uses Sybase ASE as the database. Because the system is a legacy system, the only way to create an SQL query is string concatenation (prepared statements are not possible*). Is the below scheme sufficient for preventing SQL injection on "string" columns: 1. Replace all instances of a single quote with two single quotes. 2. Replace all instances of a double quote with two double quotes. Keep in mind that the \ character is not an escape character in Sybase ASE. Also keep in mind that the columns in the selection clause and the tables in the from clause are static. The only thing that is dynamic is the where clause. *Stored procs are not possible either, because string concatenation is needed to create the SQL query that calls the stored proc.
JRG (170 rep)
Jul 19, 2020, 10:13 AM • Last activity: Jul 19, 2020, 07:48 PM
-1 votes
1 answers
2040 views
Permission denied to run set Identity_insert to table
I have just setup the ASE-ASE replication with a column as IDENTITY, when I tried to resume my DSI connection of my replication server, I'm hitting the error `Message from server: Message: 10369, State 2, Severity 14 -- 'Permission denied. You must be either the database or the object owner or have...
I have just setup the ASE-ASE replication with a column as IDENTITY, when I tried to resume my DSI connection of my replication server, I'm hitting the error Message from server: Message: 10369, State 2, Severity 14 -- 'Permission denied. You must be either the database or the object owner or have sa_role to perform this operation. Further check from the dump queue, I could see some transaction is trying to do insert to the table with IDENTITY column, and probably it hits permission denied set identity_insert customer on insert into customer (id, name) values (1,'Ben')set identity_insert customer off. May I know how can I grant my replication user to be able to run the set identity_insert and set identity_update command? Appreciate if you could help. Thanks in advance.
Tittus (33 rep)
Mar 8, 2018, 08:44 AM • Last activity: Oct 4, 2019, 04:04 AM
0 votes
0 answers
361 views
Sybase ASE 16.0 BCP in character problem
I am using SYBASE ASE 16.0 and in my tables i have some values like > "KOCAELİ", "İZMİR", "TALATPAŞA" . They are readable in csv file however when i put database with bcp in command, i have mistakes which are > "KOCAEL0", "0ZM0R", "TALATPA^A my command is : bcp ME_DEV_TRUNK_DB..aktar2 in list.cs...
I am using SYBASE ASE 16.0 and in my tables i have some values like > "KOCAELİ", "İZMİR", "TALATPAŞA" . They are readable in csv file however when i put database with bcp in command, i have mistakes which are > "KOCAEL0", "0ZM0R", "TALATPA^A my command is : bcp ME_DEV_TRUNK_DB..aktar2 in list.csv -b10000 -c -t',' -r\\n -Usa -SMYDB1 -Jiso88599 -F2 How can i fix and input data into database?
Melih (284 rep)
May 30, 2019, 11:53 AM
Showing page 1 of 20 total questions