All Questions

0
votes
0answers
6 views

How does one know when to stop normalizing?

Alright, so basically I feel that I tend to over-normalize things, and maybe I am doing it at the cost of performance. So, to illuminate on the problem, I have created the following schema to use as ...
2
votes
0answers
13 views

Can autoshrink permanently damage a database?

I've been given the task of finding out why our server is slow. I ran a stored procedure I downloaded called sp_Blitz. It let me know that our database had auto-shrink enabled, and to disable it. So, ...
0
votes
0answers
3 views

mongodb shard chunk migration 500GB takes 13 days - Is this slow or normal?

I have mongodb shard cluster, shard key is hashed. It has 2 shard replica sets. Each replica set has 2 machines. I did an experiment by adding another 2 shard replica sets, and it starts to ...
0
votes
1answer
18 views

Is there anything wrong with creating a very large log file?

I've been given the task of finding out why our server is slow. First of all I did not set this server up. Is there anything wrong with setting the initial log file size to 70GB? That's what ours is ...
1
vote
0answers
5 views

MariaDB Galera Cluster - nodes fail to start

This is a new installation (fresh VM and MariaDB install). For some reason, the nodes are having trouble joining the master server. The master server would pause at Preparing binlog files for ...
0
votes
0answers
8 views

Is database sharding done on a table level or database level?

I'm new to sharding databases, so I'm trying to wrap my head around it. Let's say we have a database that has 3 tables: Customer, Suppliers and Orders. Each table has 10 million records. I want to ...
0
votes
1answer
5 views

Effects of monolothic databases on performance and security?

Please note: although I'm specifically calling out MySQL here, I would also appreciate/entertain generic answers that apply to all/most relational systems. As a developer I don't see the design ...
1
vote
1answer
19 views

Preventing duplicate data when usual normalization only makes sense for some of the records

Background I have two tables, one called issues and the other called status_checks, which both contain (among others) the field comment (VARCHAR). An issue is raised by a user when something needs ...
1
vote
0answers
10 views

What does a high level overview of the logic backing database queries look like?

