An inconsistency was detected during an internal operation. Please contact technical support. Reference number %ld.

Details
Product: SQL Server
Event ID: 5243
Source: MSSQLServer
Version: 9.0
Component: SQLEngine
Message: An inconsistency was detected during an internal operation. Please contact technical support. Reference number %ld.
   
Explanation

SQL Server detected a structural inconsistency in an in-memory storage engine structure.

   
User Action

Look for Hardware Failure

Run hardware diagnostics and correct any problems. Also examine the Microsoft Windows system and application logs and the SQL Server error log to see whether the error occurred as the result of hardware failure. Fix any hardware-related problems that are contained in the logs.

If you have persistent data corruption problems, try to swap out different hardware components to isolate the problem. Check to make sure that the system does not have write-caching enabled on the disk controller. If you suspect write-caching to be the problem, contact your hardware vendor.

Finally, you might find it useful to switch to a new hardware system. This switch may include reformatting the disk drives and reinstalling the operating system.

Restore from BackupIf the problem is not hardware related and a known clean backup is available, restore the database from the backup.Run DBCC CHECKDBIf no clean backup is available, run DBCC CHECKDB without a REPAIR clause to determine the extent of the corruption. DBCC CHECKDB will recommend a REPAIR clause to use. Then, run DBCC CHECKDB with the appropriate REPAIR clause to repair the corruption.Caution:If you are not sure what effect DBCC CHECKDB with a REPAIR clause has on your data, contact your primary support provider before running this statement.If running DBCC CHECKDB with one of the REPAIR clauses does not correct the problem, contact your primary support provider.

Related:

A time-out occurred while waiting for buffer latch — type %d, bp %p, page %d:%d, stat %#x, database id: %d, allocation unit Id: %I64d%ls, task 0x%p : %d, waittime %d, flags 0x%I64x, owning task 0x%p. Not continuing to wait.

Details
Product: SQL Server
Event ID: 846
Source: MSSQLServer
Version: 9.0
Component: SQLEngine
Message: A time-out occurred while waiting for buffer latch — type %d, bp %p, page %d:%d, stat %#x, database id: %d, allocation unit Id: %I64d%ls, task 0x%p : %d, waittime %d, flags 0x%I64x, owning task 0x%p. Not continuing to wait.
   
Explanation

A computer might stop responding (hang), or a time-out or some other disruption of regular operations might occur at the same time that SQL Server writes buffer latch errors to the SQL Server error log.

If the stat field in the message has the value of 0x04 on, SQL Server is waiting for an I/O operation. You may also receive message MSSQLSERVER_833 in the SQL Server error log.

If the stat field in the message has the value 0x04 off, there is heavy contention for a page. If the object is a data page, this can be caused by inefficient code design. If the page is nondata, the error might be caused by server bottlenecks, such as insufficient hardware resources. For more information about SQL Server page types, see Pages and Extents.

   
User Action

To work around this problem, depending on your environment, one or more of the following steps might reduce or eliminate the error messages:

Determine whether you have any hardware bottlenecks. If it is necessary, upgrade your hardware so that it can support the configuration, query, and load requirements of your environment. For more information about bottlenecks, see Identifying Bottlenecks.

Check for any logged errors and run any diagnostics provided by your hardware vendor.

Make sure that your disk drives are not compressed. Storing data or log files on compressed drives is not supported. For more information about physical files, see Physical Database Files and Filegroups.

See whether the error messages disappear when you set the following options to off:

SQL Server priority boost configuration option

Lightweight pooling (fiber mode) option

Set working set size option

Note:

The previous settings can frequently be counter-productive if you change them from their default setting of OFF. For more information about the settings, see Setting Server Configuration Options and sp_dboption (Transact-SQL).

Tune queries to reduce resources used on the system. Performance tuning will help reduce the stress on a system and improve response time for individual queries. For more information about how to tune queries, see Query Tuning Recommendations.

Set the AUTO_SHRINK option to OFF to reduce the overhead of changes to the database size.

Make sure that you set the FILEGROWTH option to increments that are large enough to be infrequent. Schedule a job to check the available space in the databases, and then increase the database size during nonpeak hours.

Related:

The LSN %S_LSN passed to log scan in database ‘%.*ls’ is invalid.

Details
Product: SQL Server
Event ID: 9003
Source: MSSQLServer
Version: 8.0
Component: SQL Engine
Message: The LSN %S_LSN passed to log scan in database ‘%.*ls’ is invalid.
   
Explanation
If you see this message during startup when the SQL Server process tries to recover the database or as a result of an ATTACH statement, the log file for the database is corrupted. If you see the message during a restore process, the backup file is corrupted. If you see this message during a replication process, the replication metadata may be incorrect.
   
User Action
If you see the error during a restore process, check the integrity of the backup file. If possible, create a new backup in a new location and retry the restore with the new backup file.

If you see this error during startup or when you try to attach a database:

HARDWARE FAILURE

Run hardware diagnostics and correct any problems. Also examine the Microsoft Windows NT system and application logs and the SQL Server error log to see if the error occurred as the result of hardware failure. Fix any hardware-related problems.

If you have persistent data inconsistency problems, try to swap out different hardware components to isolate the problem. Check that your system does not have write caching enabled on the disk controller. If you suspect this to be the case, contact your hardware vendor.

Finally, you might find it beneficial to switch to a completely new hardware system, including reformatting the disk drives and reinstalling the operating system.

RESTORE FROM BACKUP

If the problem is not hardware related and a known clean backup is available, restore the database from the backup.

DBCC CHECKDB

If no clean backup is available, execute DBCC CHECKDB without a repair clause to determine the extent of the corruption. DBCC CHECKDB will recommend a repair clause to use. Then, execute DBCC CHECKDB with the appropriate repair clause to repair the corruption.

CAUTION: If you are unsure what effect DBCC CHECKDB with a repair clause has on your data, contact your primary support provider before executing this statement.

If running DBCC CHECKDB with one of the repair clauses does not correct the problem, contact your primary support provider.

Related:

%1: %2 failure on backup device ‘%3’. Operating system error %4.

Details
Product: SQL Server
Event ID: 18210
Source: MSSQLServer
Version: 8.0
Component: SQL Engine
Message: %1: %2 failure on backup device ‘%3’. Operating system error %4.
   
Explanation
This message indicates that an I/O error was reported by the operating system after a file handle was successfully opened. The error occurs when reading from or writing to a device specified as part of a BACKUP or RESTORE command, often when there is not enough disk space available for a write operation. This error may also be seen if third-party software that uses a virtual device to perform SQL Server backups cancels the operation.
   
User Action
The steps to take will depend upon the operating system error received.

  • Verify that the specified path has sufficient disk space for the file.
  • Test to see if the problem is isolated to this particular server, path, or file.
  • Run hardware diagnostics to verify that the media specified in the path is healthy.
  • If the operating system error only returns a number and not any text, you can open a command prompt and execute NET HELPMSG with the operating system error number as the parameter. In many cases, this will return text that can help you to isolate the problem.
  • If you received this error while using third-party backup software, check that application’s logs to see if it canceled the backup operation, and if so, why.

Related:

%1: Backup device ‘%2’ failed to %3. Operating system error = %4.

Details
Product: SQL Server
Event ID: 18204
Source: MSSQLServer
Version: 8.0
Component: SQL Engine
Message: %1: Backup device ‘%2’ failed to %3. Operating system error = %4.
   
Explanation
This message indicates that the operating system was unable to open or close a backup device (disk, tape, or pipe) specified as part of a BACKUP or RESTORE command. For more information on backup devices, refer to the Books Online topics, “Backup Devices” and “BACKUP.”
   
User Action
The steps to take will depend upon the operating system error received.

  • Cut and paste the path and file name specified in the BACKUP or RESTORE command into Windows Explorer. This will help to verify that the path is actually valid.
  • If you specify a mapped drive in the command, switch to a UNC instead and retry the command. In most cases, a service such as SQL Server Agent is not aware of drives that are mapped for individual Windows users, so a service is usually not able to execute commands that involve a mapped drive.
  • Verify that the Windows account used to start the SQL Server service has permissions to access the server specified and to traverse through the specified path. Also verify that this account has the permissions necessary to open the file for the specified type of operation.
  • If you are accessing a file that already exists, ensure that the file is not locked by another process and that it is not marked as read-only.
  • Test to see if the problem is isolated to this particular server, path, or file.
  • Run hardware diagnostics to verify that the media specified in the path is healthy.
  • If the operating system error only returns a number and not any text, you can open a command prompt and execute NET HELPMSG with the operating system error number as the parameter. In many cases, this will return text that can help you to isolate the problem.

Related:

How to rebuild MS Agent Jobs from MSDB table?

This morning our DB server died.

They restored backups to another server but these didn’t include the many MS Agent jobs.

Anyway I have managed to get a backup of the old MSDB table where all the tables used to create MS Agent Jobs are held added to our new server.

Therefore I need a script to re-create them on the new server.

There must be a job somewhere in MS SQL to script them out as you can do it from the management console. Therefore does anyone know of a script to do this or where to find the MS one please let me know.

As no manual backups were created a lot of jobs will be missing and people won’t know what to do to re-create them manually (which is why I think being able to add them to the nightly backup process would be good – I’m a webdev so it’s not my job – I just happen to be the only person around to do this lovely task).

Any help would be much appreciated.

Related:

Password mismatch while logging to sql server

Alright, I have a classic asp application and I have a connection string to try to connect to db.

MY connection string looks as follows:

 Provider=SQLOLEDB;Data Source=MYPC\MSSQLSERVER;Initial
 Catalog=mydb;database=mydb;User Id=me;Password=123

Now when I’m accessing db though front-en I get this error:

Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'me'. 

I looked in the sql profiler and I got this:

 Login failed for user 'me'.  Reason: Password did not match that
 for the login provided. [CLIENT: <named pipe>]
 Error: 18456, State:8. 

What I’ve tried:

  1. checked 100 times that my password is actually correct.
  2. Tried this: alter login me with check_policy off (Do not even know why I did this)
  3. Enable ALL possible permissions for this account in SSMS.
  4. I’ve tried this connection string: Provider=SQLOLEDB;Data Source=MYPC\MSSQLSERVER;Initial Catalog=mydb;database=mydb; Integrated Security = SSPI

And I got this error:

  Microsoft OLE DB Provider for SQL Server error '80004005' Cannot open database mydb requested by the login. The login failed.

Related: