Tuesday, July 2, 2013

[MS SQL Server] How to troubleshoot error 3041? "BACKUP failed to complete the command BACKUP DATABASE XXXXX. Check the backup application log for detailed messages."

[MS SQL Server] How to troubleshoot error 3041? "BACKUP failed to complete the command BACKUP DATABASE XXXXX. Check the backup application log for detailed messages."


How to troubleshoot error 3041? "BACKUP failed to complete the command BACKUP DATABASE XXXXX. Check the backup application log for detailed messages."

Posted: 22 Sep 2011 06:58 AM PDT

My backups have been failing and I noticed the following in the SQL ERRORLOG[quote]2011-09-21 22:13:49.70 Backup Database backed up. Database: ...2011-09-21 22:13:50.68 Backup Database backed up. Database: ...2011-09-21 22:13:51.86 Backup Database backed up. Database: ...2011-09-21 22:29:25.51 Backup Error: 3041, Severity: 16, State: 1.2011-09-21 22:29:25.51 Backup BACKUP failed to complete the command BACKUP DATABASE XXXXX. Check the backup application log for detailed messages.[/quote]There is no other information as to what might be causing this.Where is the backup application log??

Help with contents of a script

Posted: 02 Jul 2013 04:27 AM PDT

Hi all, im the first to admit im rather useless when it comes to SQL (at the moment)I've contacted the 3rd party that is responsible for the database about our growing transaction logs, who have given me a script which shrinks the logs. Before I put this in, im curious as to what it actually does. I know I could contact the third party but it would probably take around 2 weeks to get an answer from anyone. Ive managed to reverse engineer parts of it but other parts im pretty stuck with. If anyone could let me know if im on the right lines with what i've put id be greatfull. The scrit is below, ive put REM next to the parts that ive managed to figure out:-----------------------------------------------------------------------------------------------------@echo offREM checks for servername\instance (%1) and database name (%2) has been included in the syntaxif .%1==. goto DisplayUsageif .%2==. goto DisplayUsageREM Stores the below commands into a file called shrink.sql in the temp folderecho shrinking log file for database %2echo.echo declare @sql nvarchar(255), @fn sysname > "%temp%\shrink.sql"echo set @sql = 'alter database [%2] set recovery simple' >> "%temp%\shrink.sql"echo exec sp_executesql @sql >> "%temp%\shrink.sql"echo select @fn = name from sys.database_files where type = 1 >> "%temp%\shrink.sql"echo dbcc shrinkfile(@fn,1) >> "%temp%\shrink.sql"echo. >> "%temp%\shrink.sql"echo.REM -S sets SQL Server Name and Instance to what is stored in %1REM -d sets the database name to what is stored in %2REM -U sets username to SAREM -P Sets Password to ?S1M5455796?REM -n Removes numbering and the prompt symbol (>) from input linesREM -i sets input file to "%temp\shrink.sql" which contains the commandsosql -S %1 -d %2 -Uusername -Ppassword -n -i"%temp%\shrink.sql"echo.goto Exit:DisplayUsageecho Shink the log file of a SQL Database v2.00echo.echo Usage: ShrinkDBLog {Server}\{Instance} {DatabaseName}echo.echo Where:echo Server\Instance is the SQL Server and the SQL Server Instance if one is presentecho DatabaseName SQL database name to shrink, eg simsecho.echo Examples:echo ShrinkDBLog AdminPC\SIMS simsecho ShrinkDBLog AnotherPC sims------------------------------------------------------------------------------------------------------This is the part where im not really sure whats going on? I know it stores the commands in shrink.sql but im not sure what exactly the commands do? Ive managed to figure out TYPE1 = Log files?declare @sql nvarchar(255), @fn sysname > "%temp%\shrink.sql"set @sql = 'alter database [%2] set recovery simple' >> "%temp%\shrink.sql"exec sp_executesql @sql >> "%temp%\shrink.sql"select @fn = name from sys.database_files where type = 1 >> "%temp%\shrink.sql"dbcc shrinkfile(@fn,1) >> "%temp%\shrink.sql"echo. >> "%temp%\shrink.sql"

litespeed restore

Posted: 02 Jul 2013 02:35 AM PDT

we have db backup file(litespeed backup file).Litespeed is not installed in the server.we need a command to restore the litespeed backup file.

Linked server issue

Posted: 02 Jul 2013 04:26 AM PDT

