How much free space is on your C: drive?
If it’s nearly full, this might be the very reason for the database corruption.
While you have installed the plex server on drive D: (which is not recommended by the way), this will only move ~170MB off of C:
Your plex data folder and the main database file are still residing on drive C:, and this folder can get much bigger than 170 MB.
So before you are trying to repair the database, move your plex data folder to someplace else.
Otherwise your freshly repaired (or recreated) database might get damaged again shortly: [HowTo] An extended guide on how to move the Plex data folder on Windows