0
votes
0answers
7 views

T-SQL for Query that can be done in SQL. What do they want?

We are given tables Vendors(VendorId, VendorName, ..) , Invoices(InvoiceId, VendorId...) I am going over a book exercise that asks for a T-SQL statement to find all vendors with at least one invoice. ...
1
vote
0answers
9 views

When do you know that you've made a design flaw in a SQL/relational database?

I've been working with a a relational model for a work project over the last few months, and I've gotten to the point where I'm wondering if I've made a mistake in my model's design or implemented ...
3
votes
2answers
10 views

Queries without Good Enough Plan Found

I have a SQL Server 2012 database. I noticed value of Reason for early termination of statement optimization for some queries and all gave Good Enough Plan Found. Now my questions are: What are all ...
2
votes
2answers
24 views

T-SQL : Is string a Palindrome?

I am a beginner in T-SQL. I want to decided whether an input string is a palindrome, with output =0 if it is not , output =1 if it is. I am still figuring out the syntax. I am not even getting an ...
0
votes
1answer
7 views

Complex MySQL query through relational tables

I am generating a query that returns a set of profiles that meet all the conditions posted below I am receiving the data like so in Ruby, then making a dynamic MySQL query based on the contents - ...
0
votes
0answers
14 views

Connecting 2 databases using sp_addlinkedserver

I have 2 servers and I want to connect to them using this: exec sp_addlinkedserver 'myserver1.dyndns.biz'; exec sp_addlinkedsrvlogin 'myserver1.dyndns.biz' , 'FALSE', NULL, 'remoteuser', ...
2
votes
0answers
14 views

Improve query “JOIN … WHERE NOT EXISTS (SELECT 1 FROM … WHERE … )”

I'm trying to optimize a query because the plan generates a full table scan for a subquery. Data The (simplified) table structure: CREATE TABLE RECORD ( ID INTEGER PRIMARY KEY AUTO_INCREMENT ); ...
-6
votes
0answers
13 views

Components of Time Variant Data [on hold]

Specify components that would be required to hold time variant data for policy enforcement and training management
0
votes
0answers
18 views

Service Desk SLA Report

I need assistance with regard to a DBA task. I need to create an SLA report that will show incidents that were resolved after the SLA period which is 4 hours. I am using SQL Server 2014 with a Heat ...
4
votes
1answer
72 views

Table Relationship - One to Few (Many)

I know the title may seem confusing but I have yet to find a solid answer to this design pattern. Let's say I want to create an Employee table and have multiple addresses for each employee. So this ...
2
votes
1answer
22 views

Monitor if sqlserver is up from distant server using sqlcmd

I want to monitor if my sqlserver is up from a distant machine. I currently send a simple "select @@version" query with sqlcmd and then validate if that query returned the expected part of text : ...
0
votes
0answers
8 views

MySQL/JDBC: Can a commit on server get missed on client?

I am wondering about when conducting a transaction of one or two updates/inserts from a JDBC client to MySQL Server over the network... In the event of losing the network during the commit, can I get ...
0
votes
2answers
27 views

AlwaysOn Async read takes more time when compared to that of Sync secondary [on hold]

AlwaysOn Async read takes more time when compared to that of Sync secondary (by a small fraction). Is this expected behaviour? I was under the impression that ASYNC must be faster than the SYNC.
1
vote
2answers
97 views

Return multiple columns (int datatype) inside a CASE expression

How can I get multiple columns from a CASE expression? with cte as ( select ROW_NUMBER() over (order by id)'Rownumber', id from dbo.Test ) select case when (b.id-a.id) > 1 ...
1
vote
0answers
15 views

what problems can arise switching database from db2 9.7 to 10.1

Currently my database is created on db2 9.7 version and its working fine. I have taken the backup of my database and now I wants to uninstall db2 9.7 version from my sytstem and again will be ...
1
vote
1answer
10 views

Cassandra change replication factor hive datastore

I am trying to change replication factor of HiveMetaStore but I receive this message: cassandra@cqlsh:system> alter KEYSPACE HiveMetaStore with replication = {'class': ...
0
votes
1answer
21 views

i can not load back table with new primary key [on hold]

When I try to load table from dump file, primary key removed. My original file name is stream and db name is MySQL. I am using command prompt and trying to import from there. Can you give exact ...
0
votes
0answers
17 views

Can we export data from PostgreSQL to xlsx file?

I want to export the result of a query to xlsx file format. I know we can export it to csv file, but I want to export it to xlsx file. Like the following: copy(select name_related from ...
0
votes
0answers
3 views

pt-duplicate-key-checker - DBD::mysql::db selectall_arrayref failed: MySQL server has gone away

I run pt-duplicate-key-checker a few months ago successfully. Now I receive on the same database (Galera, RHEL7) those errors DBD::mysql::db do failed: MySQL server has gone away On CLI I can do use ...
0
votes
2answers
33 views

Poor performance of JOIN, WHERE, ORDER BY combination (MySQL)

Goal: select 10 most recent rows from posts which are related to a specific user. There are two tables: posts (~5,000,000 rows) and relations (~8,000 rows). posts columns: ...
0
votes
0answers
9 views

How to use column result as column name with MySQL [duplicate]

At the moment I have sample table as such doc_name | processed_date | doc_version ---------------------------------------- doc_1 | 2015-01-01 | 1.0 doc_1 | 2015-01-02 | 1.1 doc_1 | ...
0
votes
1answer
38 views

Sanity Test on Oracle Upgrade Database

My oracle sever has been upgraded from Oracle 10g to 12c. DBA has created a box for that now my question is how developers will perform testing on that.. Can anyone provide me the sanity or unit ...
0
votes
1answer
12 views

Monitor locks over long period of time

I am having some issues with one of my tables in a production server. I know there are many diffrent threads running on this table. I need to put some kind of monitoring tool to see how many locks ...
0
votes
0answers
13 views

Error connecting from other SQL instance using powershell script

I have a job to run a powershell script that will rebuid fragmented index through source SQL instance to target SQL instance. The poweshell script didn't run due to the following error: Sqlcmd: ...
0
votes
1answer
38 views

Select multiple columns from subquery - Connect by

I have a table which manage folder structure hence has parent child relationship and we trigger a query to sum all document in the complete heirarchy SELECT folder_name name, document_count, ...
0
votes
0answers
10 views

How to tune MySQL Data engine Innodb

Queries are taking a long time, so I figure out that maybe there is a tunning issue. SELECT CEILING(SUM(data_length+index_length)/power(1024,3)) Buffer_Pool_SIZE FROM information_schema.tables WHERE ...
2
votes
1answer
19 views

How to append datetime in filename in postgresql

How to append datetime in filename in below command: COPY (select query) To '/tmp/test.csv' DELIMITER ',' CSV HEADER; I want my filename like test_date_tim.csv.
1
vote
1answer
24 views

How to select redundant rows

Suppose a table data recording values of some foo and bar over time: time | foo | bar -----+-----+---- 1 | a | a 2 | a | a 3 | a | a 4 | B | a 5 | B | a 6 | a | a 7 | ...
0
votes
0answers
8 views

how to tune Mysql when storage engine is MyISAM

MyISAM queries results too slow,What changes should i make, if Ram 16GB DB 500GB mysql> SHOW STATUS LIKE 'key%' +------------------------+-------------+ | Variable_name | Value | ...
0
votes
0answers
16 views

Oracle database in maintenance mode without patch

I could not enable maintenance mode in oracle database without patch Also I don't have patch(Since I don't have Support Identifier). @$AD_TOP/patch/115/sql/adsetmmd.sql ENABLE SP2-0310: unable to ...
1
vote
1answer
12 views

I have a query which does not return result with the desired alias names of columns in PostgreSQL

The following is my query which does not return result with the desired alias column names: with d as (select distinct emp.ahrims_id, rank.name as rank from hr_employee as emp, ana_rank as rank, ...
0
votes
0answers
7 views

Cassandra query performs differently at different times

I am using apache-cassandra-2.0.12 in production, with network topology strategy and ReplicationFactor : 3 in a cluster with 2 DC’s each contains 4 nodes While analyzing the response time for the ...
0
votes
0answers
3 views

MongoS server not starting also not balancing Server's sharding metadata manager failed asking for instance is manually reset

My MongoS servers are not staring they are sending this error in logs. SHARDING [Balancer] caught exception while doing balance: Server's sharding metadata manager failed to initialize and will ...
-4
votes
1answer
31 views

Disk Space issue [on hold]

I am facing one problem regarding Disk Space issue. One Disk size is 249 GB,it contains only .mdf files. Now the Disk utilization is 84%. How can i reduce Disk utilization less than 80%.
0
votes
2answers
22 views

Slow query / Indexes creation (PostgreSQL 9.2)

I have the following Query: explain analyze SELECT split_part(full_path, '/', 4)::INT AS account_id, split_part(full_path, '/', 6)::INT AS note_id, split_part(full_path, '/', 9)::TEXT ...
2
votes
0answers
11 views

Does issuing DDL against a view in PostgreSQL take out the same locks as issuing DDL against a table?

I understand that views are implemented using the rule system but I'm unclear if this has any advantages/disadvantages when running transactional DDL against them. Does issuing CREATE OR REPLACE VIEW ...
2
votes
1answer
36 views

What happens when two separate processes perform a full backup against the same database?

I have an instance of SQL Server 2012 RTM running. I have two separate applications that want to do a backup of a database lets call them "AppFull" and "AppFullCopyOnly". AppFull does a full ...
2
votes
2answers
60 views

Can we commit the transaction when the sql server trigger fails?

I am trying to avoid data loss when the insert trigger on a table fails. I am trying this with the following scenario and my code is failing. When an insert happens on the Customers table, I want to ...
0
votes
0answers
17 views

Manual sync between 2 SQL server databases [duplicate]

I will not go in details and explain everything. For some (not good) reason I need to maintain 2 databases synchronized together. The full database schema may be different but not on table I want to ...
1
vote
1answer
25 views

TSQL Solution to backup ALL databases on ALL instances of a server?

I'm pretty sure what I'm wanting with my current implementation is impossible, the sys.databases catalog view which is scoped at the service level to be aware of other SQL Server instances (lol). But ...
0
votes
0answers
10 views

Time Series on Postgresql

I am developing a software that have a dataset time series like this: id_equip, Timestamp, Double v1, ..., Double v30 The size estimate is 5.000.000 rows by year and the time of response is very ...
0
votes
1answer
31 views

Get dates between two months

Can I know why am I getting weird output in my SQL statement whereby my table has two dates of the month May but it only appears for one month, the same things I test for dates range it is working. ...
0
votes
0answers
8 views

How to set up Amazon RDS parameter group for Postgres?

I'm trying to create a parameter group in Amazon Web Services for an Postgres 9.5 RDS instance. I'm a little confused by the units being used for things such as shared_buffers and min_wal_size. ...
0
votes
0answers
5 views

Python and SQL exception handling when internet cuts out

I have a python temperature monitoring program that runs every 30 seconds on my raspberry pi, and uploads the data to an SQL server. I am using try: and except: however this doesn't handle if the ...
0
votes
0answers
9 views

Generate UUID v4 automatically in MySQL

Is it possible to generate a UUID version 4 (completely random) in MySQL? I would like to use it as a primary key. Use Case Many systems will insert to the table, some may specify a UUID when ...
1
vote
0answers
21 views

See Full Exception String In Error Message

Right now I am trying to use HTTPGETCLOB function to pull data from an API. The problem is that the resulting error message does not show the whole exception string from the server. Below is the error ...
3
votes
1answer
62 views

Slow Delete's of LOB data in SQL Server

I have a tables for logging, and a stored procedure to purge old data that has very slow DELETE performance, beyond what makes sense to me. I am looking for how to modify the tables or DELETE ...
1
vote
1answer
54 views

what does “\” symbol mean? [on hold]

I am new to database learning and came across this \ symbol. I googled but couldn't find what it meant. It was used in the context Q = R\S, where Q, R, and S are relations. (The = sign here means ...
0
votes
0answers
14 views

Maximum number of TEXT/BLOB columns per table/performance of table with many of them?

I've created a system that generically imports CSVs into a database table with metadata columns for keeping track of when a CSV record has been changed, and it allows filtering on CSV columns instead ...
3
votes
1answer
29 views

Do temporal tables log changes when there are none?

Unfortunately I don't have ready access to a SQL 2016 instance to test this. If I had a temporal table with the following schema: create table blah ( foo int identity(1,1), baa int ) and I ...

15 30 50 per page