2
votes
2answers
88 views

Querying number of subscription to each publication

We have a production box that has about 60 publications on it. Some of these are used, and some seem to not be... What I need to do is create, or find, a script that will get the count of ...
1
vote
1answer
132 views

MySQL replication using a lot of IO

I'm having big troubles on a database pool I've setup recently. There is a master, and 4 slaves replicating one DB. All using MyISAM engine. Thing is, during the replication period (when the slave ...
1
vote
2answers
287 views

Unique Constraint with multiple null columns

I have two tables PC(Id,EmpName Not NULL, PCName NULL, HostName NULL,.... PhysicalLocation NULL, PCType Not NULL) PCNetwork(Id, EmpName Not NULL, PCName NULL, HostName ...
-1
votes
1answer
823 views

MySQL slap with custom query

I want to conduct stress test on our MySQL DB. I have the list of queries i need to execute. I have tried using Apache JMeter for this but it is very time consuming. Is it possible to run mysqlslap ...
1
vote
2answers
2k views

PostgreSQL stored procedure to return rows or empty set

I have a stored procedure, which RETURNS SETOF ct_custom_type and inside I do RETURN QUERY EXECUTE 'some dynamic query' And I want to do this: If this 'dynamic query' returns >= 10 rows, I want to ...
0
votes
1answer
299 views

MSDTC on SQL Server 2012 with mount point for data disk

I have installed a new SQL Server 2012 instance on a cluster. The installation went fine but when I've added the MSDTC as resource of the instance, it went wrong. When I just added it, the MSDTC was ...
0
votes
1answer
38 views

Can I rely on the order of colums on an index generated by Database tuning advisor

I got the following recommendation on a table: CREATE NONCLUSTERED INDEX ...
1
vote
1answer
468 views

MySQL statement-based replication and stored procedure

When you have a MySQL statement-based replication and you create a stored procedure that modify some rows (INSERT, UPDATE, DELETE commands...), What is really replicated on the slave when you call ...
2
votes
4answers
503 views

search for something in the first 1000 records in the table

If I do the following MySQL query select * from table where name Like '%john%' limit 5; that mean the query will search all the mysql database table and return only the top 5 results that match the ...
0
votes
1answer
572 views

Exporting and importing a database

I have setup an Oracle 11g Database and have a question about exporting and importing a database. I am using Enterprise Manager and have browsed to the following: Data Movement->Export to Export ...
-5
votes
1answer
3k views

What is the T-SQL syntax to connect to another SQL Server

"What is the T-SQL syntax to connect to another SQL Server?" so that I can just paste that in the top of the create script and F5 to run it and it would switch to the new server and run the create ...
2
votes
3answers
82 views

How to take SQL Server database under this scenario?

I have a database of size 290 GB running on SQL Server 2005 (compression is not available) and disk space is z: drive 250 GB and Y: drive is 80 GB. How can I take a full backup in this scenario? How ...
0
votes
1answer
781 views

Optimizing ORDER BY for simple MySQL query

I'm trying to optimize this really simple query, and it gives me grief for a day now :( Seems pretty straightforward, I need to select with a JOIN from 2 tables, and get top X results sorted in a ...
2
votes
1answer
122 views

Validate Primary Key and Index Selection

I have a table that will store transaction data from store sales registers, I have read quite a bit on index and key choice and below is what I have concluded is the best option but I am new to this ...
4
votes
2answers
952 views

Linked Server Risks

I'm implementing a new feature which requires data from databases on multiple servers. I just need to union data from all these servers and sort it. The two options that come to mind are: Use linked ...
0
votes
1answer
910 views

How to insert binary data into a PostgreSQL BYTEA column using libpqxx?

I'm a newbie at SQL, and even greener when it comes to using the PostgreSQL C++ API libpqxx. What I'd like to do is insert some binary data into a BYTEA column, but I find the Doxygen output is ...
0
votes
2answers
98 views

If an account has REQUIRE SUBJECT, does it still need a password?

I'm in the process of setting up SSL-secured replication between two servers. Each server has its own public/private keypair, and the CA cert is just the concatenation of the two public certs, like ...
4
votes
2answers
926 views

How do I execute an Oracle SQL script without sqlplus hanging on me?

For an automated task I would very much like to run some SQL scripts and make sure that sqlplus does not hang under any circumstancees, i.e.: If the script contains any named substitution variable ...
0
votes
1answer
167 views

viewing the population? (sql server full text search)

I'm thinking that when we are working on full text search, we might want to view how sql server FT engine breaks the data and indexes it. For my case the column being indexed are simple nvarchar ...
0
votes
1answer
4k views

Using postgres with the command line without pgAdmin

I started working with PostgreSQL and till now I only had issues with it ( pgAdmin3 issues the most ) now I work a lot with MySQL and sometimes on the command line by just doing mysql -u ... -h ...
2
votes
1answer
386 views

Prevent users from using power pivot excel connections to a database

A couple of weeks ago my boss connected to our production database via excel and was able to query the database. Because of how we're doing security to the database (AD groups) he should have access ...
0
votes
2answers
5k views

MySQL: Join one Row in a table with two Rows in other table

In my MYSQL Database COMPANY. I have two tables, like below in my diagram (arrow shows relations): `users` `user_login` +--------------+ ...
4
votes
3answers
2k views

Query runs slow in test site on first execution. Why?

I found this query by watching a test site with sql profiler for anything taking over 10 seconds. I plopped the code right out of sql profiler and into sql studio, where it was able to execute ...
2
votes
1answer
551 views

Moving DBs (including System DBs) to new LUNs on a single node cluster

We have a single node cluster (SQL2K8 R2) currently utilizing storage on our old SAN. We'd like to migrate to storage on the new SAN without rebuilding or moving the user DB. The infrastructure ...
0
votes
1answer
498 views

MySQL failover - Master to Master Replication

My company is trying to implement a MySQL failover mechanism, to achieve higher availability in our webservices tier - we commercialize a SaaS solution. To that end we have some low-end VMs scattered ...
0
votes
1answer
696 views

postgres deadlock without explicit locking

I use PostgreSQL 9.2, and I do not use explicit locking anywhere, neither LOCK statement nor SELECT ... FOR UPDATE. However, recently I got ERROR: 40P01: deadlock detected. The query where deadlock ...
4
votes
2answers
3k views

Is high Extent Fragmentation a problem?

DBCC SHOWCONTIG scanning 'MyTable' table... Table: 'MyTable' (2048062382); index ID: 1, database ID: 28 TABLE level scan performed. - Pages Scanned................................: 1019182 - Extents ...
0
votes
1answer
266 views

BUILTIN\Administrators allowing access via linked server but not locally

We have two servers: LYNDB01 & LYNDB02 On LYNDB01 we have a database called db_ExampleDatabase We have created a Linked Server on LYNDB02 to LYNDB01 using no mappings and the "Be made using the ...
1
vote
2answers
491 views

In Postgresql, is it possible to change the maximum number of columns a table can have?

I'm tasked with keeping a postgres table in sync with a non-postgres table. The non-postgres table has more than 1600 columns. When I try to create the table in postgres, I get: ERROR: tables can ...
0
votes
4answers
5k views

MySQL - Connection blocked because of many connection errors - How to find root cause?

I am developing a web application and am running into the dreaded host xxx blocked because of many connection errors message. There have been numerous questions on SO pertaining to this error and ...
2
votes
1answer
97 views

Find application password expiration date

I changed password of my application on one sql server? when I am using Login property command I am getting last login date. I want to know when my application password is going to expired in SQL ...
7
votes
2answers
6k views

MySQL and window functions

It seems that MySQL does not support window functions. E.g. the simple: COUNT(*) OVER() AS cnt does not work. What I am not sure is if this applies to commercial version as well (I assume the ...
1
vote
1answer
820 views

SQL Server 2012, Network for: AlwaysOn Availability Group with AlwaysOn AlwaysOn Failover Cluster Instances

Setup: I have two data centers. In site1, my primary site, I'd like to deploy an AlwaysOn Failover Cluster Instance (FCI). In site2, my data recovery site, I'd like to deploy a single-node instance of ...
0
votes
0answers
65 views

Inserting Records - How to get next incremented PK for each insert

I'm using spoon to look for Devices that have several attributes that define its location, and then create a Cabinet in that location if one doesn't exist. Is there an operation that lets me get a ...
1
vote
1answer
1k views

Pass a table array as a parameter to an upsert function in postgresql

i have an UPSERT function which works well but i update and insert records in batches, can this function be modified so that i just pass all the records to this function as an array then it will ...
1
vote
1answer
320 views

Referencing multiple tables from a single table and store additional data

I have a database where I want to store lap time information from a racing game. I have tables for car, track, game, tuning and upgrade data and want to put all these together to create a single ...
1
vote
2answers
459 views

PostgreSQL stored procedure which can return one of two custom rowtypes

I want to have one function, which can return two different types of rows according to given parameter. For example (simplified example) I have function like this: CREATE OR REPLACE FUNCTION ...
1
vote
1answer
137 views

Drop database from remote that has connected users

I have a "small" problem. There is a database server that contains a database where some test frontends are connected to. I want to update that database from a dump + some scripts to the most recent ...
2
votes
2answers
64 views

Backing up MySQL database

I have quite large and rather important DB to backup. First off, whats best way to do it? Secondly, easiest way I know is to export it through phpmyadmin, but, i'm worried about options, although ...
3
votes
2answers
1k views

Reducing high VLF count

I have been using Brent Ozar's sp_blitz script to review our database setup and have found that the VLF count is high (13562!) on the primary DB since changing to Full recovery model. I ran a full ...
0
votes
3answers
997 views

Amazon RDS MySQL performance issues

I have published my website on Amazon EC2 (Singapore region) and I have used MySQL RDS instance for the data storage. Everything is working very fine except performance. It seems that all queries, ...
1
vote
1answer
795 views

db2 tables altered, reorg

When I alter a table in DB, I need to reorg it: Call Sysproc.admin_cmd ('reorg Table myTable'); if I had done many modifications, how can I know which tables need a reorg?
0
votes
1answer
275 views

How is PostgreSQL extension feature compared to SQL Server extended and CLR stored procedures?

I am new to PostgreSQL. If I am not wrong, SQL Server has similar mechanism - extended stored procedures for adding new functionality to the base SQL Server functionality. CLR stored procedures could ...
0
votes
0answers
479 views

best way to copy data from SQL Server db to MYSQL DB(remote)

I currently copy data between my local SQL Server to a remote MySQL database linking in SQL and doing a data transformation task but now I'm sending lots of data it is getting very slow. Just after ...
1
vote
2answers
472 views

MySQL: CAST + SUBSTR vs. FLOOR + MOD

I have a field in a mysql database where dates are stored as BIGINT like YYYYMMDDHHMMSS (PHP: date('YmdHis')). I'm building a query, where I check the amount of rows per hour and have tried two ...
1
vote
1answer
720 views

How to disable oracle's MAX_ENABLED_ROLES limit

How to disable oracle's MAX_ENABLED_ROLES limit or expand the value of limitation. [oracle 10g (win32)]
3
votes
1answer
1k views

PostgreSQL concurrent increment of counter

I need to maintain a statistical table for a project, composed by a list of items and their usage (Think about something like a website in which you would like to count pageviews). Each time an item ...
1
vote
1answer
170 views

How to allow a user to create databases only with a certain prefix?

We're having a multi-user Linux server. I'd like to give each user the ability to create and manage databases at will, but to keep things sane, force them that each database name they create must ...
5
votes
1answer
429 views

How does order of index affect performance in SQL Server?

I am wondering how does order of index affect performance (ASC, DESC) ? If it affects, why ? And which order should I choose ?
0
votes
1answer
62 views

Load balancing MySQL ndbcluster

I have successfully setup ndbcluster version 7.1.26. This contains 2 data nodes[NDBD], 2 mysql [MYSQLD] nodes and one management [MGMD] node. Replication works successfully. My Web application is ...

15 30 50 per page