We've had an issue for several days now that I'm hoping you can weigh in on. We're testing a linked server between two SQL Servers. The first server, we'll call it server A for this discussion, is SQL2000. On server A we've defined a linked server to server B, which is SQL2008. The linked server's security is defined as "be made using the login's current security context". Both servers are on the same domain. We log onto server A with a Windows authenticated logon which is defined on the same domain as the SQL Servers. This logon is also defined on server B. When we attempt to execute a query that selects from a table on server B we get this error message:"Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON"If we log onto server A with a SQL authenticated logon that is on both servers we do not get the error.

Monitoring Your Database with SQL Profiler

Posted: 02 Jul 2013 04:13 AM PDT

Is there any way to identify if someone is running "Monitoring Your Database with SQL Profiler" sql trace against production database. ? We are having issue with our current application performance, after diagnosing the problem, we realized one of our database admin decided to use this tools during peak hours that effect application performance. Is there any way we can setup some notification in case, if any other admin decided to follow hand on training for sql trace ?

Probably a very dumb file size question...

Posted: 02 Jul 2013 04:08 AM PDT

So I was adjusting the size of a DB for a customer (increasing the size of his QA DB) and noticed something. SQL will let you set an initial size that is larger than the maximum size in Autogrowth.So, my question, what happens if you do this? If you create a DB (or increase the initial size of a DB) so that, for example, the initial size is 10MB while the maximum size in Autogrowth is 5MB. What would SQL do? Still tell you that there's no space in the DB, or would it let you go up to the new initial size but not beyond?Just curious, and don't have a system handy to try this out on...Jason

dbWarden questions

Posted: 15 Apr 2013 03:48 AM PDT

Hello --I am trying out the dbWarden application by running it within the 2008 Standard R2 SQL Studio application. It appears to have executed successfully, but I am having trouble identifying and locating the output file. Can anyone provide information on this? Thanks.

SQL server restart

Posted: 02 Jul 2013 03:07 AM PDT

I see the SQL server restarted last night. I don't know who did that or it is an automatic restart.As far as I know there should not be anybody doing that, how can I know if it is automatic restart or somebody did it from the logs?Thanks

SQL Server 2008 R2 , change domain

Posted: 02 Jul 2013 03:01 AM PDT

SQL Server 2008 R2Ho guys I need some help from you:I have a SQL Server 2008 R2 installation in a domain.The IT department has decided to change the domain name (keeping same name and IP).Could you provide me the direction on how to ensure the SQL Server still works after the domain change without any issue?Many thanks

change dbo login name

Posted: 01 Jul 2013 08:37 AM PDT

I have a database that I need to change the dbo owner from user A to user B. I'm getting different errors.When I try to change it I get the error that the user B is already mapped. What's the process to change the owner of a database?When I ran the scrip belowselectu.name, s.namefrom sysusers uinner join master.dbo.syslogins son u.sid = s.sidI get:name namedbo domain\userAdomain\userB domain\UserBI tried dropping user B but I cannot change the db owner to userBThank you.

[Articles] The Intrusion of Life

[Articles] The Intrusion of Life


The Intrusion of Life

Posted: 01 Jul 2013 11:00 PM PDT

Life intrudes on work at times, and we must learn to balance the limited time we have. However we also need to remember that we work to live, not live to work.

[SQL 2012] Install sql2012 with sp1 in 1 install

[SQL 2012] Install sql2012 with sp1 in 1 install


Install sql2012 with sp1 in 1 install

Posted: 01 Jul 2013 06:17 PM PDT

Hi therei am trying to automate sql 2012 installation and i dont want to install sql2012 and sp1 separately. I want it in 1 install file.I am trying to slipstream sql2012 and sp1 installation similar to sql2008r2and sp2 http://blogs.msdn.com/b/petersad/archive/2011/07/13/how-to-slipstream-sql-server-2008-r2-and-a-sql-server-2008-r2-service-pack-1-sp1.aspxIs there any way we can do this in sql 2012? or does MS release installer which has sql2012 with sp1 in it? Danny

SQL Server 2012 Upgrade Advisor: The network path was not found

Posted: 02 Jul 2013 01:05 AM PDT

