Menü Schließen

Nextcloud fehlende Indizes in der Datenbank

Nextcloud Logo

Einer meiner Nextcloud Server zeigt unter “Übersicht” das fehlen von Indizes in der Datenbank.

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”.

Die Lösung wird auch mitgeliefert und sieht wie folgt aus:

Nextcloud fehlende Indizes in der Datenbank setzen

  • auf dem Server mit Root-Rechten verbinden
  • in das Hauptverzeichnis von Nextcloud wechseln
  • Owner der Installation mittels # ls -l occ herausfinden z.B. www-data
  • Befehl ausführen: # sudo -u www-data php occ db:add-missing-indices

Check indices of the share table.
Adding additional share_with index to the share table, this can take some time…
Share table updated successfully.
Adding additional parent index to the share table, this can take some time…
Share table updated successfully.
Adding additional owner index to the share table, this can take some time…
Share table updated successfully.
Adding additional initiator index to the share table, this can take some time…
Share table updated successfully.
Adding additional mtime index to the filecache table, this can take some time…
Filecache table updated successfully.

Thats it…

2 Kommentare

  1. Andre

    Bei mir erscheint folgende Meldung ….
    Kannst Du hier weiterhelfen ?

    MfG Andy

    An unhandled exception has been thrown:
    Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:167
    Stack trace:
    #0 /var/www/nextcloud/console.php(98): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #1 /var/www/nextcloud/occ(11): require_once(‘/var/www/nextcl…’)
    #2 {main}root@cloude:/var/www/nextcloud#

Schreibe einen Kommentar zu Andre Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert