dialog
listlengths
4
30
title
stringlengths
15
150
category
stringclasses
14 values
dialog_time
stringdate
2016-01-21 01:59:30
2018-07-01 01:34:46
[ { "message": "I've read too many horror stories to even touch any T-SQL command with <code>SHRINK</code> in it, but I need to sort out a number of my SQL Server 2008 databases that have bloat.My databases consist of a simple set of tables, which have primary keys and standard indexes added onto these tables.Wit...
Scared of ShrinkDB so will this alternative be OK?
dba
2017-08-02T11:15:32.137
[ { "message": "We have a cluster of 3 Mongo 3.2.13 instances running with journaling enabled, with hundreds of DBs and collections which are accessed simultaneously.We are checking the option to disable journaling, to improve the cluster's performance. According to the docs, WiredTiger performs a checkpoint ever...
Disable Journaling in MongoDB + WiredTiger
dba
2017-08-02T11:17:13.910
[ { "message": "The <a href=\"https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-tracking-sql-server\" rel=\"nofollow noreferrer\">Change Tracking feature of Sql Server allows to identify the modified rows of a modified database copy.This is obviously helpful for sync jobs, as th...
Incremental sync for Sql Server
dba
2017-08-02T12:25:15.847
[ { "message": "Under the Registered Servers window, I switched to Reporting Services and created a new server registration. By way of trial and error I figured that the Test button would succeed if I entered <a href=\"http://ip_address/ReportServer\" rel=\"nofollow noreferrer\">http://ip_address/ReportServer for...
How can I register an SSRS server in SSMS and connect to it?
dba
2017-08-02T14:16:02.350
[ { "message": "I'm attempting to create a GIN index for full-text search on a field that may have text in it that is one of several different languages. The languages are pre-set and we'll know which language we want to search in at query time. Here is the schema I've got thus far...<pre><code>CREATE SCHEMA so...
Using SELECT within to_tsvector call in CREATE INDEX
dba
2017-08-02T15:05:34.587
[ { "message": "Running into some odd behavior. I have two tables <code>product</code> and <code>product_description</code> with the following structures (some irrelevent columns omitted for brevity):<pre><code>CREATE TABLE `oc_product` ( `product_id` int(11) NOT NULL AUTO_INCREMENT, `price` decimal(15,4) NOT N...
MySQL explain results different after adding and then removing index
dba
2017-08-02T20:33:24.883
[ { "message": "I have a monitoring system. Retrieves the user's location every 5 seconds. However, I want to show only the records that appear in the range and every 15 seconds. Maybe I'll choose a start date and an end date to show these values.... I'm trying to make this filter and I'm not getting it.I have th...
How to return some * data with time interval?
dba
2017-08-02T22:54:44.867
[ { "message": "I have a database which has two filegroups (both r/w), each with two files. The backup sequence was:Full Backup Several transaction log backups (tlog set1)Full Backup of file1 of filegroup1Several transaction log backups (tlog set2)Full Backup of file2 of filegroup1Several transaction log backups ...
Piecemeal restore of entire database - fastest way to roll forward and restore multiple files
dba
2017-08-03T18:44:16.157
[ { "message": "I have a postgresql 10 installed and I want to hide the name of users/roles to other users. I searched through other posts and somebody suggested this:<pre><code>REVOKE SELECT ON pg_catalog.pg_authid FROM public;REVOKE SELECT ON pg_catalog.pg_auth_members FROM public;</code></pre>After doing all o...
Postgres 10. Hide users/roles from other users
dba
2017-08-04T23:13:42.000
[ { "message": "I'm relatively new to T-SQL and looking through my predecessors scripts, I found a line I can't quite parse. It's a hard thing to look up on my own. Hoping for advice. This line occurs inside a WHILE loop, but I don't think that matters. I believe functionally, that this is gathering the values fr...
Using X at the end of a SELECT in SQL Server Script?
dba
2017-08-07T17:33:10.117
[ { "message": "I have a configuration where one database is log shipping to three different servers hosted in a disaster recovery site. These three disaster recovery servers are joined to the same AlwaysOn availability group (AG).In the event of failover, we recover the database on the server acting as the prim...
Problem joining log-shipped secondaries in STANDBY to AlwaysOn group
dba
2017-08-07T20:43:49.410
[ { "message": "This question is further to my previous question answered very well by @ypercube <a href=\"https://dba.stackexchange.com/questions/182789/insert-into-table-where-boolean-value-in-another-table-is-true/182808?noredirect=1#comment353020_182808\">hereI have been trying to work out the easiest way to ...
Insert incoming data (and pk from 2nd table) into 1st table if true boolean value from 2nd table
dba
2017-08-08T05:44:13.557
[ { "message": "I've been reading the high performance mysql book by Baron Schwartz and after reading about how important it is to set the log file size correctly, I thought I'd take a look at one of our servers at work. I am trying to improve server performance by fixing the bad configuration from a former emplo...
Trying to make sense of the InnoDB log file stats
dba
2017-08-08T15:39:25.420
[ { "message": "I have 2 columns in the database for events.agelow (int)agehigh (int)How it's structured:<code>agehigh</code> is being used for \"and under\" which is represented by 0 in the columnthe high age is placed in the agelow columnThe \"and over\" is represented by 99 and is not a problem since it has th...
Age range on age range in WHERE to heavy - POSTGRES
dba
2017-08-08T17:28:10.227
[ { "message": "i've realized that one of my mysql slaves has missing rows.select count on specific table on master:9605010on slave:9593831slave is completely sync,no seconds_behind_master,no errors,no slow logversion on both master and slaves:mysql Ver 14.14 Distrib 5.6.35-80.0, for debian-linux-gnu (x86_64) us...
Data drift on Row-Based-Replication
dba
2017-08-08T17:53:57.823
[ { "message": "I have a database design and I'm having trouble with two tables. I have a Users table, and a Properties table. The Properties table may only have 0, 1, or 2 users, let's call them owner and tenant, and only one of each (per property), and a User may be an owner or a tenant in many Properties.So, h...
How to model the relationships (a) between properties and owners and (b) between properties and tenants?
dba
2017-08-08T20:10:48.013
[ { "message": "I have set up a mongo cluster as follows:3 shards, one per global region APAC/EMEA/AMER (in different data centres)Shard Key is REGION + 'MONOTONICALLY INCREASING PRIMARY KEY'The \"writing\" clients for the cluster [typically] connect to the mongos in their region, and will be writing documents wi...
How to define shardKey on GridFS collections to achieve Location/Data Centre affinity (MongoDB)
dba
2017-08-09T06:31:11.750
[ { "message": "I have a dedicated schema <code>extensions</code> (PostgreSQL v 9.6.3) where I intend to install all extensions for my DB. I would like to somehow disallow (or at least remind) users installing extensions without specify particular schema.So this should fail<pre><code>CREATE EXTENSION tablefunc;</...
PostgreSQL event trigger to force extension installations into particular schema
dba
2017-08-09T15:59:36.080
[ { "message": "If I run the undocumented <code>DBCC LOGINFO</code> against my database one of the fields returned is CreateLSN. This is the LSN in the format 1629000000070500011 at the time the VLF was created. Now it is a long time later and the auto grow values of Disk Usage report are long gone. I want to...
Convert CreateLSN of DBCC LOGINFO into time
dba
2017-08-09T17:42:00.730
[ { "message": "I have a query that gets about 80k rows from said table with about 3m. I only need to paginate ten rows at a time, but with <code>ORDER BY (a+b) DESC</code> (<code>a</code> and <code>b</code> are <code>integer</code> type columns.)Right now my query's taking about 4 seconds to do this. If I <cod...
Why is my PostgreSQL expression index not being used when I ORDER BY in a subquery?
dba
2017-08-11T20:17:54.580
[ { "message": "I have <code>TableA</code> with <code>Col1</code> as the primary key. I am running the following transaction without committing it (for test purposes). <pre><code>BEGIN TRANSACTIONUPDATE TableASET Col3 = 0WHERE Col2 = 'AAA'</code></pre>In the meanwhile, I run the following query and see that it wa...
UPDATE Blocking SELECT Of Unrelated Rows
dba
2017-08-14T18:12:36.517
[ { "message": "I am trying to get my head around how to have a simple recovery solution for mysql databases in case of accidental deletion. Let's just say for argument's sake that you are an admin of a 800 gig database and one day you or someone accidentally deletes a table or a hundred rows. Here are two potent...
DB replication and recovery of a previous version in mysql
dba
2017-08-15T23:03:11.447
[ { "message": "I want to iterate the table names that are listed in a table and create one view that has all of the info listed. I have the cursor set, I have the base of the view set, but how would I modify the syntax to add a UNION ALL statement instead of repeating the Create View statement?This is the synta...
Use Dynamic SQL To Create View From Cursor
dba
2017-08-16T14:29:03.843
[ { "message": "Im using MaridaDB 10, but my question applies to all mysql variants.I have large dataset (70GB uncomressed when dumped to file).The mysqldump process takes 2-3hours. The restore process takes even longer 10-14 hours.I have a nfs share I use for syncing data between many servers. My question is spe...
mysqldump file restore while sql is still being dumped
dba
2017-08-16T17:38:18.280
[ { "message": "Recently I've migrated some schemas from <code>mysql 4</code> instance into an instance of <code>mysql 5.6</code> by <code>mysqldump</code> and import operations. After some syntax adjustments, I could import the dump file successfully. After the import, I went over the log file and i found some i...
Issues after schemas migration from mysql 4 to mysql 5.6
dba
2017-08-17T08:53:35.773
[ { "message": "Quick question. I'm using Ola's solution and with the full backup job for user databases, is there any issue scheduling these at the same time? I saw another thread on here that mentioned that it will just backup each DB one after the other but wanted to confirm?Thanks!", "role": "user" }, ...
Schedule Full Backups
dba
2017-08-17T21:34:51.083
[ { "message": "I am doing a manual comparison of the logins and jobs between Principal and Secondary server, when doing database failover from P to S. I copy both the logins and jobs from one server to excel and compare them to those on the other.Could someone please suggest a way to automate at least part of th...
Best approach to find missing logins and missing jobs between principal and mirror server
dba
2017-08-17T22:20:18.827
[ { "message": "I create one simple Full Text Catalog on a varchar(500) filed, which mainly store address text like 24 King Street Melbourne VIC 3000. The catalog is set to auto track changes. But I found there are always a few records in the table are not indexed by Full Text Catalog after I fully populate it.Fo...
SQL Server 2008R2 Full Text Catalog Missing Records
dba
2017-08-18T05:56:39.130
[ { "message": "I've a table (locations) which contains records as given below:<pre><code>id | lat | lng | radius_in_km-----------------------------------------1 | -18.17943 | 83.968051 | 52 | 44.5796 | 7.069637 | 10</code></pre>Now, I've got a point (lat, lng) from Google and I need to f...
Fetch rows which belongs to a certain geo location
dba
2017-08-20T18:23:06.270
[ { "message": "When I tried to execute query I got the below error.<pre><code>SELECT * FROM OPENQUERY([TESTORACLE], 'select * from TESTTABLE')</code></pre><blockquote> Cannot initialize the data source object of OLE DB provider \"MSDASQL\" for linked server \"TESTORACLE\".</blockquote>I have created DSN...
linked server connection error in Sql server
dba
2017-08-21T10:22:10.207
[ { "message": "I'm facing a rather strange issue with Transaction Log Shipping reports in SSMS which is showing multiple red alerts of databases that have been created and deleted while performing multiple Log Shipping scenario between two servers.<br>I've used the following post:<a href=\"https://dba.stackexcha...
Log Shipping: Bulk Remove Alerts of already deleted primary and secondary databases
dba
2017-08-21T12:40:14.357
[ { "message": "To simplify the situation, I will only consider one large table...<br>On a nightly basis a store will send all the new and changed data for one day for a large table to the head office. (this portion is good) Also, the store sends a summary of that table for the last 30 days to the head office for...
A performance Issue when querying a big table using a PK/clustered index
dba
2017-08-22T14:29:55.117
[ { "message": "We’ve been utilizing Ola Hallengren's maintenance scripts for our index optimization for years on our OLTP databases. (we are on sql server 2008 R2)2 weeks ago though one of the DBA’s here has created a maintenance job to update statistics separately and this runs weekly before the Index optimiza...
Could an update on all statistics separately cause bad performance?
dba
2017-08-22T17:05:35.067
[ { "message": "I have a toy Cassandra cluster running on some RaspberryPis at home. I am currently logging CryptoCoin data to it in hopes of learning more about Cassandra and as well as some other things along the way. My question here today is to find out if I am structuring my schema correctly on this one tabl...
ALLOW FILTERING vs NOT; Cassandra Data Model Question
dba
2017-08-23T01:20:00.323
[ { "message": "Is there any correlation between [tempdb] getting full and subsequently db_mail disabled ? [This needs sysmail_start_sp to be executed in msdb]", "role": "user" }, { "message": "Yes there is correlation between tempdb and db_mail.Ref:<a href=\"https://technet.microsoft.com/en-us/libra...
Any correlation between tempdb and sysmail?
dba
2017-08-23T13:49:47.530
[ { "message": "I am very new to SQL and database servers. I have recently been using SQL Server Express and accessing my database using SQL Server Management Studio on Windows. I am now trying to achieve a similar setup on a Linux machine.I would like to create a local SQL Server instance on the machine, and the...
Connecting to a local MS SQL Server from a GUI client
dba
2017-08-23T14:09:48.447
[ { "message": "I am attempting to prepare and restore a full backup taken through xtrabackup via a scheduling script called <a href=\"https://github.com/sixninetynine/surrogate\" rel=\"nofollow noreferrer\">surrogate.I have tarred and gzipped the backup, transferred to a local machine running the same setup (asi...
Percona xtrabackup transaction log corrupted
dba
2017-08-23T15:22:54.210
[ { "message": "Below Steps I Did<pre><code>EXEC sp_changedbowner 'domainname\\user' </code></pre>... to change the principal owner.It was executing for a long time so i cancelled it. While closing the tab it asked me to save the uncommitted transactions, so I saved them. Later when I checked under the database s...
User is not showing for abc database under security folder but when we query from sys.databases it showing as a db owner
dba
2017-08-24T07:26:30.300
[ { "message": "Is there a standard approach to monitor the performance of an application and its database, which is still in design? What I'm doing so far: I develop queries and tests directly in mysql workbench and monitor the msec used per query. On top of that I'm using mocha tests in node.js to test the data...
How to monitor the performance of a mysql database during development?
dba
2017-08-24T14:41:17.940
[ { "message": "I'm creating a function to find out what search pattern would best fit a single string. The string to match will be compared against a table of what could be possibly hundreds of possible patterns to see if it matches any of them.I've got a not-so-elegant function working right now that will read...
Efficient way to see what pattern matches a single word
dba
2017-08-24T17:01:45.133
[ { "message": "I have 6 columns in Postgres table:<pre><code>A1 character varying(5)[]A2 character varying(5)[]A3 int REFERENCES ... -- FK B1 character varying(5)[]B2 character varying(5)[]B3 int REFERENCES ... -- FK </code></pre>I need a <code>SELECT</code> where the first row matched is the winner (limit 1)wit...
How to force order of WHERE clauses in PostgreSQL?
dba
2017-08-24T18:20:48.000
[ { "message": "How could my MySQL database on Amazon RDS have recently gone from 10.5 GB free to \"storage-full\" status within about 1.5 hours?It's a 15GB MySQL 5.6.27 database running on a db.t2.micro instance. Normally only a few hundred KBytes gets added to it per day.About a day ago the free storage space w...
What can cause a rapid drop in RDS MySQL Database free storage space?
dba
2017-08-24T21:05:39.637
[ { "message": "First, I want to list databases with a specific table:<pre><code> SELECT nameFROM sys.databasesWHERE CASE WHEN state_desc = 'ONLINE' THEN OBJECT_ID(QUOTENAME(name) + '.[dbo].[TB_INF_CLI]', 'U') END IS NOT NULL </code></pre>Then, I want to use the <code>database_name<...
Run a query in loop, with the results of another query
dba
2017-08-25T20:11:12.363
[ { "message": "I would like to do a 'group by' on the following example tableInput:<a href=\"https://i.stack.imgur.com/8NzCo.png\" rel=\"nofollow noreferrer\">Output:<a href=\"https://i.stack.imgur.com/xTMZy.png\" rel=\"nofollow noreferrer\">[Low] = Min of [Low] column[High] = Max of [High] column[Symbol][Epoch]...
Returning columns based on various conditions in Group By
dba
2017-08-26T13:23:32.730
[ { "message": "I would like to do a 'group by' on the following example tableInput:<a href=\"https://i.stack.imgur.com/8NzCo.png\" rel=\"nofollow noreferrer\">Output:<a href=\"https://i.stack.imgur.com/xTMZy.png\" rel=\"nofollow noreferrer\">[Low] = Min of [Low] column[High] = Max of [High] column[Symbol][Epoch]...
Returning columns based on various conditions in Group By
dba
2017-08-26T13:23:32.730
[ { "message": "I'm not a DBA and need some help here... I have a high traffic WordPress site hosted in a EC2 instance. We are working in a new theme code that will have optimized queries, but right now I need to keep the legacy code with lots of slow queries like this (that are called 3 times in each page load):...
InnoDB memory/cpu use optimization for WordPress with MySQL
dba
2017-08-26T13:57:28.580
[ { "message": "These are the tables I have created and inserted the values accordingly:<pre><code>CREATE TABLE Customer(Customer_No INTEGER IDENTITY (1,1) PRIMARY KEY, Customer_Name VARCHAR(30) NOT NULL)CREATE TABLE DVD(DVD_No INTEGER IDENTITY (1,1) PRIMARY KEY, DVD_Name VARCHAR(30))CREATE TABLE DVD_Purchase(DVD...
SQL query to display names of customers who have purchased all the DVD
dba
2017-08-28T07:59:56.693
[ { "message": "My question is about the default isolation level: \"read committed\".As I understand, during a read committed transaction, when we update a record, the system puts a lock on that record, so other transactions would wait.Is this correct?Other: and there's a limit in the config file for the maximum ...
What happens when the lock limit is reached?
dba
2017-08-28T10:21:55.947
[ { "message": "I have a database with nearly 100M rows of stock data. Pulling the data for the last 7 days to generate a chart takes a couple seconds.My thought is to create partitions that represent the normal chart periods (1 day, 1 week, 1 month, 6 months, 1 year, for example).How does MySQL handle new data f...
How do partitions handle new data?
dba
2017-08-28T14:03:09.937
[ { "message": "I have a postgres database running on my application, and the postgres partition is 100% full. Upon checking the files in pgdata directory is see below files occupying lot of space.<pre><code>smsstoregt1 ins /postgres/pgdata/base/16384&gt; du -skh * | grep -i M589M 16400244M 16405</code></pr...
postgres database disk issue
dba
2017-08-29T11:08:24.737
[ { "message": "I can't seem to find this simple fact anywhere.I have a fact table like such in SQL server.<pre><code>fact_pickedEmp_Name Date Apples_PickedJohn May 1 17 100</code></pre>And a type 2 dimension table like this<pre><code>dim_companyEmp_Name Company Effective_SinceJohn Bl...
Join Fact table to SCD Type 2 ... how to write query? (SQL Server)
dba
2017-08-29T22:20:09.343
[ { "message": "Is is possible to get the column types and names from a <code>select</code> statement in <code>MySQL</code>?E.g.,<pre><code>SELECT t.first_col, t.third_colFROM my_table tWHERE t.id = 1</code></pre>And then I would send that to <code>MySQL</code> and have it tell me.<pre><code>column_name | type ...
MySQL Return Column Types from Select Statement
dba
2017-08-29T23:18:13.527
[ { "message": "I have a MongoDB database installed and configured, but I have a very big problem regarding security.I have enabled authentication and created a bunch of users, each with its own permissions, everything ok there, now my problem is that if a bad guy gets access to my server, he can simply restart t...
Localhost exception in MongoDB
dba
2017-08-30T12:50:17.397
[ { "message": "I've seen this question here (and elsewhere), but it doesn't really answer the question I'm trying to answer. <a href=\"https://dba.stackexchange.com/questions/68383/how-can-i-tell-how-many-cores-sql-server-is-actually-using/\">How can I tell how many Cores SQL Server is actually using?I already k...
How can I tell how many Cores SQL Server, at peak, it is using?
dba
2017-08-30T13:46:15.807
[ { "message": "Does using the <code>in</code> operator affect the use of indexes? For example, is it possible for <code>WHERE id IN (10)</code> to cause the optimizer to ignore an index?Specifically, I'm trying to understand <a href=\"https://stackoverflow.com/a/45989185/4458445\">this answer from StackOverflow....
Does using the in operator affect the use of indexes?
dba
2017-08-31T21:01:52.473
[ { "message": "I have a function that accepts as parameter an array like:<pre><code>CREATE OR REPLACE FUNCTION my_func(some_data custom_datum[]) RETURNS VOID AS $$ BEGIN create table foo_table as ( select coalesce(foo_ind, bar_ind, ter_ind) as foobarter, import_date, ...
Array exceed allowed size in Postgres
dba
2017-09-01T15:36:03.033
[ { "message": "I have just downloaded a large xml file and most of characters appear as \"�\". I changed the encoding but there was no improvement. Anyone knows what this might be due to?One fishy thing: the file does not start as a usual xml, but rather as: \"� m�Y �/opt/cds-invenio/var/www/dumps/.HepNames-reco...
Invalid characters in xml
dba
2017-09-03T21:08:14.887
[ { "message": "How do I achieve with MySQL to have peer to peer data shared between network? Let's say I have 5 different nodes of MySQL servers and would like the data to be shared peer to peer rather than master-slave or multi-master having all transactions data integrity in check.If you can show steps or even...
PHP MySQL peer to peer
dba
2017-09-05T08:06:39.010
[ { "message": "I have a few databases in which the frontend application manages certain maintenance tasks. In this particular instance, I'm running the INDEX OPTIMIZE job every night and every so often it clashes with the application and fails.The following is the error that I receive:<pre><code>Msg 50000, Leve...
How do you skip databases with Ola.Hallengren's scripts?
dba
2017-09-05T20:12:37.490
[ { "message": "This is tested with PostgreSQL 9.6, but it's a general SQL question.Is it possible to use self-joins of the recursive table in a recursive CTE (rCTE)?I tried the following rCTE containing a self-join of the recursive term <code>x</code>,<pre><code>WITH RECURSIVEx (id) AS ( SELECT 1 id UNION ALL S...
self-joins in recursive CTE: `recursive reference must not appear more than once`?
dba
2017-09-05T23:06:49.690
[ { "message": "I have a database with three tables: <code>books</code>,<code>authors</code> and<code>books_authors</code> <code>books_authors</code> is a “junction” table (i.e., it represents a conceptual level many-to-many relationship), so if it has a row with <code>book_id=1</code> and <code>author_id=5</code...
How to handle variations of the same data point?
dba
2017-09-06T01:54:08.603
[ { "message": "There is a scenario where we have 5 member replica set across two data centers.<br>Data center 1 : 3 Members<br>Data center 2 : 2 Members<br>Situation is if DC 1 goes down DC 2 becomes read only but we need to keep it ready to accept writes also.<br>Is there any possibility for same using one ext...
Keep Mongo DB set up up and running with two data center always
dba
2017-09-06T04:54:24.630
[ { "message": "I need a way of getting a unique count of <code>ek</code> that is associated with each <code>userid</code>My desired output is:<pre><code>74123 3</code></pre>But I can not seem to get the syntax for the Distinct count accurate. I can only get it to return the TOTAL count which is not what I am...
Get Count From UserID
dba
2017-09-06T14:09:05.640
[ { "message": "I have the following <code>product</code> table<pre><code>| product_id | sku | created_at ||------------ |----- |------------ || 145687 | abc | 2017-08-08 || 22456 | xyz | 2017-09-01 || 6553214 | asd | 2017-09-05 |</code></pre>I want to get output a...
MySQL function: Get string/number separated by some place holder
dba
2017-09-07T11:46:39.873
[ { "message": "A similar question has been asked before but I've been having trouble adapting those answers to my question.I want to find rows on consecutive dates, where another column has the same value, and return that as a single date range.I have tried using <code>OVER</code> and <code>PARTITION BY</code> a...
Find a date range from rows with consecutive dates and identical column values
dba
2017-09-07T17:32:00.550
[ { "message": "I am using PostgreSQL 9.6 and have following schema<pre><code>CREATE TABLE activitylog ( sessionid text NOT NULL, studentid integer NOT NULL, activity text NOT NULL, created timestamp without time zone DEFAULT now() NOT NULL);</code></pre>The schema is used to log visitors activity. Ea...
How do I add extra columns to crosstab()?
dba
2017-09-07T22:14:20.553
[ { "message": "I have a XML response with this structure but with some 150 different nodes:<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;Orders&gt; &lt;Order&gt; &lt;OrderID&gt;334&lt;/OrderID&gt; &lt;AmountPaid currencyID=\"EUR\"&gt;17.10&lt;/AmountPaid&gt; &lt;UserID&gt...
T-SQL dynamically import XML into tables (SQL Server 2014)
dba
2017-09-08T01:13:37.490
[ { "message": "My SQL Server 2008 R2 keeps recording these error in the SQL Server log:<blockquote> Error 600122, severity 11, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.</blo...
How to resolve Error 600122, severity 11, state 1 was raised
dba
2017-09-08T18:00:00.860
[ { "message": "I am literally new to this topic. Here is my deadlock graph contents. could someone help me figure out what is the cause and what options are there for me to resolve this deadlock ? <pre><code>&lt;deadlock-list&gt; &lt;deadlock victim=\"process29b0cf8\"&gt; &lt;process-list&gt; &lt;process id=\...
Deadlock scenario - what is the root cause - what are the options to resolve?
dba
2017-09-08T18:22:23.967
[ { "message": "Let's consider a table like that:<pre><code>id | name 1 | This is a test sentence 2 | is a sentence TeST 3 | This a IS test sentence 4 | iS a tEst sentence tHis 5 | This a test sentence is</code></pre>How could I achieve to get all the rows, searching for \"is a sentence test\"?I am usi...
SQL regex PostgreSQL
dba
2017-09-08T19:13:05.277
[ { "message": "I want to setup a user in MongoDB. This user will not have admin database access. But it uses admin as authentication database. It will fail to connect the mongoDB by this command <code>mongo --host localhost admin</code>. Instead, it can use this command to connect to <code>test</code> database: ...
How to set up a user who doesn't have `admin` database access but use it as authentication database?
dba
2017-09-10T01:34:56.400
[ { "message": "I want to setup a user in MongoDB. This user will not have admin database access. But it uses admin as authentication database. It will fail to connect the mongoDB by this command <code>mongo --host localhost admin</code>. Instead, it can use this command to connect to <code>test</code> database: ...
How to set up a user who doesn't have `admin` database access but use it as authentication database?
dba
2017-09-10T01:34:56.400
[ { "message": "We have some problems regarding balancer configuration.Our application which is set up with secondaryPreferred often fails to read documents from the secondary when balancer( chunk migration ) is running.So I changed the Balancer setting to the appropriate setting as below, but I could observe the...
The reading with secondaryPreferred when chunk migration occurred often fail
dba
2017-09-11T05:02:43.800
[ { "message": "I'm running mongo 3.4.7 (WiredTiger) replica set with two secondaries.According to the <a href=\"https://docs.mongodb.com/manual/reference/write-concern/#replica-sets\" rel=\"nofollow noreferrer\">docs, when journaling is enabled and write concern is <code>{w: \"majority\", j: 0}</code>, the ack i...
MongoDB Write Concern when Journaling is off
dba
2017-09-12T11:59:47.753
[ { "message": "I’ve implemented the XE to capture blocking on my instance (as per this great article <a href=\"https://www.brentozar.com/archive/2014/03/extended-events-doesnt-hard/#comment-2470072\" rel=\"nofollow noreferrer\">https://www.brentozar.com/archive/2014/03/extended-events-doesnt-hard/#comment-247007...
dm_db_index_operational_stats showing more blocking than extended event report
dba
2017-09-12T16:08:56.950
[ { "message": "I am using this connection uri to connect to mongodb: <code>mongodb://user:password@localhost/admin</code>. It will use <code>admin</code> as bot authentication and target database. How can I make the uri to use <code>admin</code> as authentication but allow me to connect to a different database? ...
How to specify authentication database and target database separately on mongodb connection uri?
dba
2017-09-13T00:30:44.937
[ { "message": "I know that MongoDB has master-slave architecture and Cassandra has peer to peer architecture. I didn't find any resources about Vertica's architecture. Is that master slave or peer to peer?<br>Does Vertica cluster allow multi-read and multi-write?", "role": "user" }, { "message": "T...
Vertica-cluster architecture
dba
2017-09-13T07:27:23.057
[ { "message": "I know that MongoDB has master-slave architecture and Cassandra has peer to peer architecture. I didn't find any resources about Vertica's architecture. Is that master slave or peer to peer?<br>Does Vertica cluster allow multi-read and multi-write?", "role": "user" }, { "message": "A...
Vertica-cluster architecture
dba
2017-09-13T07:27:23.057
[ { "message": "Software Name: Oracle SQL Developer Version 17.2.0.188I have three tables: <code>orders</code>, <code>order_details</code>, and <code>products</code>.I wanted to run a query to update <code>units_in_stock</code> in the <code>products</code> table based on <code>quantity</code> in <code>order_detai...
Update values in one table based on contents of another
dba
2017-09-14T12:47:24.510
[ { "message": "We are having trouble with simple updates on a single table taking a long time. The table contains ~5 Million rows.Here is the table:<pre><code>CREATE TABLE Documents ( GeneratedKey varchar(32) NOT NULL, SourceId int(11) NOT NULL, Uri longtext, ModifiedDateUtc datetime NOT NULL, Ope...
MySQL - Simple update is very slow
dba
2017-09-14T14:10:09.790
[ { "message": "I'm new to programming and databases and working on my first application using .Net, Entity (for SQL Server) and Identity.My application will allow users to create html pages for online courses. Think of it like a course content management system. Instead of users (instructors) having to know HTML...
My first database schema design
dba
2017-09-14T19:36:20.037
[ { "message": "Query below has fixed length values for data set being returned in a string, now the problem is that fixed lengths are not being honored in the query results. But the output text file produced by DB mail looks correct. See examples below:<pre><code> SELECT LEFT(CONVERT(char(9), machi...
Query Output Window not honoring fixed length
dba
2017-09-14T23:24:32.690
[ { "message": "I have a PostgreSQL database with a <code>history</code> table where I store an <code>fooID</code> (not a primary key serial but a text), an attribute <code>target</code> and the current timestamp whenever the <code>target</code> for this <code>fooID</code> changes:<pre><code>CREATE TABLE history ...
Better database for "keep always the 5 latest entries per ID and delete older"?
dba
2017-09-15T09:33:17.223
[ { "message": "In my database error logs (produced as in <a href=\"https://dba.stackexchange.com/questions/35015/log-all-errors-in-queries\">this answer), I see many instances (hundreds per day) of the following query:<pre>declare @HkeyLocal nvarchar(18)declare @ServicesRegPath nvarchar(34)declare @SqlServiceReg...
Investigating errors from strange query
dba
2017-09-15T13:32:11.957
[ { "message": "I analysed a huge query in DTA. The database is kind of badly designed and does not have primary keys on tables, also they dont have clustered indexes on them. I found around 80 tables as such. Now, without indexes the queries are obviously going to run slow but when I put them through the DTA, it...
Database Engine Tuning Advisor
dba
2017-09-15T14:44:53.707
[ { "message": "Take a table <code>foo</code>,<pre><code>CREATE TABLE foo(a,b,c,d)AS VALUES (1,2,3,4);</code></pre>I can insert into <code>foo</code> with a row type..<pre><code>INSERT INTO foo SELECT (foo).* FROM foo;INSERT INTO foo SELECT (v).* FROM ( VALUES (42,42,42,42) ) AS v;</code></pre>But I can't...
Is there anyway to UPDATE a series of columns on a row with a composite type record/row?
dba
2017-09-15T15:07:41.040
[ { "message": "I have SQL Server 2016 RTM installed and would like to update it to SP1. When I run an SP1 cumulative update, it fails because there is nothing to update. Presumably this is because it needs SP1 to be installed first. When I run the SP1 installer, it wants to create a new instance.How can I update...
Update SQL Server 2016 from RTM to SP1
dba
2017-09-17T10:11:18.590
[ { "message": "I have an update query below written in Microsoft Access and I would like toconvert that to Oracle SQL Developer 17.2.0.188.<br>There is also an image in the attachment showing the query expression.<br><a href=\"https://i.stack.imgur.com/e0jXc.jpg\" rel=\"nofollow noreferrer\">The query said: \"up...
How to convert an Update a query from MS Access to Oracle SQL Software
dba
2017-09-18T12:56:21.637
[ { "message": "I've written these two queries for same operation, on the basis of time complexity, i want to know which one is efficient.<pre><code>select Fname, Lname, Address from (select * from department d, employee e where d.Dnumber = e.Dno) as a where a.Dname = 'Research';</code></pre>Edit: on the basis of...
Which query is optimized
dba
2017-09-18T12:57:53.297
[ { "message": "I'm noticing this wait stat on my Azure SQL database, and I've never seen it before. I've tried Googling this wait stat but haven't been able to come up with any good information on what this is, although I saw a couple mentions of it possibly being related to exceeding the Azure performance tier ...
LOG_RATE_GOVERNOR Wait Stat
dba
2017-09-18T13:17:03.023
[ { "message": "I'm noticing this wait stat on my Azure SQL database, and I've never seen it before. I've tried Googling this wait stat but haven't been able to come up with any good information on what this is, although I saw a couple mentions of it possibly being related to exceeding the Azure performance tier ...
LOG_RATE_GOVERNOR Wait Stat
dba
2017-09-18T13:17:03.023
[ { "message": "Given two similar tables, <code>metrics_a</code> and <code>metrics_b</code>, PostgreSQL 9.6:<pre><code>create table metric_a ( logdate date not null; point_id int4 not null; m00 numeric(9,5) not null; ... m23 numeric(9,5) not null; CONSTRAINT metric_a_pk PRIMARY KEY (logdate, poi...
Store two metric sets long or wide if frequently joined?
dba
2017-09-18T16:24:26.543
[ { "message": "Need an advice from SQL Server Experts. I'm just a developer, not a DBA, so pardon my ignorance.My environment consists of 2 equal instances (Node1 and Node2) of SQL Server 2008 R2 x64 (10.50.4339.0). I have 2 databases: DB1 and DB2 with <code>Full</code> recovery model. Both databases participate...
Database with replication and mirroring stuck in LOG_BACKUP after log file shrink
dba
2017-09-19T14:28:54.770
[ { "message": "I want to insert record into a table in my remote database table.", "role": "user" }, { "message": "Ooo, bad news - this means you're using a trigger:<pre><code>from ZTable Zhinner join inserted</code></pre>If you're trying to work in a trigger, that means there are other changes to ot...
Cannot insert record in remote database - Linked server
dba
2017-09-19T17:15:54.130
[ { "message": "Are there any solutions more efficient than simple <code>INSERT INTO</code> or exporting and importing files to move millions of rows from a table with 3 columns to a similar table in another database, without blocking the destination database and not losing any of the records in transactions that...
Transfering a table with millions of rows in a fast efficient way without blocking
dba
2017-09-20T10:04:38.383
[ { "message": "Create Security Policy without schemabinding?Is this a bad idea? I have an indexed view in another database that I need to use in my security predicate for row level security. I can either turn off schemabinding and use a synonym, or I have to start using transactional replication to copy to a tab...
Create Security Policy without schemabinding
dba
2017-09-20T10:14:56.143
[ { "message": "We have a small three member replicaset running MongoDB 3.4:Primary. Physical local server, Windows Server 2012, 64 GB RAM, 6 cores. Hosted in Scandinavia.Secondary. Amazon EC2, Windows Server 2016, r4.2xlarge, 61 GB RAM, 8 vCPUs. Hosted in Germany.Arbiter. Tiny cloud based Linux instance.We have ...
MongoDB replication throttled due to Mongo using all system memory
dba
2017-09-20T11:38:44.213
[ { "message": "I have Login Audits for both failed and successful. How do i view the actual logs? Where are they located? <a href=\"https://docs.microsoft.com/en-us/sql/ssms/configure-login-auditing-sql-server-management-studio\" rel=\"nofollow noreferrer\">https://docs.microsoft.com/en-us/sql/ssms/configure-log...
View SQL Server 2016 Login Audits
dba
2017-09-20T13:22:56.453
[ { "message": "There is db space challenge at hand on Azure SQL Server database. 490 GB out of 500 GB is used. That's what I read from nice pie chart on Azure portal.Notice that some of the techniques used on-prem won't work for Azure SQL Server Database.Biggest table is <code>DidbStudySerumLevelDeviation</code>...
How to reclaim database space on Azure SQL Server after setting nvarchar values to null
dba
2017-09-20T16:54:41.500
[ { "message": "Using SQL Sever 2016 at AWS on I3 32 cpu 240GB 2012R2 server.We have import process that inserts as select 100,000s or rows into table A. Users when they log in need to update table A. Import process is is causing lock escalation since it uses more than 5000 locks. This blocks users from loggin...
What is disadvantage of disabling lock escalation in SQL Server 2016
dba
2017-09-21T01:58:03.547