Help! SQL server database log file increasing enormously

I have 5 SSIS jobs running in sql server job agent and some of them are pulling transactional data into our database over the interval of 4 hours frequently. The problem is log file of our database is growing rapidly which means in a day, it eats up 160GB of
disk space. Since our requirement dont need In-point recovery, so I set the recovery model to SIMPLE, eventhough I set it to SIMPLE, the log
data consumes more than 160GB in a day. Because of disk full, the scheduled jobs getting failed often.Temporarily I am doing DETACH approach
to cleanup the log.
FYI: All the SSIS packages in the job is using Transaction on
some tasks. for eg. Sequence Cointainer
I want a permanent solution to keep log file in a particular memory limit and as I said earlier I dont want my log data for future In-Point recovery, so no need to take log backup at all.
And one more problem is that in our database,the transactional table has 10 million records in it and some master tables have over 1000 records on them but our mdf file
size is about 50 GB now.I dont believe that this 10 million records should make it to 50GB memory consumption.Whats the problem here?
Help me on these issues. Thanks in advance.

And one more problem is that in our database,the transactional table has 10 million records in it and some master tables have over 1000 records on them but our mdf file
size is about 50 GB now.I dont believe that this 10 million records should make it to 50GB memory consumption.Whats the problem here?
Help me on these issues.
For SSIS part of question it would be better if you ask in SSIS forum although noting is going to change about logging behavior. You can increase some space on log file and also should batch your transactions as already suggested
Regarding memory question about SQL Server, once it utilizes memory is not going to release unless there is windows OS faces memory pressure and SQLOS asks SQL Server to trim down its memory consumption. So again if you have set max server memory to some
where near 50 SQL Server will utilize that much memory eventually. So what you are seeing is totally normal. Remember its costtly task for SQL Server to release and take memory so it avoids it by caching as much as possible plus it caches more so as to avoid
physical reads which are costly
When log file is getting full what does below transaction return
select log_reuse_wait_desc from sys.databases where name='db_name'
Can you manually introduce chekpoint in ETL query. Try this it might help you
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP

Similar Messages

  • Sql server 2005 log file shrinking issue.

    hi,
    one of my production server database  log file size is increasing continuously,we can take log backup but no use,
    we can change the database recovery model from  full to simple we shrink the log file, log file shrink successfully but space is not released,and we are getting the alerts continuously your physical disk is 95% like that.
    here what we can do how reduced the log file size and how to control the log file size.
    please give me the answer  ASAP.
    Thanks,

    Hello,
    In SQL Server, log truncation occurs automatically as follows:
    • Under the simple recovery model, after a checkpoint.
    • Under the full recovery model or bulk-logged recovery model, after a log backup, if a checkpoint has occurred since the previous backup.
    As Dan posted earlier, when we run the above code, we will get an integer value. The log_reuse_wait_desc value tells us why the transaction log space is not reused. You can refer to the article below to check the root cause. 
    http://msdn.microsoft.com/en-us/library/ms345414.aspx
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Connecting to sql server database mdf file without installing sql server on client machine?

    I am creating a window application that need to use sql server database. I want to install this application to client machine without installing sql server so that my application can still connect to a database i.e mdf file that i will be providing at client
    system.
    How can i connect to a database(mdf) on client machine through my window application without installing sql server. ? I dont know is it possible or not.
    If possible what will be the connection string in that case. Database need not be used in network.

    you cant connect and view the internals of mdf file unless it being attached to a sql server instance as a database.
    The sql server instance can be installed in any box which is in the same domain and then you can connect from your application to it.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Crystal Report Server Database Log File Growth Out Of Control?

    We are hosting Crystal Report Server 11.5 on Microsoft SQL Server 2005 Enterprise.  Our Crystal Report Server SQL 2005 database file size = 6,272 KB, and the log file that goes with the database has a size = 23,839,552.
    I have been reviewing the Application Logs and this log file size is auto-increasing about 3-times a week.
    We backup the database each night, and run maintenance routines to Check Database Integrity, re-organize index, rebuild index, update statistics, and backup the database.
    Is it "Normal" to have such a large LOG file compared to the DATABASE file?
    Can you tell me if there is a recommended way to SHRINK the log file?
    Some Technical Documents suggest frist truncating the log, and the using the DBCC SHRINKFILE command:
    USE CRS
    GO
    --Truncate the log by changing the database recovery model to SIMPLE
    ALTER DATABASE CRS
    SET RECOVERY SIMPLE;
    --Shrink the truncated log file to 1 gigabyte
    DBCC SHRINKFILE (CRS_log, 1000);
    GO
    --Reset the database recovery model.
    ALTER DATABASE CRS
    SET RECOVERY FULL;
    GO
    Do you think this approach would help?
    Do you think this approach would cause any problems?

    my bad you didn't put the K on the 2nd number.
    Looking at my SQL server that's crazy big my logs are in the k's like 4-8.
    I think someone enabled some type of debugging on your SQL server, it's more of a Microsoft issue, as our product doesn't require it from looking at my SQL DB's
    Regards,
    Tim

  • SQL Server Database - Transaction logs growing largely with Simple Recovery model

    Hello,
    There is SQL server database on client side in production environment with huge transaction logs.
    Requirement :
    1. Take database backup
    2. Transaction log backup is not required. - so it is set to Simple recovery model.
    I am aware that, Simple Recovery model also increases the transaction logs same as in Full Recovery model as given on below link.
    http://realsqlguy.com/origins-no-simple-mode-doesnt-disable-the-transaction-log/
    Last week, this transaction log became of 1TB size and blocked everything on the database server.
    How to over come with this situation?
    PS :  There are huge bulk uploads to the database tables.
    Current Configuration :
    1. Simple Recovery model
    2. Target Recovery time : 3 Sec
    3. Recovery interval : 0
    4. No SQL Agent job schedule to shrink database.
    5. No other checkpoints created except automatic ones.
    Can anyone please guide me to have correct configuration on SQL server for client's production environment?
    Please let me know if any other details required from server.
    Thank you,
    Mittal.

    @dave_gona,
    Thank you for your response.
    Can you please explain me this in more details -- 
    What do you mean by one batch ?
    1. Number of rows to be inserted at a time ?
    2. or Size of data in one cell does matter here.
    As in my case, I am clubbing together all the data in one xml (on c# side) and inserting it as one record. Data is large in size, but only 1 record is inserted.
    Is it a good idea to shrink transaction log periodically, as it is not happening itself in simple recovery model.
    HI Mittal,
    Shrinking is bad activity yu should not shrink log files regularly, in rare case if you want to recovery space you may do it.
    Have manual chekpoints in Bulk insert operation.
    I cannot tell upfront what should be batch size but you can start with 1/4 th of what you are currently inserting.
    Most important what does below query return for database
    select log_reuse_wait_desc from sys.databases where name='db_name'
    The value it returns is what stopping the log from getting cleared and reused.
    What is version and editon of SQl server we are talking about. What is output of
    select @@version
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Wait on the Database Engine recovery handle failed. Check the SQL server error log for potential causes in SQL Server 2012 Developer Edition

    I m using SQL Server 2012 Developer Edition. Even I tried 2012 express and enterprise edition but all
    gave same error. I browsed msdn blog. But nothing help me out.
    Below is the error log details--
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2061893606
      Start time:                    2013-10-21 12:58:05
      End time:                      2013-10-21 13:52:30
      Requested action:              Install
    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for RS:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for DQ:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    Machine Properties:
      Machine name:                  CROY-TOSH
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                    Feature                
                     Language             Edition              Version         Clustered 
    Package properties:
      Description:                   Microsoft SQL Server 2012 Service Pack 1
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       0
      Installation location:         C:\Users\CRoy\Downloads\SQL Server 2012 Developer Edition (x86 and x64) - DVD (English)\x64\setup\
      Installation edition:          Developer
    Product Update Status:
      None discovered.
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      false
      AGTSVCACCOUNT:                 NT Service\SQLSERVERAGENT
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Manual
      ASBACKUPDIR:                   C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Backup
      ASCOLLATION:                   Latin1_General_CI_AI
      ASCONFIGDIR:                   C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Config
      ASDATADIR:                     C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data
      ASLOGDIR:                      C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  NT Service\MSSQLServerOLAPService
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            CRoy-TOSH\CRoy
      ASTEMPDIR:                     C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CLTCTLRNAME:                   ROY
      CLTRESULTDIR:                  C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\ResultDir\
      CLTSTARTUPTYPE:                Manual
      CLTSVCACCOUNT:                 NT Service\SQL Server Distributed Replay Client
      CLTSVCPASSWORD:                <empty>
      CLTWORKINGDIR:                 C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\WorkingDir\
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
      CTLRSTARTUPTYPE:               Manual
      CTLRSVCACCOUNT:                NT Service\SQL Server Distributed Replay Controller
      CTLRSVCPASSWORD:               <empty>
      CTLRUSERS:                     CRoy-TOSH\CRoy
      ENABLERANU:                    false
      ENU:                           true
      ERRORREPORTING:                true
      FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, RS_SHP, RS_SHPWFE, DQC, BIDS, CONN, IS, BC, SDK, BOL, SSMS, ADV_SSMS, DREPLAY_CTLR, DREPLAY_CLT, SNAC_SDK, MDS
      FILESTREAMLEVEL:               2
      FILESTREAMSHARENAME:           MSSQLSERVER
      FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    MSSQLSERVER
      INSTANCENAME:                  MSSQLSERVER
      ISSVCACCOUNT:                  NT Service\MsDtsServer110
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                          <empty>
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              SharePointFilesOnlyMode
      RSSVCACCOUNT:                  NT Service\ReportServer
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         *****
      SECURITYMODE:                  SQL
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  Latin1_General_CI_AI
      SQLSVCACCOUNT:                 NT Service\MSSQLSERVER
      SQLSVCPASSWORD:                *****
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           CRoy-TOSH\CRoy
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
    Detailed results:
      Feature:                       Management Tools - Complete
      Status:                        Passed
      Feature:                       Client Tools Connectivity
      Status:                        Passed
      Feature:                       Client Tools SDK
      Status:                        Passed
      Feature:                       Client Tools Backwards Compatibility
      Status:                        Passed
      Feature:                       Management Tools - Basic
      Status:                        Passed
      Feature:                       SQL Server Data Tools
      Status:                        Passed
      Feature:                       Reporting Services - Native
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Data Quality Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Full-Text and Semantic Extractions for Search
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Master Data Services
      Status:                        Passed
      Feature:                       Distributed Replay Client
      Status:                        Passed
      Feature:                       Distributed Replay Controller
      Status:                        Passed
      Feature:                       Integration Services
      Status:                        Passed
      Feature:                       Data Quality Client
      Status:                        Passed
      Feature:                       Analysis Services
      Status:                        Passed
      Feature:                       Reporting Services - SharePoint
      Status:                        Passed
      Feature:                       Reporting Services Add-in for SharePoint Products
      Status:                        Passed
      Feature:                       SQL Browser
      Status:                        Passed
      Feature:                       Documentation Components
      Status:                        Passed
      Feature:                       SQL Writer
      Status:                        Passed
      Feature:                       SQL Client Connectivity
      Status:                        Passed
      Feature:                       SQL Client Connectivity SDK
      Status:                        Passed
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\SystemConfigurationCheck_Report.htm

    Hi,
    This 3rd time I followed this link. But nothing new, same error.
    Can you please tell me how to do follow, I cannt do the 1st step, how to change the local system to windows level account, vice-versa. It is shown mine as
    Server Configuration Manager(Local) 
    From here I folllowed the steps ---[I cannt insert link/image :-(]
    SQL 2008/R2 setup fails with "Wait on the database engine recovery handle failed" 
    If I right clicked on SQL Server Service, there is no option to change the account. 
    Hello,
    Thanks for your patience,did you tried stesp mentioned in below article
    http://blogs.msdn.com/b/sqljourney/archive/2012/03/16/sql-2008-r2-setup-fails-with-quot-wait-on-the-database-engine-recovery-handle-failed-quot.aspx
    To resolve it, follow these steps:-
    When the installation throws this error, click on OK and allow it to proceed. It will fail for Database Engine, but the SQL Server service should have
    been created. Check the Services console.
    If the service is present, perform the following steps:-
    1. Go to SQL Server Configuration manager, right click on the SQL Server service, and change the service account (if it is local system, give
    it a windows level account, and vice-versa). It might throw a WMI error but you will see the account getting updated anyway. If not, then use the Services console. Change the account for SQL Agent as well.
    Use this link to change sql server service account
    http://technet.microsoft.com/en-us/library/ms345578.aspx
    2. Next, try to start the service. It should come online.
    3. However, you will not be able to log in to the SQL Server
    4. Now stop the service and start it from the command prompt using -m -c -T3608 parameters.
    5. Now try logging in to the server using admin connection from sqlcmd (sqlcmd admin:<server name>\<instance name> ...)
    6. Once logged in, use the sp_addsrvrolemember '<domain\username>','sysadmin'.
    Also add the builtin/administrators to the sysadmin role
    7. Now stop the service from the command prompt and start it from SQL Server configuration manager
    You should be able to log in to the server now.
    Hope this helps someone.
    Please revert if it helps or even if it does not
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How can I get an accurate count of computers (workstations) logged in to my SQL Server database?

    We license our software by number of workstations.
    I have a query that I have used for years to get an accurate count of the workstations logged in to my SQL Server database. For simplicity, all users use the same login name/password. This is built in to the script that attaches to the DB. They
    have access only to that DB with the exception of
    USE [Master] GRANT VIEW SERVER STATE to MyUser
    The query that has been working is below:
    Basically this relies on the mac address (Master.dbo.sysprocesses.net_addre
    SELECT COUNT(Users) AS UserCount FROM (SELECT COUNT(Master.dbo.sysprocesses.hostname) AS Users FROM Master.dbo.sysprocesses LEFT OUTER JOIN Master.dbo.sysdatabases ON Master.dbo.sysdatabases.dbid = Master.dbo.sysprocesses.dbid WHERE (Master.dbo.sysdatabases.name = 'MyDatabase') GROUP BY Master.dbo.sysprocesses.net_address) AS UserCount_1
    ss), since both Workstation names and ip addresses can be duplicated.
    Recently this has stopped working at a number of customers. Suddenly individual workstations are showing multiple net addresses for the same workstation causing a substantial overcount of users. This may be related to SQL Server 2012 - not sure.
    What I need is a very reliable way to get a count of workstations logged in to my database.
    If anyone can tell me why I am suddenly getting multiple net_addresses for each workstation and how to prevent that that would be one possible solution.
    Otherwise if anyone can give me a rock solid way to get a workstation count other than the above that would be great. Our largest customer is 50 users by the way.
    Thanks in advance for any help.
    Kim

    I think your count is getting skewed because of duplicate rows in sysprocesses because of parallelism. Add DISTINCT to your query:
    SELECT COUNT(Users) AS UserCount
    FROM
    ( SELECT COUNT(DISTINCT Master.dbo.sysprocesses.hostname) AS Users
    FROM Master.dbo.sysprocesses LEFT OUTER JOIN Master.dbo.sysdatabases
    ON Master.dbo.sysdatabases.dbid = Master.dbo.sysprocesses.dbid
    WHERE (Master.dbo.sysdatabases.name = 'MyDatabase'
    GROUP BY Master.dbo.sysprocesses.net_address) AS UserCount_1
    Satish Kartan www.sqlfood.com

  • How to create a .mdf SQL Server database from a Data-Tier Application file that has data?

    This is a noob question, though I do use SQL Server databases all the time with Entity Framework when I code in C# using Visual Studio 2013.  The development environment is found below at [A].  I am trying to make a clone of a SQL Server 2008 R2
    database (.mdf)  that exists online.  I can read, connect and work with this database in Visual Studio 2013, but I wish to make a local copy of the database, as an .MDF file.  Somewhere in my notes I have a way of creating a local copy from
    an online database when using Visual Studio but I forgot how (it seems, reviewing my notes, that it deals with ADO.NET which is deprecated in Visual Studio 2013 these days, or so it seems).  So I'm looking for another way.  What I did was create
    (or export) a "Data-Tier Application File" from the online SQL Server database, with data, and it seems to have worked in that this Data-Tier Application file exists on my hard drive and seems to have data in it ("SQL Server Replication Snapshot"
    is the format it seems).  It contains skeleton code to create a database, but when I tried to execute it with SQL Server 2014 Management Studio, I got a bunch of errors.
    So my question is:
    1) Can I somehow create a .MDF SQL Server Database from an Data-Tier Application file that has data?  What tool do I use?  I saw this link, http://social.technet.microsoft.com/wiki/contents/articles/2639.how-to-use-data-tier-application-import-and-export-with-a-windows-azure-sql-database.aspx 
    and it relates to Azure, but is there a tool for C#Visual Studio 2013, standalone?
    2) If there's an easy way to create a .mdf SQL Server Database file from an online file, within SQL Server Management Studio?  I don't think so, since it would require Administrator permissions on the online server, which I don't have. I have permission
    to read, update, delete the online database file, but strangely not to download it (the service I use has a tool for backup, but not for download).
    3) same question as 2), but for Visual Studio 2013?  I don't think so, since I notice none of the templates even mentions ADO.NET anymore, but instead they go with Entity Framework.  Using EF I can of course do anything I want with the online database
    (CRUD), but it remains online.  Maybe there's a switch to make a local copy?  I guess I could write a short program to suck all the data out of the online database and put it into a new, duplicate database having the same tables, that I create on
    my localhost, but my question here is if there's an easier way than this, maybe a tool or command I can run from inside Visual Studio?
    Any advice on any of the above questions is appreciated.
    Thank you,
    Paul
    [A] Microsoft Visual Studio Professional 2013
    Version 12.0.21005.1 REL
    Microsoft .NET Framework
    Version 4.5.51641
    Microsoft Web Developer Tools 2013   2.0.40926.0
    SQL Server Data Tools   12.0.30919.1
    Microsoft SQL Server Data Tools
    Windows Azure Mobile Services Tools   1.0
    Windows Azure Mobile Services Tools

    Thanks but these links are too general to help.
    "2. what do you mean by online file?" - I mean the SQL Server database file is on a remote web server that I rent from, but I am not the administrator of.  I can access my database using SQL Server Authentication, but nothing more.
    Paul
    What do you mean by too general? It explains on how you can use data tier application to create and deploy databases
    May be this will help you to understand better
    http://www.databasejournal.com/features/mssql/article.php/3911041/Creating-Data-Tier-Applications--in-SQL-Server-2008-R2.htm
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Vix file in UI builder doesn't recieve data from Webservice application that communicates with SQL server database

    I have created Web service VI ("Prikaz insolacije.vi") which has two input string terminals (FROM / TO) for dates and two output terminals for data (1-D array) collected from database (MS SQL server). This VI communicates with database using functions from database palette with appropriate DSN and SQL query. There are two tables with two data columns (Time and Insolation) in Database.
    This VI works when you run it in Labview 2010, but when I used it as sub VI in UI builder it doesn't return any data.
    Could you please help me find a solution. Is it possible to communicate with SQL server database this way or there is another way?
    There are two attachmet files: Image of .vix file in UI builder and .vi file ("Prikaz insolacije.vi")
    Please help me ASAP!
    Thanks,
    Ivan
    Solved!
    Go to Solution.
    Attachments:
    vix file in UI builder.png ‏213 KB
    Prikaz insolacije.vi ‏35 KB

    Status is False and source string is empty. It behaves like there is no code in VI.
    I tried to access web service directly using following URL:
    http://localhost:8080/WSPPSunce/Prikaz_insolacije/2009-11-05/2009-11-01
    and it doesn' t work. It returns zeros.
    The response is:
    <Response><Terminal><Name>Insolacija</Name><Value><DimSize>0</DimSize></Value></Terminal><Terminal><Name>Vrijeme</Name><Value><DimSize>0</DimSize></Value></Terminal></Response>

  • How to view the login log in window NPS after login cisco switch and without SQL server database

    how to view the login log in window NPS after login cisco switch and without SQL server database
    in summary 
    there is only log with event id 4400
    A LDAP connection with domain controller XCPAWS20.cyberport.noc for domain NOC2 is established.

    Hi adil,
    For your issue, you can create a custom security token service (STS) and then set up a trust relationship between a SharePoint 2010 farm and the custom STS.
    For more information, you can refer to the articles:
    http://forums.asp.net/t/1335229.aspx?Sharing+Authentication+Ticket+Between+ASP+NET+and+Sharepoint
    https://msdn.microsoft.com/en-us/library/office/ff955607(v=office.14).aspx
    http://www.paraesthesia.com/archive/2011/02/01/working-with-windows-identity-foundation-in-asp-net-mvc.aspx/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • SQL server error log size is too big to handle

    I am working with a large database on windows sql server 2008 R2 such that it has to run continuously 24x7 because of that it is not possible
    to restart the server time to time. It is kind of monitoring system for big machines. Because of this SQL server error logs are growing too big even some times up to 60-70 GB at a limited sized hard drive. I can't delete them time to time manually. Can someone
    please suggest a way using which I can stop creation of such error logs or recycle them after sometime. Most of the errors are of this kind --
    Setting database option RECOVERY to simple for database db_name
    P.S.- I have read limiting error logs to 6 etc. But that didn't help. It will be best if you could suggest some method to disable these logs.

    Hi Mohit11,
    According to your description, your SQL Server error logs are growing too big to handle at a limited sized hard drive, and you want to know how to stop the generation of such error logs or recycle them after sometime automatically without restarting the
    SQL Server, right?
    As others mentioned above, we may not be able to disable SQL server error log generation. However we can recycle the error logs automatically by running the
    sp_cycle_errorlog on a fixed schedule (i.e. every two weeks) using SQL agent jobs so that the error logs will be recycled
    automatically without restarting SQL Server.
    And it is also very important for us to keep the error log files more readable. So we can increase the number of error logs a little more and run the sp_cycle_errorlog more frequently (i.e. daily), then each file will in a smaller size to be more readable
    and we can recycle the log files automatically.
    In addition, in order to avoid the size of all the log files growing into a too big size unexpected (sometime it may happen), we can run the following query in SQL Agent job to automatically delete all the old log files when the size of log files is larger
    than some value we want to keep (i.e. 30GB):
    --create a tample table to gather the information of error log files
    CREATE TABLE #ErrorLog
    Archieve INT,
    Dt DATETIME,
    FileSize INT
    GO
    INSERT INTO #ErrorLog
    EXEC xp_enumerrorlogs
    GO
    --delete all the old log files if the size of all the log files is larger than 30GB
    DECLARE @i int = 1;
    DECLARE @Log_number int;
    DECLARE @Log_Max_Size int = 30*1024; --here is the max size (M) of all the error log files we want to keep, change the value according to your requirement
    DECLARE @SQLSTR VARCHAR(1000);
    SET @Log_number = (SELECT COUNT(*) FROM #ErrorLog);
    IF (SELECT COUNT(FileSize/1024/1024) FROM #ErrorLog) >= @Log_Max_Size
    BEGIN
    WHILE @i <= @Log_number
    BEGIN
    SET @SQLSTR = 'DEL C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG.' + CONVERT(VARCHAR,@i);
    EXEC xp_cmdshell @SQLSTR;
    SET @i =@i + 1;
    END
    END
    DROP TABLE #ErrorLog
    For more information about How to manage the SQL Server error log, please refer to the following article:
    http://support.microsoft.com/kb/2199578
    If you have any question, please feel free to let me know.
    Regards,
    Jerry Li

  • My Experiences re: Migrating SQL Server Database to Oracle

    I am using SQL Developer EA4 for thsi conversion, best attempt yet.
    I had numerous problems with this conversion.
    1. The wizard asked me to specify the new Oracle database; instead it just ignored this information and created an Oracle database similarly named as the SQL Server database. I also noticed a file name "Migration.out" was produced; it contained errors such as:
    Error starting at line 3 in command:
    CREATE USER Emulation IDENTIFIED BY Emulation DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:3 Column:36
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges" and
    Error starting at line 4 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE SYNONYM,CREATE PUBLIC SYNONYM TO Emulation
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges" and
    Error starting at line 7 in command:
    CREATE USER dbo_COREv13 IDENTIFIED BY dbo_COREv13 DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:7 Column:38
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges" and
    Error starting at line 8 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE SYNONYM TO dbo_COREv13
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges".
    I followed all of the steps listed in the "Help" section re: Migrations but still ended up with these errors.
    2. My schema consists of 1000+ tables; approximately 10 tables were NOT created. When I copied the SQL from Migration.sql making NO changes and pasted it into the new Oracle database it created without issues.
    3. While the conversion is taking place, different objects (constraints, indexes, foreign keys, etc) are shown to be copied; their appears to be ordering of these items. Shouln't a dependancy tree be established, and object converted based on this?
    4. Several tables, in my case about 250 tables did NOT get any data copied across. No reasons given.
    5. A log of all activities should be produced for review and completeness.
    6. I tried to use the "Migrate select tables" option but met with no success. Apparently, it makes an assumption that both the "source" and "target" databases wil be of the same type (ie both SQL Server or both Oracle); this does not make any sense to me since the point of the exercise is to migrate data from one database vendor to another. Obviously, different database vendors use differing datatypes for similar data (ie dates).
    7. I noticed in the "Migration" sql that the "Connect" statements are not correct; they were missing the "instance name" portion.
    8. Also, when I looked in the "MIGRATION" sql, I could not find any entries for the last step of the conversion - the movement of data from SQL Server to Oracle. Is this intentional or an oversight.
    I dont want to appear negative on this Migration; I have used SQL Developer since it inception; in my opinion this is the best attempt to date.
    Murray Sobol

    Hi Murray,
    Thanks for this feedback.
    There is a lot of questions here, I think some of it boils down to misunderstandings, which we should clarify in the doc.
    Hopefully Ill get a video of a migration online soon as well.
    But here is a brief break down.
    *1.*
    "The wizard asked me to specify the new Oracle database; instead it just ignored this information and created an Oracle database similarly named as the SQL Server database."
    So this relates to Step 7 of the Migration Wizard. Where you can select the target connection.
    SQL Developer doesn't ignore the Target Connection you selected, It just uses it to connect to the target database , not the target schema.
    SQL Developer generates a new target schema for the migrated objects. It standard approach is not to generate objects directly into an existing Schema.
    The Target Connection is used to create all the migrated objects (including new Oracle Schemas) in your target oracle database. So you should choose an Oracle Target Connection which has enough privileges to create new Schemas and Objects.
    But as you have found, it doesn't generate the migrate objects , like tables, ... , directly into your chosen Target Connection.
    From the errors you encountered it doesn't sound like the Target Connection (and the underling Oracle Schema) doesn't have the privileges to create other Schemas.
    If you use something like a connection to the SYSTEM schema on your target database, it should run OK.
    It wont create any objects in SYSTEM, rather it will use SYSTEM privileges to create a new schema (ex: dbo_Northwind) and populate it.
    You don't have to use SYSTEM, but you do need a schema with enough privileges to create other schemas.
    That is the straight forward way. But if you really need to generate into an existing schema the following steps can be taken.
    a)rename the schema under the Converted Database Objects
    b)Right click "Converted Databases Objects" and choose generate. it will kick off the Migration Wizard in the correct place
    *2.*
    My schema consists of 1000+ tables; approximately 10 tables were NOT created. When I copied the SQL from Migration.sql making NO changes and pasted it into the new Oracle database it created without issues.
    When you say Migration.sql , is the entire generation file , which can be found in your <outputspecified>/generated/<projectname.modelname>.sql ?
    When your say "pasted it into the new Oracle database" , are you running it in SQL Developers SQL Worksheet using the Target Connection.
    Basically your migration is all out of shape once the target Schemas are not created. So the above issues (insufficient privileges) has to be resolved first.
    Please post back if it is still an issue.
    *3.*
    While the conversion is taking place, different objects (constraints, indexes, foreign keys, etc) are shown to be copied; their appears to be ordering of these items. Shouln't a dependancy tree be established, and object converted based on this?
    Objects are converted in a particular order and their dependencies are persisted so that they can be generated in the correct order.
    Are you seeing an issue?
    *4.*
    Several tables, in my case about 250 tables did NOT get any data copied across. No reasons given.
    I'm surprised any tables were populated with data due to the target schema not being created.
    The online data move is pretty simple and it does not report or recover very well from issues.
    If you are having difficulties once item 1. is resolved, please post an example of the source table and I will give it a go.
    For better control of the data move with much more powerful tweaking, error handling, reporting and performance try the offline data move.
    SQL Developer can created a suite of scripts which use SQL Servers BCP tool to dump out the data to dat files, and Oracle SQL*Loader tool to insert the data in the dat file into Oracle.
    *5.*
    A log of all activities should be produced for review and completeness.
    The output/generated/<projectname.modelname>.out provides the output of running the generation script.
    The migration reports http://dermotoneill.blogspot.com/2010/11/migration-reports-30.html outline what happens during the migration.
    Apart from online data move issues, is there any other data missing?
    *6.*
    I tried to use the "Migrate select tables" option but met with no success. Apparently, it makes an assumption that both the "source" and "target" databases wil be of the same type (ie both SQL Server or both Oracle); this does not make any sense to me since the point of the exercise is to migrate data from one database vendor to another. Obviously, different database vendors use differing datatypes for similar data (ie dates).
    Do you mean "Copy To Oracle" ? This option is intended to migrate tables from non Oracle databases like SQL Server to Oracle.
    Can you give more details on what issue you are seeing.
    *7.*
    I noticed in the "Migration" sql that the "Connect" statements are not correct; they were missing the "instance name" portion.
    The generation script is meant to be run using SQL Developers SQL Worksheet. I think you only get this "instance name" issue if running from SQL*Plus.
    Can you confirm
    8. Also, when I looked in the "MIGRATION" sql, I could not find any entries for the last step of the conversion - the movement of data from SQL Server to Oracle. Is this intentional or an oversight.
    The online data move is performed separately from creating the objects. It is not script based, it uses JDBC to pump the data from the source database to the target database.
    In summary , I would
    a) Create a connection to your Target database using your SYSTEM schema
    b) Right click on your "Converted Database Objects" and choose "Generate Target"
    c) Choose your new "System" connection as the Target Connection
    d) Follow the Migration Wizard to the end.
    You will end up with a new target Schema and the migrated objects in it.
    Check the .out file to see the errors
    and the migration reports http://dermotoneill.blogspot.com/2010/11/migration-reports-30.html
    Regards,
    Dermot
    SQL Developer Team.

  • SQL Server database details - DBInstanceSummary- Connection Status: Failure

    Hi guys,
    I have a strange problem with Maps 9.0 in the SQL Server database details -> DBInstanceSummary and DBInstanceProperties I got a failure as shown in the picture below.
    This sounds quite strange because I'm able to collect most of Instances and Database infos. And I'm also able to connect with status: Success to other Instances hosted in the same cluster.   
    Can you give me any good advice?
    Thanks in advance
    Ruggiero Lauria
    MCT-MCITP-MCSA-MCSE-MS SQL DBA

    We can try to see if a detailed log might reveal where the breakdown occurs. To get the detailed log, follow these instructions precisely:
    With MAP closed, rename the existing MAP log file which is located in "%LOCALAPPDATA%\Microsoft\MAP\MapToolkit.log" if the default was used during installation. It is recommended that you include a number or date when renaming so that we can keep the logs
    in order if we have to do this again.
    Open Notepad as Administrator
    Open "%LOCALAPPDATA%\Microsoft\MAP\Logging.cfg" in Notepad
    Change the line that says “.default=Info” to read “.default=Trace2”
    Save and close the file
    Open MAP (this creates a new log file)
    Go to File > Select a Database
    In the window that opens, select the radio button called “Create an inventory database” and enter a name
    Click ok
    On the Overview page in MAP, click on “Perform an inventory”
    Choose the "SQL Server with Database Details" inventory scenario
    Choose only the manual entry discovery method and enter just one target machine
    Make sure that you use the All Computers credentials for the user name and password
    Once the inventory has completed, exit MAP
    Open Logging.cfg is the same manner as before and change it back to “.default=Info”
    ZIP and send us the new log file
    Please remember to click "Mark as Answer" on the post that helps you, and to click
    "Unmark as Answer" if a marked post does not actually answer your question. Please
    VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

  • SQL Server transaction log not truncating in simple recovery model mode

    The transaction log for our SQL Server database is no longer truncating when it gets to the restricted file growth limit set by the autogrowth settings. Previously - as expected - it would reach this limit and then truncate allowing further entries. Now
    it stays full and the application using it shuts down. We are using 2008 R2 and the recovery model is set to simple. Is this a known behaviour / fault which can be resolved ? Thanks.

    As already suggested check wait type in log_reuse_wait_desc from sys.databases and open transaction on the database.
    Also, check long running SPIDs are waiting for from sys.sysprocesses from wait_type column
    0 = Nothing - What it sounds like.. Shouldn't be waiting
    1 = Checkpoint - Waiting for a checkpoint to occur. This should happen and you should be fine - but there are some cases to look for here for later answers or edits.
    2 = Log backup - You are waiting for a log backup to occur. Either you have them scheduled and it will happen soon, or you have the first problem described here and you now know how to fix it
    3 = Active backup or restore - A backup or restore operation is running on the database
    4 = Active transaction - * There is an active transaction that needs to complete (either way -
    ROLLBACK or COMMIT) before the log can be backed up. This is the second reason described in this answer.
    5 = Database mirroring Either a mirror is getting behind or under some latency in a high performance mirroring situation or mirroring is paused for some reason
    6 = Replication - There can be issues with replication that would cause this - like a log reader agent not running, a database thinking it is marked for replication that no longer is and various other reasons. You can also see this reason and it is
    perfectly normal because you are looking at just the right time, just as transactions are being consumed by the log reader
    7 = Database snapshot creation You are creating a database snapshot, you'll see this if you look at just the right moment as a snapshot is being created
    8 = Log Scan I have yet to encounter an issue with this running along forever. If you look long enough and frequently enough you can see this happen, but it shouldn't be a cause of excessive transaction log growth, that I've seen.
    9 = An AlwaysOn Availability Groups secondary replica is applying transaction log records of this database to a corresponding secondary database
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • SQL Server Restore Full + SQL Server Transaction Log backup

    Dear DB Admin,
    I would like to restore my SQL  Full + SQL Server Transaction Log backup. I tell you my current setup.. we have SQL Server 2005 full backup Time morning 6AM and SQL Server Transaction Log backup time at night 8 PM . I would like to restore
    to new server full + SQL Server Transaction Log backup how can i do it please could you explain to us...
    Best Regards
    Subash

    Dear Boss,
    Thanks for your support . I followed your steps and restore  full database with "No Recovery" option . it;s done 100% with out error . after i have
    seen my database it's say  green arrow up mark ( Restoring ) still going on ...
    Please could tell my what is the problem ..what i did wrong options...
    Best regards
    Subash 
     did you also restore transaction log backup or just full backup??
    do you have any transaction log backup taken after the full backup you restored?
    do you want to restore transaction log backups as well, how many transaction log backups did you take after the full backup, you just restored.  per your explanation, there should be one transaction log backup.. 
    so,you now need to restore the transaction log backup..
    Restore log <<RestoreDatabaseName>>
    From DISK ='BackupFileLocation\Transaction_log_BackupFileName.bak' With File= <<fileposition>>,
    ,Recovery
    Hope it Helps!!

