MariaDB Galera cluster - mariadb

Insert data into MySql DB from client(eg: 1000 inserts). While the insert happens, I stop DB which results in error state.How to resolve this? I need the remaining insert to happen once the DB is up and running. Is there a solution for this?

Related

Does table locking work in MariaDB master-master Replication?

I'm considering MariaDB master-master configuration for a webapp database.
My application has some index locking, something like:
SELECT COUNT(*) FROM person WHERE event=? FOR UPDATE;
The transaction checks the subscribers amount to an event and finally insert the new person only if the capacity is not reached, and then the lock is released with the COMMIT command.
I was wondering what happened if I enabled the master-master replica to two servers, for a first test is looks like the lock is completely ignored.
Do you please confirm index/table lock is not working with this configuration?
How usualy is resolved thing kind of problem when someone needs a multi-dbserver environment?

MariaDB - Unable to select the specified database: xxxx - after running a stored routine

I'm using MariaDB 10.1.21 installed on Ubuntu 16.4.0 and Apache2 installed on the same machine.
My problem is that from a while, after I run a procedure that makes many INSERTs, I get the error Unable to select the specified database: xxxx
We recently changed both HDD into SSD, to eliminate any suspicions about the latency.
However, even if the server's speed has been increased, .. I still get that MariaDB error.
I mention that the error persists for some seconds. After that, the web application is running ok , but the error may reapers from time to time until I restart the MySQL server.
The procedure body looks like here:
MySQL INSERT INTO table SELECT FROM another_table, inside a PROCEDURE
Any sugestion?
Wherever possible, avoid using CURSORs. SQL is designed to do things in bulk, not one row at a time.
Study constructs like
INSERT INTO ... SELECT ...;
CREATE TABLE ... SELECT ...;

Is it possible to mark an SQLite DB as a non-corrupt one

I have aborted vacuum with ctrl+c and deleted the journal (I thought it is useless for that case). Now it writes that the db is corrupt. I wonder if it is possible to mark the DB as non-corrupt without recreating it by translation to sql and back.

Checkpoint table does not exist even after creating it

I have created checkpoint table ggate for replicat rep1 but still I am getting following error:
2014-09-04 23:38:21 ERROR OGG-00446 Oracle GoldenGate Delivery for
Oracle, REP1.prm: Checkpoint table ggate.checkpoint does not exist.
Please create the table or recreate the REP1 group using the correct
table.
2014-09-04 23:38:21 ERROR OGG-01668 Oracle GoldenGate Delivery for
Oracle, REP1.prm: PROCESS ABENDING.
Can anyone tell me how to resolve it?
In this kind of situations you should:
Have you actually run the ADD CHECKPOINTTABLE? if not run it
Check if the checkpoint table actually exists in the database - if it has been created - try to drop it (DROP CHECKPOINTTABLE) and recreate it (ADD CHECKPOINTTABLE)
Check if the checkpoint parameter is correctly set in the GLOBALS config file
Restart the MGR and Extract/Replicat processes
Verify if the user has access on the database to the checkpoint table (insert, update, delete rights)
If nothing works, run 10046 flag on the target database and check what the GoldenGate Replicat process is executing on the database and when it actually fails (what it wants to do on the database and try to do the same commands by yourself)
This is a simple troubleshooting initiative:
Are you using a traditional non-CDB database or a PDB?
Are you using Classic Architecture or Microservices Architecture? - Different approaches when adding a checkpoint table.
How are you running ADD CHECKPOINTTABLE? From GGSCI/AdminClient or from HTML5 page?
In Classic Architecture, do you have CHECKPOINTTABLE parameter set in GLOBALS? (CHECKPOINTTABLE [container.] owner.table)
Who are you logged into the database as when using DBLOGIN USERIDALIAS?
What replicat are you using? - Classic, Coordinated, Integrated, Parallel?
Check the schema where the table is suppose to be? If not there, you can query the DBA_TABLES view for the name of the checkpoint table and see who owns it.
A lot of times when the checkpint table cannot be created it is due to not updating the GLOBALS file and/or connecting as the correct user to the database.

Subsonic: Select on a View, locks the table update?

I have a Web site live and running now. I am using the Subsonic to handle the database connections etc.
I am getting time out expired error while updating a table (say Employee). When I check sp_who2, I see the suspended connection for the PID which is updating with a block by anothor pid, so I run the profiler and found out when ever this suspended connection occur, the blocked pid is a select statement on the view (say ActiveEmployees, which is the same as the table but with some where conditions).
Anyone know why a Select statement on the view could cause failure in update. If it is other (like select fails due to update) may be reasonable.
Is there any way for me to make select on a view without locking the table?
PS: I am using the Sql server 2005 and subsonic 2.2.
You might add with(nolock) hint to the select statement in the view if you don't care about accuracy of the returned data (it will return uncommited rows possibly).
We encountered timeouts also when the select statements where scanning a table that other thread was inserting into. I resolved the issue by adding appropriate index that is used by our select.

Resources