9
votes
1answer
254 views

DB_ID context from farther up call stack

In SQL Server, is it possible to get the DB_ID from the context from farther up the call stack? My goal is to create some handy (and admittedly hacky) utility functions in a dev sandbox database ...
2
votes
3answers
248 views

mariadb ignoring force index

I'm trying to tune a relatively simple query: select bt.col1,bt.col2 from bigtable bt join smalltable st on bt.smalltable_id = st.smalltable_id where st.name = 'some name occuring only once in st' ...
3
votes
2answers
473 views

Materialized view for the last 24 hour period

I am collecting spatial point data that has an associated timestamp with it. I want to create a view of this data for the last 24 hour period. Because I am piping this spatial data through ArcGIS ...
2
votes
2answers
278 views

Bin logs with high i/o

I'm DBA (IBM Informix) and already use MySQL with Drupal , where have low workload. So, my knowledge of MySQL is minimal. Few days ago I start use MySQL with a basic configuration as back-end for a ...
7
votes
1answer
771 views

SQL Server 2000 to 2008 to 2012

We are migrating from SQL Server 2000 to 2008 now. We are making lot of changes to code, scripts because there has been a lot of change since 2000 to 2008. While making these changes, What I want to ...
5
votes
1answer
2k views

Deleting MySQL table with pending transactions

Is there a way to delete an InnoDB table or database with pending transactions in MySQL (preferably on file system level)? What happened: I use MySQL 5.5.28 and ran LOAD DATA INFILE… to import a ...
5
votes
1answer
142 views

Rebuild a table from history records

A small disaster happened to me on my PostgreSQL 8.4 database. I follow visitors to my webpage in two tables: History +---------------+-------------+ | whereseenlast | varchar(50) | | uniqid ...
2
votes
1answer
86 views

SQL Server Profiler behavior?

I want to monitor only sp's. Does SQL Server Profiler listen to all events and then filters the desired data (e.g. sp's)? Or rather the sql emits only Profiler pre-configured events ?
-1
votes
2answers
802 views

Postgresql could not find pg_xlog [closed]

I'm trying to mount the WAL to a different disk. I stopped the server, and did the following: (I'm using Fabric) # Move pg_xlog to wals/path.dev/ dest_dir = "/home/ec2-user/%s/wals/%s" % ...
0
votes
2answers
343 views

Merging multiple databases as separate schemas in PostgreSQL

I have to combine data from 4 different databases. Each having its own design. What i want to do is to Create a new database with my desired schema. and one schema per (to be merged) database Then ...
5
votes
1answer
95 views

grant permission

i've got a database-role, -login and user CREATE LOGIN dummyLogIn WITH PASSWORD = 'dummyPassword', CHECK_POLICY = OFF; CREATE USER dummyUser FOR LOGIN dummyLogIn; CREATE ROLE "dummyRole"; with ...
1
vote
3answers
349 views

Which RDBMS has the most advanced “table-valued” functions?

Every Database Management System focuses on specific features and applications. I am using mysql, probably as it is popular and satisfies common needs. However, I came across a problem, which needs ...
2
votes
2answers
313 views

Reordering data in a table

I have a table that stores sensor data (in SQLite) and looks like this; TABLE Timestream: idTimestream PK autoincrementing integer, time int not null, value float not null, idSensor integer not ...
1
vote
4answers
507 views

Recommendation for synchronizing SQL Server DBs

I have two databases, prod and dev. Each DB is about 500GB. At the end of each work day, the prod database gets several million new rows and several thousands of updates. After the data is loaded in ...
0
votes
1answer
1k views

Postgres Incremental Backup (Continuous Archiving WAL)

I need to take incremental backup of Postgres DB. I need to capture (backup of) daily changes on a database. So that I can restore DB with any particular data I want. As per Continuous Archiving, I ...
1
vote
0answers
251 views

Transactional Replication Snapshots causing serious locking after 2012 upgrade

I am experiencing serious locking when adding new articles to an existing transactional replication publication, which is hanging the website. This is the first time I have attempted this since I ...
4
votes
1answer
476 views

How do I display subtotals in cube browser in SSAS 2012 (Sql Server Data Tools)?

Apparently this feature was available in previous versions but has now been removed. What are some alternatives?
0
votes
2answers
72 views

MySQL query slow even with indexes

Structure of my table mysql> show create table t_group_tag_relation\G *************************** 1. row *************************** Table: t_group_tag_relation Create Table: CREATE TABLE ...
1
vote
1answer
186 views

mysql freeze/crash on JOIN

here is query: SELECT nw.news_id, nw.title, nw.description, nw.url, nw.date, nw.image, nw.status, src.title as src_title, src.keyword as src_keyword, src.url as src_url, src.icon as ...
3
votes
1answer
69 views

Way to add referencing and referenced entities of a specific entity in E-R Diagram MYSQL

Is there any way to add entities that are referencing a specific entity in an E-R Diagram. I have a database containing 400 tables. I want to see a view containing a specific entity and its ...
2
votes
1answer
239 views

Database structure for affiliate system

I am creating affiliate tracking system and looking for best database structure to use on MySQL to place the lowest possible load on the server. There will be 1000 affiliates, and each will have ...
0
votes
4answers
2k views

Unable to access mysql database remotely

I ran this command- [root@dev-img mysql]# mysql -u root -h 192.168.1.181 -e "use mysql;" and this is the output I got- ERROR 1045 (28000): Access denied for user 'root'@'192.168.1.65' (using ...
2
votes
0answers
171 views

Schema for multiple identical queue tables

I am migrating a message processing application that was built on MSMQ to SQL Server 2012 (preferably Standard Edition). Messages are received and distributed via TCP/IP endpoints and the typical ...
1
vote
0answers
113 views

Why is this table structure so slow to CRUD?

I have a table that I am using for queuing emails. Unfortunately, adding to or reading from this table becomes horrendously slow after adding about 50 records. -- Table "mail_queue" DDL CREATE TABLE ...
1
vote
1answer
324 views

Select Count(*) FROM with-clause-named table order by a, b not working

I have a series of tables defined in a stored procedure to eventually return to the application like this, then culminating to a simple table which contains distinct values from a previously defined ...
2
votes
1answer
2k views

Msg 7391, Distributed Transactions (DTC) on SQL Server

This may be DBA related or developer related, I honestly don't know. I have two Database servers: A: SQL Server 2005 (Trigger that uses DBMail on Server B) B: SQL Server 2008 R2 (DBMail configured) ...
3
votes
2answers
532 views

How to split a string to and get info from another table in mysql

I have a system to assign score for each sentence stored in a column: TABLE 1: word_scores word score this 3 is 4 a 5 test 1 another 0 sentence 8 TABLE 2: ...
2
votes
2answers
3k views

Do I need to RUNSTATS after a REORG in DB2?

The REORG documentation says: BUILD Builds indexes. Updates index statistics. But I have always heard REORG/RUNSTATS as if they should be paired. Can anyone verify that "Updates index ...
3
votes
1answer
3k views

How to update one database from another?

I'm using SQL Server 2008. I have two databases called Adb and Bdb. There is a common table called commonTable. How can I update Adb database every 15 minutes using the data from the same table in ...
1
vote
1answer
1k views

Downgrading SQL Server 2008 R2 Standard to Web Edition

I have to downgrade a SQL Server running SQL Server 2008 R2 Standard Edition SP1 to 2008 R2 Web Edition SP1. I discovered this question on Server Fault: Can I downgrade SQL Server 2008 R2 ...
4
votes
1answer
186 views

Which MySQL storage engine is the most similar to ARCHIVE when that is not available?

I have a table that contains a log of events that is written to often and read very infrequently by comparison. I would love to use the ARCHIVE engine, because it is basically designed for exactly ...
0
votes
2answers
167 views

How can I optimize this query and support multiple SKUs?

My current query only can select one SKU at a time. I can leave salesite_id constant. If there is a way to also have varying salesite_ids that would be good too, but not necessary. Also any ...
12
votes
1answer
2k views

What is the modern way to partition PostgreSQL across machines, when the data is “naturally partitionable”

After several years of dwelling into the "NoSQL" space, now I have a problem that is quite "relational" in its nature. Today I see data stores with quite different eyes than before. Things like Riak ...
8
votes
3answers
600 views

Why are there execution plan differences between OFFSET … FETCH and the old-style ROW_NUMBER scheme?

The new OFFSET ... FETCH model introduces with SQL Server 2012 offers simple and faster paging. Why are there any differences at all considering that the two forms are semantically identical and very ...
7
votes
2answers
2k views

How do Availability Groups work with cheduled jobs and SSIS packages?

I have 2 SQL Servers set up with a database in an AlwaysOn Availability Group. I also have jobs set up which run against the database. During a failover how do I ensure the jobs will continue to run ...
2
votes
1answer
391 views

Which backup files are needed for a successful restore?

Considering the built-in 'Backup Database' script (backup.bat) that comes with a new installation of the Oracle Express 11g Edition, after finishing the script execution, what folders/files should be ...
2
votes
2answers
87 views

Searching transaction logs for changes

I currently have a database with an attached CMS. The CMS has about 50+ people with various permission levels that can log in etc... I would like to know if there is a way I can look at the ...
1
vote
2answers
829 views

Trouble with triggers and insert .. on duplicate key update

I have two tables with identical schemas. one is a "main" table that is pruned periodically and kept small. The other is a "reporting" table that is an archive of everything that ever was. For ...
2
votes
2answers
127 views

separating tlog and db file when using fusionio

We have a FusionIO card that we use in our production database. We have both the transaction log as well as the database files on that same drive. I know the recommendation is to place the tlog files ...
2
votes
1answer
103 views

Where to put utility (not administration) stored procedures in SQL Server? [duplicate]

Possible Duplicate: Setting up a central CLR stored procedure / function respository library for internal stored procs in other databases to use? I have some simple user-defined functions ...
2
votes
1answer
119 views

Create MS SQL login for support engineer to access only vendor database

I have sql server 2005, I need to create separate database login to support engineer of my software vendor to access their own database. My only worry is deny him to take backup from our database ...
2
votes
1answer
684 views

In Postgres, how do I cast character varying to an enum type?

I have a Postgres 8.4 table with columns that are of type "character varying", but I want to convert them to an enum type. When trying to alter the table ALTER TABLE logs ALTER COLUMN interface_type ...
5
votes
2answers
2k views

What would be the correct size of redo logs?

I installed and put in production a 11g database. I was adviced to size redo logs to 200MB each one. Now I see that my archived redo logs are each one 200 MB and all of them occupy a lot os disk ...
3
votes
1answer
211 views

Lost databases in SQL Server 2012

Had three databases connected to SQL server 2012, unfortunately, now I can't see any of them under the Databases part of the tree in SQL Server Management Studio. The files (.mdf) are still on the ...
4
votes
1answer
1k views

MySQL on RDS, data transfer from one instance to another as a production job

I have a MySQL RDS instance ("production") from which I need to copy incremental data to another MySQL RDS instance ("reporting"). “Incremental data” being the new rows in certain tables. Currently ...
6
votes
2answers
745 views

Conditional compilation of SQL Server stored procedure

Short version: Is there some way to conditionally compile chunks of TSQL code in a SQL Server Data Project using SQL Server Data Tools for Visual Studio 2010? I'm using SQL Server Data Tools in ...
3
votes
2answers
95 views

Is there a way to speed up an ALTER statement in SQL Server

I have an existing table with millions of rows in it where I have a column which is the SMALLMONEY data type and I want to ALTER it to be MONEY. To make things a bit more complicated it has an index ...
4
votes
2answers
1k views

How do you set the pagesize, codeset and table space when creating a database in DB2?

I want to create a database in DB2. I found some information on this page I want to use only some options which are explained on the page: PAGESIZE CODESET TABLESPACE Then, I want to ...
4
votes
2answers
3k views

Why won't SQL Server optimize the UNIONs?

Consider these queries (SQL Fiddle): Query 1: SELECT * INTO #TMP1 FROM Foo UNION SELECT * FROM Boo UNION SELECT * FROM Koo; Query 2: SELECT * INTO #TMP2 FROM Foo UNION SELECT * FROM Boo UNION ALL ...
1
vote
2answers
578 views

mysql replication delay very serious

We use a ssd disk for master database and SATA disk for slave. On high write load (300 writes/s), slave delay is very serious. I have set: innodb_flush_log_at_trx_commit = 0 increased ...

15 30 50 per page