SQL Database moved under System Databases by mistake

  • I have a sw wich has a tool to configure replication between my 2 dbs I have. When the tool asked me for a name of my distribuitor database I put the same name as my main database by mistake, then the tool misplaced the database under system databases

    How can I put it back under user databases? The client side of the sw is working fine...I .

    The only way Im thinking is to set the db offline and then place a backup...but Im not sure and since Im in production I dont want to mess up with my data!!

    Please experts heeelp!! You cna check the image in the document I attached.

  • if you have enough space,

    then I will suggest

    1.take a back up of the database and restore it on the same server with different name,

    2. and then rename the db which is under system database.

    3.Rename the new database with the original name and configure Replication again.

    It can minimize your downtime .

    -----------------------------------------------------------------------------
    संकेत कोकणे

  • montse 22199 (11/6/2012)


    I have a sw wich has a tool to configure replication between my 2 dbs I have. When the tool asked me for a name of my distribuitor database I put the same name as my main database by mistake, then the tool misplaced the database under system databases

    How can I put it back under user databases? The client side of the sw is working fine...I .

    The only way Im thinking is to set the db offline and then place a backup...but Im not sure and since Im in production I dont want to mess up with my data!!

    Please experts heeelp!! You cna check the image in the document I attached.

    the distribution database is a system database, no matter what you call it. What issue are you trying to correct, the fact you mispelt the name?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks so much for your suggestions. I will do that, I am programming to do it today in the evening..wish me luck!

  • Dup

  • montse 22199 (11/7/2012)


    Thanks so much for your suggestions. I will do that, I am programming to do it today in the evening..wish me luck!

    First and foremost, my advice would be to call Microsoft and open a support ticket. Since this is a production user database that has been marked by SQL Server as a system database, you want to be overly cautious no matter what you try.

    That being said, I've been able to re-create the problem and resolve it in a TEST environment. If you configure a SQL server for distribution (right click on the Replication folder and select Configure Distribution), you can manually enter in the name of a user database for the "distribution database name". It defaults to "distribution".

    I manually entered the name of a user database and then completed the wizard. Afterwards, I confirmed that my user database was moved under the system database folder in SSMS.

  • Hit the wrong button... 😀

    To undo the operation, I right clicked on the Replication Folder and selected Disable Publishing and Distribution. I then seleced the Yes, Disable Publishing on this Server option and completed the wizard.

    SQL Server restored my user database to the user database folder.

    Again, I did this in a TEST environment and I still recommend that you call Microsoft and open a support case. Before doing anything, make sure you have a solid database backup and have confirmed that it is solid by restoring it to another location.

    Good Luck.

  • Just curious, were you able to resolve this issue?

  • Because this is a production Server, until today I schedule this tasks, was very helpul the steps you guys gave me.

    I will let you know for sure how was it. ive been doing some tests about the distribuitor but because the software tool I have to configure replication was develop by my vendor and is different that the one in Sql I am not sure yet how my db is going to react when I hit right click and disable the replication. Ill keep you guys post it.

    Thanks a lot for your help!

    Wish me luck!

  • I was able to restore my db fine.

    When I was trying to delete the db which was under system databases it didnt let me, so I run a query to change it to single user dropping connections the db may have and then it let me.

    Thanks all a lot for your help and support!!

  • Once I restore the production database and rename both databases can I delete the database found under system

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply