11
votes
1answer
913 views

Strange behaviour with Computed Columns in SQL-Server

Whilst reading through my 70-433 exam book, I thought of something that I can see not working, yet I believe it does. The passage read something like: The column must also be marked as PERSISTED, ...
1
vote
1answer
613 views

Applying MySQL 5.1 bin log to MySQL 5.5

Is it possible to apply MySQL 5.1 bin log to MySQL 5.5. I am assuming that bin log is portable between two machines (same OS, Architechture but different machines running same version of MySQL)
10
votes
2answers
2k views

What is the purpose of SET NULL in Delete/Update Foreign Keys constraints?

I am probably being narrow minded, but if I create a foreign key constraint and a row gets updated or deleted, I lose that connection if the child table's column gets set to NULL. What is the purpose ...
1
vote
1answer
136 views

Update Table with Network Client Connection Status, I need help with DB design. SQL 2008 Ex R2

I have C# client application that updates a Server Database, SQL 2008 Express R2. The client application send a ping to a group of devices once every 30 seconds and displays their status then updates ...
2
votes
2answers
4k views

Can I downgrade SSIS packages to run on older version of SQL

We have some new SQL 2008 SSIS jobs that were recently developed, mostly to do some simple flat-file loading and targeting a set of tables on a 2008 server. As it turns out, they may have to run on a ...
6
votes
2answers
12k views

What is the meaning of Microsoft Compatibility Level?

Setting cmptlevel to 80 on a SQL-Server 2005 inhibits the use of PIVOT and APPLY, but doesn't affect the use of Analytical Functions. Is there any rational behind this?
2
votes
1answer
872 views

Optimising a Database Shrink (in terms of speed and reducing fragmentation)

We have a large database that has had a lot of older data stripped out, leaving primary datafile (all objects are currently in the primary filegroup) of about 80Gb containing a little less than 20Gb ...
4
votes
2answers
3k views

Preordering the table by a specified column

I have a table and I am always getting the data by ordering a column. In my case, I order by datenum. However, the selection is so slow because of the ordering. Is it possible to order the table ...
3
votes
1answer
8k views

Running an SSIS package without the SSIS service installed

On a SQL Server 2005 instance in our DMZ, we have BIDS installed but not the SSIS service. If I have an SSIS package on that server, can I still schedule to run it without SSIS service? I tried ...
4
votes
3answers
221 views

Are there any tables that I can get all Oracle supported system privileges and object privileges?

Are there any tables that I can get all Oracle supported system privileges and object privileges? I know there is a view called all_sys_privs in Oracle. But I can't find more information about it. ...
7
votes
2answers
2k views

PostgreSQL: Last access time to table

I am in charge of a large PostgreSQL database, with few dozen tables. I suspect that many of these tables are never accessed. What's the best way to check when was the last time a certain table was ...
1
vote
1answer
1k views

OEM Grid Control Template

I create an monitoring template for my database on OEM GC, apply it on somes database and now i want to know what database is using this template. Can someone help me please?
5
votes
1answer
1k views

MySQL Replication : 1 Slave / Multiple Masters

I have a web app with 2 web servers and 2 database servers. The DBs are setup for multimaster replication. (this is the primary environment) I also have the exact same setup on a different location ...
3
votes
2answers
3k views

Can the sorting from an ORDER BY statement be saved explicitly with only one UPDATE statement?

I have this table: SELECT * FROM items id | item | position ---|-----------|---------- 1 | USB cable | 0 2 | SD card | 4 3 | Mouse | 2 4 | Keyboard | 0 5 ...
2
votes
1answer
99 views

How to make a duplicate field cheap?

There are two tables associated with each one to many in a field. In Table 2, there are fields that duplicate the value in Table 1. Is there a cheaper way to ensure (guarantee) the correspondence ...
5
votes
6answers
560 views

Check if DISTINCT is really necessary

I have a query in mysql as follows. SELECT DISTINCT `tableA`.`ColA`, `tableA`.`ColB`, `tableB`.`ColA`, ... FROM `tableA` LEFT JOIN `tableB` ON `tableA`.`colC` = `tableB`.`colA` WHERE ...
0
votes
1answer
3k views

Unattended/silent install of Oracle XE Express fails

I am experimenting with silent installs of Oracle 10g XE on a fresh XP VM. I have an iss file, copied from the standard one from oracle, called "foo.iss" Here is my command: >OracleXEUniv.exe /s ...
-3
votes
2answers
366 views

Restore single page of a database - syntax error

I'm trying to run this query RESTORE DATABASE dbname PAGE = '1:442' FROM DISK = 'C:\dbname.bak' WITH NORECOVERY but getting the error: Msg 102, Level 15, State 1, Line 2 Incorrect syntax near ...
3
votes
2answers
525 views

Join condition on complex views

If i join two/more complex views (views that are made up by joining two/more tables); would it result in multiple iteration of reads on the base tables? Would it not be more efficient just to have ...
14
votes
2answers
4k views

Rows missing after online conversion from MyISAM to InnoDB

We have a reasonably small database that we wanted to convert from MyISAM to InnoDB. Being database noobs, we just converted (using alter table) without even taking the site down. Now that the ...
7
votes
1answer
293 views

What is “SAP on Oracle”

OK, total newb question. What is "SAP on Oracle", exactly. This link is talking about how SAP can run on Oracle (I think). I'm not understanding how this is working. My understanding: SAP is a ...
10
votes
3answers
16k views

Notification on long-running query or deadlock in SQL Server 2008 R2?

I'd like to know if there is a way to send a notification on deadlock? If so what queries would be required. I understand that SQL Server takes care of deadlocks, I simply would like information on ...
9
votes
4answers
4k views

Determine when a PostgreSQL database was last changed

I'm looking at altering how backups are done and am wondering if there is a way to determine which databases in a postgreql cluster have not been recently changed? Instead of using pg_dumpall, I'd ...
2
votes
1answer
896 views

MySQL Master/Slave Master/Master setup?

I currently have 1 mysql server running and want to install 2 seperate mysql VPS'es. Maybe one master for inserts/updates and one slave for selects. What is the best setup for this if I have the ...
9
votes
1answer
6k views

Is there such thing as Custom Data Types?

Does MySQL have any support for custom data types? For example, zip codes might be stored in a varchar(10) field, but they could be compacted in to an int, with options for blank, and a flag as to ...
2
votes
2answers
4k views

Indexing for group by + SUM query on mysql

