Capturing SQL server error logs with SQL restores
Hi All.
I have a stored procedure which restores a database, the issue I'm having is that when the stored procedure fails due to space issues.
If the stored procedure is executed from SSMS, get error similar to the below.
Msg 3257, Level 16, State 1, Line 1
There is insufficient free space on disk volume 'X:\Datadrive\' to create the database. The database requires 897725691812 additional free bytes, while only 776828129280 bytes are available.
Msg 3119, Level 16, State 4, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
However, looking at the SQL server output file I only see
Msg 3013, RESTORE DATABASE is terminating abnormally.
(1 rows(s) affected)
Msg 50000, Sev 16, State 1, Line 94 : Msg 3013, RESTORE DATABASE is terminating abnormally. [SQLSTATE 42000]
I have the catch block as follows.
SET @Error = ERROR_NUMBER()
SET @ErrorMessage= ERROR_MESSAGE()
SET @ErrorMessage = 'Msg ' + CAST(@Error AS nvarchar) + ', ' + ISNULL(@ErrorMessage,'')
SELECT @ErrorMessage
RAISERROR(@ErrorMessage,16,1) WITH NOWAIT
My objective is that I want to get the first detailed error message in my output file, however I am not sure what is being done incorrectly. The issue is that the error details in the output file doesnt really say what the issue is.
Thanks in advance.
Hi,
Can you replace catch block as per below code
DECLARE @ErrorMessage NVARCHAR(4000), @ErrorProc NVARCHAR(126), @ErrorLineNo INT;
-- ERROR HANDLING - Grab Error code and throw
SELECT @ErrorLineNo = ERROR_LINE(), @ErrorMessage = ERROR_MESSAGE(), @ErrorProc = ERROR_PROCEDURE();
RAISERROR('Error %s occurred in %s. Line %d', 16, 1, @ErrorMessage, @ErrorProc, @ErrorLineNo) WITH SETERROR;
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
Thanks for the response.
Can you please confirm what the code will do, the reason I ask is that we have temporarily resolved the space issue. If i want to test this however, I would need to re-create the scenario. I would like to have an understanding of what this code will do.
Thanks in advance.
Similar Messages
-
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.htmHi,
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 -
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 -
I see this error: Error: 3624, Severity: 20, State: 1
Complete error in the error log is:
SQL Server Assertion: File: <loglock.cpp>, line=807 Failed Assertion = 'result == LCK_OK'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart
the server to ensure in-memory data structures are not corrupted.
SQL Server 2008 R2 with Service pack 2 installed and mirrored.
I see this error in the sql server dump file:
0:000> .ecxr
rax=00000000676a7a6a rbx=0000000003fd3250 rcx=000000001048aaa0
rdx=0000000000000000 rsi=0000000003bbef3c rdi=0000000000000440
rip=000007fefd10940d rsp=000000001048b0b0 rbp=000000001048ca50
r8=0000000000000000 r9=0000000000000000 r10=00000000c000007c
r11=00000000012e98d0 r12=00000000000007c0 r13=0000000000000000
r14=0000000000000000 r15=00000000000007c0
iopl=0 nv up ei pl nz na po nc
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000206
KERNELBASE!RaiseException+0x39:
000007fe`fd10940d 4881c4c8000000 add rsp,0C8h
0:000> kC 1000
Call Site
KERNELBASE!RaiseException
sqlservr!CDmpDump::Dump
sqlservr!SQLDumperLibraryInvoke
sqlservr!CImageHelper::DoMiniDump
sqlservr!stackTrace
sqlservr!utassert_fail
sqlservr!LogLockCollectionAcquire::Callback
sqlservr!LogLockCollection::ApplyLocks
sqlservr!LogLockCollection::Acquire
sqlservr!DBMRedoManager::AnalyzeLogRecord
sqlservr!DBMRedoManager::RunAnalysis
sqlservr!DBMRedoManager::ApplyLogSegment
sqlservr!DBMRedoManager::Execute
sqlservr!SubprocEntrypoint
sqlservr!SOS_Task::Param::Execute
sqlservr!SOS_Scheduler::RunTask
sqlservr!SOS_Scheduler::ProcessTasks
sqlservr!SchedulerManager::WorkerEntryPoint
sqlservr!SystemThread::RunWorker
sqlservr!SystemThreadDispatcher::ProcessWorker
sqlservr!SchedulerManager::ThreadEntryPoint
msvcr80!endthreadex
msvcr80!endthreadex
kernel32!BaseThreadInitThunk
ntdll!RtlUserThreadStart
Not sure what to infer from this. Any help would be appreciated.
Let me know if more info. is needed.
Thanks !!!I did not have a chance to run that at the time the error happened, now everything is normal. Do you have any idea on what this means?
sqlservr!LogLockCollectionAcquire::Callback
I suggest you to run full DBCC CHECKDB , like I said assertion errors are basically related to Internal SQL Server problem
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 -
We have replaced a SQL Server 2005 with a SQL Server 2014 (new physical server.) Have the new server set up to use SQL Server login OR Windows user login. Had old server connecting (for a particular DB) to front end Access (2010 or 2013) as guest for
anyone logged into the Windows NT Network with a read only ODBC connection. Have the DB in the new server set to include guest as db_datareader (with only SELECT permission for the securables of each table and view being linked) but when any Windows user not
specifically listed as a SQL DB user tries to use the front end they get an error of:
Microsoft SQL Server Login
Connection failed:
SQL State: '28000'
SQL Server Error: 18456
[Microsoft][OCBC SQL Server Driver][SQL Server] Login failed for user {domain\user}.
After closing that pop-up window a server login window appears. Of course, since the guest user is not specifically listed as a user in the DB that fails also. It seems like there should be a very simple solution to this, but I can't seem to find it. I want
to allow anyone logged in on the Windows system (locally) to be able to open the MS Access file (on their work station machine) and run their own (read only; select) queries on the SQL Server database. Any suggestions?
Thanks a billion in advance ----Thanks for the response Olaf. I have now spent weeks researching this. I realize that using the guest account in most situations is not advised. As mentioned, I have restricted the guest account to allow the db_datareader role only, and have explicitly denied
all other roles, as well as allowing select only, and still have no access for the guest account.
The suggested fix in the second link you provided, of using Windows groups is not plausible for my situation either. We are a scientific field research institution, with a few long term users and lots of users that may have Windows accounts for a few months,
and then they are gone. It would be a nightmare for the network tech to try to keep a group account up to date, and we need to give access (read only, of course) to anyone logged into the system. Realize that the ONLY access of any kind to this database is
thru MS Access ACCDB, using a (by default) read only OCDB connection.
This type of access is used particularly because researchers need to be able to set up their own queries, and the MS Access query interface is particularly convenient for people who are not themselves SQL experts, yet are trying to get some very advanced
levels of output. Putting the database online is not practical because then we are back to the need for a comprehensive query interface, and just picking up general subsets of the data online (from a basic web page search feature) would be out of the question,
since the result set would involve hundreds of thousands if not millions of records.
So - that said - what exactly would you suggest, assuming we don't have the funds to buy a whole new system, and have spent plenty of money with Microsoft's Enterprise level MS Office so that all work stations have MS Access, and Microsoft's SQL Server,
as well as running our network on Microsoft's network software. -
Need some sort of SQL Server error log parser?
I have over 100 MSSQL instances - ranging from SQL2000 - SQL2012.
Currently, I'm querying using EXEC SP_ERRORLOG to read the log files. With the querying method, I cannot always be on top of things as I like. And frankly, I just check once a day for a period of 24 hours or so.
I'm wondering if there's an utility / software / solutions out there that does the following:
1) constantly monitors the error logs of all instances
2) present the log files in an orderly manner for each instances as needed.
3) email out a group of people for certain error / severity / state number.
Putting this in SQL Server Security because I'm mainly interested in errors like 18456 Login failed either from reboot or actual login failed.
ThanksYou can try that using Powershell
srvr.txt should contain a list of servers, I would prefer same SQL version.
Save the content to ReadingErrorlog.PS1
param
[String] $infile,
[DateTime] $date,
[int] $last,
[String] $OutFile
function getUNCPath($infile)
$qualifier = Split-Path $infile -qualifier
$drive = $qualifier.substring(0,1)
$noqualifier = Split-Path $infile -noQualifier
"$drive`$$noqualifier"
$srvr=get-content c:\DBAScripts\srvr.txt
foreach($svr in $srvr)
$UNC=getUNCPath($infile)
$readbuffer=get-content -path \\$svr\$UNC -encoding unicode | select-object -last $last
$i=0
[Datetime] $date
[String] $Outbuffer
$outbuffer=""
foreach($line in $readbuffer)
$i++;
$mydate=$line.substring(0,22)
Write-host $Mydate
if ($line -ne "")
if($mydate -ge $date)
if ($line -like "*Error:*")
write-output "$i: $line"
$outbuffer=$outbuffer+$line
add-content -path $outfile -value $outbuffer
sample call
PS:\>.\ReadingErrorlog.PS1 "f:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\errorlog"
"2012-05-01 12:00:00.00"
10 c:\DBAScripts\output.txt
You may need to re-work on the code here and there.
--Prashanth -
SQL 2000 LINKED SERVER ERROR 7303 WITH SQL 2012 ON WINDOWS SERVER 2012 R2
Hi all,
I have a problem with SQL Server 2012 and a linked server for SQL 2000 database.
System specification:
Windows server 2012 64 bit
SQL SERVER 2012 64 bit
REMOTE SERVER SQL 2000 32 bit
I've installed sql native client 32bit,create a SYSTEM DSN odbc connection with "SQL Server" driver named "MYSERVER".
Create a linked server with the query below in SQL 2012:
EXEC master.dbo.sp_addlinkedserver @server =N'MYSERVER', @srvproduct=N'MYSERVER', @provider=N'MSDASQL', @datasrc =N'MYSERVER', @location=N'System';
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'MySERVER',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
GO
but when i browse the linked server i receved error 7303.You need 64-bit MSDASQL. It is the bitness of the server you are connecting from that matters. 64-bit executables cannot hook into 32-bit DLL.
However, I suspect that you will not get things to work anyway. At least I have not seen anyone this far who has been able to set up a linked server from SQL 2012 to SQL 2000. I know that when I tried this, the following providers had this result:
SQLNCLI11 - does not support connections to SQL 2000.
SQLNCLI10 - failed with some obscure message that I don't recall.
SQLNCLI - Don't recall that the problem was here.
SQLOLEDB - SQLOLEDB is always replaced with the most recent version of SQLNCLI, so this fails because of lack of support.
I don't think I got through all version of the ODBC drivers, though.
Erland Sommarskog, SQL Server MVP, [email protected] -
Sql server 2005 reports with sql server 2014
Can i upload SSRS 2005 reports as it is on SSRS 2014 and use it without doing anything extra or without changing anything ??
I can use SSRS 2005 reports as it is with SSRS 2012. But for SSRS 2014 not sure.
h2007You can upgrade the the RDL schema will be upgraded.
Report definition (.rdl) files are automatically upgraded in the following ways:
When you open a report in Report Designer in SQL Server Data Tools (SSDT), the report definition is upgraded to the currently supported RDL schema. When you specify a SQL Server 2008 or SQL Server 2008 R2 report server in the project properties, the report
definition is saved in a schema that is compatible with the target server.
When you upgrade a Reporting Services installation to a SQL Server 2014 Reporting Services (SSRS) installation, existing reports and snapshots that have been published to a report server are compiled and automatically upgraded to the new schema the first
time they are processed. If a report cannot be automatically upgraded, the report is processed using the backward-compatibility mode. The report definition remains in the original schema.
Reports are not upgraded when you upload a report definition file directly to the report server or SharePoint site. Upgrading a report definition in SQL Server Data Tools is the only way to upgrade the .rdl file.
After a report is upgraded locally or on the report server, you might notice additional errors, warnings, and messages. This is the result of changes to the internal report object model and processing components, which cause messages to appear when underlying
problems in the report are detected. For more information, see Reporting Services Backward Compatibility.
For more information about new features for SQL Server 2014 Reporting Services (SSRS), see
What's New (Reporting Services).
Check the below Microsoft link for more information
http://msdn.microsoft.com/en-us/library/ms143674.aspx
Mudassar -
How to restore a database backup taken from a SQL Server 2012 instance to SQL Server 2014
I am trying to restore a database backup taken from a SQL Server 2012 instance to my new SQL Server 2014 instance. When I add the .bak through the Mgmt studio UI, it does not seem to find a backup set in the file so I cannot proceed (does not give
me any errors though either. I tried restoring through TSQL command but only got a database restore terminating abnormally error with no other details. How can I restore this database to SQL 2014?Hello,
Please examine SQL Server Error Log and share with us any error you can find. The following article may locate the log:
http://msdn.microsoft.com/en-us/library/ms187109.aspx
Regards,
Alberto Morillo
SQLCoffee.com -
SQL server 2005 problem with service starting
I am having a problem starting my sqlserver service. It will not start and therefore i have no access to my sql 2005 server database. This is what in the event log. This database was working fine until i had two drives kill over in a RAID configuration.
The striping went out with a hitch and no i want to see if anyone have any ideas before i perform a restore. Do i need to run SQL server repair with the installation disk?Well from viewing the log it looks like i am in a pickle. Since the SQL service won't start, is there a command or script to run for a database check using powershell? Since it looks like i will be doing a restore, just curious now.
2014-01-16 15:27:58.30 spid5s Starting up database 'master'.
2014-01-16 15:27:59.81 spid5s Error: 824, Severity: 24, State: 2.
2014-01-16 15:27:59.81 spid5s SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:363; actual 0:0). It occurred during a read of page (1:363) in database ID 1 at offset 0x000000002d6000 in file
'W:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately.
Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
2014-01-16 15:27:59.81 spid6s Error: 922, Severity: 14, State: 1.
2014-01-16 15:27:59.81 spid6s Database 'master' is being recovered. Waiting until recovery is finished.
2014-01-16 15:27:59.81 spid6s System Task System Task produced an error that was not handled. Major: 9, Minor: 22, Severity:14, State:1
2014-01-16 15:27:59.81 spid5s Error: 3313, Severity: 21, State: 2.
2014-01-16 15:27:59.81 spid5s During redoing of a logged operation in database 'master', an error occurred at log record ID (2369:160:2). Typically, the specific failure is previously logged as an error in the Windows Event Log
service. Restore the database from a full backup, or repair the database.
2014-01-16 15:27:59.81 spid5s Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL
Server Books Online. -
Location: bcpimp.cpp:1797
Expression: cbOutTemp < cbOutputStr
SPID: 52
Process ID: 2364
Msg 3624, Level 20, State 1, Line 3
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to
Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.If you check your sql server error log folder you will see dump files created. You need to send those dump files to Microsoft for inspection because outside of microsoft product support the symbols for reading the dumps are not available without which it
wont be easy to find the issue.
http://support.microsoft.com/kb/2028589
In the meantime check if you are on the latest version of Service Pack and if not apply the latest service pack. Majority of these kind of assertions are bugs which are solved in Service Packs/Cumulative Updates.
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com -
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
SubashDear 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!! -
SQl Server Error:927 and Restoring
i have a problem with sharepoint database in SQL 2005.
status of tow database in sql studio mamagment are restoring...
how can i stop that? (change status to normal)
AND SO :
WHEN I GET A PROPERTISE OF THOSE DATABASE THIS ERROR APEAR:
database cannot be openned. it is in middle of restore. microsoft SQL server Error:927Hi Tibor,
I am getting same error but here database is set to standby mode(logshipped), suggestion please..
Error:
database cannot be openned. it is in middle of
restore. microsoft SQL server Error:927
TARAK
Hi Tarak,
Did the restore complete? If there are no further backups to be restored then try below command
RESTORE DATABASE <name_here> WITH RECOVERY
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle -
SAPINST 4.7 with MS SQL SERVER Error "Unable to stop server"
I'm trying to install SAP 4.7 on
- Windows 2003 Server _ host "tpt"
- SQL Server 2000 SP3 _ new Instance "MYSAP". Collation is already set to "SQL_Latin1_General_CP850_BIN2".
Sapinst ran well on all input data steps.
Next it applied from steps
"Create SAP System Opertion System Groups and Users"
"Check/Adapt File System"
until step "MS SQL SERVER tempdb Parameters" with Processing message "Changing location of
tempdb files", then stopped the installation.
I've got Error_Log file:
Transaction begin ********************************************************
INFO 2004-09-19 10:21:24
Successfully connected to "tpt\MYSAP"
ERROR 2004-09-19 10:21:25
MDB-05039 Unable to stop server "tpt\MYSAP"; error: "[Microsoft][ODBC SQL Server Driver][SQL Server]Herunterfahren des Servers auf Anforderung. (german text means "Server shuts down on request")
[Microsoft][ODBC SQL Server Driver][SQL Server]SQL Server beendet diesen Prozess." (german text means "SQL Server stops this process")
ERROR 2004-09-19 10:21:25
MDB-05034 Call to a threaded function returned "1".
Transaction end **********************************************************
WARNING 2004-09-19 10:30:21
The step doChangeTempDBParameters1 with step key SAPSYSTEM|ind|ind|ind|ind|ind|0|SAPComponent|ind|ind|ind|ind|ind|0|DatabaseServer|windows|ind|mss|ind|ind|0|TempDB|windows|ind|mss|ind|ind|0|doChangeTempDBParameters1 executed with status ERROR.
WARNING 2004-09-19 10:30:21
An error occurred during the installation.
Can you help me?
Thanks very much
thanhHello,
you should not use a german version of MS SQL Server.
Regards
Gregor -
Unable to install SQL Server 2012 along with BIDS & VS 2012 on Windows 7
Unable to install SQL Server 2012 along with BIDS & VS 2012 on Windows 7 professional.
I get the below error
Could not find vsjitdebugger.exe
Blogs say anti-virus is stopping but I dont have one on the system.
Note: I had used SQL 2008 on the system previously and has a refresh i have deleted all the software to speed up the system.
Now i could not install both the software.
Can I get some help regarding this?Hi Nandu,
As your description, you come across an error(vsjitdebugger.exe cannot be found). Please confirm if the error occurs during the installation of SQL Server 2012. If so, please help post SQL Server setup logs. By default, SQL Server setup log file locates
in C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log.
Base on my research, this error could be caused by that the previous uninstallation is improper and vsjitdebugger.exe file could be mistakenly deleted.
To troubleshoot the issue, you could start your computer into Safe Mode and fix your problem with one of the following methods. For more information, please refer to the article:
http://www.fixerrorkit.com/fix-error/fix-vsjitdebugger.exe-error.html.
1. You could execute the sfc /scannow command following steps below.
a. Press "Windows+R", type in cmd and then right click "Run as administrator"
b. Type in sfc /scannow (There's a space between sfc and /scannow) into the dialog and hit Enter key and click ok.
c. Wait until the System File Checker finishes the check.
2. You could use a Windows repair installation, also known as a Startup Repair to repair your Windows system files.
3. You could install the latest Windows updates to fix vsjitdebugger.exe error. Microsoft often releases new service packs and system patches to replace or update some DLL files of Windows system.
4. You could use third-party tool such as Automatic Error Fix Tool to fix your vsjitdebugger.exe error. However, Microsoft cannot make any representations regarding the quality, safety, or suitability of any third-party software or information found there.
In addition, if you are unable to install Visual Studio, I suggest you post your question in Visual Studio Setup and Installation forum at
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vssetup . It is appropriate and more experts will assist you.
Regards,
Michelle Li
Maybe you are looking for
-
IPhone locked to a stranger's icloud account- please help I am not a thief
I had bought iPhone 5 from AT&T the day it was released. After using it for a year and half, I decided to gift it to my dad. I completely wiped the phone to it's factory settings and shipped it to my dad. After my dad received the phone, he took it t
-
Using Multiple Parameters in Select Statement
My goal is to be able to use more than one parameter for the select statement. When I use OR instead of AND it works but with only one parameter. I thought using AND would return any parameter that is listed in the ?Report Based On}. Any ideas why
-
Itunes will not open. I click onto the icon and it does nothing. I've uninstalled it twice and still nothing. Rebooted and nothing. I plug my iphone as well as my ipod and still nothing happens. Help please.
-
everytime i turn on my ipod it wouldnt let me go any farther.like the pages says plzz go to itunes to restore and then on the bottom there are 3 different languages translating it i think and at the end it says for more info go to www.apple.com./supp
-
How can I improve audio processing in Audition CS6?
I'm a Pro Tools user, slowly migrating to Audition. I am NOT using this as an opportunity to bash either product. They're both great AND frustrating at the same time. One great thing about Pro Tools, in my opinion, is the way the tracks handle proc