Plex Slow, inconsistent "There was an unexpected error when loading this library" error

The Synology FAQ has some pointers that may help.

FAQ: Recover from a corrupt database

FAQ: Use SSH to access the Synology command line

For many CLI operations you need to be root. To become root, use the sudo command. After logging in with your userid, issue the command sudo -i. You’ll be prompted for the administrative password. Once entered, you’ll be root. Use exit or logout to return to your normal userid.

login as: User
User@host's password:
User@host:~$ sudo -i
Password:
root@host:~#