Do you want to rename DB that is having can’t exclusively locked error message.
Try this.
ALTER DATABASE dbname
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE dbnameMODIFY NAME = [dbname.DevData]
ALTER DATABASE [dbname.DevData]
SET MULTI_USER WITH ROLLBACK IMMEDIATE
God Bless!