Thursday, December 20, 2012

SQL 2012: msiexec.exe running constantly after SP1 install

Heads up on a SQL 2012 SP1 bug; this happened to me on two pretty bare 2012 installs:

Symptoms: 


After installing SQL 2012 SP1, 2 msiexec processes spawn and run constantly. These generate significant CPU and disk activity.

Description: 


An error with the installer causes the .NET NGEN (Native Image Generator) to run in an indefinite loop. According to one post, it may even cause registry bloat to the point where the registry reaches the maximum size and you may need to re-install the OS on the machine. :-/ That said, I haven't verified that claim.

Fix:

None yet available

Update: Microsoft posted the official fix (the same as the early one below) here.

Workarounds:


  1. (Per Steve Philip) "Uninstalling the Management Tools (both Basic and Complete) feature seemed to resolve the problem for us on most of our servers. On those that had the Data Tools feature installed, we also had to remove that."
  2. (Per the Microsoft SQL Team.. supposedly) "Hello all, we have identified a temporary workaround for this issue. We will continue to work on a permanent fix and will communicate more information as it becomes available.If you are currently experiencing this issue, perform the following steps appropriate for you CPU architecture: 
    1. - Open an elevated cmd.exe 
    2. - If you are on a 64-bit architecture machine, run both of the following commands in the cmd.exe window:
    3.      - %windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe queue pause
    4.      - %windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe queue pause
    5. - If you are on a 32-bit architecture machine, run only the following command in the cmd.exe window:
    6.      - %windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe queue pause
    7. After running these command(s) CPU consumption should return to normal and the 1004/1001 events should cease being published to the event log.
    8. More information on ngen.exe can be found here: http://msdn.microsoft.com/en-us/library/vstudio/6t9t5wcf(v=vs.100).aspx
    9. Note - after a machine reboot, the workaround will need to be re-applied"
  3. (Per "DizzyBadger") "Just stop and disable ALL Microsoft .Net Framework NGEN services, and make sure you kill any lingering msiexec.exe processes. If your software hive has already reached 2GB on the other hand, you are screwed. (Again, unverified) Then you have to reinstall the OS, at least if it is a production machine. You can murk around in the registry and delete the keys manually, but there is no knowing what else has been scrambeled due to the fact that nothing can be added to the registry hive past 2GB. The bloated keys are HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\NGENService &HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\NGENService"
  4. (Update1; Per Paul D., see comments) Paul came up with a workaround to allow for the optimization tasks to still run; since we're still waiting on the official hotfix from MSFT you may want to have a look at that fix here.
There is another workaround listed on the site involving removing and re-installing the SQL management studio after patching, but this didn't work for me. 


Given the potential need to rebuild the OS it would make sense to check your production systems for this problem now.

Update 2: In the Microsoft connect article, MSFT has posted a fix, but gave the following warning about using it: "Please Note: The patch should only be applied if you're on SQL 2102 SP1. If you have already applied a Cumulative update or an "On Demand" fix on top of SP1, please wait for the associated hotfix update to be made available.


Thanks and regards
Shamik Ghosh
[SQL Server Team]
"

I can't speak to the success of this patch; I'll be waiting for the associated hotfix.

Thursday, December 13, 2012

Exchange 2010 Initial Database Setup

Here's a quick how-to on Exchange 2010 addressing a couple common problems:

Assumptions:

  • You have completed Exchange 2010 setup and not yet migrated mailboxes to it. 
  • You want to create one or more mailbox databases and delete the default. (The default names make it more difficult to manage) 
  • You have more than one domain controller (See point 2 below)
  • You are executing commands directly on the server in question. (You can do it remotely, but the syntax of the commands is different) 

Steps: 

  1. First things first, let's create your new database. Pick an appropriate name and open up the Exchange Management Shell (as admin)
  2. Most Exchange 2010 setups I've been through have been subject the error detailed here. Though the article talks about a multiple domain environment it may still appear in a single domain setup. It is due to the replication delay between your domain controllers. For this reason, I've found that keying your preferred server can alleviate this and a few other issues. Long story short, pick your best (local) domain controller, and execute:  Set-ADServerSettings -PreferredServer DC.FQDN.Here  . If you would like to see the DC configuration, you can use the command Get-ADServerSettings | Format-List . 
  3. Now make the DB by using the command: New-MailboxDatabase -server 'NETBIOSNAME' -Name 'DB_NAME' -EdbFilePath ':\DB_PATH\DB_NAME.edb' -LogFolderPath ':\LOG_FILE_PATH'  .  Where: EdbFilePath and LogFolderPath are where you want the DB and its log files. For best performance, put the DB and Logs on different drives. (Different physical disk, not partitions) Use this command to create additional databases if you like. (Archive, for example) 
  4. Mount the database with the following command: mount-database -Identity db_name
  5. Now we must move the System Mailboxes from the default DB per this article. Execute the command Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase "db_name"
  6. Now the discovery search mailbox; Get-Mailbox | where {$_.Name -like "DiscoverySear*"}| New-MoveRequest -TargetDatabase 'db_name'
  7. To check the move request status, execute Get-MoveRequest
  8. Once the move requests are completed, clear them all by executing Get-MoveRequest|Remove-MoveRequest and confirm. Note: This will clear all move requests, so if you have setup any moves other than those outlined in this article and don't want to clear them you'll need to be more granular. 
  9. Dismount the original db name with the following command: Dismount-Database 'OriginalDBName'  and confirming, I.E. Dismount-Database 'Mailbox Database 1781398675'
  10. Remove the old database with the command: Remove-MailboxDatabase 'OriginalDBName' and confirm. 
  11. You can now delete the DB folder and the log folder of the db you just deleted. The remove-mailboxdatabase command should have told you where the DB was located and by default the log folder is in the same location. 

