Verify that all users are logged off from GP and run the below query in SQL Management Studio.
SELECT * FROM DYNAMICS..ACTIVITY
SELECT * FROM DYNAMICS..SY00800
SELECT * FROM DYNAMICS..SY00801
SELECT * FROM TEMPDB..DEX_LOCK
SELECT * FROM TEMPDB..DEX_SESSION
If any records return by this query, run the below query.
DELETE DYNAMICS..ACTIVITY
DELETE DYNAMICS..SY00800
DELETE DYNAMICS..SY00801
DELETE TEMPDB..DEX_LOCK
DELETE TEMPDB..DEX_SESSION
If no records are returned by first query, then run the below query against the company database.
USE 'Company Database Name'
UPDATE SY00500 SET MKDTOPST=0, BCHSTTUS=0 where BACHNUMB='Your Batch ID'
Now open GP and try again.
Hope this helps!!!