0
votes
1answer
89 views

Table and query design options

We have a alert table which have deviceID as a foreign key. At present one alert just refers to one devive so things works smoothly with join. The problem start now when one alert now is to refer to ...
3
votes
3answers
345 views

Is it possible to pass parameters to pt-table-checksum using an options file?

We're using Percona's pt-table-checksum for MySQL replication integrity check. Is it possible to pass some or all of the options using some sort of configuration file? For instance, can we write the ...
3
votes
1answer
92 views

Reporting Table Design

I'm writing a system that allows users to store values against each week in October and November and each day in December - starting from the first Monday. I'm holding the raw data entered by the ...
2
votes
2answers
359 views

Make sure two columns are sorted in the same order

I have a table like this: CREATE TABLE T ( ID INT NOT NULL IDENTITY PRIMARY KEY, CreateDateTime datetime2 NOT NULL, --other columns ) How can I make sure that ID and CreateDateTime are both ...
12
votes
2answers
2k views

SQL Server does not optimize parallel merge join on two equivalently partitioned tables

Apologies in advance for the very detailed question. I have included queries to generate a full data set for reproducing the problem, and I am running SQL Server 2012 on a 32-core machine. However, ...
1
vote
1answer
94 views

group by and having query need help?

I am using the pub database in SQL Server 2005. Which stores have at least 5 orders? Should diplay the store name and store id. I have come up with a query something like this: select ...
0
votes
1answer
145 views

Simple Search on 13 Terabyte Oracle Database to return relevant rows (.net app? Java?)

I am sure there are some easy ways to do this... I have a simple flat Oracle table which is 13 terabytes or so in size due to a large number of rows accumulating over the years. I need to do a search ...
2
votes
1answer
215 views

Is having all entity tables inherit from one main entity table a bad idea?

My co-worker is designing a schema where most entities (like contacts, quotes, tasks) inherit from an "entity" table, which keeps track of things like which tenant owns the entity, and chagnes to the ...
2
votes
3answers
1k views

How can I speed up “show columns” on MySQL?

My application depends on running "show columns" for certain tables. It takes about 60ms to run, whereas all our other queries take under a ms. Querying information_schema directly is even slower. ...
2
votes
1answer
127 views

Can I move data and full text search files to another drive and change the drive letter?

My server's G: drive is rapidly running out of space. It mainly contains data files (*.mdf) for both system and user databases. The FullText Catalogs also exist on that drive. IT added a much lager ...
1
vote
1answer
2k views

Get a fixed value on a select

I need to do a SELECT query where I get the value of the field "money". The field doesn't actually exist in the database. I just need the query to return this field with a fixed value; in this case ...
3
votes
3answers
23k views

SELECT DISTINCT on one column, while returning the other columns?

I have a query which uses three lookup tables to get all the information I need. I need to have DISTINCT values for one column, however I also need the rest of the data associated with it. My SQL ...
4
votes
1answer
117 views

unique constraint on a set

With reference to this SO question, what would be a correct way to implement Unique tag Combination Constraint in SQL Server 2005? To illustrate the problem, I make an example: A tag_bundle consists ...
4
votes
1answer
623 views

Where are queries against a linked server actually processed?

How is a query against a linked server processed? Does the linked server use its optimizer when it receives a query from a remote source? There are a few scenarios about which I'm wondering: Scenario ...
0
votes
1answer
44 views

Why this query returns rows that I don't want to be there

I'm trying to running this query: SELECT * FROM (`default_users`) LEFT JOIN `default_profiles` ON `default_profiles`.`user_id` = `default_users`.`id` WHERE `default_users`.`group_id` ...
2
votes
1answer
2k views

Enabling InnoDB on an existing MySQL production server

We have a MySQL 5.1.59 server that has 30-40 existing MyISAM databases. I need to deploy an application that requires InnoDB databases. Can I just enable/configure InnoDB in /etc/my.cnf and restart ...
0
votes
0answers
52 views

When is should/shouldn't the Entity Attribute Value (EAV) pattern be used? [duplicate]

Possible Duplicate: Is there a name for this database structure? The Entity Attribute Value (EAV) pattern usually has three columns: foreign key, attribute, and value. Attributes of data ...
3
votes
2answers
224 views

Sudden Query Performance Degradation On A Linked Server

I have an application that uses a view on a SQL Server 2008 R2 instance. This view actually queries a linked server (SQL Server 2008) that has replicated data from our main ERP database. Yesterday, we ...
0
votes
1answer
1k views

Can we back up mysql databases by copying files?

I tried to reinstall mysql on my machine, but it keeps failing. Everytime it fails, it does this locking and that locking and future effort would fail again. Finally I decided to do truly clean ...
0
votes
6answers
526 views

Equivalent of CHARINDEX OR IN for ints

I want the equivalent of this for ints. --Valid SQL DECLARE @users AS nvarchar(50) SET @users = 'Joe ,Bob,Fred,Tim' --1,2,8,23 select * FROM Person AS p WHERE CHARINDEX(p.sFullName,@users) > 0 ...
0
votes
1answer
145 views

What are the different connections of MySql?

I have a software(toad for mysql) to connect to my MySql database. We have to provide some data('username','password' etc) to this Software to connect database. There is a field known as 'connection ...
7
votes
1answer
161 views

Dynamic Dimension Security

I have a cube in SSAS 2012 with about 30 dimensions, one of which is Company. The Company dimension contains a list of companies, of which there are several hundred in the cube. Our security model ...
1
vote
4answers
494 views

Backup and restore of RDBMS(Oracle, DB2, SQL Server) from Perl

What could be the best approach ? Till now could figure out the following (Oracle) Calling exp.exe and imp.exe utilities in Oracle client using Java and inturn call it from Perl. Calling exp.exe ...
1
vote
1answer
148 views

transactional Replication of millions of updates

I have standard transactional replication setup from 2005 to 4 2008 subscribers. One of the tables that is replicated is updated several times from an agent job resulting in 6 million updates ...
2
votes
2answers
905 views

Oracle - How can I find the session id of a shell script (Linux)?

I have a Linux script run periodically from crontab which executes some sql scripts. How can I get/identify the session of that running job? thanks
2
votes
2answers
2k views

Remove the last character from Variable String

I have a few variable data in the column "email". For example: roy2087@gmail.com123 sg123@yahoo.compori How do I get rid of the characters after .com? I used Replace(email,'.com%',gmail.com), ...
3
votes
5answers
306 views

Single query to return counts over different IDs in a single record

select count(title_id)as algodata from titles where pub_id =1389 select count(title_id)as binnet from titles where pub_id =0877 select count(title_id)as newmoon from titles where pub_id =0736 ...
0
votes
2answers
893 views

Doing a comparison on two csv files with no Primary Key

I'm wondering if in SSIS there is a way to compare two csv files(with the same structure) with no reference key to make a record unique. To give you a better picture from what I mean; In initial load ...
5
votes
1answer
108 views

Retrieve Indices of Associative Array as Collection

In PL/SQL, suppose I have some associative array defined as follows: declare type a_arr_t is table of PLS_INTEGER index by PLS_INTEGER; a_arr a_arr_t; I then, sparsely, populate the ...
4
votes
1answer
288 views

Dodgy causes of ORA-12549?

I am dealing with a rather massive ETL processing which keeps throwing me the ORA-12549 error. Have been looking for problems in the database so far and nothing. The DBA says the database is "fine" - ...
3
votes
2answers
2k views

SQL Server 2008 R2 Express size

I have what I believe is SQL Server 2008 R2 Express installed on a production server. When I connect to it with SQL Server Management Studio it shows up as SQL Server 10.50.1600. If it is in fact SQL ...
1
vote
1answer
424 views

Within a RHEL 6.3 + High Reliability Add-on, how do I add DB2 (v9.7) into a service group to have the service controlled by the cluster?

I have a cluster of machines running RHEL 6.3 with the High Reliability Add-on. I have configured a Clustered Logical Volume Manager (CLVM) file system for DB2, which is working correctly. Our DBA's ...
3
votes
2answers
2k views

Copying View in Management Studio