You did it, time to celebrate. Now is when you should setup your DAGs, etc. and then move user mailboxes. Let me know if there are any questions. 

Wednesday, December 12, 2012

Off-Topic: Eac3to 3.24 with Arcsoft dtsdecoderdll.dll 1.1.0.0 on Windows 8

When I'm not doing my job one of my hobbies involves archiving all my movies to my NAS and make them available to my HTPC for my wife to watch at the touch of a button. After upgrading to Windows 8, however, I noted the encoding tool eac3to no longer worked correctly with Arcsoft dtsdecoderdll.dll V 1.1.0.0. (The only version that correctly decodes DTS-MA 6.1 tracks) It seems that the this older version of the DLL is hard-coded to use the Microsoft VC DLL MSVCP71.dll, which will not register correctly on Windows 8. (It uses a newer version of VC out of the box) To work around this, you need to run eac3to in Windows 7 compatibility mode and copy the dlls to the syswow64 directory. (No need to register since the app calls them directly) Here's a step by step:
  1. Copy msvcr71.dll and msvcp71.dll from a Windows 7 machine to the :\Windows\syswow64 directory
  2. Ensure your copy of ASAudioHD.ax is registered successfully. (This accompanies the dtsdecoderdll.dll) 
  3. Navigate to your eac3to folder and right click eac3to.exe-> properties.
  4. Click the "Compatibility" tab and click "Change settings for all users" (may as well)
  5. Under "Compatibility mode" check "Run this program in compatibility mode for" and select "Windows 7
  6. Click "OK"
As stated above, there is no need to register the msvcr71 and msvcp71 files because the app calls them directly. Now, you can test it by opening a command prompt, navigating to the eac3to directory, and typing:

eac3to.exe -test

You should see the following: 


If encoding a DTS-MA 6.1 to 5.1, make sure to use the command line -0,1,2,3,5,6,4 -down6 .

Enjoy!

Tuesday, December 4, 2012

Reccomended Network Adapter DNS Settings for a Domain Controller\DNS Server

DNS client settings for your domain controller

This comes up at nearly every client I've been to, and I have yet to see any comprehensive article from MS on the topic. There is always quite a bit of confusion surrounding what you should set the preferred DNS servers to in the network adapter of the DNS server itself. Here are some quick guidelines to save you some time:

Do:

  • Use another DNS server in the same domain as the primary, secondary, etc...
  • Use the loopback address, but not as the preferred server. Set it as the last server in the order. (Use the Advanced tab if you have more than two servers)
  • Clear the automatically added ::1 as the primary and only DNS server for the IPv6 stack unless you actively use IPv6. If so, then the same rule applies knowing that ::1 is the loopback address for IPv6.
    • Bonus, here's the command: netsh interface ipv6 delete dnsservers "Local Area Connection" ::1 where "Local Area Connection" is the name of the connection in question. It may say something to the effect of "No DNS Servers" after you execute the command, but that tingling just lets you know it's working like Denorex.

Example: 

My lab has two DNS servers in one domain: 192.168.1.30 and 192.168.1.110. Here is the IP config of the 1.30 machine:


Where there another DNS server in the domain that would be listed BEFORE 127.0.0.1. Note that the DNS servers list does not include ::1 as the preferred server since I removed that with the command listed above.


Do Not:

  • Use the server's own IP as the primary. Why? If something becomes wrong with the zone configuration or the replication of the records you could inadvertently isolate domain controllers from each other and give entirely inconsistent results to clients making troubleshooting the troublesome DC more difficult.
  • Use the loopback address as anything but the last entry.

Discussion: Some prefer to set the server's own DNS as preferred to reduce network traffic, and while I don't recommend that myself I will stress one final thing:
Whatever you decide to do with settings, be consistent. Lack of consistency inevitably costs time and money, usually when you don't have either.