0
votes
0answers
4 views

Copy data from one table into other on some condition

I have two table as follows. Table : city city_id city_name state_id 1 Cachar 1 2 Darrang 1 3 Nicobar 1 Table 2 : locality pincode Address ...
0
votes
0answers
11 views

Which columns need index in recursive table and soft delete

I have a Category table like below : I have a recursive relationship on this Category table. I use soft delete in my project. I have 2000 rows in Category table. When I want to show data in a UI ...
0
votes
0answers
6 views

Recursive Conditional trigger for insert in table MYSQL

user[ user_id, parent_user_id] user_id parent_user_id 1 null 2 1 3 1 4 1 5 1 user_assigned_role [user_assigned_role_id, role_id, ...
0
votes
0answers
2 views

WSREP: Requesting state transfer failed: -11(Resource temporarily unavailable)

We have a 3 node Galera cluster. Only one node has "valid" data (gal-1). The other nodes need to sync from this node. I delete datadir and start MariaDB. 160527 14:28:20 [Note] WSREP: discarding ...
0
votes
0answers
3 views

mongodb compact does nothing - no entry in mongodb.log and nothing in db.currentOp()

We have space problems. The actual data size is only 5 GB, but disk size is 15 GB because of deleted documents. MongoDB (3.0.6) runs in docker container where we can't extend volume. # tail -f ...
0
votes
1answer
17 views

Mixed mode auditing - 12c

Oracle 12c database comes with default Unified auditing enabled even if we set it to FALSE which has ORA_SECURECONFIG policy enabled by default. Apparently, the audit options for that particular ...
0
votes
0answers
3 views

MongoDB ixscan seems to be scanning more objects than expected

I'm using MongoDB 2.6.12 and a collection has the following index {a: 1, d: -1}. In case the types matter a is a Number and d is a Timestamp. From what I can see in the code we are limiting this ...
0
votes
1answer
18 views

RMAN Overhead on the database

What is the overhead of RMAN hot backup (full backup including archive logs) being performed during business hours? Does it actually affect the performance of the database? What is the case when ...
1
vote
1answer
20 views

Could someone explain how PHP, MySQL, SQL work together?

I feel so confused on what they are and how they work. From what I've read PHP is a server-side language. Therefore, it's a language basically designed to talk with the web server to get it to do ...
0
votes
0answers
6 views

Long queries on PostgreSQL hot standy

Is there a way to convince PostgreSQL to execute long queries on a hot standy? It kills the query with User query might have needed to see row versions that must be removed. I understand that, but I ...
0
votes
1answer
19 views

SQL PIVOT multiple columns

so this: so I need: any suggestions?
0
votes
0answers
9 views

Update column with different value for multiple rows

I often find myself using excel to create update queries. When I need to update multiple rows with different values for a column, I simply use excel to create the update queries (multiple). Here's ...
1
vote
1answer
19 views

Why doesn't Oracle show my privileges?

I have a user that is able to drop, alter, create tables and indexes. But when I list the privileges for my Oracle user it does not show any CREATE TABLE or other such privileges. How am I able to do ...
0
votes
1answer
16 views

How to export own objects using expdp without special privileges?

As per this post on Oracle forums expdp can be used to export your own schema without any special privileges: It all depends on what you want that user to be able to export/import. If all that ...
0
votes
1answer
13 views

PostgreSQL vs MariaDb On Read/Write when table has about 200M Rows

I want to build a new web application with my collected data, but I don't know witch DBMS is best choose for my Project, MariaDB or PostgreSQL there is 2 table : categories and data more than 200 ...
0
votes
1answer
8 views

Migrating differential backup restoration

Good afternoon, A little back story about what I'm trying to do: I'm migrating a database environment from one SQL server to another. A simple full backup/restore works fine, but there's a ...
0
votes
0answers
20 views

Singe database account for all users

Welcome everyone, I'm wondering if one common database account for all users of web application is enough or I should create database account for each user in order to carry out some querying? Can ...
0
votes
0answers
8 views

PostgresSql - Flattening nested JSON arrays

Interesting problem trying to query nested arrays stored in JSON... Context I'm using PostGreSQL to navigate some data I'm pulling from a server. After doing some reading, I think my issue revolves ...
0
votes
0answers
13 views

Grant access schema to user

Getting error while writing the following query SQL>grant select, insert, update, alter, delete on schema::schema_name to user; showing as missing keyword –
0
votes
0answers
13 views

Multiple SQL Server instance install question for AlwaysOn

I have a 2 node WSFC cluster with SQL Server 2014 installed on each for AlwaysOn. This is working fine. My question is can I install another instance of SQL Server 2014 on these nodes for another ...
2
votes
3answers
25 views

Clustered Index Scan when using greater than in WHERE clause

I have the following table create table t1( col1 varchar(255) NOT NULL, col2 varchar(255) NULL, col3 bigint NULL, CONSTRAINT PK_t1 PRIMARY KEY CLUSTERED ( col1 asc ) ) CREATE NONCLUSTERED INDEX ...
2
votes
1answer
17 views

Optional Parent-Child relationship

I have a problem modeling a relationship whereby the child may or may not be related to a parent. For example. You have a Band database with a Tour(parent) table, and a Gig/Concert(child) table. Now, ...
2
votes
2answers
45 views

Why is .bak file size increasing/doubling with each consecutive backup on SQL Server?

I'm running a simple DB on SQL Server 2012 Express. Just today, when I backup the database, the .bak file size doubles to what it was from the previous backup just minutes before. I have done ...
0
votes
0answers
10 views

Transaction on delete is committed, but for a brief time the entries can still be read?

I have a Java application that uses Spring JDBC and HikariCP for pooling MySQL connections. There is a high level of concurrency where a thread creates a unique entry for a given task in a single ...
0
votes
2answers
19 views

expdp full export not exporting all schemas

On Oracle 12c, fairly new database with APEX installed. I do a expdp \"/ as sysdba\" directory=dp_dir full=y dumpfile=full.dmp logfile=full.log And I am getting just a few tables from SYS and ...
0
votes
0answers
4 views

JMX interface to an API that provides Oracle Database performance statistics

Do we have any API that provides Oracle DB performance statistics ? I am looking for such an API and how to connect to it using JMX (if it has any JMX interface)
0
votes
0answers
13 views

How to start Oracle 12 after initial installation

I'm a graduate student taking an Oracle 12 PL/SQL class this summer. I'm trying to set myself up for success but it appears to be difficult. I've installed Oracle 12c and SQL developer 4.1.3. What do ...
1
vote
1answer
36 views

Transactional replication latency issue

I inherited database systems like this. Currently I have publisher database in SQL Server 2005 compatibility mode on Windows Server 2008 R2 with SQL Server 2008R2 SP2 machine. Distributor is on the ...
1
vote
1answer
17 views

ON CONFLICT ON CONSTRAINT fails saying constraint doesn't exist

I'm trying to use new Postgresql 9.5 upsert feature. But for some reason my query saying constraint doesn't exist (when it does). My query is this INSERT INTO journals (ext_ids, title) VALUES ...
1
vote
1answer
40 views

Syntax Error Help [on hold]

I have this script that works just fine but when I change the directory paths it seems to get this syntax error "unclosed quotation mark after the character string" I have looked over this for hours ...
1
vote
1answer
12 views

MySQL trigger to update a key if record exists

I'm trying to build a trigger in MariaDB to follow this logic: 1. If the primary key val exists, increment the counter column 2. Else, insert the primary key into the table Here is my prosed ...
2
votes
2answers
118 views

Composite index

Assuming i have a table X with 12 columns . in my queries i am filtering on these conditions select * from x where a=@a and b=@b select * from x where a=@b and b=@b and c=@c select * from x where ...
0
votes
0answers
20 views

Any pointers on a good concise and clear text or article that describes normalization theory?

I am looking for a text that I could pass on to a friend. Something that's short, concise and that very clearly explains the benefits of database normalization, the different forms of normalization ...
1
vote
2answers
55 views

Any different guidance for tempdb with Availability Groups?

I have an Availability Group set up on SQL Server 2014 running on a two-node Windows Server Failover Cluster. The setup consists of two stand-alone instances + synchronous with automatic failover. ...
0
votes
0answers
7 views

How do I assign the result from ST_GeomFromText() to a variable and consume the variable?

This SQL works as is: select field1, field2 from schema1.featureClass1 t1 where sde.st_intersects(t1.shape, sde.ST_GeomFromText('point(99.0 22.0)', 1111)) = 1; Now I need to perform some ...
0
votes
1answer
13 views

How to create tables with geometry in Postgres?

I need to create 2 tables with distinct geometry. One needs to be a table that has point information. The other needs to be a table that has line information. They do not need to be populated as ...
0
votes
0answers
6 views

Postgres: How to log materialized view refresh

I would like to keep a record of when various Postgres materialised views are refreshed. As far as I can see there are no built in logs. The next obvious choice is to create a trigger, however it ...
0
votes
0answers
9 views

OLE DB provider “MSDASQL” for linked server “[name]” was unable to begin a distributed transaction

I have a linked server setup from SQL Server Ent 2012 to PostgreSQL 9.3 and a stored procedure pulling 3 filtered tables from it and storing each in a temporary table. There is a final query at the ...
0
votes
0answers
6 views

SSL Issue on SQL Server 2014 DEV SP1

We have a cert on our SQL Server 2014 dev box running SP1 with force encryption enabled. If we connect to the FQDN for the box the encryption works. If you put encryption on it works and if you don't ...
1
vote
2answers
47 views

How can I represent a list of words and related words in a relational structure?

I have a list of header words and words as below and I am trying to understand how best to represent these in a relational table: Header Other Words Words abandon abandoned, ...
0
votes
1answer
16 views

How to create a table with data from other tables in Postgres?

How to create a table that with data from 6 other tables that have the same columns? The table names are: ab1_2, ab3, ab4, ab5 and ab6. This is a spatial data with the Postgis extension enabled so ...
1
vote
1answer
16 views

Is there a way to associate a description with database snapshot?

Is there a way to associate a description with database snapshot? I usually name snapshots using original database name and timestamp: DBName-05-27-2016_1018 I would like to be able to associate a ...
0
votes
0answers
24 views

Can I rely purely on an auto-generated unique primary key for CRUD?

I am in the process of developing a large web-based application that uses a SQL server database for data storage. There will be multiple accounts all sharing one database for generic account related ...
2
votes
1answer
18 views

Migrating from SQL Server 2008 R2 to SQL Server 2014

I'm migrating from SQL Server 2008 R2 to SQL Server 2014. Can someone tell me if my approach will work? Current Environment: SQL Server 2008 R2 Windows 2008 R2 Steps to Migrate from SQL Server ...
-2
votes
0answers
18 views

Index Rebuild/Reorganize Time [duplicate]

ON 2012 Enterprise edition, I have a maintenance job that runs daily and checks the index fragmentation and reorganizes or rebuilds indexes based on the percentage of fragmentation (see the Hallengren ...
0
votes
1answer
14 views

ORACLE - Trying to return MAX or MIN based on a CASE statement

I'm working on a query to give me either a MAX or a MIN based on whether another column is divisible by 2. SELECT CASE mod(ROLE_TYPE, 2) WHEN 1 THEN MAX(SALARY) ELSE ...
0
votes
0answers
9 views

MySQL: database setup to properly deliver non-ascii characters

I'm facing the following problem: I have a MySQL database which contains non-ascii characters in some records. Characters like "ñ", for example. What kind of setup do I need to perform at the ...
0
votes
0answers
6 views

MySQL: physical table vs temporary table

This question is part of this question MySQL: excessive memory usage I am in process of debugging MySQL high memory usage, I need to know the difference and impact of the physical tables and ...
0
votes
0answers
5 views

MySQL: excessive memory usage

In our production system, MySQL service uses above 95 % of the available memory. System Info: OS: CentOS 6 RAM: 32 GB CPU: 4 core MySQL version: MySQL 5.5 Database Size: 158 GB my.cnf info: # ...
0
votes
1answer
9 views

Delete document from nested array in mongodb

I've created a collection with following insert statement db.test.insert({ "_id": 1, "updatedAt": ISODate("2016-05-27T05:37:44.928Z"), "created_at": ISODate("2016-05-13T09:41:23.000Z"), "batchId": ...

15 30 50 per page