0
votes
0answers
4 views

Oracle Restoring Database on Existing Dtabase or rename database

I want to change my DB name in Oracle. i am using ****nid TARGET=SYS/welc0me12$@CSPROD DBNAME=CSGOLD SETNAME=Y**** after that i am geeting error Datafile ...
0
votes
1answer
9 views

MySql - Get all children in JOIN if one child matches a condition

I have a one-to-many relationship between two tables Parent and Child. I want to get all children if one child matches a condition. Something like below: SELECT * FROM Parent p INNER JOIN Child c ON ...
0
votes
0answers
12 views

Which Isolation Levels are Appropriate when using SQL Server Service Broker?

What affects does each isolation level have on the various SQL Server Service Broker statements? More specifically, which isolation levels might be considered "dangerous" or otherwise cause bizarre ...
1
vote
0answers
8 views

Using schema + Filegroups or entirely separte database(same instance) to partition some big tables?

I have the following challange: I have a staging database which holds a few big tables (on SSD) but I start to run out of space on the SSDs. I use SQL server 2014 BI-Edition (=Standard Edition for ...
0
votes
0answers
8 views

Mysql Disk Scanning algorithm

How mysql scans data from disk? What scanning algorithm it uses to scan from disk? Since the rows are stored in data pages will it read the entire data page to get the resulting rows?
1
vote
1answer
24 views

Why PostgreSQL scans a lot of rows?

I have not a big table with only 135000 rows inside. Here is schema id integer NOT NULL nextval('history_sum_id_seq'::regclass) zone_id integer NOT NULL spot_id character varying(24) ...
0
votes
0answers
11 views

Is there an equivalent of 'FORMATFILE' in MySQL?

I'm looking for a way to import data from a text file to a MySQL database, the text file used to be imported in a SQL SERVER db via BCP and FORMATFILEs option for exemple : BULK INSERT [Table_1] ...
2
votes
1answer
16 views

Query Exceeding Query Timeout on Linked Server and Working

Currently we have a SQL Server Agent job that executes a stored procedure that reads data over a linked server. Initially on our test server this was timing out at 10m:17s (617 seconds). We changed ...
1
vote
3answers
199 views

what is causing arithmetic overflow in the query below?

when I run the following query on MY_Database select * from sys.sysfiles I get the following results: But when I run a dynamic query that gets the percent of free space I get: Msg 8115, ...
1
vote
1answer
30 views

Building new version of a table and replacing the old one by rename, is it a good idea?

We have a slightly heavy table which is semi-frequently (every ~5 minute) being recreated by a procedure. I wondered if there was something that could be done in order to minimize the downtime during ...
1
vote
1answer
27 views

SQL log file growing exponentially

We have a SQL database on FULL back up with a client and they have NOT implemented a Log file maintenance and noticed that the log file grows exponentially, filling the 20GB they have allocated to it ...
-1
votes
2answers
15 views

How to select sets of rows for which some condition is met for each of sets?

Question title might no be clear, sorry for that, but I don't know how to describe my problem. I have following table: create table test ( company_id integer not null, client_id integer not ...
0
votes
1answer
5 views

How to find all records in mongo db whoese primary key is a user defined character string

I would like to know the command to find all records in mongo db whose primary key(_id) is a user defined character string. Or Find all records where all primary keys(_id) are not 12-byte BSON type. ...
1
vote
1answer
31 views

Group by other table with sum function

I have a query that pulls in a delivered count of a campaign. Each run is a new row in the runs table. To retrieve a campaign I need to join the related table in. SELECT c.Company, r.RunId, ...
1
vote
0answers
6 views

mysqldump show Table doesn´t exist when doing LOCK TABLES

Our server had power outage and after start some of mysql tables was inaccessible. I tried many things but nothing helped and currently i am at freeze point. I used command : mysqldump database ...
1
vote
0answers
9 views

Database Designs Alternative to Polymorphism in Establishing Relationships

I'm working on a database which handles replacement of parts in a machine. Rules A machine has many components A machine has a set of assembly instructions Many components have many part (screws, ...
0
votes
1answer
14 views

Restoring a mysql database using --single-transaction

I learned that specifying "--single-transaction" (yes we do have InnoDB) option into the mysqldump tool produces a dump utilizing transactions. However, I am failing to find a way to restore the ...
0
votes
2answers
31 views

Shrinking sql databases - bad idea?

So I have a database, that due to some silly code issues has grown hugely. It is now sitting at 24gb, most of it is VERY unnecessary log info. My server lives on a cloud hosted server. I am now ...
0
votes
0answers
10 views

pgAdmin crashes or freezes when big MATERIALIZED VIEWs are refreshing

I'm using pgAdmin III v1.22.1 on Windows 7 to connect to a PostgreSQL server version 9.4.8 on Red Hat. We have scripts to REFRESH MATERIALIZED VIEWS during the night. When they are refreshing, I ...
2
votes
1answer
84 views

Create a function to generate a column value in a specific format

I am new to databases or, in fact, programming. I want to create a function or maybe a stored procedure (if it works) to insert/create default values for a column of the users table. In this table, ...
0
votes
1answer
22 views

What happens when the buffer pool size is insufficient in mysql

Let us assume I run a query for a table whose size is very huge. My buffer pool size is as low as possible. What happens now? whether I will get an error regarding the insufficient space in buffer ...
1
vote
1answer
17 views

Combining multiple-row data into a single row

I have a table that has columns like following ID Number Value1 User1 Value2 User2 Value3 User3 -- ------ ------ ----- ------ ----- ------ ------ 1 123 0 Jack 1 123 ...
0
votes
0answers
10 views

Tag system for multiple Item types and groups Schema

I have a groups table and users table, and a many to many relationship between them. In my app, there are different modules, like question, product,suggestion , etc. Users can create ...
2
votes
1answer
48 views

Drop 15 days records in monthly partition

I have created a monthly partition on my table like below: PARTITION BY RANGE (PARTITION_KEY) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH')) ( PARTITION MayPartition VALUES LESS THAN ...
1
vote
0answers
16 views

Re integrate MSSQL 2008 to new Active Directory

I have a server which was joined to an AD Domain, then installed with MSSQL Server 2008 R2 and System Center Operations Manager 2012's Reporting Server on it. The same server had the Active Directory ...
0
votes
0answers
28 views

Freezing Centos server

My dedicated server (CENTOS 6.4) freeze every two day and I have some trouble to found te origin. What I know : This is not hardware issue as tests were made about (RAM, CPU, Discs, ...). At the ...
0
votes
1answer
15 views

Get the highest value [duplicate]

I have the following data: account_id note_id size id ---------- ------- ------ -------- 48 1554 196036 28229509 48 1554 18777 28229588 48 1554 4861 28229566 ...
0
votes
1answer
37 views

Insert into multiple tables with one query

I would like to add data to at least three tables with one query. I thought of something like this: WITH ins AS ( INSERT INTO core.adr (street, "number", postal_code, city) VALUES ('test ...
0
votes
0answers
35 views

Shrink Log file in an Always On Availability Group [duplicate]

My LDF file is too big (almost 500 GB) because we had some problems. I know that is not good to shrink files, but we need to do it this time. My database is using the FULL recovery model and is in ...
1
vote
0answers
24 views

Linked server to Availability Group Listener - is anyone successfully using one?

I edited the question hoping to check the basic stuff first. Does anyone have linked servers that successfully work with Availability Group listener? Have anyone heard of problems with linked ...
-1
votes
0answers
16 views

WSFC Quorom query - 2012 R2 [on hold]

I have an three node AlwaysOn AG setup, running on SQL Server 2012 SP3 in Windows Server 2012 R2. Node 1 and Node 2 are in the same physical location. Node 2 is the secondary replica. Third node acts ...
0
votes
0answers
6 views

How to Create Flexible Dataset Reports using SQL ERP system as Datasource? [on hold]

I need to create flexible financial "cost centre, budget and general ledger" reports which can be easily 'sliced and diced' using a SQL ERP system as the data source. I need to create and map 400 ...
0
votes
0answers
9 views

Redshift Queues

I'm brand new to RedShift and am trying to debug why our systems are running very slowly. I've noticed that we have around 50 users and hundreds of daily reports running, all of which take substantial ...
0
votes
1answer
37 views

Need sample script for Cluster index scan

Do we have any example which is behaving as cluster index scan when ever queried with range of values. I am trying to get the conclusion on optimizer behavior as when ever the select count increases ...
1
vote
0answers
13 views

pub/sub database schema

I am having a hard time creating a pub/sub database schema with stateful metrics. Saying it aloud it sounds easy enough: "There are many organizations that will subscribe to checklists that are ...
1
vote
2answers
49 views

What is the easiest way to make SQL Server backup and send them to Dropbox?

I have three SQL Server databases and I need to make a full backup once a day, differential every 4 hours and transaction log every 30 minutes. How can I do it in automatically? Should I use any ...
1
vote
0answers
9 views

Can a BRIN index be used instead of Table Partitioning in Postgres?

Given an append only table with a GUID and a timestamp (and a bunch of other columns) which can grow by ~50Mio entries / year. I want to keep the number of indices low and just use a normal (B-Tree) ...
0
votes
1answer
22 views

Creating trigger to manipulate language

This is the table that I have. Effective date is a user input, then I need to use a trigger that produces Print depending on the language the user inputs (English or French only). For English, I used ...
0
votes
2answers
27 views

sp_configure: Preserve values of 'xp_cmdshell' and 'Show Advanced Options'

I dont want to disturb the server values of xp_CMDShell & Show Advanced options. The criteria is to use SQL to run a batch file. This is the script i am trying to solve it with: DECLARE ...
1
vote
2answers
63 views

Why is it faster to do four simple selects instead of one select with left joins?

I need to find a single value from a table A containing three foreign keys to two other tables B and C. For the sake of experiment, I tested two ways to query the value: Multiple queries: declare ...
0
votes
1answer
24 views

Inserting two tables together with no id or unique anything

Lets assume we have two tables table1 Name Height Age Mary 1.60 18 Mary 1.62 19 Mary 1.68 20 John 1.80 17 John 1.85 18 John 1.86 19 and table2 Name Height Age Mary 1.60 18 Mary 1.62 19 Mary 1.68 ...
1
vote
0answers
19 views

Getting InnoDb internal Errors on every query run

I am having following errors in error.log at the run of each query due to which I am not able to use error.log properly. 2016-05-30 09:39:58 7f7c7e3cb700 InnoDB: Error: Column last_update in table ...
0
votes
0answers
20 views

Decompose the relation R into 3NF

I have a relation R(A,B,C,D,E) with set of functional dependencies A->BC, CD->E and B->D. My Method:- As we know Relation R is in 3NF if it satisfy below condition:- R is in 2NF There is no ...
8
votes
2answers
288 views

Odd Stream Aggregate behaviour

Query: declare @X xml = ' <item ID = "0"/> <item ID = "1"/> <item/> <item/>'; select I.X.value('@ID', 'int') from @X.nodes('/item') as I(X); Result: ----------- 0 1 ...
0
votes
2answers
35 views

Sorting by month by chronological occurrence when the year doesn't matter?

Given a table with a date column, and given a query that selects dates in a given range of the year (like "November 20th through February 20th"), and where the year portion of the date doesn't matter ...
0
votes
0answers
16 views

Mysql/pivot table for two tables

I was trying to get multiple rows into single row with dynamic columns created as per the data.i have two tables combined with foreign key.here is my data follows table 1: | id | name | Invoice value ...
0
votes
0answers
24 views

Unique Clustered Index and Unique Non Clustered Index [on hold]

What is the basic difference between Unique Clustered Index and Unique Non Clustered Index ? I would understand it much better and clearly if a simple basic example of SQL Server code for both Unique ...
0
votes
1answer
11 views

Error installing Oracle Database Client 12c: “OracleMTSRecoveryService Control Utility has stopped working”

The installation of the "Oracle Services For Microsoft Transaction Server" component fails when I attempt to install Oracle Database Client 12c (12.1.0.2.0) on Windows Server 2012 R2. When ...
3
votes
2answers
149 views

Clarification on Clustered index scan and Clustered Index Seek

I have created one table with 80000 records with Cluster Index on CustomerID column. When I queried the following statements the execution plan behaves in differently. Can anyone clarify the same. ...
0
votes
0answers
13 views

PostgreSQL Redhat Cluster Implementation(Active-Passive) With Streaming Replication setup For DR failover

We have a scenario Where Customer is looking For Cluster kind of solution with DR failover Setup. I am Planning to suggest the attached Architecture with customer. Few Clarification as per ...

15 30 50 per page