We installed the SQL Server 2012 GUI tools, including "Upgrade Advisor," on a new virtual machine. We can connect to the old SQL Server 2008 R2 clustered databases just fine over port 1433 using SQL Server Management Studio 2012, but Upgrade Advisor is a mixed bag. Here are the steps we are taking:- Click on "Start," "All Programs," "Microsoft SQL Server 2012," "SQL Server 2012 Upgrade Advisor"- Fill in the server name with a valid SQL Server Network Name- Select "SQL Server" as the only component to be analyzed- Fill in the instance name with a valid named instance- Use Windows Authentication (the default)- The "SQL Server Parameters" window displays valid database names, meaning that we have a successful connection to the desired SQL Server instance at this point- Leave all of the databased selected (the default)- Click the "Run" button- The "Upgrade Advisor Progress" window spins for a while and eventually generates the following error:[code="plain"]TITLE: mscorlib------------------------------The network path was not found.------------------------------BUTTONS:OK------------------------------[/code]Why would Upgrade Advisor be able to display the database names after making a successful connection only to fail later saying that it cannot find the network path?I have seen Google references that mentioned the creation of an alias as a work around, but I have not found the right permutation. (For example, [url]http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f6d1d9d4-c07f-460f-a8f4-c6f66839578a/sql-2012-upgrade-advisor-the-network-path-was-not-found[/url] .)I opened a support call with Microsoft, and I was told flatly that Upgrade Advisor is *NOT A SUPPORTED PRODUCT*. Go figure... Yeah, I am disappointed in the response, but it's not worthwhile to chase Microsoft on this one.Does anyone have any ideas?

Multiple SQL Standard Instances on 4 Processor/32-core Server

Posted: 01 Jul 2013 09:28 PM PDT

We have a large 4 processor/32-core server with 192GB of memory available in the data center and over twenty small SQL Standard databases to consolidate. They are a mix of SQL 2012 and 2008 R2 for 3rd-party apps.Is there any issue with simply installing two instances of SQL Standard on the server - one for 2012 and one for 2008 R2 ? Each instance will use up to 64GB out of the 192GB and 16 cores. If we did this with Enterprise, the licensing would be a fortune and the Enterprise features are not needed.

scripting table triggers

Posted: 01 Jul 2013 04:02 AM PDT

I recently did a "poor man's" backup by using SSMS to script table creates for all my tables. After I had done this I noticed that the one table that I have a trigger on did not include "trigger create" scripting. Is there a way in SSMS to script the table AND any triggers in one step?

[SQL server issues] Commented Issue: AdventureWorksDW2008R2 DimDate table has missing dates [13383]


Commented Issue: AdventureWorksDW2008R2 DimDate table has missing dates [13383]



pavanbarnala wrote Feb 23, 2012 at 10:47 AM


Hello,
Is this been taken care? If so, please share the latest data for DimDate. I'm working on some POC which requires dates in between 2008 and 2010 as well. If it is not already done, can someone let me know is there is any way I can generate the data for those missing dates in that table?



petermyers wrote Feb 26, 2012 at 5:21 AM


The attached script will fix the problem. Use the stored procedure to extend to future dates if needed.



.

sqlserversamples.codeplex.com



[SQL server issues] Created Issue: SQL Server 2008 Developer edition sample database install error [18174]


Created Issue: SQL Server 2008 Developer edition sample database install error [18174]








description


I'm trying to install Adventureworks sample dB and i get an error.
I successfully downloaded the mdf file however when attach, add and click OK from SSMS I get the error:
 
Msg 5172, Level 16, State 15, Line 1
The header for file 'C:\Program Files\Microsoft SQL Server\AdventureWorks2012_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.







.

sqlserversamples.codeplex.com



[SQL server issues] Created Issue: AdventureWorksDW2012 Download file corrupt [19063]


Created Issue: AdventureWorksDW2012 Download file corrupt [19063]


There seams to be an issue with the AdventureWorksDW2012 Data file download. When I try to run this SQL statement:

CREATE DATABASE AdventureWorksDW2012 ON (FILENAME = 'E:\MSSQL11.SQL02\MSSQL\DATA\AdventureWorksDW2012_Data.mdf') FOR ATTACH_REBUILD_LOG;

This is the error I get:

Msg 5172, Level 16, State 15, Line 1
The header for file 'E:\MSSQL11.SQL02\MSSQL\DATA\AdventureWorksDW2012_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.

Thanks,Dan


.

sqlserversamples.codeplex.com



[SQL Server] Advanced SQL Server 2008 Extended Events with Examples


Advanced SQL Server 2008 Extended Events with Examples




Weekly SQL Server newsletter with articles, forum posts, and blog posts via email. Subscribers receive our white paper with performance tips for developers.



SQLTeam.com Articles via RSS


SQLTeam.com Weblog via RSS



.

sqlteam.com



Search This Blog