Pg_rewind Uitility – PostgreSQL Snapshot standby

We have Primary-secondary PostgreSQL Streaming replication.

I have done some testing.

Steps.

1.Promote secondary

2.Run some DML on secondary which is in Write mode(another new primary)

3.Down new primary

4.Re-attach with primary using pg_rewind utility.

So, Can we use these steps to create snapshot standby database like we have in Oracle database.

“ORA-01109: database not open” when trying to open a database

Everything I can find about ORA-01109 says "run alter pluggable database XXX open;", but I’m getting ORA-01109 when running that command!

select name, open_mode from v$ containers;

NAME         OPEN_MODE  ------------ ---------- CDB$  ROOT     MOUNTED    PDB$  SEED     MOUNTED    XEPDB1       MOUNTED 

alter pluggable database cdb$ root open;

Error starting at line : 2 in command - alter pluggable database cdb$  root open Error report - ORA-01109: database not open 01109. 00000 -  "database not open" *Cause:    A command was attempted that requires the database to be open. *Action:   Open the database and try the command again 

Why am I not able to add a user?

I’m running command grant all privileges on *.* to 'username'@localhost identified by 'strong password';, but I get the error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘identified by ‘strong password” at line 1.

I can add a user separately and then assign it the privileges on the database, but I’d like to add the user and assign privileges in a single command. MySQL version:

| version                  | 8.0.23-0ubuntu0.20.04.1       | | version_comment          | (Ubuntu)                      | | version_compile_machine  | x86_64                        | | version_compile_os       | Linux                         | | version_compile_zlib     | 1.2.11                        | 

php mysql create an entry into a field. (INSERT INTO) WHILE logged in currentuser/session

I did the php registration system and it works https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php

but i created extra fields in the DB so the user can add some data to the database.

All search results are only to add to database from scratch, not from CURRENT SESSION USER. or they are just how to make php user reg systems but no further PHP CURRENT SESSION user interaction with DB

DB structure is just like on that site, i posted above, but created a URL field so a user can save their favorite URL. DB = **users > username > URL ** once i get that working im going to figure out how a user can append to the field and keep adding URLs

i came up with this.. .

