All Questions
101,211
questions
0
votes
1
answer
8
views
Whether to run integrity check before or after backups (Ola H FAQ)?
Going through Ola H FAQ's, https://ola.hallengren.com/frequently-asked-questions.html, I see that
I also recommend that you perform the full backup after the integrity
check.
Isn't the opposite true?...
0
votes
0
answers
3
views
Hashes vs key scan in REDIS
My team is using Redis for caching and I want to cache the following structure:
inbox --(1 to many)-> folders --(1 to many)-> messages
It's just a simple tree with no nesting, and each inbox/...
0
votes
0
answers
4
views
MySQL is corrupted and not able to start mysql even after innodb_force_recovery=6
Here are Error logs from MySQL:
2023-09-25T23:38:12.380772Z 0 [System] [MY-013105] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Normal shutdown.
2023-09-25T23:38:14.418767Z 0 [...
0
votes
0
answers
14
views
Update parent table, based on one record from children table (one-to-many)
I have a Persons table, which has a DefaultEamil column.
I also have an Emails table which has PersonId, Value, IsDefault columns. A person can not have multiple default emails. There is an index ...
1
vote
1
answer
8
views
MariaDB 11.0 to 11.1 GA fails with ERROR 1210 (HY000) at line 32: Incorrect arguments to DATA DIRECTORY
I upgraded to MariaDB 11 some time ago, and all has been working well for a long time. I saw there was a newer GA release, 11.1, so decided to update to that, but the upgrade fails. This is on Windows ...
0
votes
0
answers
28
views
How to Count calculated work hours in one month for each labors
Good Day.
I have some data like bellow
id name in out
1 lala 2023-09-29 07:00:00 2023-09-29 17:00:00
2 lili 2023-09-29 07:30:00 2023-09-29 16:00:00
1 lala ...
0
votes
0
answers
34
views
Convert a list-of-IDs column into a junction table
I have a table, Office, with a column that contains lists of ids representing many-to-many relationships:
TABLE Office {
OfficeId int IDENTITY(1,1) NOT NULL,
CubeIds NVARCHAR(MAX) NULL, --values ...
1
vote
0
answers
10
views
There was a recoverable, provider-specific error, such as an RPC failure. SQL to MySQL linked server no longer working
I have been searching all day and trying every manner of solution that I come across, yet nothing has resolved this issue.
Here is my was working code:
delete RemoteTable from OPENQUERY (LIGHTSAIL, '...
1
vote
0
answers
18
views
Migrating from PostgreSQL to MySQL (data with \r\n)
I'm trying to migrate a database from PostgreSQL to MySQL on an Ubuntu 23.04 system (latest version of both).
So far, it looks like things are fine, except for one problem. In one of the character ...
0
votes
1
answer
31
views
Configuring a Failover Cluster Fileshare Witness?
I'm relatively new to high availability groups in SQL Server, and am hoping for a bit of advice on best practices for configuration. I didn't set up this configuration, I inherited it and am trying to ...
0
votes
0
answers
12
views
How do I temporarily enable mysql.general_log in AWS Aurora Serverless V2?
I am trying to debug an issue and I just need to see the general log of a mysql instance. Is there any way of temporarily enabling or routing the logs to a file/cloudwatch for a minute or so?
...
-1
votes
0
answers
26
views
for loop causing a deadlock in SQL stored procedure
I've spent long time try to solve this deadlock. The daedlock is in the _dbcontext.DeleteTags(tag);
The AddTags and DeleteTags goes to the same graphtable (this is the reason that I can't use EF to ...
0
votes
1
answer
13
views
Postgres table structure optimization: separate small field from large jsonb fields
A table has the following structure:
a: id
b: large jsonb
c: large jsonb
d: timestamp
Looking at stats in 2 weeks, see many updates:
90k requests updates the "d" field alone (total time: ...
0
votes
1
answer
20
views
I am looking for a Postgre SQL query which should list out all tables being used in a function
PostgreSQL query which should list out all tables being used in a function.
Need help on this.
exmple: Let say Function_name is 'A' and 4 tables are being used in that function(X,V,B,N). Need query ...
0
votes
0
answers
19
views
Performance Issues with Concurrent Queries During Mass Update in PostgreSQL
I have a PostgreSQL table with a large amount of data (2 terabytes) where I recently performed a mass update to add UUID values to a column (uuid_column). While the update was successful, I am ...
0
votes
1
answer
27
views
Why use $group / group_by instead of multiple requests?
Let's suppose that there are 100 types of dogs scattered across the documents of my collection. If I need to group by types of dogs and then compute some aggregate statistic about each type of dog, ...
0
votes
0
answers
23
views
Why doesn't PostgreSQL lookup by PK first (when `WHERE` contains more conditions)?
When I run this against my PostgreSQL DB (where the id column on the courses table is the primary key, and there's also an index on is_deleted, which is a boolean):
SET enable_seqscan = OFF;
EXPLAIN ...
2
votes
1
answer
34
views
How to use aggregate column in where clause when using group by
I've following table
CREATE TABLE `books` (
`book_id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) DEFAULT NULL,
`author_fname` varchar(100) DEFAULT NULL,
`author_lname` varchar(100) ...
0
votes
1
answer
31
views
Configuring Always On Availability Groups sql Server 2019 and log backup
We want migrate to sql 2019 and I did the test and set up Hight availability with twho 2 nodes,but and the set up of AG I have four option,
I gave that option a shared path for the transaction log ...
0
votes
0
answers
21
views
link feature - Azure SQL Managed Instance multiple databases
Is it possible to replicate two databases in the same DAG to an Azure MI?
Or is it possible to configure two DAG (single db) pointing to the same Azure SQL MI?
https://learn.microsoft.com/en-us/azure/...
0
votes
2
answers
93
views
SQL Server database with 100 terabyte of data
We have been assigned a new application where the vendor is expecting the database to grow to around 100 TB. They have mentioned SQL Server Standard Edition is compatible.
My question is whether SQL ...
0
votes
1
answer
45
views
Availability group issues - databases not synchronising
I am hoping someone may be able to offer some assistance with an issue that I do not seem to be able to work around.
We have 2 on-premise SQL Server 2019 machines in an always on availability group. ...
0
votes
1
answer
12
views
What is the meaning of lsn_time_mapping.start_lsn
I have enable Change Data Capture on a table. I'm trying to understand cdc.lsn_time_mapping. Unfortunately the documentation is vague and missing a column from the results.
What's the difference ...
0
votes
0
answers
41
views
SQL Server unexplained network traffic gaps in traced events
This appears to have started happening a week, maybe two weeks ago.
Essentially, we cannot figure out whether it is the server or the client that is periodically pausing between SQL statements. In the ...
1
vote
1
answer
40
views
Postgres heavy updates cause fast table growth
I have a question related to an incident that happened on one of our Postgres DBs.
We have a backend service that keeps track of user's activity in some kind of online event. The service uses Postgres ...
1
vote
1
answer
15
views
pg_restore drops extension plpgsql
We face a situation where pg_restore drops extension plpgsql and then recreates it. This is done by a CI job we have but i could not reproduce it. These are the commands we use:
pg_dump -d $...
0
votes
0
answers
21
views
Switch slave to new master
I have one master and 2 slaves in a mysql replication mode. All slaves are synchronised to the actual master.
Because of space disk problem, I have to shutdown master_old to switch the first slave to ...
1
vote
2
answers
49
views
How to order by COALESCE by some fields?
Let says I've this query:
DECLARE @QueryString NVARCHAR(MAX) ;
SELECT @QueryString = COALESCE(@QueryString + ' UNION ALL ','')
+ 'SELECT '
+ '''' + ...
0
votes
0
answers
16
views
SQL Server subscription that can work without the publisher
My requirement is to have a SQL Server replicated on another server and even if the publisher server is shut down unexpectedly the subscriber should have all the information and can be used without ...
-2
votes
1
answer
33
views
Clients which have seen an impression of a product at least 3 times before purchasing it- most optimal answer for Billions-record table
or a project I am working on I was asked to solve this task:
Given the table
**events**
event_id int (autoincrement) --10B distinct values
event_ts datetime -- 10B
event_type int (1 = impression, ...
-4
votes
0
answers
22
views
Unable to call a procedure for loop [closed]
Create table looptable
Delimiter$$
Create procedure interestingdata()
Begin
Set @var=10;
Generate_data : loop
If @var %3 = 0 then
Set @var= @var+1
Insert into looptable values(@var)
If @var = 100 ...
0
votes
1
answer
18
views
Postgres changing data type from timestamp to timestamptz (with time zone)
I recognize there are some similar questions, and I've read quite a few, so pardon me if I just missed the answer.
I have data that was stored as a TIMESTAMP data type, but now we want it to be stored ...
0
votes
0
answers
19
views
SQL Server 2019 CU22 error Using 'dbghelp.dll' version '4.0.5' & non-yielding on Scheduler
I've had SQL Server 2019 with CU22 on Windows 11 Pro.
We use this database during hardly 1 year.
Usually between 26-28th every month we have scenario:
1.Database save in log file message "Using '...
0
votes
0
answers
5
views
Java Inheritance - Hibernate6 + JPA - How to prevent selecting all child tables when joining on parent?
I'm working on a Java application that uses Hibernate6 + JPA.
I have classes like
class Thing {
Parent parent
}
class Parent {
}
class ChildA extends Parent {
}
class ChildB ...
0
votes
0
answers
15
views
Migrate existing Postgres table with foreign key references to declarative partitioning
I want to apply declarative partitioning to a Postgres table referenced by many other tables with foreign key constraints.
As far as I can tell, Postgres provides limited support for this. The entire ...
0
votes
0
answers
25
views
Mongodb database hosting limitations and options
So I'm currently working on an application in node js and I'm using mongodb as the database for the server, it all went well until I got to the point of hosting the database.
I've came across mongodb ...
0
votes
0
answers
19
views
sql server transactional replication high latency
I am new to system and we have database of size around 2TB and its has been set up for replication. there are 4 subscriber to it. Tables (articles) of database has been divided into 14 publishers. ...
2
votes
1
answer
84
views
Why does is JSON_EXTRACT's return value treated differently depending on the operator?
I'm using MySQL 8.0 (inside Azure Database for MySQL Server).
I've noticed some strange behavior while querying with the "json_extract" functionality. In the example below, I am querying a ...
0
votes
1
answer
37
views
How to efficiently retrieve total row count along with paginated results?
I'm using pagination in my SQL Server query to limit the number of records returned at a time. I achieve this by providing @PageSize and @PageNumber variables to my query like so:
ORDER BY [Name] ASC
...
0
votes
2
answers
20
views
How I can check whether 2 databases haves same data and schema fast?
A coleague of mine has does a mysqldump into the same db server.
I want to know when it is complete so I can use it.
Is there a way to compare 2 databases and check whether dump is complete. I assume ...
0
votes
2
answers
36
views
I installed MariaDB 11.0 and there is no mysqldump.exe, any symlinks or any other program with 'dump' in its name
I have a script that I can not modify and that relies on mysqldump.exe
I am using Windows 10. What can I use instead? I need to export a database into a file.
0
votes
0
answers
10
views
Using CDC on Read only Secondary Managed instance
We are planning to migrate our on-premises database to Azure Managed instance. Is it possible to use Read Only secondary of the managed instance for CDC.
0
votes
2
answers
70
views
SYS password has expired and cannot be changed due to ORA-00257: Archiver error
In the past : When I had once the error ORA-00257: Archiver error, I had resolved it using the RMAN command:
rman target sys/1234
delete archivelog all;
This time , when I try to connect to rman ...
0
votes
1
answer
15
views
Adding subtotals using GROUPING SETS
For a data table I would like to create the following table:
store
department
gender
workers_count
A
Light
Male
10
A
Light
Female
5
A
Plumbing
Male
20
A
Plumbing
Female
0
2
35
B
Food
Male
12
...
1
vote
1
answer
41
views
MySql count using and still show all data even using where clause
Good Afternoon,
How i can show all data when using count and where clause in MySql.
In my case, I have master data like pict at below.
and i using this query to show count the data.
SELECT body,
...
0
votes
0
answers
30
views
New column that subtacts 2 rows from a different column and pushing out the difference number
I am doing this query, I want to be able to take 2 values from different rows from 1 column(Population growth rate) subtract them from each other, and put that value into the new column(...
0
votes
1
answer
33
views
When using multiple basic AGs is it recommended to use 1 listener or mirroring endpoint?
I want to setup HA DR for a single instance SQL server by adding a new instance on another machine and configuring multiple basic AGs (with manual failover mode).
I want all client apps to be able to ...
0
votes
1
answer
47
views
PostgreSQL 15 pg_read_file absolute path not allowed
When not superuser but granted the pg_read_server_files role,
with statement
select * from pg_read_file('E:\PG_VERSION');
PostgreSQL 15 got a error "absolute path not allowed" while 14 is ...
0
votes
1
answer
35
views
SQL Server Service Broker on a High Availability Group
I'm using a instance with Microsoft SQL Server 2016 || Enterprise Edition and I need to enable Service Broker for my database with this sentence:
ALTER DATABASE DB SET ENABLE_BROKER;
The size of the ...
-2
votes
0
answers
27
views
UPDATE QUERY ACROSS TWO TABLES JOINED BY ANOTHER MSSQL
I have two tables. table1 I would like to use to update table2, i.e. table1.displayvalue to table2.fields. I would like it to match the rows.
They are joined like this:
table1.sectionid = table3....