All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
51 views

Populating bridge table with conditions [closed]

I have a bridge table trajectory_detail that I am supposed to populate with millions of records from the corresponding parent tables. The problem is that every value from parent table trajectory_id is ...
1
vote
0answers
16 views

How to check progress with mongorestore

I'm using mongorestore to move a dump from a location to another. I've to use the quiet flag and I'm on Windows. How can I check for restore progress? Actually I can only check the size of the db on ...
1
vote
0answers
25 views

2020-07-29T07:44:29.817503Z 108716 [Note] Aborted connection 108716 to db:

We are getting continuously logs in mysql error logs 2020-07-29T07:46:56.534666Z 111536 [Note] Aborted connection 111536 to db: '' user: '' host: '' (Got an error reading communication packets) we ...
0
votes
3answers
46 views

Simultaneous SQL full backups of newly created databases

I would like to take a backup of newly created databases but within a minute if the user creates three databases the script can able to take only one database but for one new database which was ...
0
votes
0answers
15 views

Best way to prevent lock wait timeout exceeded try restarting transaction

I'm not totally savvy about databases, I just know the basics. We encountered this problem while trying to query something from our database. This query occurs every 10 seconds. This is the first I ...
0
votes
2answers
53 views

LEFT JOIN not working as intended

I'm using mysql 8.0.21. I'm trying to join two tables such that I can find the index name of foreign keys. This is my query: SELECT KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA, KEY_COLUMN_USAGE....
0
votes
0answers
14 views

Is there any way to optimize my “random data storage” table?

I have a table like this for "general storage" of less-important random things here and there, which don't require their own dedicated table and which would be a lot of work to code as well ...
0
votes
1answer
8 views

How to Fetch A Record If Shipping And billing Address are Different

Show New Orders with Address If shipping and billing are different. I am stuck with this query. Can someone guide me a bit. Thanks
-1
votes
0answers
28 views

PostgreSQL COLLATE and Character Type - Values to use in a RDS Service hosted in Australia

We are using Aurora RDS PostgreSQL database in AWS Sydney (ap-southeast-2) The application requires an UTF-8 encoding. What should the Collation and character types be? LC_COLLATE="en_AU.UTF-8&...
0
votes
0answers
17 views

Best practice privileges and roles for postgres schema migration

I'm having a re-look at roles and privileges in postgres to minimise the damage that a compromised account can do. Ownership and migrations is a part I'm having trouble getting my head around. As I ...
0
votes
0answers
10 views

How restore a Postgres database on AMAZON RDS when the file is in another server?

I'm around 2 days to simply restore my database to an AMAZON RDS server. The tutorial page from AMAZON is so bad that I can't do a simple task like this. I have db_example.bak file on my local machine ...
0
votes
0answers
3 views

How to create hs oracle to SQLSERVER with rac scan

hi i am trying to create an hs for oracle rac for a course but i am unable to configure the hs How to configure the listener with scan_listener? hs example: odbc windows64 bits system dns: ...
0
votes
1answer
10 views

What does Oracle impdp do when a name clashes with a materialized view or synonym?

I have a production Oracle database, and I want to export tables, data, views, materialized views, synonyms, etc, to import into a development Oracle database. Actually, this is part of my job, and we ...
0
votes
1answer
38 views

How to update a UID throughout the database?

Our database makes use of uniqueidentifier and we have the need to update that value everywhere it's found in our system. Sample minimal structure: CREATE TABLE Users ( id uniqueidentifier not ...
0
votes
1answer
18 views

Insert results from query, update old existing row if query doesn't still return same value

I am trying to refactor a table which contains historical data and therefore isn't ever deleted, but has an 'active' field. Each day we run a query (a few joins, but quite slow) to get some data to ...
0
votes
1answer
14 views

How to exclude the entire result of a Grouped row based on a value of any of the rows it contains

I have a table that looks something like this: ID | Class | Item ---+-------+------ 1 | 1 | 1 2 | 1 | 2 3 | 2 | 1 4 | 2 | 3 5 | 3 | 2 and a query that looks something ...
0
votes
1answer
15 views

Storing Hex Colors in a column in Postgres

I want to store Hex color codes in a column in my Postgres database. I would like to put a restriction on the column to ensure it has the format of being a hex color (Example: #FFAA00) Some Example of ...
0
votes
0answers
52 views

https://localhost.com:5500/em not working [closed]

I installed Oracle 19c correctly. But when I tried to access it by "https://localhost.com:5500/em", it's not working. I followed this thread but didn't work for me. 5500 port is also open. ...
0
votes
1answer
10 views

Get SSIS to check if excel file is updated?

So I have a SSIS package that reads from an excel file and populates a Sql server database. It assumes that the file will be updated monthly, and consequently, the data pull to update it is also done ...
0
votes
1answer
23 views

Listing active PostgreSQL foreign data wrappers

I have a few foreign data wrappers set up from my main PostgreSQL database to other databases. Is there a table I can query to list all of the FDWs? Unfortunately select * from information_schema....
0
votes
1answer
20 views

count distinct column without null value in MySQL 5.7

how to distinct not contain null in MySQL, if I have a dataset like this: a b 1 null 2 1 I want to using sql like this: select count(distinct b) fromt table the expect result may output 2, but I ...
-1
votes
1answer
30 views

MYSQL EAV JOIN QUERY OPTIMISATION [closed]

I am creating a e-commerce website, which consist of product and its variants. So I decided to go with EAV for attributes mapping as I may have indefinite data like (size, color, material). But Now, I ...
0
votes
0answers
9 views

Disable auto-rehash when connecting to mysql via jdbc?

Is there a way to specify equivalent of no-auto-rehash when connecting to mysql via jdbc? I am trying to connect to a large db and the initialization is slow. If I connect without jdbc and specify -A,...
0
votes
1answer
27 views

Difference in MYSQL Master Slave DISK SPACE

I am using percona_mysql_5.6, both master and slave are in sync as terms of replication and table wise records are also same. However there is a difference is the disk space consumed. The slave is ...
1
vote
0answers
11 views

Getting bounds in result with width_bucket

I'm trying to do a query using width_bucket and having a column in the results with the bounds of my buckets. Is there a simple way to do this? My query: SELECT width_bucket( (EXTRACT(...
0
votes
0answers
29 views

How to set or grant SELECTINAUTH for a schema in DB2 11.5

I'm running DB2 11.5 and want to grant select, insert, update or delete rights for all tables in a specific schema. SELECTINAUTH etc. seems to be perfect for this. When I'm looking to the SYSCAT....
0
votes
0answers
12 views

MySQL: create ER diagram, but in text only

With MySQL Workbench it is possible to create a graphical ER diagram; however, this can become very messy when there are many tables and relations, so it might be good to have something like one or ...
0
votes
1answer
34 views

Is it possible to make a trigger that does not allow INSERT?

I'm currently learning how to implement sqlite commands through C code and I've been trying to figure out the best way to ensure that no data can be inserted to a table (which will only happen during ...
0
votes
1answer
39 views

SQL - Spilt timestamp into multiple rows

I am dealing with data that needs to be looked at on a shift-to-shift basis (8:00:00 to 20:00:00 and its reciprocal are the two shifts) There are instances where a timestamp (one row) will span longer ...
2
votes
1answer
22 views

Is it safe to have Mongo replicas on single server?

I am planning a minimum setup for a low traffic discussion forum. Everybody says to use replicas because otherwise I am in a risk of data loss. I see an advantage that I can add new more powerful node ...
0
votes
0answers
36 views

Query performance become slower after upgrade to MySQL 8.0.20

I have found bug/issue after update the MySQL Server from 5.7 to 8.0.20. When I run a query with the user-define function in 5.7(same session), the duration for each query is constant and stable. But ...
0
votes
0answers
11 views

MySQL: is root a special user?

That may sound like a silly question, but let me explain - I wanted to log on to MySQL as user root from several other systems, so I created this: mysql> create user root@`10.254.%.%` identified by ...
0
votes
2answers
42 views

How to properly and effective rename a vaue (column) of a foreign key in both tables?

I have 2 tables: users and user_statuses. A user status is of type varchar. It's varchar for the purpose of readability and I don't consider using id/int in this case. CREATE TABLE users( --.............
0
votes
0answers
8 views

is it possible to except some expect word when using distinct in MySQL 5.7

I am using this SQL to caculate transin user count : select sum(transin_num) as transinNum, case when count(distinct transin_user_num) -1 < 0 then 0 else count(distinct ...
0
votes
2answers
25 views

Mysql 8 - % CPU Wait

Is it normal in Mysql 8 to have a high percentage of CPU wait? (see image)
0
votes
0answers
15 views

High-performance query of two tables with count from second table?

I am searching for a high-performance query using two tables to output all locations (name) from country (adm0 = 'DE') in the geodb_locations table, sorted in descending order by the number of users ...
2
votes
0answers
30 views

Postgres NOT IN performance

I'm currently doing some exploratory work with Postgres 12, and have bumped into an issue I want to try and understand more about. My background is primarily Microsoft SQL Server, so I'm looking at ...
0
votes
0answers
33 views

Strict in OPENJSON not work well

I've a table for save sub tasks data. some time we change status of sub tasks, and i need both of them id and status in @JsonStatus parameter. I wrote a stored procedure like below : Declare @...
0
votes
1answer
26 views

Bulk Inserts in Postgres

This is with respect to Data Migration activity where the historical data from the client database is migrated to vendor Postgres Database. There will be millions of transactions that need to be ...
0
votes
0answers
8 views

The good method for full text search on one column may contain multi languages?

when I only have english. I use such way. add a new english_column to store tsvector. create gin index on the english_column. create trigger on insert or update. However. When I want to support ...
-2
votes
1answer
45 views

deleted Database data comming back overnight

I am a developer i am facing a situation where Web Application deletes data, on the next morning the deleted data is back on the Database. Yesterday some of our users spent the whole day deleting ...
0
votes
0answers
22 views

Deadlock On METADATA SERVER_PRINCIPAL

Hi Im using Microsoft SQL Server 2016 and i had Deadlock that include two procedures and the waitresource="METADATA: database_id = 1 SERVER_PRINCIPAL(principal_id = 1) from first lock database_id ...
0
votes
1answer
8 views

Select most recent record per day based on 3 columns

I have a table that looks like this: CREATE TABLE tbl_AppUsage( ID int IDENTITY(1,1) NOT NULL, UserName nchar(250) NULL, UPN nchar(250) NULL, AppDisplayName nchar(250) NULL, AppId nchar(250) NULL, ...
0
votes
1answer
12 views

OPENROWSET Bulk insert Text File NULL Columns

I need to automate a weekly import of .txt log files into a SQL database. I have already created my table, format file and can get some of the data to work using OPENROWSET BULK, but the data from the ...
1
vote
0answers
29 views

Unexpected result by MySQL Optimizer for identical queries?

Following query is working like expected and uses index Query takes 0,0481 sec SELECT geodb_locations.name, geodb_locations.name_url, COUNT(user.uid) AS useranzahl FROM user LEFT ...
1
vote
1answer
43 views

Trouble connecting to Oracle database with sqlplus and OS authentication

I am a read-only user to an oracle database, and the DBA gave me two accounts, one with a specific user name and password, and another with OS authentication. The OS authentication is supposed to let ...
0
votes
1answer
9 views

Is there a better way to summarize a table containing events of different types by identifier?

I have this table definition for sensor events: Table "public.sen_sensor_event" Column | Type | Collation | Nullable | Default ------------...
0
votes
1answer
10 views

Data sync between two local Mysql databases in different system in same netwrok

I am using mysql as database for my application and for the purpose of fail over and I need to sync the data from one local mysql database in system one to other local database in system 2 connected ...
-1
votes
0answers
3 views

Searching multiple files on OneDrive at once [closed]

one of my tasks at my new e-commerce job is regularly checking a OneDrive folder to check if certain files have been uploaded. Checking each filename one by one is tedious. Is there anyway I can run a ...
-1
votes
0answers
11 views

I am using mongoDB atlas's free tier but it limits me to 512 mb [closed]

I have data weighing up to about 1 gigabyte and the free teir only allows 512 mb are there any other services that offer a GB or more and can i store data locally for the time being

15 30 50 per page
1
5 6
7
8 9
1700