# Monday, May 28, 2007

Yesterday, I detailed how to setup an Oracle database server on Windows Server 2003 in Oracle for Microsoft Developers, Part I: Installing Oracle 9.2 on Windows Server 2003.  Today, I want to step back  a little, take a look at some of the conceptual differences between Oracle and SQL Server, and then provide steps you can take to setup an Oracle database that you can use within your applications.

You may be saying to yourself, "Why should I care how to setup an Oracle database server and database?  I work with SQL Server, .NET, and could care less!  Let the DBAs concern themselves with Oracle!"  Now, I can't discount your sentiments - I've been there myself!  However, over the years, I've discovered two compelling reasons to take the time to learn more about Oracle: 1) it's always good to have more tools in your tool belt, and 2) getting DBAs to respond to your requests can occasionally be a long and arduous process.  If you have the know-how and acumen to setup an Oracle environment for yourself, I believe you'll find your ability to deliver on your development projects will be greatly enhanced.

Okay, that said, let's take a look at some important Oracle concepts.

Oracle Concepts

Tablespace

The Oracle tablespace is the lowest logical layer of the Oracle data structure. The tablespace consists of one or more datafiles, which are typically files on the operating system filesystem.  The space specified for a tablespace is allocated on the filesystem, but is not used until somebody creates a file or saves some data.

Think of the Tablespace as functionally equivalent to the data file (MDF) and log file (LDF) in SQL Server

Schema

A schema is a collection of objects associated with the database.  These objects are abstractions or logical structures that refer to database objects or structures. Schema objects consist of such things as clusters, indexes, packages, sequences, stored procedures, synonyms, tables, views, and so on.

I find it difficult to exactly correlate an Oracle schema to a concept in SQL Server.  I suppose it would be safe to say that a schema is similar to an object within SQL Server (such as a table or view) that's attached to a particular owner (such as dbo).

Data Dictionary

The data dictionary is a set of tables Oracle uses to maintain information about the database. The data dictionary contains information about tables, indexes, clusters, and so on.

The data dictionary is similar to the system tables that exist within SQL Server.

Database

The physical layer of the database consists of three types of files:

  • One or more datafiles
  • Two or more redo log files
  • One or more control files

The logical layer of the database consists of the following elements:

  • One or more tablespaces.
  • The database schema, which consists of items such as tables, clusters, indexes, views, stored procedures, database triggers, sequences, and so on.

The database is divided into one or more logical pieces known as tablespaces. A tablespace is used to logically group data together. Tablespaces consist of one or more datafiles. By using more than one datafile per tablespace, you can spread data over many different disks to distribute the I/O load and improve performance.

As part of the process of creating the database, Oracle automatically creates the SYSTEM tablespace for you. Although a small database can fit within the SYSTEM tablespace, it's recommended that you create a separate tablespace for user data. The SYSTEM tablespace is where the data dictionary is kept.

Administrative accounts

  • INTERNAL - The INTERNAL account is provided mainly for backward compatibility with earlier versions of Oracle, but is still used for key functions such as starting up and shutting down the instance.
  • SYS - Automatically created whenever a database is created. Used primarily to administer the data dictionary. This account is granted the DBA role, as well as CONNECT and RESOURCE roles.
  • SYSTEM - Automatically created whenever a database is created. This account is used primarily to create tables and views important to the operation of the RDBMS

Administrative roles

  • DBA
  • OSOPER - Assigned to special accounts that need OS authentication, which can be done only when the database is open; allows users to run commands like STARTUP and SHUTDOWN, and ALTER DATABASE
  • OSDBA - OSOPER plus additional permissions such as CREATE DATABASE or ADMIN OPTION

Oracle instances

An Oracle instances is identified by a SID (system identifier), and is functionality equivalent to a SQL Server database.

(I must credit the following Web sites for much of the previous content, as I certainly did not know much of this until I visited: http://vsbabu.org/, http://www.fredshack.com/, and http://www.rocket99.com/.)

Setting Up Your Oracle Database

Now that we've provided a high-level discussion of Oracle, and some of the differences from SQL Server (and yes, I realize that this is not a comprehensive analysis or comparison - you can find plenty of those elsewhere), let's look at some of the steps you need to take in order to work with Oracle.

1. Install the Oracle database server.  See Oracle for Microsoft Developers, Part I: Installing Oracle 9.2 on Windows Server 2003 for detailed steps on installing Oracle 9.2.

2. Use SQL*Plus and log into the Oracle database server.  I prefer to login as "system" when defining tablespaces, users, etc.

3. Create a new tablespace.  The following script creates a tablespace called "ts_name" at the root of the drive that Oracle is installed on (e.g. C:\), has logging turned on, a default size of 32 MBs that automatically extends to 2 GBs.

create tablespace ts_name
  logging
  datafile '/ts_name.dbf'
  size 32m
  autoextend on
  next 32m maxsize 2048m
  extent management local;

4. Create a new user (or user schema) that has access to this tablespace.  The following script creates a user named "alfred" with a password of "pword".

create user alfred identified by pword;

You can also define the default and temporary tablespace for this uses, as well as the quota.  Note: you can specify a numeric value for the quota (such as 10) or unlimited, which defines an unlimited quota.

create user alfred identified by pword
  default tablespace ts_name temporary tablespace ts_name quota unlimited on ts_name;

Failure to define a quote for your user within the tablespace will prevent the user from actually writing data into the database.  Make sure you don't miss this step!

5. Grant the user privileges, such as creating a session, table, views, etc.

grant create session to alfred;
grant create table to alfred;
grant create view to alfred;
grant create trigger to alfred;
grant create procedure to alfred;
grant create sequence to alfred;
grant create synonym to alfred;

6. Close SQL*Plus, cause you're done!

At this point you should be set!  You've created a tablespace, a user, and given the user the privileges necessary to create tables, procedures, and more!

Realize again that I am not an Oracle DBA, and I would never think about configuring a production environment for Oracle.  The purpose of this blog is to familiarize Microsoft developers with Oracle, as it's very likely you'll have to work with it sooner or later.  The ability to setup and define your development environment should not be underrated and marginalized, as it will not only help you with your delivery, but also make you more marketable!

Best of luck!

posted on Monday, May 28, 2007 7:35:19 AM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Sunday, May 27, 2007

There comes a time in every Microsoft developers life that he/she will have to work with an Oracle database.  I hope that you find this to be a good experience; my experiences have thus far been a mixed bag, mostly because of my own ignorance.  Nevertheless, I've picked up a few things here and there, and figured that it would be worthwhile to post some of the top tips and tricks I've learned over the years.

In this post, I want to discuss how to setup an Oracle database server.  I am going to follow-up with a post on how to create an Oracle database.  I use those terms loosely, because the terminology within the Oracle world is different from the SQL Server world.  I promise I'll do my best to get it right, but chances are I'll make a mistake or two - please feel free to point out my gaffes.

So, without further ado, let's see go through the steps needed to install Oracle 9.2 (sorry, I don't have 10+) on Windows Server 2003 32-bit (note: there are many differences between 32-bit and 64-bit Windows, and my experience has shown that the following steps will not work in 64-bit Windows.  Perhaps I'll follow-up in the future if I figure out how to get it to work ...)

  1. Secure a copy of Oracle 9.2.  I assume that you have a copy available through work.
  2. Start the Oracle Universal Installer.  Click the Next button.


  3. Confirm the installation destination (you'll need at least 3 GBs available for the installation) and click Next.


  4. Select "Oracle9i Database 9.2.0.1.0", and click Next.


  5. Select "Enterprise Edition", and click Next.  (Why?  Well, I don't have any compelling reason here - it's just what I've used to get things working ...)


  6. Select "General Purpose", and click Next.


  7. Leave the Port Number as 2030, and click Next.


  8. Define the Global Database Name.  I choose "orcl", but feel free to choose whatever.  Make sure that the SID is unique - it's probably easiest to make it the same value as the Global Database Name.  Click Next.


  9. Specify the Directory for Database Files.  I choose to leave the default value.  Click Next.


  10. Unless you have a reason to change it, leave the "default character set" selected, and click Next.


  11. On the Summary screen, click Install.  This installation process will take a little while.  Be patience.  Read one of my other posts, while you're waiting.


  12. The next screen to appear is the Database Configuration Assistance.  On this screen, specify the SYS and SYSTEM passwords.  Do NOT click OK yet.


  13. Before you click OK, click the Password Management Button.  Specify passwords for SYS, SYSTEM, and DBSNMP (SCOTT too, if you'd like).


  14. Once you get to the End of Installation, click Exit.


  15. After you click Exit, the Oracle Enterprise Management Console will start.  Check and make sure you can log into your Oracle database server by expanding databases, right-click ORCL (or whatever you called it) and click Connect.  Enter the "system" Username, and change Connect as from "Normal" to "SYSDBA".  Click OK.


  16. If you were able to successfully connect to the Oracle database server, then restart Windows.  There's a number of reasons to do this, including updates to the PATH environment variable.

And that's it!

Now, I realize that this installation procedure pretty much accepts the defaults, and clicks next.  However, at least you have the benefit of knowing that this procedure does work, and will prepare you for the next step: configuring Oracle databases, tablespaces, users, and user access.

Best of luck!

posted on Sunday, May 27, 2007 9:34:04 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback

Have you ever received the following error when you tried to access a UNC path?

XXXXXXX is not accessible. You might not have permission to use this network resource. Access is denied.

I found that if I logged into some of our production servers, I was unable to connect to a UNC path on the file server (a different machine), even though I was able to access these resources locally.  The only difference I could find was that in order to access the production servers I had to use a different login than my local login (e.g. my local login had acess to the file share, but not the login I used for the production boxes).  And, as I do not have administrative rights in this domain (nor were any administrators available to assist) I couldn't change the rights to the file server to give my production user access.

So, I needed to find a way to access the file share as my local account.  Unfortunately, I couldn't log into the production server with my local account (a good thing, actually), and I couldn't get Explorer.exe to runas my local account while on the server.

Then I decided to try and mount the share as a driver.  Here are the steps I took:

  1. Opened up My Computer, the click Tools --> Map Network Drive ...
  2. For the folder, specify your UNC share.  Then, instead of clicking finish, click the "Connect using a different user name".


  3. In the Connect As screen, specify your local account that has the ability to access the UNC share.


  4. Click OK, then Finish.

These steps mount the UNC share using your local account.  As a result, I was able to access the file server on the production server, which I previously hadn't been able to do.

If you find yourself in a similar situation, these steps may provide you with a temporary work around.

I hope this helps!

posted on Sunday, May 27, 2007 1:30:19 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Thursday, May 24, 2007

I awoke to see a very encouraging post from Ryan Donovan on the future of Commerce Server.

Some key points to take away:

  • Microsoft is committed to their e-commerce platform, and has no plans to roll Commerce Server into another server product (for those of you who follow, there has been a lot of speculation and rumors about Microsoft not being fully committed to Commerce Server - this really helps to dispel those rumors).
  • Microsoft plans to provide "successors for the current Commerce Server SKUs"
  • The standard support life cycle for Commerce Server 2007 ends 07/12/2011.
  • Microsoft plans to find more and better ways to align Commerce Server to major product revisions in the Windows Server, SQL Server, .NET Framework, and BizTalk Server spaces.
  • The team also plans to add incremental updates and features "on an interim a la carte basis".

So, as I said, very encouraging.

Some things I'd like to see in future releases ...

  • A fully managed stack; get rid of COM dependencies
  • Replace pipelines with Windows Workflow
  • Replace DTS tasks with SSIS
  • There's more, but it's early and my brain is not working yet ...

Given the major enhancements Commerce Server 2007 has made over previous versions, I'd say we can expect to see a lot of great things from the Commerce Server team.

Best of luck!

posted on Thursday, May 24, 2007 6:58:55 AM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Wednesday, May 23, 2007

As a consultant, I often have to spend a great deal of time diagnosing issues that are confronting my clients.  Over the years I've used some of the tools available from Sysinternals, but I honestly never put a lot of energy or time into really learning to use them.  On my most recent project, however, I've found them to be tremendously helpful, and I'm now a confirmed believer!

There are a number of useful tools available, and I don't profess to have used or mastered them all.  There are a few, however, that I strongly encourage you to familiarize yourself with:

  • Process Monitor - This montioring tool monitors the file system, Registry, processes, threads, and DLL activity in real-time.  Ever need to track down where data is getting written?  Ever wonder why you try to write or read from the Registry and receive errors?  This utility will help you track that down.  Process monitor is a combination of two older tools (Filemon and Regmon), and adds a whole slew of additional features such as rich and non-destructive filtering, comprehensive event properties such session IDs and user names, reliable process information, full thread stacks with integrated symbol support for each operation, simultaneous logging to a file, and more.

  • Process Explorer - Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This utility will even show you who owns each process.  This tool is excellent for tracking down programs or processes that have locked files and directories.  It also has some powerful search capability that shows you which processes have handles opened or DLLs loaded.

  • BlueScreen Screen Saver - Okay, so this isn't a monitoring tool, but it's part of the Sysinternals suite and it's great!  Just load this up as the screen saver for your favorite person at work, sit back, and enjoy the show!

Take the time to explore the various tools that are available on the Sysinternals Web site.  There are a lot of tools that will make debugging and problem solving less of a hassle.

Best of luck!

posted on Wednesday, May 23, 2007 7:47:56 PM (Central Standard Time, UTC-06:00)  #    Comments [2] Trackback
# Friday, May 18, 2007

The Commerce Server team has released four white papers outlining how to use the Commerce Server adapters to export a product catalog, export an inventory catalog, export new orders, and export user profiles.  If you are attempting to use the adapters (or even thinking about it), I highly encourage you to take a look at these white papers.  If nothing else, they will give you a good overview of how you can make use of these adapter (I've been wanting to blog on them for awhile now, but haven't found the time).

In this lab, you will use the Microsoft Commerce Server 2007 Catalog adapter with Microsoft BizTalk Server 2006 to export a catalog from the Commerce Server 2007 Starter Site to the CSharp Site.

In this lab, you will use the Microsoft Commerce Server 2007 Inventory adapter with Microsoft BizTalk Server 2006 to export an inventory catalog from the Commerce Server 2007 Starter Site to the same inventory catalog within the CSharp Site.

In this lab, you will use the Microsoft Commerce Server 2007 Orders adapter with Microsoft BizTalk Server 2006 to export new orders from the Commerce Server 2007 Starter Site to a specified file directory.

In this lab, you will use the Microsoft Commerce Server 2007 Profiles adapter with Microsoft BizTalk Server 2006 to export new user profiles from the Commerce Server 2007 Starter Site to the CSharp Site.

Good luck!

posted on Friday, May 18, 2007 8:41:29 PM (Central Standard Time, UTC-06:00)  #    Comments [1] Trackback
# Thursday, May 10, 2007

I learned a new twist to the following error message today:

The adapter "SQL" raised an error message. Details "Unable to enlist in the transaction. (Exception from HRESULT: 0x8004D00A)".

This can occur in a scenario where your BizTalk server attempts to connect to a separate SQL Server database and execute a distributed transaction.  In order for this to work the BizTalk server must have the ability to "hand-off" the transaction to SQL Server.  Typically, when you receive this error, it's because the Distributed Transaction Coordinator (DTC) service is disabled or network DTC access is disabled.  These are the default settings in Windows Server 2003.  Take a look at the following article:

http://support.microsoft.com/?kbid=816701

There's an additional twist to this scenario.  I found myself in a situation where I was receiving this error but had DTC setup correctly on all the machines in my BizTalk group and SQL Server cluster.  Nevertheless, the distributed transactions failed.  Then I found the following article:

http://msdn2.microsoft.com/en-us/library/aa561924.aspx

Turns out that, in order for DTC to work, the SQL Server must be able to resolve the NetBios name of the client (the BizTalk servers, in this case).  If it cannot resolve the NetBios name the transaction will fail.  In my environment, a firewall prevented the ability to resolve the NetBios name to an IP address thereby preventing the distributed transaction from processing.

To resolve this, I updated the HOST files on the SQL Server cluster so that they were able to resolve the NetBios names to an IP address.  Literally, moments after saving the HOST file, all my records started getting written into the database.

As I said, a different twist to a common problem.

I hope this helps!

posted on Thursday, May 10, 2007 1:10:41 PM (Central Standard Time, UTC-06:00)  #    Comments [1] Trackback
# Friday, May 04, 2007

As I mentioned in a previous blog, I've been setting up BizTalk 2006 in a 64-bit Windows Server 2003 environment.  This BizTalk solution communicates to AS/400 and Oracle, so I've been using the Microsoft BizTalk Adapters for Enterprise Applications (for Oracle connectivity) as well as Microsoft BizTalk Adapters for Host Systems (for AS/400 DB2 connectivity).

Setting up these adapters has not gone extremely well in the 64-bit O/S (whereas a 32-bit O/S is quite simple to configure).  I've been set back about a week because many different issues related to the 64-bit environment (and a few other issues).  In this post, I want to explain the issues I've encountered with regards to the Oracle adapter in a Windows Server 2003 64-bit environment.

This post assume that you've already installed your Oracle client.  Check out my post Using the "ODBC Adapter for Oracle Database" in BizTalk 2006 for information on how to install the client.  However, if you're installing on a 64-bit machine, stop after you install the client.  The 64-bit world is quite different ...

1. Install the .NET Framework 1.1 and SP 1.

The Oracle adapter requires the .NET Framework 1.1 and SP 1.  My 64-bit environment didn't have the .NET Framework 1.1 installed, so this was an additional step I had to take.  This was the easiest of all the steps I had to take ...

2. Create the ODBC connection.

Turns out that you cannot simply run Data Sources (ODBC) from Administrative Tools.  You have to run %WINDIR%\SysWOW64\odbcad32.exe, which invokes the 32-bit version of the Data Sources (ODBC) GUI.  See my post Adding ODBC connections in Windows Server 2003 64-bit for more information.

3. Install the Microsoft BizTalk Adapters for Enterprise Applications.

I only installed Oracle (r) Database.  Surprisingly, with the .NET Framework 1.1 and SP 1 installed, this goes very well.

4. Update registry settings for the Microsoft BizTalk Adapters for Enterprise Applications.

Turns out that some of the registry keys that are written during the installation are wrong (or rather, they're not interpreted correctly).  Browse to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\BizTalkAdapters.  Two of the values, InstallDir and InstallPath, need to be changed.  Do the following:

1. Change InstallDir from "C:\Program Files (x86)\Microsoft BizTalk Adapters for Enterprise Applications" to "C:\Progra~2\Microsoft BizTalk Adapters for Enterprise Applications".

2. Change InstallPath from "C:\Program Files (x86)\Common Files\Microsoft BizTalk Adapters for Enterprise Applications\" to "C:\Progra~2\Common Files\Microsoft BizTalk Adapters for Enterprise Applications\".

Yes, for some reason, you have to change "Program Files (x86)" to "Progra~2", probably because the Adapter isn't written very well.  If you don't update these registry settings, you will most likely get the following error:

The description for Event ID ( 0 ) in Source ( Microsoft BizTalk Adapters for Enterprise Applications ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event:     Exception occurred:
            Error Code: 12154 (0x2f7a)
        08004 : [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve service name.

5. Update additional registry settings to fix permission errors if you are using domain groups for authentication.

Your domain groups will not have access to the Oracle adapter by default.  In order to allow the runtimeagent.exe (which is the executable that is spawned and runs the Oracle adapter) to run appropriately, it needs to be able to access a registry key.  See the following article for more information: http://support.microsoft.com/?id=923650.

Do the following to resolve this issue (from the article):

1. Locate the following registry key: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\BizTalkAdapters\Config

[** Thanks to Steef-Jan Wiggers for noting that I forgot to display the 32-bit path in the Wow6432Node key]

2. Right-click the registry key that you located in step 1, and then click Permissions.

3. On the Security tab, click Add.

4. Type the domain group or the domain user account that is configured as the BizTalk host instance, and then click OK.

5. On the Security tab, click the domain group or the domain user account that you added in step 4, click to select the Read check box, and then click OK.

If you don't update these registry settings, you will most likely get the following (unhelpful) error:

"RuntimeAgent: Error trapped in constructor: No connection could be made because the target machine actively refused it"

Error transmitting message: No connection could be made because the target machine actively refused it

6. Update the security permissions on your Oracle folder.

This is the most bizarre step of all, and it's not particular to the 64-bit environment.  Oracle software requires that you give the Authenticated User privilege to the Oracle Home.  In most cases, your Oracle agent will not be the Administrator account (or at least, I hope it's not).  However, there seems to be an issue with the permissions associated to Authenticated Users.  Consequently, the agent you specify to run the Oracle "runtimeagent.exe" is unable to gain access to the folder.  You might see the following error:

IM003 : Specified driver could not be loaded due to system error  5

To resolve this problem, you have to do the following:

1. Log on to Windows as a user with Administrator privileges.

 

2. Launch Windows Explorer from the Start Menu and and navigate to the ORACLE_HOME folder. This is typically the "Ora92" folder under the "Oracle" folder (i.e. D:\Oracle\Ora92).

 

3. Right-click on the ORACLE_HOME folder and choose the "Properties" option from the drop down list. A "Properties" window should appear.

 

4. Click on the "Security" tab of the "Properties" window.

 

5. Click on "Authenticated Users" item in the "Name" list (on Windows XP the "Name" list is called "Group or user names").

 

6. Uncheck the "Read and Execute" box in the "Permissions" list under the "Allow" column (on Windows XP the "Permissions" list is called "Permissions for Authenticated Users").

 

7. Re-check the "Read and Execute" box under the "Allow" column (this is the box you just unchecked).

 

8. Click the "Advanced" button and in the "Permission Entries" list make sure you see the "Authenticated Users" listed there with:

 

Permission = Read & Execute

Apply To = This folder, subfolders and files

 

If this is NOT the case, edit that line and make sure the "Apply onto" drop-down box is set to "This folder, subfolders and files". This should already be set properly but it is important that you verify this.

 

9. Click the "Ok" button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.

 

10. Reboot your computer to assure that these changes have taken effect.

Yes, I was in as much shock as you are.  Uncheck a flag, and then re-check it.  I lost almost three days because of this bug.

That's about it!  A series of (mostly) undocumented steps that are required in order to get the Oracle adapter to function in a 64-bit environment.  Fortunately, I had some great support from the escalation engineer's with the Microsoft Product Support Services group.

 

I hope this post helps someone else avoid much of the pain and agony I had to go through ...

Best of luck!

posted on Friday, May 04, 2007 3:21:14 PM (Central Standard Time, UTC-06:00)  #    Comments [5] Trackback

If you've worked with .NET 2.0 long enough, you've probably come across the following error:

The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Unable to open shim database version registry key - v2.0.50727.00000.

This behavior is caused because the ASP.NET application needs read/write access to a specific registry key but has only read access.

There is a hotfix available for this error: http://support.microsoft.com/kb/918642

Note the following fine print:

A supported hotfix is now available from Microsoft. But the hotfix is intended only to correct the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Visual Studio 2005 service pack that contains this hotfix.

This error is more of an annoyance because it fills up the application log.  It shouldn't actually affect any of your applications.  If you don't mind ignoring the error, then just ignore it and wait until the next service pack resolves the problem.

Best of luck!

posted on Friday, May 04, 2007 12:35:30 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Thursday, May 03, 2007

We've been deploying a BizTalk 2006 solution to a x64 system and, while BizTalk 2006 itself has no problems, I've had a lot of problems related to the BizTalk Adapters for Host Systems and the BizTalk Adapters for Enterprise Applications.  I plan to write a number of posts in the near future discussing these problems (once we have them all resolved).  In the meantime, I wanted to share this little tidbit I've learned about ODBC on 64-bit windows.

It's important for you to know if your application is going to run as a 32-bit or 64-bit application.  There are two different repositories for ODBC connections, based on the drivers you've installed and the client that will run them.  32-bit applications will only see ODBC connections from the 32-bit side, and 64-bit applications will only see ODBC connections from the 64-bit side.

32-bit applications register ODBC connections to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI

64-bit applications register ODBC connections to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

Adding these keys is initially tricky, but if you understand the above then it should make sense.  Typically, you go to Start --> Administrative Tools --> Data Sources (ODBC) to create your ODBC connections.  And this is fine if you want to create 64-bit ODBC connections.  Any ODBC connection created using the Data Sources (ODBC) link will get created in the HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI key.  This is because it calls the program %WINDIR%\System32\odbcad32.exe.  However, this program will not create 32-bit ODBC connections.

To create 32-bit ODBC connections, you have to run %WINDIR%\SysWOW64\odbcad32.exe.  Adding an ODBC connection through this application will create the ODBC connection in the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI key, and allow your 32-bit applications to see and use the ODBC connection.

I'm still getting used to the concept of WOW and how it runs 32-bit applications on an x64 system.  This information may not be news to some of you, but it presented a challenge to me.

I hope this helps!

posted on Thursday, May 03, 2007 9:51:45 AM (Central Standard Time, UTC-06:00)  #    Comments [4] Trackback
# Wednesday, May 02, 2007

I thought I'd share this quick and dirty way to load the Adventure Works catalog into Commerce Server 2007 so that you can use it with the Starter Site.  This catalog, along with the Start Site, is a great way to familiarize yourself with well designed catalog and how it interacts with Start Site.

This procedure assumes that you've downloaded the Starter Site, and unpacked it to the default location.  Also, it assumes that you've setup the Business Management Applications to interact correctly with the Commerce Server web services, which in turn assumes you've configured security for the web services through Azman.msc appropriately.

  1. Open up the Commerce Server Catalog Manager.
  2. Under the Tasks pane, click Import a Catalog.  This launches the Import Product Catalog Wizard.  Click Next to continue.
  3. On the File Location screen, click the Browse button, and browse to the following XML file: C:\Program Files\Microsoft Commerce Server 2007\Sdk\Samples\Catalog\AdvWorksCatalog.xml.  This XML file is an export of the Adventure Works catalog.
  4. Change the type from Incremental to Replace.  Most likely you don't already have this catalog, but if you do this it will ensure that it replaces the current catalog.
  5. Click the Advanced check box, just so that in the next few steps you can see the advanced options.  Click the Next button to continue.
  6. On the first Advanced Import Properties screen, confirm that the Adventure Works Catalog is selected and click the Next button to continue.
  7. On the second Advanced Import Properties screen, ensure that all import properties are selected.  Leave all the default selections and click the Next button to continue.
  8. On the Import Catalog Summary screen, review your summary.  If everything looks good, click the Create button.  The import will take minute or so to complete.
  9. Click View --> Status to pull up the Progress Status window.  The import runs asynchronously, so you can watch the status of the catalog import.  Once you see that the catalog has been imported successfully, return to the Catalogs view and click the Refresh button.  You should now see the "Adventure Works Catalog" under your catalogs explorer.

Make sure that your CatalogSets allow anonymous and registered users to view your new catalog.  This CatalogSets determine which catalogs users have access to view and interact.  Click the CatalogSets link under Views, and double-click the Anonymous User Default CatalogSet.  Click the Add All Catalogs check box, and click the Refresh button.  You should see your Adventure Works catalog in the Included Catalogs list box.  Click Save and Continue, and do the same thing for the Registered User Default CatalogSet.

Now that you have successfully imported the Adventure Works catalog and setup the CatalogSets, click the Refresh Site Cache button.  If you have problems updating the Site Cache, be sure to read the following article: http://msdn2.microsoft.com/en-us/library/aa546079.aspx.  An alternative is to run IISRESET from the command line, which forces the Web site to reload its cache, but I recommend you configure your sites appropriately so that the Refresh Site Cache functions.

Before you try to run the Starter Site and see browse your catalog, let's grab some some of the files within the AdvWorksImages.cab from the C:\Program Files\Microsoft Commerce Server 2007\Sdk\Samples\Catalog folder.

  1. Create an "Images" folder under the Start Site (by default, it is found at: C:\Inetpub\wwwroot\StarterSite).
  2. Extract the images from the AdvWorksImages.cab file into this new folder.  You can do this by double-clicking the cab file, selecting and copying all the files, and paste them into the new folder.

Now you're ready to browse the Adventure Works catalog.  Take the time to browse products on the Web site, as well as the catalog itself.  Try creating some product relationships for cross- and up-sell opportunities, as well as new products.  Be sure to refresh your site cache, or you won't see your changes reflected on the Web site.

If you want to be able to add items to your cart, then you'll have to add your Adventure Works catalog to an inventory catalog.  Under the Catalog Manager, either create a new inventory catalog, or add your Adventure Works catalog to the default catalog.  Once this is done, you'll then have to go back to your Adventure Works catalog and add inventory quantities to your items.  I'll save this process for a future blog.

Best of luck!

posted on Wednesday, May 02, 2007 2:23:28 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback