Labels

Sunday, 17 January 2016

SQL DBA : Error 5030 Fix Unable to rename database name

Route Cause :

Still sessions or user connections exists on this database .

Solution :

1. Kill all the existing connections with the user acceptance (I would believe you are the owner and the user to this DB ) and rename the db. 

Note : If you are only the person using this DB then close all opened sessions pointing to your database and rename .
                                                          (or)  

1. Set the database to single user mode :

  ALTER DATABASE  <OldDBName > SET SINGLE_USER WITH ROLLBACK IMMEDIATE  

2.  Try to rename the database : 

 ALTER DATABASE <OldDBName >  MODIFY NAME = WRITE HERE YOUR NewDBName 

 3. Set the database to Multiuser mode:  

ALTER DATABASE <NewDBName> SET MULTI_USER WITH ROLLBACK IMMEDIATE

No comments:

Post a Comment