www.infralib.com

www.infralib.com
Please visit my new site http://www.infralib.com for my and other authors' newer posts, articles. We will also have forums, videos, webcasts and etc.
Showing posts with label DB. Show all posts
Showing posts with label DB. Show all posts

Monday, 26 November 2012

WinPE AdoDB SQL Connection Error (429)

I was using MDT wDB for OS deployments, now I am creating the same (better) system with SCCM for wider and easier deployment. I prefer MDT integration to SCCM as it provides lots of flexibility and customizability.

Today, I wanted to use MDT DB with my SCCM OSD, so I created a new MDT Settings package and copied my old CustomSettings.ini from MDT and customized. Duplicated my current build TS and changed the MDT Settings package in respective Gather actions.

Deployed a test machine and found out no localization settings have applied. So I found the error "Unable to create ADODB.Connection object, impossible to query SQL Server: ActiveX component can't create object (429)" in logs. After a few web search I found MDT Boot image usage is recommended as it has necessary libraries to create ADODB connections.

As usual I wanted to fix that instead of using my old MDT boot image, checked WinPE_FPs folder in WAIK and seen there is a winpe-mdac.cab (MS Data Access Components) and added this package to boot image.

  • dism /mount-wim /WimFile:g:\wimwork\boot.csrx64.wim /index:1 /MountDir:G:\WimWork\x64
  • dism /image:G:\WIMWork\csrx64 /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-mdac.cab"
  • dism /unmount-image /MountDir:G:\WIMWork\csrx64 /Commit
Now I have necessary libraries in my new boot image and it can connect to SQL server.

Note : Don't forget to change Netlib value to DBMSSOCN in your CustomSettings.ini if you will use SQL Authentication instead of Windows Authentication. 

Wednesday, 16 February 2011

Changing collation of Virtual Center Database

I needed to change VMWare ESX's Virtual Center 2 Database collation while moving the DB to another MS SQL server using different collation, you might not need to change VC2 DB collation but I think it is better to use default server collation. As usual for most databases I got the error below; because of an object dependent on database collation.

  • Alter failed for Database 'VirtualCenter2'.  (Microsoft.SqlServer.Smo)
  • An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
  • The object 'sys_PhysicalIndexStatistics_Wrapper' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation.
  • ALTER DATABASE failed. The default collation of database 'VirtualCenter2' cannot be set to SQL_Latin1_General_CP1_CI_AS. (.Net SqlClient Data Provider) (Microsoft SQL Server, Error: 5075)
You can easily deal with this issue by using the steps below.
  1. After restoring the DB on target server , browse to VC2 DB\Programmability\Functions\Table-valued Functions, right click on sys_PhysicalIndexStatistics_Wrapper then select Script Function As > Create To > New Query Editor, it will create the query needed to re-create the  sys_PhysicalIndexStatistics_Wrapper object.
  2. Delete sys_PhysicalIndexStatistics_Wrapper
  3. Change collation of the database.
  4. Run the query you have created on step 1. , check if sys_PhysicalIndexStatistics_Wrapper created successfully.