All Questions

1
vote
1answer
4k views

Unable to connect to SQL server 2008 R2 via Instance name?

I don't understand : I've installed sql server 2008 R2. the installation process asked me for the desired instance name , so I wrote: MSSQLSERVER. after the installation , running Setup Discovery ...
2
votes
2answers
1k views

How to use CREATE TABLE … AS with Primary Key in SQLite

From SQLite documentation for CREATE TABLE http://www.sqlite.org/lang_createtable.html: A table created using CREATE TABLE AS has no PRIMARY KEY and no constraints of any kind. So is there any ...
1
vote
2answers
627 views

From SQL Server to NuoDB: Common Table Expressions, Stored Procedures and Bulk Uploads

I am currently evaluating NuoDB as a replacement for SQL Server. The application is written in C#, .NET 4.0. Now I am using features of SQL Server like: Common Table Expressions (I have a table ...
2
votes
1answer
2k views

Mysql Forcing close of thread 946 user

My mysql box keeping shutting down and up. Below is snippet of the log file. There is quite a number of places I notice this Forcing close of thread 946 user: 130426 12:36:28 [Note] Event Scheduler: ...
4
votes
4answers
887 views

Oracle 11g delete by unique key slow

We have been plagued by a deadlock issue for quite some time that relates to deletes and inserts on the same table. It happens sporadically, but had been increasing in frequency. It would manifest ...
4
votes
1answer
686 views

Postgres: count(*) vs count(id)

I saw in the documentation the difference between count(*) and count(pk). I had been using count(pk) (where pk is a SERIAL PRIMARY KEY) not knowing about the existence of count(*). My question is ...
1
vote
2answers
629 views

Dropping a group of schemas with similar name patterns

Consider a situation where one need to perform a bunch of essentially identical operations, with the only variable being the name of some object. In my case, I need to drop some schemas, all of the ...
5
votes
2answers
2k views

MySQL replication: most important config parameters for performance on slave server?

I'm setting up a mysql master-slave configuration, where slave is located on a much weaker sever. Since, if I understand correctly, slave only works on updates/inserts, what are the most critical ...
1
vote
1answer
575 views

Database for opening times of locations

I'm designing a database for opening times and created this solution. The specifications of the database which will be a MySQL are, that a location have standard opening times in a week and can ...
-1
votes
3answers
113 views

Add Contents in a Column and make them 0 [closed]

http://sqlfiddle.com/#!3/96f11/3 In the above fiddle, I need the required output in the Fiddle. ie., The UserID column in Filtered Table and Main table are equal. I need to get the Amt column data ...
0
votes
1answer
3k views

How to purge logs by using Flashback feature in Oracle Database

I’ve configured flash recovery area for Oracle Database. My question is: how can I delete Flashback Database log?or is there any retention policy for that? 2- After I’ve enabled archive log mode and ...
-1
votes
2answers
477 views

How do I connect to a database with a blank password using a shell script?

## connect to mysql and source backup file ## USER="root" PASS="" mysql -u$USER -p$PASS database_name < backup.sql Above is my shell script which I used to source database but still its asking ...
1
vote
4answers
3k views

Speed up large clustered index creation?

I have a large table, the row count of the table is more than 3 billion, the data space for this table is about 120 GB. And Intel Xeon CPU E5645 @2.4GHz(2 processors), 24 CPUs, 64G memory, 64bit ...
2
votes
3answers
9k views

Getting SELECT to return a constant value even if zero rows match

Consider this select statement: SELECT *, 1 AS query_id FROM players WHERE username='foobar'; It returns the column query_id with value 1 along with a player's other columns. How would ...
0
votes
1answer
667 views

Problems in opening mysql query browser

My mysql query browser doesn't run. I just started to work with xampp and php. So I just installed xampp in my local machine. Now I have a problem in opening mysql query browser... What I'm getting ...
2
votes
1answer
414 views

Visualiser for spatial query results

This question Whats the easiest way to get sql 08 spatial data onto a map? (and many other articles) recommends Craig Dunn's Geoquery, but all the download links appear to be kaput. SQL Server ...
-1
votes
1answer
194 views

Should I keep pg_xlog on the same disk as data if using disk snapshotting?