I have a table with the following schema: CREATE TABLE `wordtrend` ( `oid` bigint(20) NOT NULL AUTO_INCREMENT, `monitorId` bigint(20) DEFAULT NULL, `nGram` varchar(255) COLLATE ...
6
votes
4answers
236 views

Dynamic contacts database

I'm trying to create a database for contacts. I must have many categories for every contact, like Home, Office, Emails, Phones. In every category one can add more than one value. Also the categories ...
2
votes
1answer
5k views

What I can do to speed up Key Lookup in my Query

I am using SQL2005 and against them I calling query simila to this declare @art table (id int primary key, naziv varchar(35) null, sifra varchar(15) null, jm int null); insert ...
3
votes
3answers
5k views

Want to order on two columns but not the usual way

I have a table as below ID userID Date 1 2273 22/08/2011 2 2274 24/08/2011 3 2275 26/08/2011 4 2273 26/08/2011 5 2273 26/08/2011 6 2271 26/08/2011 And want result as ...
2
votes
3answers
396 views

VLDB - SQL SERVER versus VFoxPro

I must create an DBF for an application which will collect data from 5 millions sensors on every minute, so I will have 5 millions records every minute. I was thinking to use SQL server because I ...
2
votes
2answers
560 views

Full Name search query

We currently have a solution for this in production, but it's pretty bad. I'd like a fresh perspective on it please. We have a PERSON table with an ID, LAST_NAME, FIRST_NAME, MIDDLE_NAME, and ...
1
vote
2answers
1k views

Replication error on SQL Server 2008

I'm doing merge replication between two SQL Server 2008 machine. But, when I attempt to do any modification on subscriber system, I get the following error. The merge process could not enumerate ...
7
votes
4answers
370 views

What are the performance implications of running multiple smaller DBs instead of a single larger DB on a server?

Our database architecture allows multiple 'customers' to exist in the same database, yet we split them into mulitple database for administrative reasons [patching, backup, etc.] Question 1 What ...
1
vote
1answer
894 views

Running query against SQL Server with FreeTDS's bsqldb returns blank output

Here is the query I ran select CAST(PageGuid as varchar(max)) + ',' + CAST(TenantGuid as varchar(max)) + '/' + CAST(OriginalFileGuid as varchar(max)) from Pages This worked with tsql but when run ...
4
votes
1answer
2k views

Foreign Key constraint on fixed value field

Note: I am a developer... I have an Asset table that has many codes that are foreign keys into a second table OutlineFiles. The OutlineFiles table has Type and Code as the primary key. The foreign ...
6
votes
3answers
13k views

Oracle 10g: Properly using ora_rowscn to detect table row changes (ie, inserts, updates, deletes)

Some research into checking when a table's records were last updated, modified, or deleted has lead me to the pseudo column known as ora_rowscn. First, I do this: select max(ora_rowscn) from ...
0
votes
2answers
587 views

FBI on function with concatenated string

I have an index in place (from days of old) that I'm curious about. It's on a basic person table and the function is upper("LAST_NAME"||','||"FIRST_NAME"||"MIDDLE_NAME"||"SUFFIX_NAME") When trying ...
2
votes
1answer
465 views

Oracle Database Block Size

One of our Production database has a rather peculiar block size of 16KB. This database was created about 2 years ago and at that time the size of the db was approx 1TB only.However over the past 2 ...
2
votes
1answer
281 views

Shortest Query to Combine Count and Unique (Oracle)

I have the following query which works for me: select count(*) from ( select UNIQUE col1, col2, col3 from my_table where cond1 = 'A' and cond2 = 'B' and cond3 = 'C' ) Is it possible ...
3
votes
5answers
2k views

MySQL slow query log: huge query time, no lock time, minuscule number of rows scanned

I have a slow query log item with the following: Query_time: 55 Lock_time: 0 Rows_sent: 739 Rows_examined: 739 No one in my group can explain it besides a guess about packet loss. Is there a ...
2
votes
1answer
782 views

Trusted Constraints and NOT FOR REPLICATION

Version and Build: SQL Server 2005 SP4 (9.0.5000) As a disclaimer of sorts, I am asking this question to generate some discussion and/or debate on the topic. I don't know if there is really a ...
3
votes
1answer
79 views

Can you control what tags are used in an XML column?

We allow our developers to use XML columns to store data. We want to provide standard names to XML tags. As a DBA, can we prevent the users from adding XML tags that are not predefined?
5
votes
1answer
715 views

T-sql: Select most specific match from table

Apologies for the horrible title. I couldn't come up with a better way to briefly describe the problem. Here's the scenario: Users can set up service instructions to be attached to a work order ...
3
votes
2answers
773 views

Oracle 10g Storage Migration

We need to migrate the storage of our production database. What is the appropriate method of doing so and what specific/generic precautions do we need to take?? Database Configuration: Volume Manager ...
3
votes
2answers
2k views

Oracle 10g SGA sizing Help

Help in sizing oracle 10g database sga We've an Oracle 10g r2 database, size = 4.5TBASM is used to manage the storage. It uses "External Redundancy" option on "Raw Device" (i.e. no os file system ...
10
votes
2answers
8k views

SQL Server Join/where processing order

After reading Slow SQL query, not sure how to optimize, it got me thinking about the general performance of queries. Surely, we need the results of the first table (when other tables are joined) to be ...
2
votes
1answer
558 views

Can you trigger an action when a view is created?

Is it possible to create a trigger that fires when a view is created on a user schema? I want to create a meta data table which will hold all the views and a listing containing what they are supposed ...
8
votes
1answer
9k views

mysqldump with INSERT … ON DUPLICATE

I want to merge data from one database to another. So I create dump with mysqldump and then import it to another database (with same tables structure). I don't have any problems (such as duplicate ...
1
vote
1answer
681 views

Issue with SQL Server 2008 replication

I'm doing merge replication between two SQL Server 2008 machine.But,when I attempt to do any modification on system,I got the following error. The Merge Agent failed because the schema of the article ...
3
votes
1answer
481 views

Locking, deadlocking workaround while process data at the same table

My database has a table: tableX. Task1 makes intensive INSERTs (1000 records per minute) as records to process and very seldom UPDATEs (1-2 records per minute) as records to recalculate. At the ...

15 30 50 per page