OCC commands in shared hosting! "occ db: add-missing-indices
With issue #11491 three points were solved. The following are still pending:
Fehlender Index "owner_index" in der Tabelle "oc_share".
Fehlender Index "initiator_index" in der Tabelle "oc_share".
Regards, Thomas
Hi, I solved with this thread (also the big int matter):
https://help.nextcloud.com/t/the-database-is-missing-some-indexes-and-some-columns-in-the-database-are-missing-a-conversion-to-big-int-with-phpmyadmin-and-or-cron-job-cant-use-occ-command-in-shared-hosting/42976/4
Be careful, read it till the end ;-) Marco
Thanks for the hint. I have tried accordingly. I made a database backup before and of course it did not work, because I DID NOT not read until the end. ;-)
So for all those who like a working summary here it comes:
Issue #1
Error Message (in German):
In der Datenbank fehlen einige Indizes. Auf Grund der Tatsache, dass das Hinzufügen von Indizes in großen Tabellen einige Zeit in Anspruch nehmen kann, wurden diese nicht automatisch erzeugt. Durch das Ausführen von "occ db:add-missing-indices" können die fehlenden Indizes manuell hinzugefügt werden, während die Instanz weiter läuft. Nachdem die Indizes hinzugefügt wurden, sind Anfragen auf die Tabellen normalerweise schneller.
Fehlender Index "share_with_index" in der Tabelle "oc_share".
Fehlender Index "parent_index" in der Tabelle "oc_share".
Fehlender Index "owner_index" in der Tabelle "oc_share".
Fehlender Index "initiator_index" in der Tabelle "oc_share".
Fehlender Index "fs_mtime" in der Tabelle "oc_filecache".
Solution if you have root access: occ db: add-missing-indices
SQL commands in database if you do not have root access:
ALTER TABLE oc_share ADD KEY share_with_index (share_with) USING BTREE;
ALTER TABLE oc_share ADD KEY parent_index (parent) USING BTREE;
ALTER TABLE oc_filecache ADD KEY fs_mtime (mtime) USING BTREE;
ALTER TABLE oc_share ADD KEY owner_index (uid_owner) USING BTREE;
ALTER TABLE oc_share ADD KEY initiator_index (uid_initiator) USING BTREE;
Issue #2 Error message (in German):
Bei einigen Spalten in der Datenbank fehlt eine Konvertierung in big int. Aufgrund der Tatsache, dass das Ändern von Spaltentypen bei großen Tabellen einige Zeit dauern kann, wurden sie nicht automatisch geändert. Durch Ausführen von "occ db:convert-filecache-bigint" können diese ausstehenden Änderungen manuell übernommen werden. Diese Operation muss ausgeführt werden, während die Instanz offline ist. Weitere Einzelheiten findest Du auf der zugehörigen Dokumentationsseite.
activity.activity_id
activity.object_id
activity_mq.mail_id
filecache.fileid
filecache.storage
filecache.parent
filecache.mimetype
filecache.mimepart
filecache.mtime
filecache.storage_mtime
mimetypes.id
storages.numeric_id
Solution if you have root access: occ db: convert-filecache-bigint
SQL commands in database if you do not have root access:
ALTER TABLE oc_filecache MODIFY fileid bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE oc_filecache MODIFY storage bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_filecache MODIFY parent bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_filecache MODIFY mimetype bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_filecache MODIFY mimepart bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_filecache MODIFY mtime bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_filecache MODIFY storage_mtime bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_activity MODIFY activity_id bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE oc_activity MODIFY object_id bigint NOT NULL DEFAULT '0';
ALTER TABLE oc_activity_mq MODIFY mail_id bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE oc_storages MODIFY numeric_id bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE oc_mimetypes MODIFY id bigint NOT NULL AUTO_INCREMENT;
This has been tested on a Strato hosted website without root access.
Regards, Tom
Thanks! This helped me a lot. I'm having these messages for ages now...