All Questions

Filter by
Sorted by
Tagged with
3
votes
1answer
164 views

Is it possible in PostgreSQL to have some DBs under PITR stragtegy while other DBs are not?

I have a PostgreSQL server that contains a number of databases. The number varies over time between 20 to 30. Some of these databases contain real production information for what we want to have the ...
0
votes
1answer
29 views

Consolidating data from Subscriber database at Publisher

We have some tables published from one SQL server and another server subscribed to it. However we just realised on two tables data was added at the subscriber end that doesn't exist at the publisher. ...
0
votes
1answer
17 views

How to get available worker from a roster database?

I am using Postgres, and I am working on a database for a roster system like this: drop table if exists sessions; create table if not exists sessions( id int GENERATED ALWAYS AS IDENTITY, name ...
0
votes
1answer
33 views

Its possible create a trigger after every transact in all DB? (SQL SERVER)

I have 100+ databases in my instace of SQL SERVER and mostly is a legacy DB but i dont have a control of what is new and what is old. My idea is create a Trigger in all server for every transact and ...
0
votes
0answers
4 views

SSIS - Attunity 5.0 Oracle destination running for hours yet row count shows data has arrived so why does the dest task look in a hung state?

Using SSDT v14 A simple package that extracts data from a SQL Server view and sends via Attunity to Oracle takes about 5 hours to run, of which 4 hours seems to be the Oracle destination task showing ...
0
votes
0answers
49 views

Oracle Query Performance

I have a query that I need it to be execute fast as possible. Even though I have indexes, it is executing very slowly and I can't figure out why. This is the query, I am trying to optimize. SELECT d.*,...
-1
votes
1answer
27 views

INSERT-only tables? [duplicate]

I know I could stop normal users from using UPDATE and DELETE by revoking permissions. No-one (including DB admins) should be able to UPDATE or DELETE from these tables. (This is for a write-model in ...
0
votes
1answer
10 views

oracle query to split data into per-date rows

I need to create a report which splits the values from table A into a row-by-date format. So for example If I create a sub-set of dates for the past week and sales in the past week, I need to output ...
0
votes
1answer
35 views

Why my postgres table takes too much space?

I have 2 identical tables for 2 countries: ES and NL. In table_es I have 477k rows, in table_nl 1.600M rows, but after checking size of both tables I have 26 GB in ES and 24 GB in NL. How is it ...
1
vote
1answer
31 views

Specific index issue with postgresql planner/optimizer

i have an issue where i have no idea anymore and can't seem to find a similar one already discussed, so... Am/have to be on pgsql 10.15 / RHEL x86_64. rel A has about 813 million records. format is ...
0
votes
0answers
36 views

SQL Server 2019 Express for Linux on Ubuntu 20.04 - Bug - CU 13 - c0000005 EXCEPTION_ACCESS_VIOLATION when specifying @wkt in Table-valued function

Pretty sure I've found a bug in SQL Server 2019 (Express) for Linux (CU 13, version 15.0.4178.1 running on Ubuntu 20.04 LTS). After the following table-valued function dbo.bTest is created: use devdb ...
1
vote
1answer
30 views

Database Design for evolving entities

I am looking for some best practices regarding table design when an entity is expected to evolve over time and get more properties. As an example let's consider a process that has a bunch of metadata ...
0
votes
0answers
27 views

How can i Restore Oracle 12c database Schema from a full EXPDP dump on a Test Server providing a new scheam name?

I have a production database whose full dump is 500Gig and and I cannot do a full restore on a test server because of space issues. However I need to restore a certain schema in from that dump into ...
0
votes
1answer
39 views

SQL Server is not reading environment variable

I want to create a CLR assembly, and here's my code: use [master] go exec sp_configure 'show advanced options', 1 go reconfigure go exec sp_configure 'xp_cmdshell', 1 go reconfigure go execute ...
4
votes
1answer
136 views

Does Azure VM backup also backup SQL DBs?

I'm trying to disentangle our backup strategy, and also troubleshoot the overnight backup of the Azure VM and of the SQL DBs to local storage on the Azure VM, via an agent job and maintenance plan. ...
2
votes
1answer
18 views

Postgres WAL full and database stopped/exited with error - No space left on device

I am new to postgresql. We had a full disk issue on PostgreSQL DB where data and WAL was set. WAL was taking almost 65 GB. This is a lower environment and we don't need to restore to a point. Compared ...
0
votes
0answers
19 views

mysql replication duplicate entry

I replicate my mysql master to a slave. They works very well but once in a while, duplicate entry would happen and I don't know how to resolve it ending up copy the master over and start replicate ...
0
votes
1answer
10 views

Increasing TransactionLogsDiskUsage in postgresql 11.12 RDS instance [duplicate]

We have a test RDS postgresql 11.12 instance, configured for logical replication. The only thing connected to it is a 3rd party service, Hevo Data, which is managing sync to a separate Redshift ...
-2
votes
0answers
15 views

Translating Oracle syntax (openquery) to T-SQL MSSQL [closed]

Dears, I've a setup where bunch of MSSQL stored procedures are calling to a Oracle system using a linked server and openquery syntax. We would like to bring everything to MSSQL. Obviously we need to ...
0
votes
2answers
47 views

SQL Server WHILE loop runs twice with update, once without

So this is weird. Here's my code: PRINT 'Define cursor' DECLARE cursor1 CURSOR FOR SELECT b.EmploymentTypeID FROM EmploymentTypes b INNER JOIN #ListEmployments l on b.EmploymentID = l....
1
vote
1answer
26 views

How to parametrize DDL in a plpgsql procedure?

How do I parametrize DDL statements in a plpgsql procedure? Namely, I want to use the org_label param as the role and schema name but the code below takes it literally and I end up with the role "...
0
votes
2answers
21 views

How to increase range of values?

We're doing database design and implementation work in my SQL course, and I accidentally made the value range too short. We're supposed to be building a DB for payment information, and when I put in ...
0
votes
1answer
46 views

Improving cold query performance with pg_prewarm

We have a projects UI page where users can search projects. I noticed that search queries will be slow the first run (up to 10 seconds) and faster on subsequent runs (around 2 seconds). Could this ...
-1
votes
1answer
33 views

Should i use a composite key or 1 primary and 2 uniques in a branch table for banking database? [duplicate]

CREATE TABLE branch ( branch_id INT NOT NULL AUTO_INCREMENT, address_id INT NOT NULL, branch_name VARCHAR(30) NOT NULL, PRIMARY KEY (branch_id), UNIQUE (branch_id, address_id, ...
-3
votes
0answers
34 views

How to add top 1 row as header on SQL server as extra row? [closed]

I work on SQL server 2014 I face issue but I don't know how to solve it I need to add columns header from Table as first row on table I Try as below but I get error Msg 213, Level 16, State 1, Line 1 ...
0
votes
0answers
6 views

How to generate hexagon polygons with coordinates of the center point in PostGIS?

I have given a database with coordinates and want to use these coordinates as the center points for hexagon polygons. PostGIS provides this convenient function: ST_Hexagon The example from the ...
0
votes
0answers
22 views

Replica is significantly behind Source on MySQL 8.x

I am running a MySQL 8 source/replica setup on two dedicated bare mettal AMD servers, each on Ubuntu 20.04. Connection is fast over 1GB ethernet switch on dedicated NICs. The database replicated has ...
-2
votes
1answer
53 views

Sql Server Database not accessible [closed]

I have a big problem The main database of my site is not accessible. Can anyone guide me? What should I do? Displays the following error when opening (expanding) this database in SSMS: ================...
0
votes
0answers
26 views

How to make multiple queries and save the result in a cursor?

I have 4 tables (Company, User, Role, UserRole), I need to get the Id of several users, and then delete them. TABLE Company Id Name TABLE User Id FirstName Email Company TABLE UserRole UserId RoleId ...
-3
votes
1answer
24 views

Sql 2008 export table csv with headers and data

I need to export a table in SQL Server 2008 with headers and data delimited with | ( pipes ), but some information inside of this table have , ( comma ) and CR or LR, it's possible to put it a "&...
0
votes
0answers
28 views

How can I handle multiple social logins per user and yet unique email in this database schema?

I am trying to create a postgres database for a webapp that has users that either login with email/password combo or with social accounts. I would like to do it such that once logged in a person is ...
5
votes
1answer
164 views

Large memory grant for joined tables

When I select columns from both joined tables a get a huge memory grant (529808). If I query each table columns separately it has a combined memory grant of just 8008. Why does the combined list of ...
0
votes
3answers
28 views

Automatically start SLAVE (mysql) Master Master

I performed the configuration of a database replication (slave), performed it as MASTER MASTER, however, every time I restart as machines, I need to manually start the slave I use the command: START ...
0
votes
0answers
14 views

Can I log connection IPs coming to Oracle listener from TCP clients?

I am looking for an option to log client IPs that come to Oracle listener without enabling oracle audit or creating trigger. Is there an option for this? Ps I am on a windows host, but I am willing to ...
1
vote
1answer
37 views

How to restore certain tables from a BAK file sql server?

I have a migration project where I need to do some ETL on a snapshot of a database. IT has created a secure .bak file of the requested db and I need to restore it on a non-prod environment before ...
2
votes
3answers
327 views

SQL Full DB Backup performance on different Hardware

I wrote a fairly simple script that creates in a periodic interval a backup of our DBs, switching automatically into differential in case a full backup already exists. This runs great on my system. A ...
0
votes
0answers
15 views

GroupBy with count array in MongoDB

I have a collection and object where this object has a list of objects as following: { "_id": { "$oid": "615617f5b0cd1765b7ba21c1" }, "response": { &...
3
votes
1answer
40 views

Why tsquery containing a hyphen isn't found in full text search?

Trying to figure out, why the below query isn't returning any results: select id from story where tsv_story_text @@ to_tsquery('CumEx-Files<->2.0'); The term exists in the headline of a story ...
1
vote
1answer
15 views

List Postgres materialized views the current user has select grant

With select matviewname from pg_matviews I get all materialized views in the database. How can I filter the result to get only those the current user has select grant (= read permission) on?
1
vote
2answers
100 views

In SQL Server the backup file is around 190 gb, but when restore the log needs around 2 TB space

From the production the database is backed up automatically every day full backup and every 1 hour for transactional backup. A test server was prepared and I want to restore the latest full backup to ...
0
votes
0answers
23 views

Sum and Count of user quantity

Table 1 Table 2 I am struggling to write a query in which I want how many times a users have purchased a quanity and sum of total quantity of one users Sample Entries Table 1 Table 2 So my result ...
-1
votes
1answer
25 views

How do I insert a sum of a column into a table?

I am trying to get the sum of amount from purchases and insert it into the table total_expenses. I don't really understand how to add the values of aggregate functions into other tables as new tuples. ...
-1
votes
0answers
20 views

Join Two Tables with get value AsssetCode from Max Date

I'm trying join Two tables: KDSCMSCNTRCTD CNTRCTDID | CNTRCTDCOMP | CNTRCTDLNUM | 3221 | NAV | 207 KDSCMSCNTRCTDHIST CNTRCTDHISTID | CNTRCTDHISTSDATE | CNTRCTDHISTCOMP | CNTRCTDHISTLNUM | ...
0
votes
1answer
31 views

Postgres views for PII

How would I set up a view that is for showing a restricted set of data for masking PII? Can a view be created which is available at lesser role access than the source tables? This is for Postgres ...
-1
votes
0answers
23 views

Driver Sql Server Pentaho with limit commits

I have a job in Pentaho that performs an INSERT on SQL Server. This table Input has a "commit size" of 1000 lines. Everything was working fine until switching to a Paas bank. After that, the ...
-3
votes
0answers
28 views

guidance on building a blog database structure

I'm attempting to design and build a data structure for a blogging platform. the business of my website follows users can create articles. articles must include one of predefined generic category, ...
0
votes
1answer
34 views

Referencing a system function from a DB with a lower compatibility level

I need to be able to parse a string array with STRING_SPLIT on a SQL 2016 instance. The vendor has required the one user DB we have access to be set with a compatibility level of 100 while the system ...
1
vote
1answer
21 views

Temp files and work_mem

My Postgres instance is logging things like this: 2021-11-16 22:18:52.491 UTC [1808765]: [3-1] db=xxx,user=xxx LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp1808765.0", size 262144 My ...
0
votes
0answers
49 views

Excessive TempDB Usage When Using Pivot + Temp Tables

I have a stored procedure that is acting quite strangely, it basically works in this way: --Populate #tmpActualsVertical with data(in this example 84,652,788 rows) SELECT ...
0
votes
0answers
16 views

What exactly is a persistent storage database?

I have to load some stuff(data) onto a "persistent storage database." The assignment says: 'Please use some sort of network-accessed database like MySQL or Cassandra, but it may be any such ...

15 30 50 per page
1
3 4
5
6 7
1867