We're running on EBS volumes on EC2. We're interested in leveraging EBS snapshotting for backups. However, does this mean we'd need to ensure our pg_xlog is on the same EBS volume as our data? (I ...
0
votes
1answer
482 views

Defining system scope and boundary

I have been given a homework task where I am to create an ER model of a database from a set of client requirements. Another part of this task is to create a diagram that shows the scope and boundary ...
7
votes
2answers
5k views

Optimizing bulk update performance in PostgreSQL

Using PG 9.1 on Ubuntu 12.04. It currently takes up to 24h for us to run a large set of UPDATE statements on a database, which are of the form: UPDATE table SET field1 = constant1, field2 = ...
0
votes
0answers
404 views

SQL nested select (query rows after variable), running slow

Have large table (Sybase) rows = 6276225. I'm pulling call status and my query is very slow. In effect what I’m trying to do is pull data for any event after my variable. While querying for just one ...
4
votes
2answers
361 views

Total Memory capped far below available memory

We are testing out a new install of SQL Server 2012 on a virtual server and the memory allocated to SQL Server seems to be capped around 16 GB even though much more is available. What could cause ...
0
votes
1answer
298 views

adding fields to 2LIS_12_VCITM datasource in ECC

From what I have read the datasource 2LIS_12_VCITM is built off of the ECC tables LIKP, LIPS, VBUK, and VBUP. I would like to add a couple of fields that are in the LIPS table to this datasource and ...
7
votes
2answers
9k views

Is it safe to delete mysql-bin files?

I have MM Replication in mysql, and I want to squeeze some free space in the box be deleting unnecessary files, I came across these mysql-bin files inside /var/db/mysql/ There are hundreds of those ...
4
votes
2answers
808 views

Sharded key-value store using MongoDB

Would like to set up a key-value store that is sharded across multiple machines. We are currently using MongoDB, is there a reason why we shouldn't use MongoDB for this purpose? We also use Redis, ...
0
votes
1answer
123 views

using row data for column headers

I have a table CREATE TABLE "AUTOMATION"."TESTRESULTS" ( "BUILDNUMBER" VARCHAR2(30 BYTE), "TESTNAME" VARCHAR2(100 BYTE), "STATUS" VARCHAR2(100 BYTE) ) sample data would be ...
4
votes
1answer
7k views

Usage of COPY FROM STDIN in postgres

I just started using Postgres and I'm trying to create a sample db to understand its functions, looking around, I found some scripts in pgfoundry.org. I understand the commands, since I previously ...
0
votes
1answer
219 views

Creating a partial unique constraint for MySQL

I have the same question as asked in a previous post: PostgreSQL multi-column unique constraint and NULL values. But the solution there is not applicable as I am using MySQL instead of PostgreSQL. My ...
4
votes
2answers
956 views

maintaining full text index on large table

I'm on SQL Server 2008 and have a table, for reporting purposes, with 500,000 records that will easily reach the millions. The table will employ a full text index for rapid searching on a handful of ...
2
votes
1answer
451 views

Rebuilding Unique Index with uniqueidentifier in SQL Azure never succeeds

We have a number of tables (~1M records) that have a column on them defined as: [GlobalID] [uniqueidentifier] NOT NULL that gets auto-populated with newid(). We use this ID for synchronizing data ...
1
vote
1answer
456 views

Composite field in SQL Server, does it exist?

I'm designing a table to be used by a Web App, and my framework requires that the primary key be a surrogate key. But I also need an extra field which will be a composite of 2 other fields. In other ...
2
votes
2answers
423 views

limit the number of rows returned when a condition is met?

Is it possible to limit the number of rows returned when a condition is met? I am working on a query to check if a student is ready to graduate, and they need to meet a certain number of credits per ...
2
votes
0answers
57 views

How can service pack rollback file end up on non-system volume?

I'm attempting to upgrade a SQL 2005 SP3 clustered instance to SP4. During installation, a rollback event took place with the error indicating there was insufficient space on the the disk. The system ...
1
vote
1answer
167 views

Separating tables vs having one table

