Does restoring a database break external synonyms targeting objects in that database?Quickly restoring a backup over top of an existing database - error “database in use”After Restore Log_reuse_wait_desc of ReplicationErrors restoring a differential backupUse database to track locking/unlocking of objectsMy stored procedure randomly fails due to invalid object in a swapping database instanceSQL Server Database Migration - Backup/Restore while Original DB still in ProductionSQL Server message 3154 Server 2005 to 2008Is a partial restore of data from backup possible?SQL Server - redirect synonym without downtimesqlserver RESTORE missing views

What is Tony Stark injecting into himself in Iron Man 3?

Boss Telling direct supervisor I snitched

Is it appropriate to ask a former professor to order a library book for me through ILL?

Why isn't P and P/poly trivially the same?

Should I file my taxes? No income, unemployed, but paid 2k in student loan interest

Why aren't there more Gauls like Obelix?

Issue with units for a rocket nozzle throat area problem

How can I have x-axis ticks that show ticks scaled in powers of ten?

What is the oldest European royal house?

Exempt portion of equation line from aligning?

Can I negotiate a patent idea for a raise, under French law?

Should I apply for my boss's promotion?

Propulsion Systems

How to distinguish easily different soldier of ww2?

ESPP--any reason not to go all in?

How to educate team mate to take screenshots for bugs with out unwanted stuff

Vector-transposing function

Interpretation of linear regression interaction term plot

Was this cameo in Captain Marvel computer generated?

Is there a logarithm base for which the logarithm becomes an identity function?

Paper published similar to PhD thesis

How can I portion out frozen cookie dough?

Can I challenge the interviewer to give me a proper technical feedback?

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?



Does restoring a database break external synonyms targeting objects in that database?


Quickly restoring a backup over top of an existing database - error “database in use”After Restore Log_reuse_wait_desc of ReplicationErrors restoring a differential backupUse database to track locking/unlocking of objectsMy stored procedure randomly fails due to invalid object in a swapping database instanceSQL Server Database Migration - Backup/Restore while Original DB still in ProductionSQL Server message 3154 Server 2005 to 2008Is a partial restore of data from backup possible?SQL Server - redirect synonym without downtimesqlserver RESTORE missing views













4















If one has a database where synonyms in another database refer to objects in that database, does restoring a backup into that database invalidate the synonyms?



To be specific, imagine this situation:



  • Database Synonym_Targ on a SQL 2008 R2 server has some database objects in it, e.g. a table called dbo.foo

  • Database Synonym_Home has a synonym dbo.foo referring to the table dbo.foo in the database Synomym_Targ.

  • A backup of the database normally resident in Synonym_Targ is restored into it. This contains an object dbo.foo.

Should one expect this process to invalidate the dbo.foo synonym on Synonym_Host?










share|improve this question



















  • 1





    Found out what the problem was - the tester's publish configuration had the DB name configured incorrectly for his test environment.

    – ConcernedOfTunbridgeWells
    19 hours ago















4















If one has a database where synonyms in another database refer to objects in that database, does restoring a backup into that database invalidate the synonyms?



To be specific, imagine this situation:



  • Database Synonym_Targ on a SQL 2008 R2 server has some database objects in it, e.g. a table called dbo.foo

  • Database Synonym_Home has a synonym dbo.foo referring to the table dbo.foo in the database Synomym_Targ.

  • A backup of the database normally resident in Synonym_Targ is restored into it. This contains an object dbo.foo.

Should one expect this process to invalidate the dbo.foo synonym on Synonym_Host?










share|improve this question



















  • 1





    Found out what the problem was - the tester's publish configuration had the DB name configured incorrectly for his test environment.

    – ConcernedOfTunbridgeWells
    19 hours ago













4












4








4








If one has a database where synonyms in another database refer to objects in that database, does restoring a backup into that database invalidate the synonyms?



To be specific, imagine this situation:



  • Database Synonym_Targ on a SQL 2008 R2 server has some database objects in it, e.g. a table called dbo.foo

  • Database Synonym_Home has a synonym dbo.foo referring to the table dbo.foo in the database Synomym_Targ.

  • A backup of the database normally resident in Synonym_Targ is restored into it. This contains an object dbo.foo.

