3
votes
2answers
56 views

Unexplained log ship slow down

I have a number of SQL 2008 instances all running Microsoft SQL Server 2008 (SP4) (confirmed with select @@VERSION on the servers in question). They run on either Windows Server 2008 or Windows ...
1
vote
0answers
21 views

TokuDB table stats show 1 row

I have a few Percona 5.6.28 servers with a TokuDB table that has ~120 million rows. On some of these servers, row count in SHOW TABLE STATUS mysteriously dropped to 1. This is accompanied by rather ...
0
votes
1answer
10 views

shipping data without impacting performance

I am new to DBA - actually deputising for a colleague on maternity, Im a sql developer. My company, an on-line retailing coy wants to move copies of our databases from our prod server to a back up ...
4
votes
1answer
82 views

How do I set a SQL Server Unicode / NVARCHAR string to an emoji or Supplementary Character?

I want to set a Unicode string variable to particular character based on its Unicode code point. I want to use a code point beyond 65535, but the SQL Server 2008 R2 database has a collation of ...
0
votes
0answers
34 views

SQL Server Join the same table twice with different filters [on hold]

I'm working on a query right now that requires me to filter joined data differently for multiple aggregate columns, so I'm joining the same table twice and applying a filter only one one of the joins. ...
5
votes
1answer
161 views

sp_who returns more rows than the value of “max degree of parallelism”

sp_configure returns the following values on a server. name minimum maximum config_value run_value max degree of parallelism 0 32767 8 8 However, ...
1
vote
0answers
19 views

psql in windows

I want to connect to Amazon Redshift and run scripts like exports to s3 and loads through command line. is psql the only way to go? If that is the case, is there a package that would install just ...
0
votes
1answer
26 views

sql auth vs nt auth in SQL server

Ok, so everything I read says best practice is to us NT authentication in SQL server. And I can see some advantages to that but using NT auth how do I force users to access the data using only my ...
1
vote
1answer
13 views

Is there a way to set bind_address from command line in mysql 5.5 without restarting?

I made a modification to bind_address in my.cnf that knocked down a monitor. It has been repaired since, firewall allowing the monitor IP in. However, mysql is still running in its previous state ...
0
votes
2answers
48 views

Improving query performance on mysql star catalog

I have a mysql database that contains a table with roughly 645 million records. I am trying to improve the query performance. Below is the SQL for the table as well as the indexes I use. CREATE TABLE ...
0
votes
2answers
28 views

Can multiple Oracle databases share a single parameter file?

I'm a developer working on an application team that supports a system with one production database and 4 test databases (2 Dev, a SIT and UAT environment). The prod database exists on it's own Unix ...
0
votes
1answer
10 views

Powershell: Does System.Data.SqlClient.SqlDataAdapter usange in powershell need some ADO.Net installation?

In PowerShell, goal is to query some data from Sql Server and put that into a preformatted Excel file. Towards that, the following PowerShell script snippet, throws an error saying "assemblies are ...
1
vote
0answers
34 views

Is there a cheap way to bulk select/insert data between SQL Server instances?

In my office, our employees use applications that are consistently writing transaction-type data to a number of databases on a SQL Server 2012. The traffic consists mainly of inserts and updates but ...
3
votes
1answer
48 views

Create a hierarchy chain (reverse path) for each node in a tree

Given a typical closure table, how would I write a query to get a list of ids back to the root? Is there a way to do that for all the [unique] ids? I'm using Microsoft SQL Server. Given: parent ...
0
votes
1answer
61 views

Slow SQL Server 2008 R2 backups after Windows update

I recently installed a series of Windows Updates on our SQL Server 2008 R2 server. Note, these were not SQL Server updates, they were just the usual monthly Windows updates. These updates included a ...
0
votes
0answers
26 views
+50

Simplify Month Over Month % Change, 4 Months Moving Average %

invoice created_at | amount | status | ------------+--------+--------- 2016-06-01 | 50 | 2 | 2016-05-30 | 150 | 2 | 2016-04-29 | 32 | 2 | 2016-03-28 | ...
1
vote
0answers
37 views

Why is my server with memory pressure when I have 4.3GB available memory? [duplicate]

I'm doing a couple of tests in my local computer and I noticed that the plan cache was being wiped every couple of minutes. After researching a bit I noticed on my error log that my instance was with ...
1
vote
1answer
24 views

Change column from NOT LOGGED to LOGGED

I have a database DAT1 running on DB2 version 10.5. I want to enable logging for all CLOB and BLOB columns of my table TAB1. The table was initially created with those columns as NOT LOGGED but now I ...
1
vote
0answers
20 views

Optimal query to show active records by date

I'm trying to determine what the optimal query might be for associating a date with a record that would have been active for that day. Here is a setup to demonstrate what I'm trying to do (demo at ...
0
votes
2answers
19 views

Query Amount of entries per column from multiple tables + provide table name

I have five tables with all having the same column (objart): I queried for the number of entries and combined the result with UNION, which worked well. Two questions: 1) Is there a shorter/ better ...
0
votes
1answer
15 views

Perfomance of CREATE INDEX vs CREATE INDEX CONCURRENTLY in PostgreSQL

I know CREATE INDEX CONCURRENTLY is slower, but how many longer it will takes to finish in comparison with the traditional CREATE INDEX? 40% more or much more than that? I am creating an index in a ...
0
votes
1answer
28 views

dropping SYNONYM is blocking in sql server?

I have synonyms which points to a TestDB1, by the next refresh synonyms point to TestDB2. while re-pointing from TestDB1 to TestDB2 it will drop all synonyms and re-creates them for TestDB2. Now my ...
0
votes
0answers
10 views

HOW TO RESTORE THE DATABASE OF 1 DB TO ANOTHER NEW DB? IN ORACLE 11G using RMAN AT WINDOWS [on hold]

I am new to DB field and becoming DBA. Can you please assist me to resolve this issue? Actually I have taken the backup of working database using RMAN, and I have created the new database but I ...
0
votes
0answers
16 views

Multiple Database Environment with External Activator

I am trying to create an infrastructure with External Activator and MSSQL 2008 R2. Currently we have one server hosting multiple instances of a database environment: Dev, Test, and Production. We ...
1
vote
1answer
13 views

MySQL: with CREATE_USER_PRIV, GETTING “Access denied” when attempting to change another user's password

In MySQL 5.6.27, user 'bmcrae' has create user privileges and is able to create a new user. However, when trying to change another user's password: SQL: SET PASSWORD FOR 'newuser' = ...
0
votes
1answer
44 views

Index Reorganize/ Rebuild Time

I have maintenance job on SQL Server 2012 Enterprise Edition that runs daily to check index fragmentation and reorganize or rebuild the index based on the percentage of fragmentation. I used this ...
0
votes
0answers
15 views

After crash, lost Postgresql data

I was developing a Rails application with pg when there was a power loss. After turning on my computer again I was having: psql: could not connect to server: No such file or directory. Is the ...
0
votes
0answers
29 views

How can I detect if a function is built in to MySQL/MariaDB?

Is there a way I can detect if a function is built in, in MySQL/MariaDB? I'd rather use feature detection than version string matching in my application. I know about the responses here for user ...
1
vote
1answer
46 views

Oracle index with REGEXP_REPLACE is it a good idea?

I have a table of contacts with 1 million registers and now the user wants to search in it by the telephone. Trying to avoid a fullscan I decided to create a new index in this column, but the trick ...
0
votes
0answers
3 views

MongoDB Initial Sync failing repeatedly

I have a one member mongod instance (Server1) with a very large DB with 2.5 million documents (Each document is very big) and 4 indices. Then I added another machine (Server2)to this replica set. ...
1
vote
3answers
111 views

Oracle union default sort is weird [on hold]

As you know union removes duplicated rows. I thought it removes from the latter ones, but it doesn't. I found out that if there's no order by clause, Oracle sorts the merged dataset by the first ...
6
votes
1answer
648 views

Simulate deadlock with more than 2 processes

How to Simulate deadlock with more than 2 processes in SQL Server test environment? Can someone help me with the code? Just to clarify my question again, I don't want deadlock simulation with only 2 ...
1
vote
0answers
11 views

How to prevent SSDT publishing from dropping columns

I want to create a publishing profile that DOES a complete schema comparison and publishing BUT does not drop any tables or any columns that have been removed between the old and new version. I am ...
1
vote
1answer
101 views

Select the maximum aggregate value for a limited set of chunked/grouped rows in a large database?

I work on WordPress plugin which implements sitemap functionality. One of the steps is to build an index of sitemap pages for post entries. The logic required is roughly: determine last modified time ...
1
vote
0answers
35 views

MySQL - Find bookings free time slot

I am trying to find free time blocks on a day between the business hours (08:00 to 18:00) of a service station. The schema of the database is as below, CREATE TABLE IF NOT EXISTS `Bookings` ( `id` ...
0
votes
0answers
16 views

Oracle schema for educational Purpose [on hold]

Is there any schema other than HR in the oracle database.? I am learning something, Just wanted to explore other scenarios other than HR. Thanks AK
8
votes
1answer
285 views

Is the WHERE-JOIN-ORDER-(SELECT) rule for index column order wrong?

I am trying to improve this (sub-) query being part of a larger query: select SUM(isnull(IP.Q, 0)) as Q, IP.OPID from IP inner join I on I.ID = IP.IID where ...
1
vote
1answer
37 views

What could cause a text comparison to fail?

DB Version: PostgreSQL 8.2.15 (Greenplum Database 4.3.4.1 build 2) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Feb 10 2015 14:15:10 I'm having a problem in one of our ...
1
vote
1answer
100 views
+100

Dropping PLE on query

In company we are working in project on very big database. It uses 100GB RAM. What's weird before first running a query PLE is 11k~, after running it drops to about 70, anyway when after 15 mins I ...
3
votes
0answers
106 views

Best procedure to measure query optimization effects?

I could not find valuable answers or explanations to the following question: How should a procedure to test query improvements effects look like? Using SSMS I am not absolutely sure about the steps. ...
1
vote
0answers
31 views

Move SQL Server cluster from one location to other

I am looking for ideas on how to move SQL Server 2012(standard) two node cluster installed on Windows server 2012 standard to other location which is far away from current location. The two locations ...
1
vote
2answers
45 views

How can I stop Oracle Shutdown command?

I used Shutdown normal, instead of Shutdown immediate. Now I want to stop the process, because its taking too long. How can I do it?
-1
votes
0answers
15 views

Installing a Failover Cluster Instance on a Cluster already in use for Instances hosting Always On

I have been asked to install a SQL Server FCI on a 3 nodes cluster already hosting 4 different instances with Always On Availability Groups. While I am building the lab on my machine, I am wondering ...
0
votes
1answer
24 views

MySQL binary log - write operation

Consider a scenario, where you have a MySQL master and slave server in replication. As we know, binary log enabled on the master and the slave reads from the binary log of the master. From MySQL ...
0
votes
1answer
15 views

Chained MySQL replication from Master->Master replicated pair

This is a pictorial view of what I have: Master 1<----->Master 2 | | | | V V Slave 1 Slave 2 The masters are never written ...
0
votes
0answers
11 views

What is the best practice of storing mysql connection details to use in ruby/python scripts

I have ruby and python scripts that connect to mysql DBs. They are controlled in github and can populate to different servers. They run in a schedule way (not adhoc). What is the best practice of ...
2
votes
1answer
28 views
+100

Increase in IO Wait after adding indexes with postgres

I've recently been put in charge of a system that has been fairly untended for a period of time. The majority of activity is via queued worker jobs based off of data feeds from other systems/data ...
0
votes
1answer
40 views

How to delete duplicate records in my database? [duplicate]

I joined about 12 databases into 1 db and in each database I have some duplicate records. How can I delete all duplicate records in my joined database? For example, I want to delete duplicate ...
0
votes
1answer
22 views

Checking for BCNF in a relational database through FDs?

Okay so I know that for BCNF, when listing all non-trivial FD's that everything to the left has to be a candidate key. So I have this relation: Person(Id, TFN, Name, Phone) Where Id and TFN(Like ...
0
votes
0answers
25 views

Should I use mysql stored procedure or regular inline statement?

So here is the problem: I have been currently working on a project that would be handling millions of data and thousands of records would be inserted as well as retrieved at the same time. Before ...

15 30 50 per page