SQL Server - Feq Questions to clarify

Hello All,
1. If i have my Latest full backup on Sunday , and there by i have my differntial Backups daily ( mon, tue till sat) , and if i want to restore on friday, Tell me the procedure
Ans : I am not sure i am right - but sharing my view and correct me if i am wrong - I will take the latest full backup on sunday , and there by i will pick all the Differntial Backups ( Mon, TUe, Wed, thur) & Start restoring all one by one
i.e  - sunday Fullbackup + Monday Diff Backup + Tuesday Diff Backup + Wednesday Diff Backup + thurs Diff Backup .
If i am wrong, please guide me the right formate of restoring
Q2 : If my DB is configured to Replication And my secondary Server DB 's Ldf file has grown and i have to shrink , Whats the method i should adopt, Is it normal shrinking process which we adopt for stand alone DB or is there different process to shrink if
the DB if its configured for replication.
Q3 : What is the best way to identify the if the sql instance is  suffering from Memory issue or an CPU ? please suggest me the best way , apart from using tools like solar winds etc.
hemadri

1. nope
Differential means it will contain all changes from last full backup
so all that you would require to apply would be the last full backup on Sunday + latest differential backup on Thur
2. see if this helps
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dae1484d-1a7e-4008-b55a-1e9f41de3c2b/shrink-database-for-replicated-db?forum=sqlreplication
You cant shrink T- Log directly though if its a replicated db
3. One method is to use query involving DMVs
Another way is using performance counters
http://www.grumpyolddba.co.uk/monitoring/Performance%20Counter%20Guidance%20-%20SQL%20Server.htm
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • SQL Server Procedures Questions

    Hello,
    I needed some simple help in SQL Server, given below are my two questions.
    I am looking at making a SQL Server Procedure which uses cursors to detect some data entry 
    mistakes. 
    1) I have a query joining two or three tables and returning me a list of rows. I would like to compare the Name column in this list using a like operator and report back any names which are similar. How can this be done ? If possible please send me a brief
    skeletal code to do the same.
    2) I am using a query to join names of employees with languages they speak. The query works fine but for employees who speak more than 1 language, the record gets repeated with a new line for every new language they speak, instead of doing this, I would
    like to concatenate their languages in 1 column and report back 1 row per employee. Is this possible ?
    If yes please send me the brief skeletal code to do this on [email protected]
    Thanks
    Irfan

    >> If yes please send me the brief skeletal code to do this on [email protected]
    Good day Irfan
    This is not a paid supporting center, where you get private support, by commercial company, but a public forum where communities members helps each other. Public posts, answers, and discussions have a huge advantage! Other people might learn from the thread
    as well.
    >> I have a query joining two or three...
    Please check Tom
    Cooper's answer, and if this is not what you are looking for, then please post more information and less stories (I mean codes). Please show us the query instead of describe it. the code describe it better :-) Moreover, pls post DDL+DML
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Running multiple SSIS packages using SQL Server Agent question.

    I have a multitude of SSIS packages I want to run using SQL Server Agent.  What would the best practice be for running these jobs using SQL Server Agent?  One job per package or running all pakages from one job?  If you have an answer can
    you explain the technical reasoning behind your answer?  Thanks in advance.
    Stan Benner

    Hi, maybe a bit more analysis will give a better answer
    Do all the packages have to run in sequence? (if yes, single job better)
    Can the list of packages to be executed be grouped by dependency (ex package 1,2 and 5 must run in sequence and can be executed by one job, while package 3,4 are not dependent on package 1,2 and 5 can be run by a separate job).
    Can any jobs be run in parallel?
    How often will the package execution sequence change?
    How will you deploy your packages and job? (the more jobs to create the more install script needed and upgrade scenarios become messy).
    My personal preference:
    I create ONE ssis package which is executed by ONE sql agent job. lets call this 'PackageExecutionWrapper.dtsx'
    PackageExectionWrapper then contains multiple 'Execute Package' tasks for the packages you want to execute.
    In the package you can apply any package execution rules - which packages have to run after the other, which packages can run concurrently, which packages should only run if previous succeeded.
    If you need to change the sequence, simple, just update the PackageExecutionWrapper package.

  • SQL Server Scheduler Question

    I've got a simple package that I want to build. It appears that I will not be able to meet the scheduling requirements on it though. 
    It needs to run on the 16th of every month - UNLESS the 16th is a weekend day, in which case it needs to run on the following Monday.
    I can run it on the 1st, 2nd, (etc) Monday ... or the 1st, 2nd, (etc) weekday ... of the month.
    It seems like I need some combination of available options - and I don't see them.
    I believe I'd define my requirement as "First Weekday after the 15th day of the Month".
    I doubt this is available - but if anyone has any ideas, I would love to hear them.
    Thank you.
    Scott MacDonald
    Tucson, AZ

    Hello,
    Could you please take a look at the comment posted by THaouet on the following post?
    http://blogs.msdn.com/b/mwories/archive/2005/10/24/smosample-createjob.aspx
    Using programming he assigns a date for the job to start, the frequency, end date, etc.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server Licensing Query

    Hi Team ,
    I have some queries for MS SQL server , can you please clarify the below points :
    Can I buy licenses for SQL 2008 R2 or do I need to buy license for MSSQL server 2012 license and then downgrade it?
    Would there be any additional cost for downgrade ?
    If I want to buy license for MSSQL 2008 ,would it be “per processor “ or “per core” for Virtualization i.e. which of the two licensing policies will apply.
    Please clarify on this.relevant microsoft oem docs/links would be really helpful
    Thanks

    Hi Team ,
    I have some queries for MS SQL server , can you please clarify the below points :
    Can I buy licenses for SQL 2008 R2 or do I need to buy license for MSSQL server 2012 license and then downgrade it?
    Would there be any additional cost for downgrade ?
    If I want to buy license for MSSQL 2008 ,would it be “per processor “ or “per core” for Virtualization i.e. which of the two licensing policies will apply.
    1. You can buy license for 2008 R2, if your requirement is 2008 R2 dont buy 2012 its costly.. You dont need to buy 2012 license and downgrade it.I am not sure whether it is possible or not licensing expert will be in better position to answer this question.
    2.Licensing expert can tell better.
    3.Licensing expert can tell better. Please use information provided by Kalman.But i still suggest you to go for 2008 R2 IF that suits your requirement
    PS: This is technical forum, Licensing question must be directed to licensing expert
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • Sql server 2005 backward compatibility

    Dear all,
    I have a stored procedure which use the below code and was developed in Sql server 2012.
    ;WITH CTE 
    AS
        SELECT *,
        ROW_NUMBER() OVER(PARTITION BY SUPPID ORDER BY JDATE ASC) AS  RCount
        FROM #VDN
    My question is whether the same procedure will be compatible with Sql server 2005. Please clarify.  
    Thanks in Advance.

    We have both
    ROW_NUMBER (Transact-SQL) and
    WITH common_table_expression (Transact-SQL) since SQL Server Version 2005, so yes, it will work.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Error while executing bts_ConfigureBizTalkLogShipping with SQL Server 2012 and BTS 2013

    Hi,
    while configuring the DR site for Log shipping (http://msdn.microsoft.com/en-us/library/aa560961(v=bts.10).aspx)
    exec bts_ConfigureBizTalkLogShipping @nvcDescription = '<MyLogShippingSolution>',
    @nvcMgmtDatabaseName = '<BizTalkServerManagementDatabaseName>',
    @nvcMgmtServerName = '<BizTalkServerManagementDatabaseServer>',
    @SourceServerName = null, -- null indicates that this destination server restores all databases
    @fLinkServers = 1 -- 1 automatically links the server to the management database
    Getting errors while trying to execute the stored procedure "bts_ConfigureBizTalkLogShipping".
    OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "Login timeout expired".
    OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible.
    Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
    Msg -1, Level 16, State 1, Line 0
    SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
    This is very strange because with the same server name (which I am passing in above query) I am able to connect from SQL Server Studio from DR site.
    Any help would be much appreciated.
    Thanks!
    Regards,
    Gautam
    Thanks! Regards, Gautam

    You need to check the DTC Connectivity between your DC and DR SQL Instance. The Linked Server requires DTC connectivity. Secondly this activity is better done from the SQL Server in question (the DC server in your case).
    You can also manually add the Linked Server. Refer
    http://msdn.microsoft.com/en-IN/library/ms188279(v=sql.105).aspx - Linking Servers and
    http://msdn.microsoft.com/en-IN/library/ff772782(v=sql.105).aspx - Creating Linked Servers.
    After having created the Linked Server(s) you can run the log shipping configuration again BUT using @fLinkServers = 0.
    Regards.

  • Can't Create a Data Source - Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi there,
    I am having a serious issue with The Power BI Data Management Gateway which I am hoping that someone can help me with.
    Basically I am setting a connection between a Power BI demo site and a SQL 2012 Database based on Azure. The Data Management Gateway and is up and running, and Power BI has managed to connect to it successfuly.
    By following the tutorials at
    here I was able to successful create my Data Connection Gateway with a self-signed certificate.
    However, when trying to create the data source I come into problems. The Data Source Manager manages to successfully resolve the hostname, as per the screenshot below:
    Bear in mind that I exposed the require ports in Azure as endpoints and I managed to modify my hosts file on my local machine so I could access the SQL server hosted in Azure using its internal name -- otherwise I would not be able to get this far.
    However the creation of the data source also fails when trying to created it whilst logged in the SQL server in question:
    The Data Source Manager returns the error when using the Microsoft OLE DB Provider for SQL Server:
    Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
    I tried using the SQL Server Native Client 11.0 instead but I also get an error. This time the error is:
    Failed to test connection. Login timeout expiredA network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.Named Pipes Provider: Could not open a connection to SQL Server [53]. 
    Some considerations
    If I provide an invalid username/password, the Data Source Manager does say that the username and password is incorrect.
    Firewall is turned off in the SQL Server (either way, this error also happens if I try top use the Data Source Manager whilst logged in the SQL Server itself).
    SQL Profiler does not show any attempt of connection.
    The SQL server instance in question is the default one.
    The error happens regardless if I select the option to encrypt connection or not.
    In SQL Configuration manager I can see that all protocols are enabled (TCP/IP, Named Pipes and Shared Memory.
    The Event Viewer does not provide any further errors than the one I have copied in this post.
    I'm at a loss here. Could someone please advise what might I be doing wrong?
    Regards,
    P.

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • MS SQL Server 2005 Developer Edition

    Hi,
    We are developing a legal management product on SAP platform
    We would have  SQL Server to be used as a database for SAP ECC 6.0 in DEVELOPEMENT environment
    The landscape of the planned development  environment  has a total of 8 servers. We understand that a separate MS SQL Server 2005 ( Question :- Enterprise / standard / Developer ??? ) edition is required for all the servers Each server will run its own instance. Each server will have 2 Intel Xeon CPUs with quad cores.
    We understand that there will not be any users accessing the database directly. Instead, the SAP ECC software will create its own schema and users ( at most 4).
    1) Please let us know which edition is best suitable for us for above scenario .
    2) Does SAP ECC work on SQL Server 2005 Developer edition ?
    3) Can we have  one instance of SQL Server be used and multiple databases for dev, qa and prod be created from it
    Your prompt response will much be appreciated
    Thanks a ton !

    1) Please let us know which edition is best suitable for us for above scenario .
    SAP ONLY supports Enterprise edition.
    2) Does SAP ECC work on SQL Server 2005 Developer edition?
    No SAP willnot work on SQL Server 2005 edition.
    3) Can we have one instance of SQL Server be used and multiple databases for dev, qa and prod be created from it.
    Yes, technically it is possoble. But not at all recommended by SAP.
    Regards,
    SK

  • Insert data from oracle  to sql server

    we have running R12.1.1 .
    our company wants to deploy some CRM Application with sql server database. Continuously we have to insert data ( some fields from some tables of Order Management module ) from ORACLE -----------> SQL Server
    My Questions are :
    1. What are possible methods to insert data from ORACLE -----------------> SQL Server ?
    2. What are pros and cons of each method ?
    3. What is performance over load of each method ?
    PLease share your valuable knowledge / ideas / suggestions
    thanks

    What is a maximal latency for data changed in Oracle come into MS SQL?
    this data will be updated in CRM after 24 hours.Does it mean that data replicated from Oracle will be updated in MS SQL and should be replicated back?
    i want to know more details about these APIs etc and middle layer.what API? In MS SQL you can use Linked server and write SQLs that select from Oracle tables via that linked server and insert/update/delete into MS SQL. You can organize these SQLs into T-SQL procedures and run them in jobs.
    Also you can use MS SQL replication, snapshot or transactional, which is ugly because it places triggers on Oracle tables. I doubt that this will be approved by app vendor.
    Also you can use Oracle Streams via Transparent Gateway for MS SQL, which will be quite heavy solution.
    Also, if real-time replication is needed, you can use "middle layer" Oracle Golden Gate, which may be quite pricy for 30 tables.
    Also, if real-time replication is needed, you can use 3-rd party middle layer like DataCurrents or others.

  • General question on SQL Server 2000 to Oracle 10g

    Hello all,
    I just have a general question on migration from SQL Server 2000 to Oracle 10g using SQL Developer.
    How does it migrate Users with proper privileges from SQL Server to Oracle? Follow the interface steps? Or should the users be created on destination Oracle side?
    Thank you.

    Hi,
    It depends which type of migration you are making.
    For a 'Standard' migration when you migrate data a 'create user' statement is created as part of the migration and you will see this in the generated code.
    If you are using the 'Quick' migration option then you need to create the Oracle user or use an existing user to receive the data.
    Your best option is to review the documentation available from -
    http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    or directly from -
    http://download.oracle.com/docs/cd/E12151_01/index.htm
    and then get back with specific questions if this does not give you the information you need.
    Review the chapter -
    2. Migrating Third-Party Databases
    in -
    Oracle® Database SQL Developer User’s Guide Release 1.5
    Regards,
    Mike

  • SQL server service accounts question

    We created a test SQL environment using a Technet evaluation copy of Windows Server 2012 along with an evaluation copy of SQL2012. After testing, everything is working as planned so were going to enter the product keys for both Windows Server and SQL 2012.
    My question is that once we have our Server licensed we’re going to start a new domain and recreate all the user accounts but I installed SQL using a local user account I created called ”sqladmin”. Once Server 2012 is the DC in the new domain will I need to
    change all the service accounts for SQL in order for it to function or can I still use the local “sqladmin” user account? If I can re-use that local account are there any downside to that? What’s the best practice in this scenario

     Once Server 2012 is the DC in the new domain will I need to change all the service accounts for SQL in order for it to function or can I still use the local “sqladmin” user account? If I can re-use that local account are there any downside to that?
    What’s the best practice in this scenario
    Hi,
    You can use your sqladmin account but that wont be a good security practice. You should always follow principal of least privilege and should run SQL server with domain account having least privilege.Below link will help you in this
    Configure SQL server account and services
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • SQL Server 2012 Failover Cluster configuration questions

    Hi,
    I have few questions on , SQL Server 2012 Failover cluserting pleasse provide suggestions:
    1) In SQL Server 2012 is there a configuration for active / passive Failover Cluster installation? If so how is it done? if you could provide any links or articles that would help.
    OR 
    Is this been replaced by Always ON Availability Groups?
    2) Also in our environment we have done active/active installation but at a time my understanding is only node has the ownership to the shared storage versus both the nodes, is that correct? If not please provide an explanation?
    Any additional information would be valuable in clearing my doubts?
    Thank youy
    Malini=

    Hi malinisethi,
    If you install SQL Server in a cluster and configure Active-Passive cluster. In the first node, select “New SQL Server Failover Cluster installation” option , when we are installing Active-Passive cluster, we have to specify one virtual/network name. (Note:
    For Active-Active clustering you have specify different network names as per the number of nodes). on the other nodes is similar to installing on the first node except that we have select the Add Node to a SQL Server failover cluster option from the initial
    menu. For more information, there is a similar issue about SQL Server 2008 Active-Passive/Active-Active cluster installation, you can review the following article.
    http://sqldbpool.com/2009/10/07/sql-server-2008-active-passive-cluster-installation/
    About Active/Active SQL Cluster, two clustered SQL Server instance are created in different nodes. Then apply Active /Active configuration of both instance. There is an example about creating an Active/Active SQL Cluster using Hyper-V. you can review the
    following article.
    http://blogs.msdn.com/b/momalek/archive/2012/04/11/creating-an-active-active-sql-cluster-using-hyper-v-part2-the-clustered-instances.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Question about updating SQL Server on failover cluster

    Hi all,
    I would like to better understand the update process of SQL Server (2008 r2) in a failover cluster environment.
    In our cluster we have 4 instances of SQL running, where two of them I am able to at anytime stop the instance and update it.
    The question is... Applying the latest update, will update forcibly all instances installed on that node, or do I have the ability to choose which instance I want to update?
    This way, I could "test" the update process in those two SQL Instances, as described in http://support.microsoft.com/kb/958734 and after finishing I would update the remaining instances.
    Please let me know.
    Thanks in advance.
    Nuno Silva

    Hi Nuno,
    It's a failover cluster issue, I moved it to SQL Server High Availability and Disaster Recovery. So that you can get better help.
    Regards,
    Charlie Liao
    TechNet Community Support

  • MVA SQL Server Query Assessment question

    Hi Guys
    I was doing a course on MVA, Querying Microsoft SQL Server Quick Start. This question came up in the assessment:
    True or False: You use the INTERSECT operator to combine results from two SELECT statements. Only rows that appear in both results sets are displayed.
    I answered it as TRUE but it marked it wrong.
    Am I not right??
    Thanks

    Hi,
    Choose yourself :-)
    http://technet.microsoft.com/en-us/library/ms188055.aspx
    [Personal Site] [Blog] [Facebook]

Maybe you are looking for