explanation i.e. At the database driver level of abstraction you may invoke API methods for compiling and executing some kind of query language, which can be expressed as a string sometimes (SQL ...
0
votes
0answers
19 views

Where statement involving isnull/case

Here is my query: [SuggestedRetailPrice] > 0 AND (ISNULL( CASE WHEN [AdEnd] < GETDATE() THEN [AdPrice] END, [BasePrice]) )/[SuggestedRetailPrice] > 0.8 ...
0
votes
1answer
26 views

Sum(Case When) Question

I'm trying to get the syntax correct on my query but I'm having issues. Currently my query will show the Household Total Value (HHValue) and then the NationalValue on one row, then the second row ...
1
vote
1answer
23 views

Breaking down by minutes in between two dates

In MySQL, I've got a data model with a "visit" table that has start and end datetimes. How can I get a breakdown of the number of visits that are active per minute? e.g. | visit_id | start | end ...
0
votes
1answer
16 views

What permissions do I need to grant on service accounts on SQL root path when relocating?

During a Win2012 with SQL Server 2012 two-node cluster installation, I accidentally set the system root to be the mount point volume hosting folders for the various attached LUNs for the system and ...
0
votes
1answer
19 views

Populate a table with “WITH” clause

How to perform the following select query? with x (x, y, z) as ((2 5 6), (6,3,2)) select * from x I am not sure if this approach is possible. Not even sure if the syntax is correct. But I don't ...
0
votes
1answer
10 views

MySQL: Is there a way to update a field so that all foreign key related fields are updated as well?

I'm assuming the answer to this question is yes but it is hard to Google this type of question and not get overly ambiguous results. I am working with a database that was dumped from a Magento ...
1
vote
1answer
15 views

SQL Server log for revoke statements

I am trying to figure if SQL Server has a feature to log when a user fires statements as revoke, delete from, etc. It would be great to see which user has fired the command, date and time, and which ...
0
votes
0answers
4 views

HSQLDB 1.8: Trying to have the result table contain two records in each row and be sorted

I'm really stuck doing this because each time I think I have a solution, HSQLDB v1.8 doesn't support it. I am forced to use this version at work, and believe me, I wish I could use a new DB, even v2.x ...
0
votes
0answers
4 views

Customizing OEM notification title and body

I am writing a reporting tool that accepts email notifications for incedents , alerts and events coming from the OEM. The tool parses the email title and body to extract information from it. I was ...
0
votes
0answers
10 views

SQL Server decryption authentication not working with concatenation

I'm trying to retrieve encrypted text according to the authenticator. I am using SQL Server 2014. Everything works except for the decryption. Does anybody know why this is not working? --Step1: ...
1
vote
2answers
36 views

Way to test alerts for backups?

We have some MSSQL servers that are backed up using SQL and some that are using 3rd party backups (like Egnyte). Is there a way to setup alerts inside SQL for that? I also need a way to test so we ...
1
vote
2answers
41 views

How to use variables with RESTORE FILELISTONLY

Storing the result of RESTORE FILELISTONLY in a temporary table called #filepaths. IF object_id('sp_restore') IS NOT NULL drop procedure sp_restore go CREATE PROCEDURE sp_restore AS BEGIN ...
1
vote
2answers
37 views

sp_testlinkedserver output verbose

I've built a script/Agent job that goes and polls our linked servers every 10 minutes to make sure they are online. Now, when one goes offline, It generates an email and notifies me. See below: ...
0
votes
0answers
21 views

Update on table deletes the record

I'm having a problem in my oracle database, I have a table PAYMENTS which has an ID (PK) and when I want to update a record: UPDATE PAYMENTS SET AMOUNT = 2000 WHERE ID = '1'; The record with ID = ...
1
vote
3answers
178 views

Can I turn auto-shrink off while on production server with people connected?

I'm going to turn auto-shrink off on our SQL Server 2008, but I was wondering if I need to wait until the end of the day when no one is on the server? Or, can I just make the change now? Thanks!
1
vote
0answers
11 views

Ctrl-F1 shortcut stopped working in SSMS 2014

I've had the Ctrl-F1 query shortcut bound to sp_whoisactive for years (this technique is described in How to assign CTRL+F1 to sp_whoisactive in ssms 2012?). A few days ago, it stopped working: if I ...
0
votes
1answer
9 views

Execute grant for MySQL stored procedure revoked when stored procedure is altered

I have created the following stored procedure in a MySQL database (MySQL 5.5). DELIMITER $$ CREATE DEFINER=`remote_admin`@`%` PROCEDURE `usp_insert_deal_and_segment`() BEGIN "code here" END$$ ...
0
votes
1answer
19 views

Moving SQL Server default instance's folders to another path on the same server

My customer installed SQL Server 2012 default instance. But default instance's folders and data folder are on the same disk. I want to move the default instance's folders to another disk (C:Program ...
0
votes
0answers
12 views

Last synchronization time between master and slave (replication)

During replication process where a Master is connected with slave. Some times connection between these two goes down. Any options to get the details of the last synchronization time?
0
votes
1answer
14 views

xp_logevent Invalid Parameter Type

I'm working with SQL Server 2012 Enterprise Edition SP2 on a Windows 7 32bits. I have this code inside a stored procedure. Begin try -- EXEC CLR Stored Procedure exec ...
0
votes
1answer
10 views

MS-Access vba sql update where not working

I am having trouble with an MS-Access VBA sql update command. I have a form which has a combobox of GroupMembershipIDs, and a button. I am trying to write code which will iterate through the ...
1
vote
0answers
23 views

Best implementation of Service Broker when multiple readers needs to read their own message

I have implemented service broker using rusanu.com articles and advices. Now I need to implement the following scenario : The service broker will manage Many messages for differents workers and each ...
0
votes
1answer
22 views

PostgreSQL data directory/files portability

I have lost my PostgreSQL 9.1 installation on my Ubuntu machine by update to Ubuntu 14.10. Now I have no (reasonably easy) way to export the data from my PostgreSQL 9.1 database. Is it possible to ...
1
vote
1answer
39 views

SQL Pivot column

I'm trying to figure out how to create a From and To column based on ID.LocationID Column. I'm hoping with a suggestion this can be done (i can figure it out) without having to create sample tables ...
0
votes
1answer
25 views

Rescue truncated data from incorrect column type

I have mistakenly inserted a variable 18-20 digit variable into an unsigned INT() column. The data has been truncated to the max 32bit length so all my data is displayed as "4294967295" Is there ...
0
votes
1answer
29 views

Select products and include all cities it belong to

I have 2 tables : PRODUCTS +----------+----------+----------+----------+ | id | title | content | city | +----------+----------+----------+----------+ CITIES +----------+----------+ | ...
0
votes
0answers
16 views

How to store multiple raster files in postgres / postgis efficiently

This question is partly linked with another question on GIS:stackexchange, but I believe it is has more to do with clever data management. I have a Postgresql server with Postgis extension running ...
2
votes
1answer
60 views

Why am I getting cardinality issues when querying a single table

I have the following query: SELECT [iri].[RateItemKey], [iri].[RateItemType] FROM [prism72].[dbo].[ispRateItem] AS [iri] WHERE [iri].[Status] = 1 AND ( ...
3
votes
2answers
67 views

CTE works as expected, but not when wrapped into a function

--testing table CREATE TABLE public.test_patient_table ( entity_id INTEGER NOT NULL, site_held_at INTEGER NOT NULL, CONSTRAINT entityid_pk PRIMARY KEY ...
0
votes
0answers
18 views

Is Moving data from Greenplum to Oracle for reporting is advisable? [on hold]

We are working for one of the leading telecommunication industry for data warehouse and business intelligence reporting , The volume of data is very huge in size(CDR data) and frequency of getting the ...
3
votes
3answers
437 views

How to achieve many to many relationship in this database design?

I am currently working on small travel application in which users can add other users' trips in their wishlist. I am facing difficulty in designing database for wishlist. What I have tried so far is: ...
2
votes
1answer
29 views

Slow index scans in large table (PostgreSQL 9.2)

I'm having trouble with slow queries on a relatively large table (200+ million rows). I'm trying anything crazy, just add historic values. Below is the query and the query plan output. I sadly expect ...
1
vote
1answer
22 views

Different kinds of pricing PostgreSQL

I would like to hear your opinion about handling different kinds of pricing. We have a product table which looks almost like this: +----+------+-----------+-----------+ | ID | Name | price_old | ...
1
vote
2answers
36 views

Cancel Query in remote ssms from ssms in my pc

We connect to our customer's database server with vpn. Sometimes we manage Sql server to connect database server or to connect with ssms in our pc's. I executed a query with ssms in database server, ...
-1
votes
2answers
38 views

Calculate number of items with distinction using SQL [on hold]

I have a product Table like this; Product | Operation | Component A | 10 | C1 A | 10 | C2 A | 11 | C3 B | 12 | C3 B | 11 | C1 B ...
0
votes
0answers
11 views

How to import to UNIX the results from a select query?

After a select query i get around 14k records.Rather than exporting them as insert statements into a file and then executing from UNIX, i want to import them to UNIX directly and insert so as to save ...
0
votes
1answer
37 views

Work with table named Group [on hold]

I have a table named Group in my database , when I try to work on it it gave error : SELECT GroupID,GroupName FROM Group it said : Msg 102, Level 15, State 1, Line 1 Incorrect syntax ...
-4
votes
2answers
42 views

How to List out all the tables on the SQL server which do not have a Clustered index? [on hold]

SQL Query to retrieve the tables on the server which does not have the clustered index.
2
votes
2answers
58 views

SQL Server Backup Job failed multiple times

I am getting the same error as mentioned by Mr.Ali Sql Server Backup Job failed Can anyone please explain the possible ways to fix this error as the backup is failing since 1 month. Here is the ...
1
vote
1answer
22 views

Correlated query Issue [on hold]

In the below query i have 2 tables product and productstatus. In product table I have productId and productName and in productstatus table there are locationid,productid,currentstock and ...
2
votes
1answer
96 views

How Do I Use PowerShell to Get a SQL Server Backup Status?

I need a power-shell script to obtain the following information Name of the database , LastBackupDate of the database and this information should be sent via an email converting the results to HTML ...

15 30 50 per page