Sunday, March 15, 2009
"The current SKU is invalid." error? Didn't I pay for my license?
The current SKU is invalid.
After a quick search on the Internet, I found out that this is a bug (my first time to get bitten by it). There is currently a Microsoft Connect item regarding this and it mentions having Cumulative Update 1 applied should fix this issue but I wouldn't want to apply a hotfix for something like this as I normally do that after the entire installation is complete. A few more hits on Google directed me to a forum post that mentions about deleting the DefaultSetup.ini file from the installation media. Just make sure you copy the installation key from this file before deleting it or simply do what I did - move the file some place else. What I usually do is copy everything on a local disk for the installation to be a lot faster. After going thru the Add node to a SQL Server failover cluster option, I manually entered the installation key and it the installation completed successfully. I wonder why I never got this error during my previous installations
Friday, March 13, 2009
The Return of the Living Dead:Job Owners who Keep Coming Back
UPDATE
msdb.dbo.sysdtspackages90
SET
OWNERSID = SUSER_SID('DOMAIN\new_user')
WHERE
OWNERSID = SUSER_SID('DOMAIN\old_user')
For SQL Server 2008, this query should do the trick
UPDATE msdb.dbo.sysssispackages
SET OWNERSID = SUSER_SID('DOMAIN\new_user')
WHERE name = 'MaintenancePlan' AND OWNERSID = SUSER_SID('DOMAIN\old_user')
There's currently a Microsoft Connect item for this case so feel free to vote on it if you think it's worth having a solution that just a workaround
Tuesday, March 10, 2009
How to immediately shrink the SQL Server log files
- Backup the transaction log. This will truncate the log
- Shrink the log file
Pretty simple, right? Well, there are times when this might not work because SQL Server does not shrink the log immediately. The DBCC SHRINKFILE operation occurs only at checkpoints or transaction log backups. SQL Server divides each physical log file internally into a number of virtual log files (VLFs), which make up the transaction log. This MSDN article describes virtual log files in SQL Server. SQL Server MVP Tibor Karaszi highlights why you would not want to shrink your log files. This blog by Johnny Hughes has a script that lets you do this task.
USE databaseName
GO
DBCC shrinkfile(<file_id>,NOTRUNCATE)
DBCC shrinkfile(<file_id>TRUNCATEONLY)
CREATE TABLE t1 (CHAR1 CHAR(4000))
GO
DECLARE @i INT
SELECT @i = 0
WHILE (1 = 1)
BEGIN
WHILE (@i < 100)
BEGIN
INSERT INTO t1 VALUES ('a')
SELECT @i = @i +1
END
TRUNCATE TABLE t1
BACKUP LOG databaseName WITH TRUNCATE_ONLY
END
Are you a SQL Server DBA wanting to Learn Windows PowerShell?
This article is a first in this series of introducing Windows PowerShell to SQL Server DBAs. Go check it out