All Questions

0
votes
0answers
9 views

Help in Automating Database Restoration in SQL Server

This question is a continuation of my last question How to use variables with RESTORE FILELISTONLY. Every two months, I have to clone about 50 databases from production to a development environment. ...
0
votes
0answers
11 views

Using Case in SQL

I want my query to fill in information where results are null. Particularly I want the PlanFirmSpecCode.SpecialCode to = the FinancialPlanner.LastName when the special code field is null. And when my ...
0
votes
0answers
4 views

Efficiently relating simple dimensions to fact table in Tabular Model

I have a SSAS Tabular model that has a fact table that joins to many simple, descriptive dimensions. FactA DimA DimB DimC ------- ------- ------- ------- DimAKey DimAKey ...
1
vote
0answers
10 views

System Health Extented Event - Security_Ring_Buffer_Error_Recorded

I've recently upgraded a Production SQL instance from 2005 SP4 to 2012 SP2 and have noticed a large amount of the following entries in the system_health extended event:- I've been looking into this ...
0
votes
0answers
28 views

how do i join two different tables in mysql

This is table1: id name m1 m2 m3 total 1 raj 10 10 10 30 2 ram 60 60 60 180 3 kumar 70 70 70 210 4 kanna 50 50 50 150 5 vivek 64 ...
0
votes
0answers
11 views

Connection through listener stops working after VPN client is connected

I have an Oracle 11g2 64bit database instance running on my Win7 developer machine. Normally everything works fine, I can connect to the DB with or without listener. (Normally all connections are ...
1
vote
0answers
34 views

SQL 2012 Std using too much ram

For the past few months I have had a SQL Server 2012 Standard edition installation using up all the RAM in the server, up to 190GB (I'm not kidding). About every 3 to 4 days I end up having to ...
0
votes
0answers
3 views

Move a MySQL 5.5 database to a server running MySQL 5.1

I have a backup of a MySQL database (using InnoDB) from a Windows machine that was running MySQL 5.5. The Windows machine is no longer available and now I need to import the backup into an Ubuntu box ...
3
votes
1answer
48 views

Overlapping indexes

I have two non-clustered indexes on one of my dbs and their definition are: CREATE NONCLUSTERED INDEX [NC_Index1] ON [dbo].[anyTable] ( [X] ASC, [Y] ASC, [Z] ASC ) INCLUDE (A , ...
1
vote
1answer
22 views

How to create a relationship between one table and multiple other entities

(PLEASE NOTE: I am aware that in a few cases there are one-to-one relationships where one-to-many should be present. It's not intentional, it's just a mistake on my side. Take no notice.) I am ...
0
votes
2answers
13 views

Need help about giving relationships in database design

I am developing a simple blog application in which users can write posts and others can like, comment, share etc. i am facing difficulty in designing database. What I have tried is: user ...
0
votes
1answer
16 views

Multiple queries and a report

im fairly new to databases. I have multiple query's that i normally run individually at the end of loading data to my table doing simple integrity checks like length ,char types and so on (see ...
0
votes
0answers
12 views

How to determine a schema version at runtime

Is there a portable way or best practice to access a version number for a schema at runtime? Rationale: you have multiple systems (development, QA, etc.) where you push schema changes from one system ...
0
votes
2answers
44 views

Create/Alter stored procedure without compiling

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure? (* - yes, unfortunately, we still need to support 2005 as our minimum standard) I have a ...
0
votes
0answers
12 views

ORA 00933 SQL command not properly ended, WHERE function

I've made a query that works perfect but when i add the sentence below it gives the error 00933 SQL command not properly ended. Could anybody tells me why? where be.be_symbool='S';
0
votes
0answers
32 views

How much minimum RAM and number of physical hard disks needed for SQL Server to handle a million records per day [on hold]

I am building a Real-time BI solution which will basically consist of an ETL and BI Engine - mainly based star schema/measures-dimensions. I also have to build Reporting/Charting into it. I can't ...
0
votes
0answers
24 views

unique constraint violated

I have code create table CREATE TABLE OFPHONE ( PHONEID INTEGER NOT NULL, HOTLINE VARCHAR2(20 CHAR), EXT VARCHAR2(20 CHAR), PHONE VARCHAR2(30 ...
0
votes
0answers
6 views

Mongo Replication with VIP

Have anyone implemented Mongo replication using replset arbiter. At the time of fail-over from Primary to Secondary, Arbiter should bring down VIP on primary and enable on secondary when Arbiter ...
0
votes
1answer
12 views

fn_trace_gettable Error SQL Server 2008

When I Execute SELECT * FROM FN_TRACE_GETTABLE(N'E:\Trace_Files\trace1.trc', 1) It says "You do not have permission to run 'FN_TRACE_GETTABLE", What type of permission on server required to execute ...
0
votes
0answers
12 views

MySQL performance_schema not working properly?

I have MySQL 5.6.19 community server running on my Ubuntu 14.04. Lately I have been trying to monitor MySQL server using performance_schema. Previously I used to do this by running SHOW FULL ...
3
votes
3answers
150 views

Why SQL Server 2008 R2 do full installation for just adding another instance on the same machine

Why SQL Server 2008 R2 does a full installation for just adding another instance (only database engine) on the same machine? I thought it will be quick a installation, but it's not. What is SQL Server ...
0
votes
1answer
21 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
1answer
33 views

Can autoshrink permanently damage a database? [duplicate]

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, ...
1
vote
1answer
16 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
2answers
34 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
6 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
11 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
10 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
20 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
13 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
26 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
31 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
28 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
17 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
26 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
12 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
16 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
6 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
5 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
12 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
47 views

Way to test alerts for backups?

We have some SQL Servers that are backed up using T-SQL and some that are using 3rd party backups (like Egnyte). Is there a way to setup alerts inside SQL Server for that? I also need a way to test ...
1
vote
2answers
52 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
38 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
27 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
183 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
10 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
22 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
17 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
15 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 ...

15 30 50 per page