The -D parameter specifies to ‘delete’ messages from the Error database; you will get prompted that ‘deleting messages without saving to a file is dangerous’; just enter ‘Y’ to continue. You can specify a filename after the -D parameter if you wish to save off the messages for some reason, but I’m assuming you just want to clear out the Error database. You don’t have to stop anything to perform the hcidbdump command.
The hcidbinit command (along with all of the necessary parameters) is used to re-initialize the recovery and error databases, which deletes any messages in the databases and compresses the databases to re-claim space. You need to have all the process shutdown to perform the ‘hcidbinit’.