1
vote
1answer
8 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
4 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
14 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
11 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
6 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
8 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
17 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
6 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
8 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
10 views

Multiple SQL instance install question for Allways On

I have a 2 node WSFC cluster with SQL 2014 installed on each for Allways On. This is working fine. My question is can I install another instance of SQL 2014 on these nodes for another Allways On ...
2
votes
3answers
21 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
2answers
13 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
39 views

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

I'm running a simple DB on SQL SERVER EXPRESS 2012. 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
9 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
18 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
34 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
15 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
37 views

Syntax Error Help

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
11 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
116 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
18 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
51 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
12 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
5 views

SSL Issue on SQLServer 2014 DEV Sp1

We have a cert on our sql 2014 dev box running sp1. with force encryption enabled. If we connect up to the FQDN for the box the encryption works. If you put encryption on it works and if you don't it ...
1
vote
2answers
42 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
21 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
17 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
13 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": ...
1
vote
0answers
22 views

Converting a composite primary key to composite unique, and adding an auto-incremented PK column

Background I have taken over responsibility for a table that, in the long run, will grow monolithic. The table is a very simple link table with 2 columns, call them col1 and col2, both being foreign ...
0
votes
0answers
6 views

How we can make “statement_timeout” work inside a function?

I have a requirement to perform a query operation in a specified time limit in postgresql. If the query is not performed in that time limit, we need to catch a exception/a action and need to kill all ...
0
votes
0answers
4 views

mysqldbcompare giving Compare table checksum FAIL error

Running mysqldbcompare on two test databases on same server. There is no data discrepancy in any table but showing following message which I'm not able to understand. Any help is appreciated. TABLE ...
0
votes
0answers
23 views

Log shipping secondaries in STANDBY stuck in 'Restoring…' - SQL Server 2012 SP3

Yesterday, I configured Log shipping between 2 SQL Server 2012 SP3 servers for a total of 13 databases. Some specifics: I'm using 'Azure files' to transfer the log files (CIFS accessible BLOB ...
0
votes
0answers
16 views

How to use an external encryption key in an Oracle function?

I am storing People data in an Oracle 11g database. I am implementing symmetric encryption on one sensitive data column in my People table. For this, I created an Encrypt function based on the example ...
2
votes
0answers
16 views

Could I use both UUID and Sequential ID or is it bad design

Sequential IDs have pros and cons. UUIDs have pros and cons too. Why not use both for each table? (Let's say I have -and will have- no problem about storage space) I could use: UUID for exposition, ...
4
votes
2answers
202 views

Should I add an auto-increment / IDENTITY field to a cross-reference table just for PK purposes?

I'm adding the following cross-reference table to my SQL Server-hosted DB: company_id bigint not null (FK) org_path nvarchar (2048) not null The company_id field refers to the id field in another ...
0
votes
1answer
68 views

Products with different prices in an order

I have a "classic" database schema for order and products: Orders ------ id etc. Products -------- id name etc. Order Products --> Pivot table -------------- id --> some people don't like ...

15 30 50 per page