Fixing an error 9004 without taking the database offline My database (SQL Server 2008 r2) is running fine but I’m getting the following error in my event log. 

Error: 9004, Severity: 23, State: 6.
An error occurred while processing the log for database 'MyDB'.  If possible, restore from
backup. If a backup is not available, it might be necessary to rebuild the log.


Is there any way to fix this without taking the database offline?

If not, what would be the fastest way? Transactional data loss would be accepted.
Not knowing much else about your problem, if your database is online and you're not using anything that may be actively using part of the log - such as Mirroring, AGs, Replication, etc, you could attempt removing that part of the log from the sweep by changing to the simple recovery mode (if in bulk or full) and issuing a checkpoint. Then go back to your normal recovery model and either take a full or differential to restart a valid LSN chain.

This may or may not work for you depending on what the actual underlying cause is, but should work for most cases caused by a state of 6.

Please note: I am not advocating that you do anything to compromise your database. If the database is online and functioning, this won't cause any data loss nor would it be destructive other than to your LSN chain which can be bridged.