if (isset($  _SESSION['loggedin']) && $  _SESSION['loggedin'] == true) { echo "<a href="file.php?save=yes>Add to Favorites</a>";}   if(isset($  _GET['save'])){          echo "got a save";      userID = $  _SESSION["username"];      echo $  userID; //it does give the current username, meaning im logged in , session-start is on the header .        $  URL = $  _GET['URLforbookmark'];      $  sql = "INSERT INTO users (URL, UserID)      VALUES ('$  URL', '$  UserID')";            if (mysqli_query($  sql)) {         echo "New record created successfully !";      } else {         echo "Error: " . $  sql . " " . mysqli_error($  sql);      }      mysqli_close($  sql); } 

Feedback Error reads: Error: INSERT INTO users (test, UserID) VALUES (‘theusersfavorurl’, ”)

thank you !

Retrieve date that sequence value was used?

I have an OOB system that has hundreds of tables. Each table has a ROWSTAMP column (integer) that gets populated by a trigger — each time a record is created or updated. All the tables/triggers use the same db sequence. Each time a record is updated anywhere in the db, that one sequence is used to get the next available integer. (I suppose I could consider the sequence to be a sort of global sequence).

IBM: Usage of ROWSTAMP column in Maximo tables

It’s unfortunate that those ROWSTAMP columns are integers, and not dates. What I really need in the tables are CHANGEDATE columns. Dates would be useful for data entry troubleshooting, reporting, and analysis in general. But I can’t really justify customizing hundreds of tables and adding hundreds of triggers in the OOB system. The customized tables wouldn’t be supported by IBM and it wouldn’t be worth the effort/added complexity.

I feel like those ROWSTAMP columns are so close to being useful to me. I can’t help but wonder:

Is there a way to retrieve the date that those ROWSTAMP sequence values were generated?

For example, and I doubt this is possible, could I add a DATE column to the sequence, and then join from my table to the sequence to get the date? Or could I use some sort of logging mechanism on the sequence to put rows (with dates) in a table whenever the next sequence value is used?

Msg 8114, Level 16 , State 5, Line 1 Error converting data type nvarchar to float error

Just having some issue when trying to combine table using the union function keep getting this error as above

Msg 8114, Level 16 , State 5, Line 1
Error converting data type nvarchar to float error

SELECT * FROM dbo.['202004-divvy-tripdata$  '] UNION ALL  SELECT * FROM dbo.['202005-divvy-tripdata$  '] UNION All SELECT * FROM dbo.['202006-divvy-tripdata$  '] UNION all  SELECT * FROM dbo.['202007-divvy-tripdata$  '] UNION all SELECT * FROM dbo.['202008-divvy-tripdata$  '] UNION all SELECT * FROM dbo.['202009-divvy-tripdata$  '] UNION ALL SELECT * FROM dbo.['202010-divvy-tripdata$  '] UNION ALL SELECT * FROM dbo.['202011-divvy-tripdata$  '] (UNION ALL SELECT * FROM dbo.['202012-divvy-tripdata$  ']) -----> here is where it stops working and I get an error message as shown above.  

Can I get help on this?

How to enforce that a company has a ceo?

I’ve a requirement to ensure that every company has an owner. Example database model with requirements @db<>fiddle.

I’ve tried following ideas:

  1. use before update or delete trigger: look at the graph and try to guess what happens after execution. It doesn’t work, because it’s executed immediately.
  2. use after update or delete constraint DEFERRABLE INITIALLY DEFERRED trigger: how check count of ceos’ if staff is deleted too? Or how to allow, if company is deleted with staff and role? And it isn’t easy to test with pgtap.

Any further ideas? Thanks!

Recovering InnoDB database from backed up “data” folder in XAMP in Windows 10

I copied the data directory from mysql folder and uninstalled the XAMPP as the MariaDB was not starting. I installed XAMPP same version and backed up the data folder into mysql data directory. At first only copied the required database folder named production inside the mysql data directory. PhpMyAdmin showed the tables correctly though no record/row was there and it showed "Table doesn’t exist in engine". Then I copied all the contents from the DATA folder to the mysql data folder and now it does not start. Now the problem is MariaDB is not starting. I tried setting the innodb_force_recovery but it failed to start the mysql.

The error log is given below:

2021-06-11  0:08:23 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2021-06-11  0:08:23 0 [Note] InnoDB: Uses event mutexes 2021-06-11  0:08:23 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2021-06-11  0:08:23 0 [Note] InnoDB: Number of pools: 1 2021-06-11  0:08:23 0 [Note] InnoDB: Using SSE2 crc32 instructions 2021-06-11  0:08:23 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M 2021-06-11  0:08:23 0 [Note] InnoDB: Completed initialization of buffer pool 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\applied.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`applied``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`applied` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\data.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`data``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`data` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\data_employer.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`data_employer``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`data_employer` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\education.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`education``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`education` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\education_list.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`education_list``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`education_list` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\industry.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`industry``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`industry` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\jobs.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`jobs``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`jobs` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\login.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`login``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`login` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\login_admini.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`login_admini``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`login_admini` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\login_employer.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`login_employer``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`login_employer` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\resume.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`resume``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`resume` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\jobs\selected.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``jobs`.`selected``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `jobs`.`selected` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\projects\entries.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``projects`.`entries``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `projects`.`entries` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\projects\geoname.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``projects`.`geoname``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `projects`.`geoname` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\projects\geonamebackup.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``projects`.`geonamebackup``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `projects`.`geonamebackup` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\projects\pincodes.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``projects`.`pincodes``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `projects`.`pincodes` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\projects\specifier.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``projects`.`specifier``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `projects`.`specifier` because it could not be opened. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 3 in a file operation. 2021-06-11  0:08:23 0 [ERROR] InnoDB: The error means the system cannot find the path specified. 2021-06-11  0:08:23 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2021-06-11  0:08:23 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\projects\users.ibd' OS error: 203 2021-06-11  0:08:23 0 [ERROR] InnoDB: Operating system error number 203 in a file operation. 2021-06-11  0:08:23 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/ 2021-06-11  0:08:23 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``projects`.`users``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue. 2021-06-11  0:08:23 0 [Warning] InnoDB: Ignoring tablespace for `projects`.`users` because it could not be opened. 2021-06-11  0:08:23 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2021-06-11  0:08:23 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2021-06-11  0:08:23 0 [Note] InnoDB: Setting file 'D:\Program Files\XAMP\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2021-06-11  0:08:23 0 [Note] InnoDB: File 'D:\Program Files\XAMP\mysql\data\ibtmp1' size is now 12 MB. 2021-06-11  0:08:23 0 [Note] InnoDB: Waiting for purge to start 2021-06-11  0:08:23 0 [Note] InnoDB: 10.4.19 started; log sequence number 1515509790; transaction id 611499 2021-06-11  0:08:23 0 [Note] InnoDB: Loading buffer pool(s) from D:\Program Files\XAMP\mysql\data\ib_buffer_pool 2021-06-11  0:08:23 0 [Note] Plugin 'FEEDBACK' is disabled. 2021-06-11  0:08:23 0 [Note] Server socket created on IP: '::'. 

Can’t remove “synchronizing/suspect” database after removed from availability group Sql Server 2019 Enterprise

I’ve removed a db from a synchronous availability group.The db shows "synchronizing/suspect" as it should. I’m trying to remove this database cannot. I have tried:

DROP DATABASE [db1]; 

but get "Cannot drop database "db1" because it is currently in use.". even though their are no sessions using this database.

ALTER DATABASE [db1] SET OFFLINE; 

but get "ALTER DATABASE failed because a lock could not be placed on database ‘db1’. Try again later."

ALTER DATABASE [db1] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 

but get "ALTER DATABASE failed because a lock could not be placed on database ‘db1’. Try again later."

ALTER DATABASE [db1] SET EMERGENCY; 

ALTER DATABASE failed because a lock could not be placed on database ‘db1’. Try again later.

This is a 24/7 production db and restarting is not a good option.

Any advice?