Database "template0" is not currently accepting connections
DBA Stack Exchange
by BAE
2d ago
i got the following error database "template0" is not currently accepting connections How to vaccum it? Thanks UPDATE i got the following yesterday postgres=> select * from public.test; WARNING: database "template0" must be vacuumed within 33781829 transactions HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database. You might also need to commit or roll back old prepared transactions, or drop stale replication slots. I got the following now: postgres=> drop table public.test; ERROR: database is not accepting commands to avoid wraparound data loss in dat ..read more
Visit website
Running sp_repldone on a secondary node of an Availability Group with @reset = 1 not working
DBA Stack Exchange
by Hannah Vernon
2d ago
I have a two-node SQL Server 2019 Availability Group with a database that has CDC enabled for several tables. The CDC is used to keep track of transactions that have not been captured for population into a data warehouse. The Availability Group is configured with multi-subnet failover, with readable secondaries. The application replicates transactions captured via CDC by using sp_repltrans to get a list of transactions, which it then reads via the undocumented function fn_dump_dblog. Once a transaction has been captured and integrated into the data warehouse, the app marks the transaction as r ..read more
Visit website
MySQL no selected database without setCatalog
DBA Stack Exchange
by Petar Vasiljevic
2d ago
I run this query select * from database_name.table_name over JDBC and it fails. It fails with the exception : SQLTransientConnectionException: (conn=4444889) No database selected Caused by: MariaDbSqlException: No database selected Caused by: SQLException: No database selected at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:79) at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:158) at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:262) at org.mariadb.j ..read more
Visit website
Serialisable Schedule but not View Serialisable
DBA Stack Exchange
by revision
2d ago
These are the definitions I have for Serialisable and View Serialisable. I know that View Serialisability => Serialisability and I want to find an example of a schedule that is Serialisable but not view serialisable ..read more
Visit website
PostgreSQL - Sum all row that satisfy a condition into a single row
DBA Stack Exchange
by Mateja Maric
2d ago
I'm trying to extract some statistics from a Postgres database and I made this query: SELECT city, job_count, TO_CHAR(job_count * 100 / SUM(job_count) OVER (), '90D00%') AS job_share FROM ( SELECT localities.name as city, COUNT(*) AS job_count FROM jobads JOIN localities ON jobads.locality_uuid = localities.uuid WHERE jobads.external = true GROUP BY localities.name ORDER BY job_count DESC ) AS job_count_table; Here's the result it returns: city | job_count | job_share -----------------------+-----------+----------- City #1 | 13 ..read more
Visit website
XML parsing: line 1, character 2908, illegal qualified name character
DBA Stack Exchange
by Marcello Miorelli
2d ago
while querying the msdb database looking for failing jobs, I am getting this error message: Message: XML parsing: line 1, character 2908, illegal qualified name character Error: 9455 Severity: 16 State: 1 the code that I am running is: set nocount on DECLARE @test varchar(20), @key varchar(100) if charindex('\',@@servername,0) <>0 begin set @key = 'SOFTWARE\MICROSOFT\Microsoft SQL Server\'+@@servicename+'\MSSQLServer\Supersocketnetlib\TCP' end ..read more
Visit website
Setting log level for MongoDB
DBA Stack Exchange
by Parag Kadam
2d ago
I am looking to set log level to Error(E) for all the components except for the control component which should have the log level set to Informational(I). Also, I would like to log slow queries which takes more than 1000ms. Having gone through the documentation I am confused as to which verbosity level refers to Error(E) and which refers to Informational(I) because from 1-5 is all Debug log level. Any suggestion would be really appreciated. PS: I am using MongoDB 4.2 ..read more
Visit website
Renaming a SQL Server database [closed]
DBA Stack Exchange
by Dominique
2d ago
I have just renamed a database in Microsoft SQL Server Management Studio (from <Company>_<Customer> into <Company>_<Customer>_orig. As you can guess, it's the idea to restore another backup for investigation purposes, delete that backup and return the "DB_orig" back into "DB" (something like that). However, after having renamed the database, when I try to restore the backup, I get the error message that the "MDF" file has not been renamed. After checking (Database properties, Files), I can see the names of the files, so I decide to rename the file in the "Logical Names ..read more
Visit website
Railway - problems with connecting to postgres in production
DBA Stack Exchange
by Mikheil
2d ago
Django worked perfectly locally, but had errors in production (I was using the same postgres DB and configuration). Django server, hosted on Railway gave me this: Newtorking tab in Postgres settings on Railway: Postgres logs locally: Settings: (WORKED PERFECTLY ON A LOCAL MACHINE WITH THIS IN-PROD DATABASE AND SAVED DATA) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', //tried django.db.backends.postgresql, not working 'NAME': os.getenv('DB_NAME'), 'USER': os.getenv('DB_USER'), 'PASSWORD': os.getenv('DB_PASSWORD'), 'HOST': os.getenv('DB_HO ..read more
Visit website
How can I find a topmost row and count the rows with only one scan?
DBA Stack Exchange
by user570286
2d ago
Suppose that I have a schema like the following: -- Many rows CREATE TABLE t1(i INTEGER PRIMARY KEY, c1 INTEGER, c2 INTEGER); -- t1's rows with c1 even CREATE VIEW t1_filtered(i, c1, c2) AS SELECT i, c1, c2 FROM t1 WHERE c1 % 2 == 0; -- The real WHERE clause is slightly more complex. Suppose that table t1 contains some millions of rows: INSERT INTO t1(i, c1, c2) SELECT value, random(), random() FROM generate_series(1, 5000000); Suppose that I want to get both the index of the row in t1 that has the highest even c1 and the count of rows with even c1 that also have even c2: SELECT (S ..read more
Visit website

Follow DBA Stack Exchange on FeedSpot

Continue with Google
Continue with Apple
OR