synonyms vs views when using a linked server

  • Forum,
    In our current environment where we have 2 domains 1-PROD 2-DEV we usually restore previous night 6pm backup daily to help the Dev and QA folks to perform validation and fixes , but as its last night data they might be missing some transactions that came in around midnight , so they wanted to create a linked server and we created a separate DB with access to synonyms . We admins were able to access the DB but QA/DEV/BA were not able to run queries joining multiple tables because of CLR not enabled . Is it better to create views instead of granting via synonyms .? Can we create views for all tables in a DB and how can we create views from newly added tables dynamically.

    What are the best practices to implement in this current scenario .

  • So let me get this straight, you are basically giving the developers and testers direct access to the production system via linked server.  You do realize that this could have significant impact on the production server as queries to the production tables will require that all the data be pulled from production to the dev/qa system before any filtering of data occurs.

    For development and testing just how critical are those daily transactions that are done at midnight for development and testing?

  • It is mostly financial information and they need it matched to exact $ amount , it is critical . BTW forgot to mention there are 3 nodes (SQL Server 2014 Always on )and the 3rd node is read only and we created linked server to this node .

  • ... were not able to run queries joining multiple tables because of CLR not enabled

    What does CLR have to do with running queries joining multiple tables?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • objects exposing columns with clr types are not allowed in distributed queries, we have linked servers to join tables so whenever we perform that operation or try running a query using synonyms we run into this issue . Again coming back to my original post Synonymns or Views which option is best  when used in a linked server and always on scenario ?

  • I guess I am still stuck on why the devs and QA need to test on the most current data possible.  What is wrong with testing on day old or older data?

  • The company is driven by business so whatever the business needs we need to provide, evn for setting up the QA test env they need the latest prod data not with any test data. they want to see the lifecycle of the acc how it reacts with different scenarios .

  • JSB_89 - Friday, November 2, 2018 4:24 PM

    The company is driven by business so whatever the business needs we need to provide, evn for setting up the QA test env they need the latest prod data not with any test data. they want to see the lifecycle of the acc how it reacts with different scenarios .

    Doesn't explain why it has to be the latest.  If that is the requirement, figure out how to get the data from the midnight processing to the dev/qa environment. Perhaps a copy only backup taken after that processing and restore it to the dev/qa environment.

  • Well like I mentioned in the original post, we have 2 domains and we perform a backup in prod and copy to dev environment and then perform the restore.so a 600GB DB takes 2 hrs to backup and copying to different env takes 2 hrs min and restore takes 1.5 hrs so 6hrs . Some agents in the field are already working by then and will have to compare what happened to the ticket over the process from start to finish. Different time zones

    Hope this helps ..let me know if you have anymore questions.

  • Are you using differential backups, or full?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Full backups

  • Diffs could be much faster. Might be worth trying.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • That’s a long process to get approval from IT manager and jump thru all the hoops.

    That’s for a later day

  • JSB_89 - Friday, November 2, 2018 4:24 PM

    The company is driven by business so whatever the business needs we need to provide, evn for setting up the QA test env they need the latest prod data not with any test data. they want to see the lifecycle of the acc how it reacts with different scenarios .

    If it's THAT critical... setup replication.  But, before you do, have you tied down the Dev and QA environments so that they're at least as secure as Prod so that no one can walk off with critical PII and other sensitive information that will have you reading about yourself in the morning news?  If you haven't, then do what the business really needs and protect it.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Saturday, November 3, 2018 12:12 PM

    JSB_89 - Friday, November 2, 2018 4:24 PM

    The company is driven by business so whatever the business needs we need to provide, evn for setting up the QA test env they need the latest prod data not with any test data. they want to see the lifecycle of the acc how it reacts with different scenarios .

    If it's THAT critical... setup replication.  But, before you do, have you tied down the Dev and QA environments so that they're at least as secure as Prod so that no one can walk off with critical PII and other sensitive information that will have you reading about yourself in the morning news?  If you haven't, then do what the business really needs and protect it.

    we do have replication setup for DataWarehouse environment .. and we get only a subset of tables but the reports and QA and DEV need all the tables . we do redact sensitive info once we restore the DB to lower env's 

    HTH

Viewing 15 posts - 1 through 15 (of 21 total)

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