1
vote
1answer
976 views

Oracle DataGuard: Find primary from standby DB

I have SYS access to a data guard standby DB, but i need to find the primary one. I was searching in Oracle Docs but couldn't find anything that could help.
2
votes
1answer
107 views

Query takes longer as domain user than local admin

I have an application that runs ad-hoc queries to a remote SQL server. I'm running into a bizarre problem with the application taking significantly longer to return results when the application is ...
1
vote
1answer
118 views

SSIS Transaction Scope

My question is in regards to the scope of a transaction when using SSIS transactions. If I have a sequence container and it is marked as "transaction required" and I have tasks in that sequence ...
1
vote
2answers
700 views

Oracle 12c Client to 10g Server (OPENQUERY)

Scenario: We currently have a SQL 2008 R2 server (with Oracle 10g Client) using OPENQUERY to return data from an Oracle 10g database. Problem: We would like to upgrade to SQL Server 2014 SP1 (with ...
3
votes
1answer
50 views

How to Join a table to a group_contact in mySql

I have this query select concat('[',group_concat(inn.str),']') into string4 from ( select concat( '{"idmm":',customer.id, ',"cd":"',customer.code, '","nm":...
7
votes
2answers
3k views

nvarchar(max) converting to varchar and table optimization

I am working with a table that has all character types set to nvarchar some of them are nvarchar(max). We are converting all these to varchar and specifying a character width based upon the actual ...
2
votes
1answer
39 views

Should I create many ID for a same Person/entity in my DB?

In my model, I must store the name of the teacher of some kids and the classroom in which the teachers work, let’s say. All of the hundreds of teachers in the schools have 1 and only 1 classroom, ...
0
votes
0answers
148 views

Stored procedure return -1

Normally, when I execute a SP, it returns a value of zero (0), but I have a SP is returning a -1 and can't figure out why. Does the -1 indicate an error? If I copy all the SP code into a separate ...
1
vote
1answer
36 views

SQL Join Field and Content

I have this MySQL Structure: CREATE TABLE Fields ( ID INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY, ForUser VARCHAR(255) NOT NULL, ForCategory VARCHAR(100) NOT NULL, FieldName VARCHAR(100) NOT NULL ); ...
0
votes
0answers
159 views

SYNTAX ERROR: delete from multiple tables with inner join

Sorry, but I need syntax help :( This needs to run on SQL Server 2005 + DELETE SO, ASO, ASOV, AOV FROM SYS_OPTION SO INNER JOIN ADM_SYS_OPTION ASO on SO.OPTION_ID = ASO.OPTION_ID INNER JOIN ...
1
vote
1answer
117 views

cassandra in memory tables

I am planning to use Cassandra in memory tables for my particular work load. THe problem is I am worried if the node fails then what will happen to the data in memory that was not flushed to disk ? ...
0
votes
2answers
262 views

Doing a left join and having every match include an extra null row

So I want to do a left join and have every row on the left table include a row of nulls on the right, even when there is a match. Is there a name for this type of join? And is there a better way to ...
0
votes
2answers
118 views

SSMS fail to connect localhost SQL Server 2008 R2 suddenly [closed]

Until today when accessed by remote desktop to my sql server could connect using localhost, but suddenly I cant (without any update or change in my server), now I can connect using localhost\instance ...
0
votes
1answer
47 views

Allowing a user to view/edit only a specific table in a database with ~50 tables

The database I'm working with has about 50 tables in it. A single user requires edit permissions on one of the tables, but should not have access to any other tables. I know how to deny her the ...
-1
votes
1answer
72 views

A complex query to Joining 2 tables and getting result [closed]

I have a database in MySQL. I have 2 tables, Structures as follows : t1 t2 I want to join both the tables and result should be like this : Employee_id | count(DNIS) | total_calls | count(DNIS) :...
2
votes
1answer
288 views

Best practice for when the ideal number of columns is unknown

I'm currently making a MySQL database to list products for an e-commerce site. Each product will have several sizes available which will each have their own dimensions and measurements (e.g. length, ...
3
votes
2answers
122 views

Database Tuning Issues

I'm not a DBA so looking for some advice on tuning a MySQL (MyISAM) database. I've found that during peak hours we are getting pretty severe load spikes which are slowing down the web front-end. I've ...
3
votes
1answer
995 views

To have PostgreSQL-like Partial Index in MySQL 5.5

I have big data where I only select a small interval of data at a time such that the selection is always in a sequence. I am trying to implement PostgreSQL like Partial index in MySQL which is ...
0
votes
2answers
22 views

Possible to upgrate SQL Server 2012 express to 2012 Standard?

I need to do an in place upgrade of SQL server 2012 express to standard without losing any data. Is this possible? Is it as simple as just running the setup for the standard version? TIA
0
votes
1answer
94 views

How to track changes to a record that spans multipe tables

I have the challenge to design a new database using a RDBMS, Oracle, to be precise. In this database there will be one specific record/document which may span multiple tables. With as little ...
3
votes
1answer
98 views

Is it a bad practice to keep Master and Slave (Replica) Database on Same Server?

I have a database A (master) on server 1. I need to read from database A perform aggregations and write on database B. Since database A has a very high traffic, I cannot read directly from database A ...
1
vote
1answer
74 views

How to determine RAM usage of a query

I would like a detailed explanation on the below question. This is regarding the Mysql RDBMS. Thanks in advance. What are the factors that would affect the RAM usage by a query. how to ...
2
votes
0answers
23 views

SQLITE Foreign key has to be re-added? [closed]

Currently I have a mysql database on my computer which I convert to sqlite database. On the sqlite database, I have transaction_detail table with a foreign key to transaction_master table. The ...
4
votes
1answer
127 views

Implementing a function written for Postgres 9.4 in Postgres 8.4

I have a simple function (tested on Postgres 9.4) that I need to implement on Postgres 8.4. The error I get is that function format does not exist. I've been trying to find resources but 8.4 is 6 ...
1
vote
1answer
34 views

oracle database filter with full outer join and coalesce intersect

in a Oracle Database if I "shoot" SELECT RAP.IDPL, C41.TIP_COD_DESEU AS CD41,C41.STOC_VAL AS CANT41, C42.TIP_COD_DESEU AS CD42,C42.STOC_VAL AS CANT42, C43.TIP_COD_DESEU AS CD43,C43....
1
vote
1answer
117 views

Windows crashes on doing sql dump [closed]

Windows simply crashes and opens the blue screen for dumping physical memory on trying to import sql dump. Blue screen error: IRQL_NOT_LESS_OR_EQUAL So far I have tried 4 methods: Through workbench ...
3
votes
3answers
4k views

Problem with new MySQL Workbench connection

I'm working on Debian 8 and wanted to create database using MySQL Workbench. I did everything in this tutorial, but when I created a new MySQL Connection, the program returned: Failed to Connect ...
2
votes
0answers
250 views

operator class “gin_trgm_ops” does not accept data type tsvector

ALTER TABLE users ADD COLUMN full_text_vector TSVECTOR; CREATE INDEX full_text_index ON users USING gin(full_text_vector gin_trgm_ops); The last line is giving me the following error: SQLSTATE[...
1
vote
1answer
85 views

Product attribute schema design, mixing solutions

I am working on a product database in MySQL and the products can be multiple types with different attributes. The number of attributes and there datatype vary. I read about some design patterns (post) ...
4
votes
1answer
7k views

Benefits of SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

I use SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED in the majority of my general SQL queries, mainly because this was drilled in to me when originally learning the language. From my understanding,...
2
votes
1answer
75 views

Multiple indices on a table

I have run SQL Profiler and I can see that I'm "missing" some indexes (non-clustered) on a table. How is it best to handle indexes that can be a "subset" of another index? Index 1 UserId, InstanceId,...
2
votes
1answer
84 views

Best way to backup mysql database?

How do you backup your mysql database so you can be sure that you are 100% protected of data loss whatever problems that may happen? I am thinking to rent one or two servers that i will use only for ...
3
votes
1answer
1k views

Why has my slave server stopped connecting to master in MySQL replication?

We have MySQL replication setup and it has been running without issue for some time. This server acts as a slave and a master (it replicates through to another server). This morning I received an ...
14
votes
4answers
2k views

Why should a key be made explicit?

I am very new to the subject of databases so this may sound ignorant, but I am curious why a key should be made explicit within a table. Is this primarily to tell the user that the given column value ...
1
vote
2answers
84 views

How to break down RELATIONAL data into HIERARCHY data structure?

I have a query that returns the following dataset: RELATIONid MAPid D1id D2id D3id 4999 4999 626 1250 7 5000 5000 626 1250 8 For the next step, I need to bind those ...
3
votes
2answers
440 views

How to split numbers and text in MySQL

I have searched over the internet looking for a function like REGEXP_REPLACE in Oracle, regexp_replace in PostgresSQL but I haven't find one similar in MySQL just REGEXP and RLIKE, but these operators ...
3
votes
3answers
2k views

No advantage of using Cross Apply or CTE over inline sub-query

I came across a query like this: SELECT (SELECT COUNT(1) FROM Orders o WHERE i.ItemId = o.ItemId) [C] FROM Items i I changed it to following ;WITH cte_count AS ( SELECT COUNT(1) c, OrderId ...
0
votes
2answers
307 views

Select all from table using procedure oracle

I am trying to execute the select command in a procedure.Initially i retrived all of the columns of the table in the procedure using cursor. The real problem comes when I am trying to access the ...
3
votes
1answer
137 views

Skip specific field name

I am trying to execute a table from a MySQL database using a for loop statement, in order to get the field names as the column header. Here is my code: $result = mysql_query("SELECT * FROM ...
2
votes
2answers
285 views

Scheduling MySQL Workbench to execute and export on a daily basis

Here's my question. I have a couple scripts (very simple stuff; select queries) that I run in MySQL Workbench which I can than export to CSVs. What I want to know is if it is possible to schedule ...
2
votes
2answers
29 views

Indexing order by columns

Based on the query below it was suggested that I create an index on the column in the order by clause. My understanding is the sorting is done on the result set and not the table. The person ...
2
votes
1answer
236 views

Where is the default postgres user path environment set?

This is probably simple but I can't seem to find the answer. We have a server running postgresql 9.4 on CentOS 6.6. Recently we had somebody run a yum install for postgres which installed postgresql ...
3
votes
0answers
81 views

Need a way to prevent log shipping from kicking users out

We have SQL Server 2012. A service we use requires us to use log shipping, however we are tired of having users being kicked offline every 15 minutes. Are there any creative ways to get around this (...
5
votes
2answers
126 views

Combine two event tables for multiple timelines into a single result set

This question is an extension to a question I've previously asked that was overly simplified. The more accurate example is demonstrated in this SQLFiddle, where I demonstrate a working (but slow) ...
4
votes
1answer
175 views

Slow window function query with big table

I'm doing some performance testing on a new DB design on PostgreSQL 9.4rc1 and I'm seeing some pretty slow queries using window functions. Here is my table setup: CREATE TABLE player_stat ( ...
5
votes
2answers
513 views

Can CLR execution continue after 'THROW' is encountered in T-SQL?

I am calling a T-SQL stored procedure from a CLR stored procedure. and the THROW statement in T-SQL stops the execution of CLR without going into the catch block. Is there something I can change in my ...
4
votes
1answer
134 views

Why does it take so long for Postgres to return a sequence number?

I have an application that does bulk loads into a large table (100 million rows). I am using Postgres' COPY FROM functionality to load data from a flat file. The target table has a primary key of id. ...
2
votes
2answers
638 views

Would increasing innodb buffer pool size prevent a mysql crash?

My server keeps running out of memory for mysql. I keep getting. 150708 3:39:09 [ERROR] /usr/sbin/mysqld: Out of memory (Needed 258064 bytes) When I looked in my.cnf I saw that ...
2
votes
0answers
1k views

How can I eliminate false “connection string format is not valid” messages from SSIS log?

I have a project that uses the SSIS catalog with project-level connection managers. The connection managers' connection strings are overridden at the server using a project parameters file, to enable ...
2
votes
1answer
189 views

SQL Server process only using half of the memory on host

We doubled the memory on host that has a SQL Server Enterprise 2014 instance on it. After a reboot of the server we noticed that the SQL service is only using half of the memory. A little background ...

15 30 50 per page