At the moment I have a table setup that looks somewhat like this: create table tbl_locationcollections ( id int(11) PRIMARY KEY IDENTITY, --(Primary Key), name varchar(100) not null, ...
0
votes
3answers
2k views

Easier way to handle so many isnull() situation

Is there any good way to avoid writing so many times isnull() function inside sproc ? I have stored procedure that use almost 30 times isnull() function, I think that I am miss a concept , but until I ...
1
vote
1answer
66 views

Summation query with complex grouping criteria

I have a database of coded actions with this structure. {User, Date, ActionCode} I need to generate reports based on dates and action codes, and the action codes are not clean because we have to ...
1
vote
2answers
184 views

How to create trigger on database that 'triggers' when mirroring role changes from mirror to principal

I want to perform some sql when my database mirroring state changes
0
votes
1answer
60 views

mysql replica ignoring server-id [closed]

I've setup a mysql replica slave a couple months ago. After a couple hickups lately, I've decide to restore it from a clean master export. I'm trying to start my mysql instance with this command : ...
4
votes
1answer
168 views

Fulltext stoplist replication

In MS SQL Server 2008 R2 there is replication of table with fulltext index on it. But stoplist that is associated with replicated fulltext index doesn't replicate. Is there any possibility to ...
5
votes
2answers
1k views

tempdb logs on same drive as tempdb data or with other logs? [duplicate]

For many reasons I only have 3 hard drives (RAIDed and in an Always-On AG) for all my database files: D: Data E: Logs F: Tempdb Should the tempdb log file go on F: with the data file(s) or on E:? ...
2
votes
2answers
5k views

Does a simple select query acquire locks?

I am very new to SQL Server, and would like to understand whether the following, very simple select statement would take any locks. Select * from Student; Please consider the case where the ...
0
votes
1answer
2k views

Database creation on Linux with dbca: “command not found”

I have installed an Oracle on my machine. When I open a session with VNCServer and type dbca, either as root or as oracle, I get these errors: -bash : -dbca : Command Not found Xlib: connection to ...
1
vote
2answers
32k views

Login failed for user 'domain\username'. (Microsoft SQL Server, Error: 18456)

I am facing this problem when connecting to local system db, but when i connect any server it connects. Login failed for user 'domain\username'. (Microsoft SQL Server, Error: 18456) For help, click: ...
1
vote
1answer
2k views

Is it possible for a trigger to update a row in a table using a value that was deleted?

I have a trigger which is updating a column in a different table after the row is inserted: mysql>delimiter $$ mysql> create trigger status after insert on table2 FOR EACH ROW BEGIN ...
0
votes
1answer
432 views

Ideal frequency to gather table statistics in Oracle for database of 1GB in size

I want to know what should be the ideal Frequency for Analyzing tables in a schema. Database size 1GB. Currently the frequency is set to 7 days, it takes around 40 mins to complete. Data volume is ...
2
votes
0answers
114 views

Changing Charset to utf8 for all the fields and tables in mysql

How should I use the mysql and awk to change the charset for all the fields and tables for a specific database? I did not include username or password, so for sure it will not work. Should I run it ...
0
votes
4answers
101 views

Selecting the first purchase item of each customer

I have a table like this: CREATE TABLE SALES ( CID NUMBER(4), PDATE DATE, ITEMCODE NUMBER(4), ITEMNAME VARCHAR2(20) ); INSERT INTO SALES VALUES (1111,'15-JAN-2011',4001,'LUX'); INSERT INTO SALES ...
0
votes
2answers
269 views

How to design database table to store process status?

I have an application (ProcessMonitor) that monitor some constantly running process at fixed interval (like 30 seconds, but can be changed by user) and store the process status to a database table, ...
2
votes
3answers
4k views

Logging queries and other T-SQL

I would like to know if SQL Server 2008 R2 has a default logging scheme for SELECT statements (or any other T-SQL for that matter). If yes, where can I see it? If not, how could I set it up?
3
votes
1answer
302 views

How to determine cause of runtime increase given two query plans with SpillToTempDb warning

Two actual query plans were captured for two executions of one query: Plan "Fast" took ~1s and occurs about 90% of the time. Plan "Slow" took ~16s. Since the graphical plans look ...
0
votes
1answer
127 views

Efficient way to perform approximated search?

I have to perform a join between table_a and table_b, using three fields as key being one of them the date of the event, say, both tables have id1, id2 and evnt_time for eache record. As it happens ...

15 30 50 per page