Is that a MySQL/MariaDB or PostgreSQL database?
Take the values from your config/config.php:
DB_HOST = 'dbhost'
DB_USER = 'dbuser'
DB_PASS = 'dbpassword'
DB_NAME = 'dbname'
If dbtype is mysql:
Open a terminal and enter
mysql --host=$DB_HOST --user=$DB_USER --password=$DB_PASS $DB_NAME --no-auto-rehash --default-character-set=utf8mb4
Now you should be inside of the MySQL/MariaDB command line console. If your database name is “nextcloud”, It should look like this:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 210114
Server version: 10.11.7-MariaDB-1:10.11.7+maria~ubu2204-log mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [nextcloud]>
now enter this repair command at the
MariaDB [nextcloud]>
prompt:
REPAIR TABLE oc_systemtag_object_mapping;
After that is ready, you can exit the MySQL/MariaDB Console with
\q
If dbtype is pgsql:
Open a terminal and enter
PGPASSWORD=$DB_PASS psql --host=$DB_HOST --user=$DB_USER -d$DB_NAME
Now you should be inside of the PostgreSQL command line console. If your database name is “nextcloud”, It should look like this:
psql (14.10 (Ubuntu 14.10-0ubuntu0.22.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
nextcloud=>
now enter this repair commands at the
nextcloud=>
prompt:
REINDEX INDEX oc_systemtag_object_mapping_pkey;
and
REINDEX INDEX systag_by_tagid;
After that is ready, you can exit the PostgreSQL Console with
\q
I hope this will repair the database table.
Much and good luck,
ernolf