I want to copy a VIEW from one server to another. I could copy tables but I can't copy views. Is there a way to do so? Thanks
6
votes
1answer
6k views

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (MsDtsSrvr)

I have a clustered environment which has many instances in it. I have modified the xml file to allow several instances to use ssis. Everything works great when the instances are on the same node as ...
7
votes
2answers
517 views

Filtering data ordered by rowversion

I have a SQL table of data with the following structure : CREATE TABLE Data( Id uniqueidentifier NOT NULL, Date datetime NOT NULL, Value decimal(20, 10) NULL, RV timestamp NOT NULL, ...
2
votes
1answer
357 views

Export SQL Server varbinary field to string using Visual Basic script in SSIS?

I'm using SSIS to export data from a set of tables to flat files. The export is running great except for one table with a varbinary field. The export is running a Visual Basic script task to load the ...
1
vote
1answer
478 views

How can I import Create Table Statement from SQL Developer into Visio to create an Entity Relationship Diagram?

I have the following Create table statement from SQL Developer and I am trying to generate an ERD Diagram using 2003 Visio. I was wondering what I need to do to convert the Create Table from SQL ...
2
votes
1answer
294 views

Implementing “ANY” aggregate operator in T-SQL

I have a database that contains department and employee tables, and I need to return the number of employees for each department. I write the following query: SELECT d.ID, d.Name, COUNT(*) ...
3
votes
3answers
4k views

Mapped drive for Microsoft SQL Server 2008

I've noticed strange issue after this weekend. Maybe someone could explain this situation. I've got SQL Server 2008 placed on Windows Server 2008 with read/write permission to catalog ( let say ...
7
votes
1answer
2k views

How do I swap tables in MySQL?

Suppose, I have a table foo, which contains some statistics that are computed every now and then. It is heavily used by other queries. That's why I want to compute more recent statistics in foo_new ...
4
votes
1answer
123 views

Shrinking Reluctant Log Files

I have several SQL Server 2008 databases with transaction logs which have gotten out of hand and filled the drive. One of these logs was 68gb yikes. I know better than to kill off my backup chain ...
5
votes
4answers
971 views

Composing the “ultimate database maintenance script”

I'm trying to compose T-SQL script that will: A) Shrink database size to the minimum possible size; B) Make integrity checks, and completely "reorganize" and optimize the database so that it is in a ...
0
votes
1answer
1k views

Converting Python's date format to a MySQL

First of all I hope this is the right place to ask. I have a Python script which parses data from a few links. In the parsers I parse also the date of the last modified article. This is the output ...
3
votes
1answer
144 views

I have Fragmented Index on a empty table!

I ran the following query on my database to identify the fragmented indexes. However I surprised when saw the Indexes belong to some empty tables among the highly fragmented indexes! How can it be ...
3
votes
2answers
716 views

How does compound index help speed up query?

Say we have a bunch of column in mysql table. Latitude Longitude Say we make an index (Latitude and Longitude) Well, the index will sort by Latitude first and IF the Latitude is the same it'll sort ...
2
votes
1answer
625 views

What is a source table, and a target table?

I've seen alot of talk about source tables, and target tables on the internet, but no definitions of what these things are...from what I can infer it seems to mean something about copying data from an ...
0
votes
2answers
350 views

Is there data visualisation tool for postgresql which is capable of displaying inter schema relations as well?

Operating system used is linux. I have tried Navicat and SQL Power Architect. They did display relations between tables in the same schema. I have some foreign key constraints which reference tables ...
2
votes
3answers
903 views

Unique combination key MySQL

Lets say I have a table with 3 fields: id1 id2 mapTypeId What I want is a primary/unique key that is any combination of id1 and id2. For example if I have this record already in the database: ...
2
votes
1answer
659 views

Determining SQL Server memory requirements

I just a bit of an issue there where a SQL Server database was eating up quite a lot of RAM for its size. A bit of background: The database is for a small content managed website. The CMS is custom ...
2
votes
2answers
363 views

Tool to match mysql password encryption

I've created a user ... but forgotten the password mysql> create user 'blayo'@'%' identified by 'right'; Which Linux command line tool can encrypt the password the same way mysql does ? mysql> ...

15 30 50 per page