All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
7 views

GROUP BY with date ranges when values change but then change back

Consider a historical table where a value was changed and then changed back: value | date 3 | 1/1/2019 3 | 1/2/2019 3 | 1/3/2019 4 | 1/4/2019 4 | 1/5/2019 3 | 1/6/2019 3 | ...
-1
votes
0answers
6 views

MySQL returns more than one row with AND operator match

I have two tables 1:n relationship, customer to orders the schema is in the http://sqlfiddle.com/#!9/a6842e/1 I have created. The key in customer is composite id and type. I am trying to get the ...
0
votes
0answers
13 views

Storing 450,000,000,000 data points in a bitemporal datastore

I'm really looking for guidance on an appropriate way to tackle persisting and retrieving 450 billion data points. The details: 15,000 equities 15,000 days of history (approximately 40 years) 2,000 ...
0
votes
0answers
5 views

Does postgres single-user mode use postgresql.conf settings?

Does running postgres in single-user mode (--single argument) cause postgres to start and use the settings present in the postgresql.conf file in the data directory defined by the -D option? I am ...
0
votes
0answers
10 views

Without rewriting this query, is there a way to force the query optimizer to better estimate the amount of resources required, e.g. with query hints?

I know there's a couple of alternate ways to write this query, but I'm more curious if there's another approach that I could use to improve the performance by helping guide the optimizer in the right ...
0
votes
0answers
7 views

Restore plan cache and buffer pool after database restore?

When restoring a database, is there a way to restore the plan cache so it doesn't have to be re-created during production use? Similar question: is there a way to pro-actively restore the buffer ...
0
votes
2answers
11 views

How to add time from a Date value to another without a varchar conversion?

Let's say I have 2 variables in a Stored Procedure, both are Dates Foo contains '13/10/2019 00:00:00' Bar contains '01/10/1914 16:33:11' I want to add Bar's time to Foo's date, so that I get a ...
0
votes
2answers
36 views

Is there a way to increase the speed of the following insert without having to create an unclusterd index being suggested by sql server?

Below is a query that we are running that takes a while to run. Table 1 has about 400+ million records with 80 columns (this is a db warehouse table). The index being suggested is on the columnx with ...
0
votes
0answers
6 views

How can I import the fga_log$ table with impdp Oracle 12 R1

I am trying to import with impdp a save made as follows: expdp '"sys/mmm as sysdba"' full=y COMPRESSION=ALL DIRECTORY=LOGICS_EXPORTS COMPRESSION_ALGORITHM=BASIC LOGTIME=ALL CONTENT=ALL DUMPFILE=FULL-...
0
votes
0answers
7 views

Analyze Table running constantly on a few tables

I am seeing a few of my tables constantly having analyze table running on them. How would I determine what would be causing or triggering this and is there a way for me to stop that from running? It ...
0
votes
0answers
16 views

Postgresql v10.1 - How to fix ERROR: duplicate key value violates unique constraint

I'm not sure how this happened to this table but have an issue with ERROR: duplicate key value violates unique constraint trying to use AWS's DMS service to move a postgres v10.1 DB to RDS v10 The ...
1
vote
2answers
36 views

Permissions using a TYPE as a Table Valued Parameter

I'm developing a .Net App that calls an stored procedure that have a table valued parameter declared as a TYPE READONLY. First time I tried to call the SP I received the next error: Msg 229, Level ...
0
votes
1answer
23 views

Insert set value into DB

I'm pulling values from RESTORE FILELISTONLY FROM DISK for multiple backup files into a temp table. I am trying to insert a set value (@dbSet) to a column (@dbSetC) but when running my insert it's ...
0
votes
2answers
18 views

Select data from table join or UDPATE?

I have a question regarding PostgreSQL DB performance. I am given a CSV file with a lot of rows (let's say around 1 million rows) that represents updates to a database table (let's call it MY_TABLE). ...
0
votes
1answer
22 views

Session ID in SQLCMD running multi-batch script

My script contains multiple GO keywords. I know that SQLCMD interprets GO as a batch delimiter, so the code is not run as a single block but instead each part between the delimiters (a batch) is run ...
0
votes
0answers
9 views

Can you edit DB content, if you can't access phpmyadmin? [on hold]

I've crashed my domain's DNS trying to enter a DKIM entry to my control panel, now I can't access my domain, my control panel or PHPMyAdmin because they all reside on my domain. Is there a way I can ...
0
votes
0answers
32 views

Recommended ways to export large query result to JSON or other text format

I am tasked with exporting a settings query result to a text file so it can be imported on other machines. I have a working solution in a WPF project however the problem is that the results are 28K+. ...
2
votes
1answer
31 views

UPDATE column to MIN of a SELECT result set - what went wrong?

I've got the following scenario: I've got a table of assets with standard columns a table of hardware assets with extension columns a history table where all changes to an asset are stored with ...
0
votes
1answer
20 views

Can we copy data from 1 text file to 2 postgresql tables?

I have a text file with some data and I have two similar tables in my postgresql database. Is it possible to copy a part of the data present in the file, say first 10 lines, to the first table and the ...
2
votes
2answers
81 views

SQL log file 2TB is not enough, now what?

This is a hypothetical question, that flows from the answer by sepupic where they explain that 2TB is the physical limit for SQL log file. if you need it more than 2Tb you add the second log file. ...
0
votes
0answers
6 views

What to pass as a key instead of username and password for anonymous users @login?

I am trying to make a mongodb schema in which I am allowing the person to publish projects anonymously. I already have the authenticated user schema and I am thinking of using that only to allow users ...
2
votes
1answer
34 views

what could be preventing my transaction log autogrowth to be set to UNLIMITED?

I have been trying to set the autogrowth of one of my databases to unlimited but despite whatever I do it remains the same. First thing I have checked if something is holding any locks to my database:...
0
votes
0answers
11 views

How to sync data between two databases on two different ms sql server instances - one 2008 and the other 2016

What is the easiest way to sync data between two databases on two different instances. I am not thinking replication. Just sync e.g. production database to test database from time to time.
0
votes
0answers
14 views

Is it possible to join on column placeholders?

I have a query below in which i was wondering whether it is possible to join on my placeholders and if so are my joins in my CTE's correct? WITH DCM AS (SELECT date, placement as creative, SUM(...
1
vote
1answer
12 views

Postgresql Master/Slave Using Patroni

Can i promote a slave node to be a master for insert/update/delete using postgresql-patroni once the original master become down?
1
vote
1answer
20 views

Oracle Database 11g Failing to mount on windows server 2012

I have an Oracle 11g database installed on Windows Server 2012. It's failing to mount after shutdown. The reason why i want to mount it is that i want to enable Archive log mode, and i have been able ...
0
votes
1answer
12 views

Use plpgsql to count records selected for output AND output those records

My query SELECTs 1 row from table1, which has a number of fields plus one very long text field. It JOINs with a second table2, that may have many matching corresponding rows. I would like to be able ...
0
votes
1answer
42 views

Restructuring table - start with PK or not?

I am restructuring a bunch of tables in my database (in this case using a smaller data type for some columns - in most cases cutting those by ~50%, and they tend to be large columns). I've gone ...
1
vote
2answers
24 views

How can I have an aggregate function in the WHERE clause?

Using PostgreSQL 9.3.24 Issue Just simple operation, but I don't know how to do that best simplest way. How can I display results only when sum of available_counts for same product_id is 0 and ...
0
votes
0answers
16 views

Can copy command in postgresql append data to a file? [duplicate]

I want to add some data from a postgresql table to a text file. But already some data is present in the file. I do not want to delete that data. Is it possible? The questions asked earlier were the ...
0
votes
0answers
8 views

MongoDB - Setting up the MMS Automation Agent

I am currently trying to set up a testing environment that includes 3 MongoDB database deployments and one server with an installation of the MongoDB Ops Manager. I succesfully installed the MongoDB ...
0
votes
0answers
28 views

AG lag for some weird reason

I am having issue with Availability Groups, the secondary server lags for some reason and after restart of primary and secondary for week or two it works fine but back to lagging. Our consultant told ...
0
votes
0answers
46 views

Incorrect syntax near the keyword 'CASE' [on hold]

When I ran my procedure, it got created successfully without any error. But when I try to execute it, I am getting an error. Error in executing bspCDRExtract in bspDynamicCDRExtract. Details: ...
0
votes
1answer
16 views

Serialize a column based on sorting order?

I have a column number_order and products_name I'm struggling to build a command that will sort by A-Z so that respectively: A = 1 B = 2 C = 3 I'm using MariaDB. To be clear I want to run a command ...
0
votes
0answers
11 views

Environment variables for Oracle OPAM 11g

Is there a way to set environment variables when logging through Oracle OPAM 11g to #OPAMSH console? Prior to OPAM integration, environment variables are set through a logging script where a question ...
0
votes
1answer
12 views

how to take postgres server backup skipping some of databases?

I have PostgreSQL server version 9.5. Contains 20 Databases. I want take server backup skipping of some 10 databases. Am using pg_dumpall, but it was taking full server backup. thanks,
0
votes
0answers
9 views

Mysql vsz keep growing until OOM

cat /etc/redhat-release CentOS release 6.5 (Final) thread variables join_buffer_size 4k read_buffer_size 2k read_rnd_buffer_size 4k sort_buffer_size 4k key_buffer_size 2k tmp_table_size 64M ...
0
votes
2answers
17 views

Different Maximum server memory across Availability Replicas

I have a scenario in SQL Server 2014 AlwaysOn High Availability where other services are running in one of the Secondary read-only replicas. These services obviously demand additional memory. Is ...
1
vote
1answer
23 views

Some timeout in query store but get all SP:Starting and SP:Completed in profiler

I have a report SP running. The user complaint report timeout sometimes. And I do get some canceled execution plan in my query store. But in my profiler tracing file, every SP:Starting has its SP:...
0
votes
0answers
13 views

MySQL replication still failing after new import

I had an issue with my MySQL replication from Master to Slave. An App we had by mistake wrote to the Slave and deleted some data as well, causing errors during the replication (delete errors, primary ...
-1
votes
0answers
21 views

Indexing strategy for optional predicates

Let me ask a similar question i asked before. I believe there is more scope of explanation on this one. CREATE TABLE [dbo].[SalesOrder]( [Id] [uniqueidentifier] NOT NULL, [PageId] [...
1
vote
2answers
24 views

New to CTE - How to do a count after making table unique

I'm new to CTE's and usually sub query my SQL. I'm unsure how to get the results I want as I keep finding solutions that would require sub queries. I have the below table in SQL. I'm trying to write ...
0
votes
2answers
42 views

SQL cannot add columns to query

I have the following query (PostgreSQL 9.5.19): with userlist as ( select a.ips, array_agg(t.super_user_id) as super_users from tmp_table_1 t left join unnest(t.ips) as a(ips) on ...
-3
votes
1answer
19 views

Create a trigger that will prevent any one from updating personal information of others [on hold]

I'm trying to create a trigger in DB2 that will prevent any one from updating any personal information that does not belong to them I.E. FIRST_NAME, LAST_NAME, EMAIL , PHONE_NUMBER columns. I'm trying ...
0
votes
0answers
32 views

Stored procedure execution duration and sending email to DBA if it run long

Does anyone has a T-SQL query which checks the stored procedure run duration and inform DBA team if it run long may be more than 1 min. Any help would be appreciated Thanks
-3
votes
0answers
30 views

can anyone answers these im new to database [on hold]

a. List the first name, middle initial, and last name of all employees who earn a salary greater than 27,000. b. List the first name, last name, and address of all employees who have a son as a ...
1
vote
1answer
27 views

(MySQL) SET column with values from a foreign key constrant

I am making a junction table that tracks relationships between users. Among other things it is formatted with a group leader, and with a variable amount of members. All users have a user id and so ...
1
vote
0answers
18 views

Oracle 12c Database Config Manager very slow at creating a new database

I have installed Oracle 12c on a number of machines (Windows 10, 2012, 2016 mostly) before and created several databases on them, using the Database Config Manager, all with no real hiccups. However ...
0
votes
0answers
9 views

Converting this Postgres query to sequelize [migrated]

Hi I'm trying to convert my query into a sequelize query but I haven't been able to do it, The query is: SELECT SUM(od."totalValue") AS total FROM "OrderDetails" AS od LEFT JOIN "Orders" AS o ON od....
1
vote
0answers
9 views

Missing CALLs on identifiers_all using PL/SCOPE

Posted this on StackOverflow, but maybe this is the right place for it: I'm trying to use the view all_identifiers from PL/SCOPE to find out calls to procedures and functions but it's not showing all ...

15 30 50 per page