Should one expect this process to invalidate the dbo.foo synonym on Synonym_Host?










share|improve this question
















If one has a database where synonyms in another database refer to objects in that database, does restoring a backup into that database invalidate the synonyms?



To be specific, imagine this situation:



  • Database Synonym_Targ on a SQL 2008 R2 server has some database objects in it, e.g. a table called dbo.foo

  • Database Synonym_Home has a synonym dbo.foo referring to the table dbo.foo in the database Synomym_Targ.

  • A backup of the database normally resident in Synonym_Targ is restored into it. This contains an object dbo.foo.

Should one expect this process to invalidate the dbo.foo synonym on Synonym_Host?







sql-server sql-server-2008-r2 restore synonyms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 18 hours ago









Paul White

53k14281457




53k14281457










asked 19 hours ago









ConcernedOfTunbridgeWellsConcernedOfTunbridgeWells

15.9k24868




15.9k24868







  • 1





    Found out what the problem was - the tester's publish configuration had the DB name configured incorrectly for his test environment.

    – ConcernedOfTunbridgeWells
    19 hours ago












  • 1





    Found out what the problem was - the tester's publish configuration had the DB name configured incorrectly for his test environment.

    – ConcernedOfTunbridgeWells
    19 hours ago







1




1





Found out what the problem was - the tester's publish configuration had the DB name configured incorrectly for his test environment.

– ConcernedOfTunbridgeWells
19 hours ago





Found out what the problem was - the tester's publish configuration had the DB name configured incorrectly for his test environment.

– ConcernedOfTunbridgeWells
19 hours ago










1 Answer
1






active

oldest

votes


















7














This process should not invalidate the synonym. As per the docs:




The binding between a synonym and its base object is by name only. All existence, type, and permissions checking on the base object is deferred until run time. Therefore, the base object can be modified, dropped, or dropped and replaced by another object that has the same name as the original base object.




You can test this behavior with the following.



use [master]
go
drop database if exists Synonym_Targ, Synonym_Home
go
create database Synonym_Targ
create database Synonym_Home
go
alter authorization on database ::Synonym_Targ to sa
alter authorization on database ::Synonym_Home to sa
go
use Synonym_Targ
go
create table dbo.foo ( i int default 1);
go
insert dbo.foo default values
go
use Synonym_Home
go
create synonym dbo.foo for Synonym_Targ.dbo.foo
go
create or alter proc p
as
select * from dbo.foo
go
exec p
go
backup database Synonym_Targ to disk = 'c:tempSynonym_Targ.bak'
go
drop database Synonym_Targ
go
exec p
/*
Msg 5313, Level 16, State 1, Procedure p, Line 3 [Batch Start Line 30]
Synonym 'dbo.foo' refers to an invalid object.
*/
go
restore database Synonym_Targ from disk = 'c:tempSynonym_Targ.bak'
go
exec p
go
use [master]
go
drop database if exists Synonym_Targ, Synonym_Home
go





