How to rename a database snapshot

  • Hi All,

    I would like to know how to rename a database snapshot ? Please help.

    If you could take a look at the following link, I am trying to achieve the (1) solution.

    http://blogs.msdn.com/b/sqlcat/archive/2008/08/05/microsoft-sql-server-database-snapshots-and-synonyms.aspx

    When I try to rename the snapshot, it is throwing error -:

    Msg 902, Level 16, State 1, Line 1

    To change the NAME, the database must be in state in which a checkpoint can be executed.

    Thanks,

    Ganesh

  • Can some one please reply ?

  • ***Here is what Microsoft had to say on this***

    Be interesting to see if anyone has found a workaround

    The no rename restriction is not limited to snapshots. The restriction is on any database in a read-only state.

    The reason for the restriction is that the database name is recorded in the internal metadata of the database itself, and so we cannot change the name without violating the read-only status of the database.

  • Drop the snapshot and create a new snapshot with the name you want.

  • Thought about that too, but if the source table changed since the first snapshot and you needed to preserve that point in time that would not work

  • dennis.malone (11/17/2010)


    Thought about that too, but if the source table changed since the first snapshot and you needed to preserve that point in time that would not work

    The only option you have is to drop the snapshot and create a new one.

    I don't see anything in that article that says you need to rename the snapshot. All you need to do is modify the synonyms to point to the snapshot that you have already created. Then, when you create a new snapshot you would drop the existing synonyms and create them again with the new snapshots name.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 6 posts - 1 through 5 (of 5 total)

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