2
votes
2answers
231 views

Performance effect of indexing foreign keys

My database is for an HR application with performance reviews and I am interested in whether I should index my foreign key. There are two tables involved. The first is a ratings table with 2 columns: ...
0
votes
1answer
2k views

How to do an in-place upgrade of SQL Server 2005 Express to SQL Server 2008 R2 Express

I would like to upgrade my SQL Server 2005 Express instance which is installed using this command: SQLEXPR.EXE/qs /action=INSTALL /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine ...
2
votes
2answers
291 views

Migration to databases Domain Users do not have access

I migrated databases to new servers, however the applications that were previously used with the databases are failing to load. I have changed the connections and etc. The jobs also seem to be ...
2
votes
2answers
639 views

MySQL version confusion

How is this possible: I installed mysql-5.6.11-osx10.7-x86.dmg which is supposed to be version Mac OS X ver. 10.7 (x86, 32-bit), DMG Archive (32 bit!) But upon SHOW VARIABLES LIKE "%version%"; I get ...
0
votes
1answer
40 views

dimension table with “like” condition

In an effort to scale some existing code, we are removing logic from CASE statements and putting it in dimension/lookup tables. Thus instead of CASE WHEN 'F' THEN 'Female' WHEN 'M' THEN 'Male' is now ...
4
votes
2answers
521 views

How do I turn off ALTER DATABASE script output in VS 2012?

I am using SQL Server 2005 in conjunction with Visual Studio 2012 and a SSDT database project. When I publish my VS project and generate the script to run against my database, VS includes the ...
1
vote
2answers
274 views

Jobs view is not visible to read-only account users

I am the admin of one of the database, and I have created a view in SYS schema using below code which returns the status of the running jobs: CREATE OR REPLACE VIEW CAF_DB_REFRESH AS SELECT * FROM ...
1
vote
1answer
112 views

How would I change this relational model to fit a nosql database?

Because of things beyond my control, I have to switch from a relational database to MongoDB for the advertising platform I'm helping to build. I've got a relational schema sketched out, but I'm unsure ...
2
votes
1answer
50 views

How can I include more query in one query?

These are my tables: tbl_answers => aid qid answer uid dateposted emailnotify namedisplay status isbestanswer tbl_questions => qid question ...
0
votes
1answer
28 views

Separate table by often changed / not often changed data?

I have a application which querys different gameservers, and stores for example if the server is online, and how many players are connected. But of course there is also data which is changed rarely. ...
1
vote
0answers
99 views

Is there a way to generate an execution plan for a stored procedure before executing it?

We have a very large (many millions of rows) table that contains some (few million) rows with invalid values in particular columns. A stored procedure exists to correct the invalid records but it ...
0
votes
1answer
201 views

Does MySQL reserve memory for MEMORY tables based on max_heap_table_size

Currently I have a set of large MEMORY tables, and have previously calculated how much space I believe each will require and assigned max_heap_table_size accordingly so that the sum is not greater ...
1
vote
1answer
149 views

How to achieve this sql server replication scenario?

I want to achieve below illustrated scenario via sql server replication. Client A and Client B are client databases containing same article Table A. This article needs to be published by Client A ...
1
vote
1answer
99 views

Migration of create statement from SQL Server to MySQL

I have a table that have the following table structure CREATE TABLE [dbo].[ASAT]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [ASATID] AS ('ASAT'+right('00000000000000000000' ...
3
votes
3answers
371 views

Restore of logfiles in SQL Server [closed]

I'm trying to write a script which will read a folder containing a full backup and X number of log files. My script fails when it starts the loop to read the log files. The error is cannot convert ...
2
votes
0answers
137 views

Why is dynamic pivoting not supported?

TL;DR What is the reason that in 2013 we still can't define a VIEW that displays some pivoted data with a dynamic column set. TL;DR/2 Is pivoting data a denormalization technique? First: Not going ...
1
vote
2answers
173 views

Usage of foreign key when the referenced table data will not change

I have to design a table where user has 10 fields and 6 are dropdown. Some are single selections and some multiple. Dropdown data is supposed to change very rarely. For e.g., the user is presented ...
0
votes
2answers
3k views

How to quickly startup/shutdown Oracle 11?

I am wondering what is the quickest way to properly startup/shutdown a Oracle DB daemon (Oracle 11.2, installed on a test machine). I need it for C/C++ programs that use the OCI/Pro*C API. Currently ...
0
votes
0answers
327 views

How to improve the performance for SQL Server Count(distinct()) and Sum() functions? [closed]

The below one is my query. It's taking 12 seconds for the execution process. The count(distinct()) and SUM() functions are taking long time for execution. I tried it after create the non-cluster index ...
1
vote
1answer
322 views

Would Mongo's ObjectID work well in InnoDB's clustered index?

Mongo's ObjectID is defined like this: ObjectId is a 12-byte BSON type, constructed using: a 4-byte value representing the seconds since the Unix epoch, a 3-byte machine identifier, ...
0
votes
3answers
2k views

Creating a global temp table in MySQL

I am working on a MySQL stored procedure. I need to create a temp table and I want to access this temp table whenever I execute this stored procedure. I know we can't access the temp table in ...
0
votes
2answers
786 views

Is there a good reason to store big text data outside database?

I was analyzing my MySQL database performance and found that tables containing text fields are just huge, larger than 1Gb. This data is only used when loading single record (like article or blog ...
1
vote
2answers
3k views

How to attach an .mdf file that was not properly detached?

One of our clients had a SQL Server 2000 database, on a system which is no longer running. They have no idea what was in the database. They have given me the .mdf and .ldf files, and want us to ...
1
vote
0answers
165 views

Job accessing linked server yields error 7391 [closed]

I created a stored procedure which queries data from a linked server to insert into a local table. I tested this stored procedure by directly executing it; it works fine. I have to run this stored ...
0
votes
0answers
499 views

Properly index magento mysql tables to improve specific query performance

I am running magento community edition and its db performance is horrible. I have the following query: SELECT `width_idx`.`value`, COUNT(DISTINCT width_idx.entity_id) AS `count` FROM ...
-4
votes
1answer
87 views

Oracle database and data has been corrupted. Is there a way to get it back? [closed]

The Oracle database has been corrupted and both the data and backups were lost in the corruption. Is there anything I can do to recover my data? It would be terrible if it were all lost.
3
votes
2answers
496 views

checksum(newid()) as primary key - what happens if a collision occurs?

Inspecting a rather critical database that is used by some software on my system, I found that one of the tables had a primary key on the column Id, where Id is calculated using checksum(newid()). ...
5
votes
1answer
1k views

Best strategies to have a backup of an RDS MySQL database

I have an AWS RDS MySQL database. I'm not a DBA, so my knowledge is limited. I wish to design strategies to have zero data loss in case of a failure, in terms of replication or data backup. I know ...
2
votes
1answer
3k views

Merging two Access tables into one

I have mostly identical tables, however there are slightly differences like missing columns in older ones. I want to merge 5 tables into one. Is there any easy way to do this?
7
votes
2answers
191 views

Is there any way to prevent the memo structure from being pruned?

We know that the memo structure is pruned and some expensive alternative plans are discarded during optimization. I was wondering if there is any way to prevent this and let the optimizer just ...
5
votes
1answer
174 views

How to dive into the PostgreSQL's optimizer and trace each step it takes to optimize the query?

Just like the MEMO structure in SQL Server which is kind of a "paper trail" of steps the optimizer takes in optimizing the query. Does PostgreSQL have the similar structure which records steps the ...
1
vote
1answer
1k views

MySQL Workbench - question about creating FK relationships

Forgive me a little new at databases and I came across something while working with Workbench that I have a question on. In a very simple testing database, with three tables: Company, Department, ...
1
vote
2answers
264 views

Update my local db based on scripts executed in my server database

I need to create an solution that update my local db version based on changes that was made on my server database. First, I need to check the differences that has exists between these databases and ...
1
vote
2answers
80 views

Tracking down program from Event Viewer

The event log has hundreds of login failed errors for SQL Server. How do you find out the application generating them? There are lots of potential candidates on the server and since it's logging in ...
1
vote
2answers
2k views

Restore database created in SQL Server 2008 R2 to SQL Server 2008 R2 SP2 [closed]

I have a .bak file created by some other user in (I think) SQL Server 2008 R2 (10.50) and I need to restore it in SQL Server R2 SP2 (10.52). I used a hex viewer to look into the .bak file and found ...
1
vote
0answers
560 views

pg_restore and psql asks password for restoring dump file

This will be probably extreme novice question but I want to restore a .backup dump file. I have tried the following command: pg_restore -i -h localhost -p 5432 -U postgres -d old_db -v ...
1
vote
1answer
575 views

PowerPivot doesn't install in SharePoint mode on an Active/Passive Cluster

We a provisioning a new SQL Failover Cluster. We have successfully configured the SQL instance, and have moved on to configuration of the PowerPivot for SharePoint instance. We run the configuration ...
5
votes
1answer
6k views

Start service error code 3417 with SQL Server 2012

I cannot start the SQL Server 2012 service. The event log says the service-specific error code is 3417. In the Event Viewer: The SQL Server (MSSQLSERVER) service terminated with the following ...
3
votes
1answer
166 views

Will creating a view on a MySQL replication slave break the replication?

We need to run some very ugly queries on a MySQL replication cluster. Does anyone know if creating a view directly on the slave will break the replication of the other, otherwise untouched data ...
3
votes
1answer
432 views

Postgres backup and WAL to S3

We are looking for a solution for the following problem: We have set up streaming replication so we have a master DB and a slave DB, we want to have basebackups and WAL files sent to our S3 storage ...
3
votes
1answer
48 views

SP with Encryption Read/Writes Stats

If a stored procedure in SQL Server 2005 is created with the syntax "WITH ENCRYPTION" ,are the reads and writes of the encrypted stored procedure recorded in the sys.dm_db_index_usage_stats? I am ...
0
votes
1answer
311 views

SQL Server TDE - add master key and certificate [closed]

I want to add multiple master database encryption keys and certificates. Can I do that?
2
votes
2answers
209 views

MySQL many to many relation

Sorry is this seems a stupid question, but I have a table of server addresses and a second table with a list of hardware devices which use the addresses, it is possible for multiple devices to use the ...
1
vote
2answers
449 views

Approaches for deleting unnecessary records from tables

We have a database which stores the temperatures of 20 thermometer every 7 seconds. We want to delete all records in the way that every minute holds just one tempereature instead of 8 which are older ...
2
votes
1answer
1k views

Percona Node fails to join: Operation not permitted

Joining a new Percona node fails with: 130521 7:15:44 [Warning] WSREP: Failed to prepare for incremental state transfer: Local state UUID (00000000-0000-0000-0000-000000000000) does not match group ...
1
vote
2answers
776 views

Need an Oracle query to get the Oracle Home directory for a particular instance

I am searching for a query to get the Oracle Home for a particular instance name, say Eagle (if there are more than one instance on the host).
4
votes
2answers
2k views

One filegroup, multiple datafiles, how to get list of tables in each file

In one of my production databases, I have a filegroup with 3 data files sitting on 3 different disks. There are over 50 tables on this filegroup. How do I identify the location of each of the 50 ...
2
votes
1answer
94 views

Why does postgres use more space for a time with timezone than a timestamp with timezone?

The documentation on date/time data types state that timestamp with timezone takes 8 bytes, while time with timezone takes 12 bytes. They both have the same resolution (1 microsecond), and on the face ...
3
votes
0answers
148 views

custom population of full text index

Is there any way to populate a full text search index without storing the backing information in the database? I don't mean using remote-blob-storage or FILESTREAM types. The backing information is a ...
0
votes
0answers
1k views

Oracle 11gR2 DBCA installation failing with TNS Lost contact

I am getting below errors while running DBCA with silent install using response file ORA-12547: TNS:lost contact PRCR-1079 : Failed to start resource ora.ocl.db It's a fresh installation and not ...

15 30 50 per page