Exit message:MsiGetProductInfo failed to retrieve ProductVersion for package with Product Code = '{8BDD006D-7863-4D25-9806-08527E285EA4}'. Error code: 1605.
Start time:2009-07-28 18:30:43
End time:2009-07-28 18:31:14
Requested action:ComponentUpdate
Log with failure:C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20090728_182952\Detail_ComponentUpdate.txt
Exception help link:http%3a%2f%2fgo.microsoft.com%2ffwlink%3fLinkId%3d20476%26ProdName%3dMicrosoft%2bSQL%2bServer%26EvtSrc%3dsetup.rll%26EvtID%3d50000%26ProdVer%3d10.0.1600.22%26EvtType%3d0x4E099C65%400x7B130144
The error happened during the installation of a SQL Server 2008.
Solution / Fix / Workaround
The above remark line show us the product code related with the error. First, is necessary to know that SQL Server 2008 has around of 30 products registered on the Registry. Each product has a Product code and an installation code as well (GUID).
For this case the Product Code is the following:
{8BDD006D-7863-4D25-9806-08527E285EA4}
The Installation Code is build with the product code in reverse form:
D600DD8368752D460894AE582E72580
One time that you got the Installation Code look into the Windows Registry and delete all the entries found.
Then try again the installation and the result must to be SUCCESSFULLY.
Days ago I was working to find out the root cause of a SUSPECT state in a productive database. When I started to work in the database, it was already online. Somebody restart the MSSQL service and it bring online the database, but nobody knows what was the cause of the issue, it task is my job. :-)
Please be aware that the database name, data file or log file names are not the real values.
1. First I saw that the size of Transaction Log was several times the size of the entire db. It is bad, but this is not the cause of the suspect database.
2. I started to checking the ERRORLOG and I saw the system was configured to archive almost 60 ERROLOG. It is strange.
4. When I was checking the ERROLOG.10, I saw the following error:
2009-07-03 22:40:02.78 spid51udopen: Operating system error 32(The process cannot access the file because it is being used by another process.) during the creation/opening of physical device c:\Productive_DB_LOG_FILE.ldf.0
2009-07-03 22:40:02.78 spid51FCB::Open failed: Could not open device c:\ Productive_DB_LOG_FILE.ldf for virtual device number (VDN) 2.
In the first error I can see that the log file can not be blocked by SQL Server. We knows that SQL Server block the data files and log files when it try to start the database. The issue here is, the database was not offline at any moment. The system was working during long period of time and I did not see any message where the database was offline. So, if the database was ONLINE, what was the cause of the log file was not blocked by SQL Server?
At this moment I knew that the cause of the database was in SUSPECT state, was because a log file for the database was blocked by other process and can not be blocked by SQL Server when it try start the database.
5. When I was checking the ERRORLOG files, I saw several messages (not errors) as the following.
2009-07-03 22:33:08.85 spid51Analysis of database 'PRODUCTIVE_DB' (9) is 100% complete (approximately 0 more seconds)
2009-07-03 22:40:02.74 spid51Starting up database 'PRODUCTIVE_DB'.
Mmmmmm Starting up database several times?,
What is the cause that the database is starting in several times? I thought in the option AUTO_CLOSE at db level. SQL Server has an option that close the database automatically when the last user close his connection to database. It option is AUTO_CLOSE.
6. Then I checked if the AUTO_CLOSE is enabled with the next statement:
IsAutoClose: Database shuts down cleanly and frees resources after the last user exits.
7.Conclusion.
At this moment I know that AUTO_CLOSE option is enable. So, if this option is enable, it cause that SQL Server frees the resources of the database after the last user finish his connection and when a new user is connected to the database, it is started and it generate a message of �Starting Database� in the ERROLOG files. Hence, I am ready to conclude: AUTO_CLOSE option is enabled, this option caused that all resources are frees and caused that the data files and log files of the database are not blocked anymore, then this is cause that another process was able to block the log file and it happened, finally, when SQL Server try to start the database and block the log file again, it was not possible and SQL Server marks in SUSPECT state the PRODUCTIVE_DB.
Today in my job, some colleague asks me about the next error:
Msg 4305, Level 16, State 1, Line 1
The log in this backup set terminates at LSN 9386000024284900001, which is too early to apply to the database. A more recent log backup that includes LSN 9417000002731000001 can be restored.
So, my explanation was:
You are trying to apply a Log file that finish with LSN 9386000024284900001 into a DB restored with LSN 9417000002731000001, so, the LSN of the Full Backup (restored) is older than the log file that is trying to apply. So, the log file is not possible to apply it.
Now, we are going to replicate that error and we are going to see how to know the LSN of each backup, in order to clarify and understand the error mentioned above.
First a DB will be created, some backups will be taken, then the DB will be restored and some log will be applied in the wrong way, then we are be able to identify the right way and the we will apply the logs.
First, we create a database and a table for testing purpose.
--Create DB for Testing
createdatabase DB_TestLSN
GO
USE DB_TestLSN
GO
--create a testing table.
createtable test(
aint
)
Now, we are going to backup the database and log:
backupdatabase DB_TestLSN
todisk='c:\DB_TestLSN.bak'
A table2 and table3 are generated and two log backups are taken:
createtable test2(
aint
)
-- backup log file
backuplog DB_TestLSN
todisk='c:\DB_TestLSN_LOG1'
createtable test3(
aint
)
-- backup log file
backuplog DB_TestLSN
todisk='c:\DB_TestLSN_LOG2'
Restoring database�.
First restore the full backup
restoredatabase DB_TestLSN_REST
fromdisk='c:\DB_TestLSN.bak'
with norecovery
then we restore intentionally the wrong log file
restorelog DB_TestLSN_REST
fromdisk='c:\DB_TestLSN_LOG2'
Msg 4305,Level 16, State 1, Line 1
The login this backupset begins at LSN 18000000015300001, which is too recent toapplyto the database. An earlier logbackup that includes LSN 18000000014000001 can be restored.
Msg 3013,Level 16, State 1, Line 1
RESTORELOGis terminating abnormally.
� is necessary to identify what is the correct way to restore the logfiles. For this, we can mention two manners:
1. If we have access to the server where the backup was taken.
We can check the system table msdb..backupset. To identify the chronologic order of the data backup and log backup, we can put special attention on the following columns
With that columns we can view the LSN of each of the backups taken, so our error shows that 18000000015300001 (this is the first lsn for the second log backup) is too early to apply and and earlier log backup that includes LSN 18000000014000001 must be exists, and that is correct, the first log backup includes the LSN 18000000014000001 and also this logs begins with the log_chain.
In this case also is necessary to put special attention on the columns first_lsn, last_lsn in each of the backup files.
To reproduce exactly the error mentioned on the top of this article,
Msg 4326,Level 16, State 1, Line 2
The login this backupset terminates at LSN 18000000015400001, which is too early toapplyto the database. A more recent logbackup that includes LSN 18000000022000001 can be restored.
Msg 3013,Level 16, State 1, Line 2
RESTORELOGis terminating abnormally.
follow up the next steps.
Create DB
Backup Full Database (BkpDBFULL1)
Backup Log (BkpLOG1)
Backup Full Database (BkpDBFULL2)
Restore BkpDBFULL2
Try to apply BkpLOG1
Instead of use backup log, you can use backup incremental and the behavior is the same than we show in this examples.
[Questions & Answers]
Q: What is a LSN (Log Secuence Number): ?
A:
Every record in the Microsoft SQL Server transaction log is uniquely identified by a log sequence number (LSN). LSNs are ordered such that if LSN2 is greater than LSN1, the change described by the log record referred to by LSN2 occurred after the change described by the log record LSN.
The LSN of a log record at which a significant event occurred can be useful for constructing correct restore sequences. Because LSNs are ordered, they can be compared for equality and inequality (that is, <, >, =, <=, >=). Such comparisons are useful when constructing restore sequences.
LSNs are used internally during a RESTORE sequence to track the point in time to which data has been restored. When a backup is restored, the data is restored to the LSN corresponding to the point in time at which the backup was taken. Differential and log backups advance the restored database to a later time, which corresponds to a higher LSN.
Error: Property Owner is not available for Database '[DB_NAME]'.
This property may not exist for this object, or may not be retrievable
due to insufficient access rights. (Microsoft.SqlServer.Smo)
This a common error that happens when we try to access the database options and the database doesn�t have owner. The database can not be an owner because somebody clean the owner property, or the user (owner) was deleted, etc.
Solution / Fix / Workaround.
Is necessary to assign a proper owner for the database. To know what are the valid owners for the database, we can execute the following query:
select databases.name,server_principals.name
from sys.[databases]
innerjoin sys.[server_principals]
on [databases].owner_sid = [server_principals].sid
Sometimes when we are trying to truncate the transaction log, we can got the following error message:
Statement:
BACKUPLOG<SID>WITHTRUNCATE ONLY
Error:
The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.
This is because some part of the transaction log is pending to replicate (publisher side), hence is not possible to truncate it from the transaction log. In this case is necessary to mark these transactions as replicated in order to be able to truncate them.
Solution / Fix / Workaround.
To mark the transactions as distributed (or replicated) we can use the following statemtent:
Use sp_repldone just for troubleshooting purpose and in emergency situations. If this SP is not used in the proper way you can invalidate pending information to be replicated.
Sometimes when sp_repldone is used, is possible that we get the following error.
Msg 18757, Level 16, State 1, Procedure sp_repldone, Line 1 The database is not published
It means that our Database is not published. A workaround to this error, is to publish our database with the below statement, then try again the sp_repldone and finally execute again the sp_dboption with publish = false.