Friday, September 12, 2008

Using Microsoft Metadata Samples Remotely

Everything documented in this post was a complete waste of time as you can launch DependencyViewer from the command line using the /depDb: switch to specify the remote repository. Example below

DependencyViewer.exe /depDb:"Server=myservername;database=SSIS_META;Integrated Security=SSPI;"

This switch is documented for DependencyAnalyzer, but there are no such instructions about command line usage of DependencyViewer except when you launch it from the command line with the standard /? switch. Must learn to mentally join up very widely spaced dots...

Microsoft provides sample code showing how to interrogate the metadata of the SQL Server 2005 tool suite. The process is as follows:


  • Run scripts to create the SSIS_META database
  • Run DependencyAnalyzer on your warehouse, which populates SSIS_META with lots of juicy metadata
  • Use DependencyViewer to view the metadata in a graphical layout
I spotted an SSIS_META database on a remote server and naturally wanted to peruse its contents with DependencyViewer. However DependencyViewer assumes a local repository, so the person who created this database either had local login rights to the server or had a modified build that could connect to remote repositories. I had neither, so I set about making the necessary changes to the solution.

Form1.cs has a hard coded connection string:

private string connectionString = "server=localhost;database=SSIS_META;Integrated Security=SSPI;";

which I changed to:

private string connectionString = "server=myservername;database=SSIS_META;Integrated Security=SSPI;";

The rebuilt app threw an error on clicking the Load button as follows:

************** Exception Text **************System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=gfjhs98s90s67a6dssd' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.PermissionSet.Demand() at System.Data.Common.DbConnectionOptions.DemandPermission() at System.Data.SqlClient.SqlConnection.PermissionDemand() at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.Samples.DependencyViewer.Form1.buttonTest_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The action that failed was:Demand
The type of the first permission that failed was:System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was:Intranet

I was trying to run it from a network share, never a good idea - so I copied the exe to a local location. Next the load button gave me an hourglass for a while before throwing the following:

************** Exception Text **************System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.Samples.DependencyViewer.Form1.buttonTest_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I put the connection string in a message box in at the start of ButtonTest_Click and found that the connection string was still pointing to localhost. More searching turned up another reference in Program.cs. The following change in this file got it connecting.

From:

[Argument(ArgumentType.AtMostOnce, HelpText = "ADO.Net SqlConnection compatible connection string to dependency database location.", DefaultValue = "Server=localhost;database=SSIS_Meta;Integrated Security=SSPI;")]
public string depDb;


To:

[Argument(ArgumentType.AtMostOnce, HelpText = "ADO.Net SqlConnection compatible connection string to dependency database location.", DefaultValue = "Server=myservername;database=SSIS_Meta;Integrated Security=SSPI;")]public string depDb;

Thursday, July 31, 2008

VMWare Server Remote Console problems

Common situation

You have a VMWare Server 2.0 RC1 box (let's call it vmhost) that's being used as a sandbox and isn't allowed to be added to the primary company domain that everyone uses. Consequently it's set up in its own workgroup using DHCP.

Known Problem

The default url to access VMWare Server would be https://vmhost:8333/. However launching the console within Web Access by clicking the picture of the overlapping boxes will result in the following error:

Error opening the remote virtual machine vmhost: The host name could not be resolved.

VMWare Commentary

This is listed as a known issue in the release notes:

On Windows, the VMware Server desktop and Start menu shortcuts use the NetBIOS name in the connection URL. This might cause VI Web Access to fail to connect to VMware Server. VMware Remote Console connections might also fail, with the error Error opening the remote virtual machine machine_name: The host name could not be resolved.

Workaround: Enter the correct host name as the Fully Qualified Domain Name (FQDN) when prompted by the Windows installer. Or, if the URL specified in the shortcut does not work, use the correct host name, IP address, or localhost, as appropriate, in the connection URL. You can also manually enter the short name and the FQDN, or localhost, in the /etc/hosts file.

For the situation described, the IP address isn't static and the FQDN is not defined in DNS. Therefore none of this will work.

Workaround

Create an ASP page on the server including the following:

<a href="https://<%=Request.ServerVariables("LOCAL_ADDR")%>:8333" target="_blank">VMWare Server</a>

This will interrogate the server for the local IP address and construct a url that will work for both Web Access and Remote Console.

Edit: corrected the asp code which got messed up by unescaped characters. "Sorry about that, chief"

Tuesday, July 22, 2008

Classic ASP on IIS7 (for IIS6 old farts)

So you've got a shiny new Vista or Windows Server 2008, and now you want to create a test site with one classic asp page.

The problem is, if you're like me you had no idea how to navigate around the new UI. I had assumed

  • Roles = security
  • Features = bugs I'm insisting are by design
But it turns out I was soooo IIS6 in my thinking. I had to pull my head out of 2003 to understand.

Installing IIS7

  • Start Menu:Administrative Tools:Server Manager
  • Find the Roles Summary section
  • Add Roles:Web Server (IIS)
  • Follow the wizard and it's done. Web Server (IIS) will show up as an installed role in the Roles Summary
Adding ASP etc

  • Click Web Server (IIS)
  • Find the Role Services section
  • Click Add Role Services
  • Check Application Development (or you can just select ASP if that's really all you want)
  • Complete the wizard and you're done. Application Development including ASP will show up as installed role services

Using Classic ASP in IIS7

  • Start Menu:Administrative Tools:Internet Information Services (IIS) Manager
  • Expand the server
  • Select Application Pools. Look! There's a Classic .NET AppPool ready for your use
  • Select your site
  • Click Basic (or Advanced) Settings in the right panel
  • Select the Classic App Pool

Troubleshooting Errors in Classic ASP

  • Start Menu:Accessories:Command Prompt
  • %windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true
  • This turns on detailed error messages

Congratulations, you've turned a hybrid into a Fred Flintstone car!

Thursday, July 17, 2008

Happy 1st anniversary, blog

Or personal (but heavily sanitised) technical note diary or whatever...

Today someone asked me how long I've been writing to this blog and I got a surprise to find it's been exactly one year since my first article.

Let's see who's reading today by throwing in a few search terms on topics I've covered: wherescape businessobjects cognos oracle microsoft windows sql server p2v vmware db2

Thanks to everyone for searching, visiting and groaning!

Setting up an old Proliant for virtualization

I'm configuring an old DL580 G3 for virtualisation - both MS and VMWare. I blithely assumed it would have hardware virtualization, so I installed Windows Server 2008 with a view to using Hyper-V. Unfortunately I couldn't add the role.

Hyper-V cannot be installed. Server Manager has detected that the processor on this computer is not compatible with Hyper-V. To install this role, the processor must have a supported version of hardware-assisted virtualisation, and the feature must be turned on in the BIOS.

I had enabled VT ("Intel Hardware Virtualization") and XD Bit ("In-Memory Execution Prevention" in Advanced Settings) in the bios and powered down fully. (note to self: Ctrl-S followed by F9 to get to bios)

Securable, Intel Processor Identification Utility & VMWare Processor Checker all gave the thumbs down on hardware virtualisation support for the aging Xeons. Desperate for a positive answer, I almost went into the server room with vt.iso burnt onto a cd but decided I had to give it up as I had plenty enough expert opinions.

What now?

  • XenServer also requires VT.
  • VMWare ESX does not, but I want to use MS as well.

So I installed

  • Virtual Server 2005 R2 SP1 - 64 bit
  • VMWare Server 2.0 RC1 - unspecified, claims to support 64 bit VMs but installed to Program Files (x86) so guessing it's not

I followed Virtual PC Guy's instructions for setting up IIS, and after this Virtual Server installed with no problems.

VMWare Server had trouble with the url for opening up remote consoles. This is because the host server isn't part of the domain I'm on, so the hostname wasn't always available. This situation was easily worked around by using the ip address in the url (https://a.b.c.d:8333/ui) to login to VMWare Infrastructure Web Access.

Sunday, June 15, 2008

IBM DB2 - ready for the gold watch and retirement

It's IBM DB2's 25th Anniversary this year, as discussed in this article at Intelligent Enterprise.

Page 3 is titled "A Vision Out Of Many Ideas", the author's intention being to emphasise the cross-disciplinary origins of DB2. But based on IBM's patchy track record in the database and business intelligence industry, I think it would be more accurate to drop the word "Many".

Friday, June 6, 2008

"CSC Cuts Corners"

I try to limit the quantity of regurgitated industry news that ends up in my blog, but this gave me an ABIMCL* moment. It goes to show that rebranding can be risky...

* Arch Back In My Chair Laughing