Maybe you are looking for

  • Why doesn't my iPad mini show as a device in iTunes?

    I just got a new iPad mini and was planning to sync my iTunes library to it.  I've never had issues with syncing my iPod and I understand how to sync and choose playlists.  BUT: when I connect my iPad to my computer, the iPad never shows up as a devi

  • Setting Scale and Units in a PDF document

    Hi, I have a batch of architectural plans in PDF format. They have been generated from Autocad. When I want to make measurements on them, I need to specify the scale in the dialog box. In the Preferences > 2D Measures, there is an option tu use the d

  • How to undo word doc back to pdf?

    I was sent an attachment as a pdf. When I went to save it the file is in word now and I would like to get it back to the original pdf format. Can you tell me how I can do this? Thank you!

  • Apple TV desperate help unknown problem

    Hi ok, im at an end to know what to do. My apple tv 2nd gen has been constantly re-starting itself when I am streaming a video or music from itunes via home sharing or streaming a movie from the online apple tv menu, it will play for around 2 secs th

  • 802.1x WLAN auth not showing client ip in win 2008 AD security log

    Hello. I have a ongoing project configuring a cisco wlan with 802.1x, where microsoft network policy server is used for radius authentication. Configuring the SSID on the WLC, and the 802.1x on wlc/radius server works fine, users type in their userna