share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "182"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231638%2fdoes-restoring-a-database-break-external-synonyms-targeting-objects-in-that-data%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7














    This process should not invalidate the synonym. As per the docs:




    The binding between a synonym and its base object is by name only. All existence, type, and permissions checking on the base object is deferred until run time. Therefore, the base object can be modified, dropped, or dropped and replaced by another object that has the same name as the original base object.




    You can test this behavior with the following.



    use [master]
    go
    drop database if exists Synonym_Targ, Synonym_Home
    go
    create database Synonym_Targ
    create database Synonym_Home
    go
    alter authorization on database ::Synonym_Targ to sa
    alter authorization on database ::Synonym_Home to sa
    go
    use Synonym_Targ
    go
    create table dbo.foo ( i int default 1);
    go
    insert dbo.foo default values
    go
    use Synonym_Home
    go
    create synonym dbo.foo for Synonym_Targ.dbo.foo
    go
    create or alter proc p
    as
    select * from dbo.foo
    go
    exec p
    go
    backup database Synonym_Targ to disk = 'c:tempSynonym_Targ.bak'
    go
    drop database Synonym_Targ
    go
    exec p
    /*
    Msg 5313, Level 16, State 1, Procedure p, Line 3 [Batch Start Line 30]
    Synonym 'dbo.foo' refers to an invalid object.
    */
    go
    restore database Synonym_Targ from disk = 'c:tempSynonym_Targ.bak'
    go
    exec p
    go
    use [master]
    go
    drop database if exists Synonym_Targ, Synonym_Home
    go





    share|improve this answer



























      7














      This process should not invalidate the synonym. As per the docs:




      The binding between a synonym and its base object is by name only. All existence, type, and permissions checking on the base object is deferred until run time. Therefore, the base object can be modified, dropped, or dropped and replaced by another object that has the same name as the original base object.




      You can test this behavior with the following.



      use [master]
      go
      drop database if exists Synonym_Targ, Synonym_Home
      go
      create database Synonym_Targ
      create database Synonym_Home
      go
      alter authorization on database ::Synonym_Targ to sa
      alter authorization on database ::Synonym_Home to sa
      go
      use Synonym_Targ
      go
      create table dbo.foo ( i int default 1);
      go
      insert dbo.foo default values
      go
      use Synonym_Home
      go
      create synonym dbo.foo for Synonym_Targ.dbo.foo
      go
      create or alter proc p
      as
      select * from dbo.foo
      go
      exec p
      go
      backup database Synonym_Targ to disk = 'c:tempSynonym_Targ.bak'
      go
      drop database Synonym_Targ
      go
      exec p
      /*
      Msg 5313, Level 16, State 1, Procedure p, Line 3 [Batch Start Line 30]
      Synonym 'dbo.foo' refers to an invalid object.
      */
      go
      restore database Synonym_Targ from disk = 'c:tempSynonym_Targ.bak'
      go
      exec p
      go
      use [master]
      go
      drop database if exists Synonym_Targ, Synonym_Home
      go





      share|improve this answer

























        7












        7








        7







        This process should not invalidate the synonym. As per the docs:




        The binding between a synonym and its base object is by name only. All existence, type, and permissions checking on the base object is deferred until run time. Therefore, the base object can be modified, dropped, or dropped and replaced by another object that has the same name as the original base object.




        You can test this behavior with the following.



        use [master]
        go
        drop database if exists Synonym_Targ, Synonym_Home
        go
        create database Synonym_Targ
        create database Synonym_Home
        go
        alter authorization on database ::Synonym_Targ to sa
        alter authorization on database ::Synonym_Home to sa
        go
        use Synonym_Targ
        go
        create table dbo.foo ( i int default 1);
        go
        insert dbo.foo default values
        go
        use Synonym_Home
        go
        create synonym dbo.foo for Synonym_Targ.dbo.foo
        go
        create or alter proc p
        as
        select * from dbo.foo
        go
        exec p
        go
        backup database Synonym_Targ to disk = 'c:tempSynonym_Targ.bak'
        go
        drop database Synonym_Targ
        go
        exec p
        /*
        Msg 5313, Level 16, State 1, Procedure p, Line 3 [Batch Start Line 30]
        Synonym 'dbo.foo' refers to an invalid object.
        */
        go
        restore database Synonym_Targ from disk = 'c:tempSynonym_Targ.bak'
        go
        exec p
        go
        use [master]
        go
        drop database if exists Synonym_Targ, Synonym_Home
        go





        share|improve this answer













        This process should not invalidate the synonym. As per the docs:




        The binding between a synonym and its base object is by name only. All existence, type, and permissions checking on the base object is deferred until run time. Therefore, the base object can be modified, dropped, or dropped and replaced by another object that has the same name as the original base object.




        You can test this behavior with the following.



        use [master]
        go
        drop database if exists Synonym_Targ, Synonym_Home
        go
        create database Synonym_Targ
        create database Synonym_Home
        go
        alter authorization on database ::Synonym_Targ to sa
        alter authorization on database ::Synonym_Home to sa
        go
        use Synonym_Targ
        go
        create table dbo.foo ( i int default 1);
        go
        insert dbo.foo default values
        go
        use Synonym_Home
        go
        create synonym dbo.foo for Synonym_Targ.dbo.foo
        go
        create or alter proc p
        as
        select * from dbo.foo
        go
        exec p
        go
        backup database Synonym_Targ to disk = 'c:tempSynonym_Targ.bak'
        go
        drop database Synonym_Targ
        go
        exec p
        /*
        Msg 5313, Level 16, State 1, Procedure p, Line 3 [Batch Start Line 30]
        Synonym 'dbo.foo' refers to an invalid object.
        */
        go
        restore database Synonym_Targ from disk = 'c:tempSynonym_Targ.bak'
        go
        exec p
        go
        use [master]
        go
        drop database if exists Synonym_Targ, Synonym_Home
        go






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 19 hours ago









        Peter VandivierPeter Vandivier

        1,1791722




        1,1791722



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Database Administrators Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231638%2fdoes-restoring-a-database-break-external-synonyms-targeting-objects-in-that-data%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Solar Wings Breeze Design and development Specifications (Breeze) References Navigation menu1368-485X"Hang glider: Breeze (Solar Wings)"e

            Kathakali Contents Etymology and nomenclature History Repertoire Songs and musical instruments Traditional plays Styles: Sampradayam Training centers and awards Relationship to other dance forms See also Notes References External links Navigation menueThe Illustrated Encyclopedia of Hinduism: A-MSouth Asian Folklore: An EncyclopediaRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to Play10.1353/atj.2005.0004The Illustrated Encyclopedia of Hinduism: A-MEncyclopedia of HinduismKathakali Dance-drama: Where Gods and Demons Come to PlaySonic Liturgy: Ritual and Music in Hindu Tradition"The Mirror of Gesture"Kathakali Dance-drama: Where Gods and Demons Come to Play"Kathakali"Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceMedieval Indian Literature: An AnthologyThe Oxford Companion to Indian TheatreSouth Asian Folklore: An Encyclopedia : Afghanistan, Bangladesh, India, Nepal, Pakistan, Sri LankaThe Rise of Performance Studies: Rethinking Richard Schechner's Broad SpectrumIndian Theatre: Traditions of PerformanceModern Asian Theatre and Performance 1900-2000Critical Theory and PerformanceBetween Theater and AnthropologyKathakali603847011Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceBetween Theater and AnthropologyBetween Theater and AnthropologyNambeesan Smaraka AwardsArchivedThe Cambridge Guide to TheatreRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeThe Garland Encyclopedia of World Music: South Asia : the Indian subcontinentThe Ethos of Noh: Actors and Their Art10.2307/1145740By Means of Performance: Intercultural Studies of Theatre and Ritual10.1017/s204912550000100xReconceiving the Renaissance: A Critical ReaderPerformance TheoryListening to Theatre: The Aural Dimension of Beijing Opera10.2307/1146013Kathakali: The Art of the Non-WorldlyOn KathakaliKathakali, the dance theatreThe Kathakali Complex: Performance & StructureKathakali Dance-Drama: Where Gods and Demons Come to Play10.1093/obo/9780195399318-0071Drama and Ritual of Early Hinduism"In the Shadow of Hollywood Orientalism: Authentic East Indian Dancing"10.1080/08949460490274013Sanskrit Play Production in Ancient IndiaIndian Music: History and StructureBharata, the Nāṭyaśāstra233639306Table of Contents2238067286469807Dance In Indian Painting10.2307/32047833204783Kathakali Dance-Theatre: A Visual Narrative of Sacred Indian MimeIndian Classical Dance: The Renaissance and BeyondKathakali: an indigenous art-form of Keralaeee

            Method to test if a number is a perfect power? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Detecting perfect squares faster than by extracting square rooteffective way to get the integer sequence A181392 from oeisA rarely mentioned fact about perfect powersHow many numbers such $n$ are there that $n<100,lfloorsqrtn rfloor mid n$Check perfect squareness by modulo division against multiple basesFor what pair of integers $(a,b)$ is $3^a + 7^b$ a perfect square.Do there exist any positive integers $n$ such that $lfloore^nrfloor$ is a perfect power? What is the probability that one exists?finding perfect power factors of an integerProve that the sequence contains a perfect square for any natural number $m $ in the domain of $f$ .Counting Perfect Powers