| Edwin Daniel's profileMicrosoft technologies a...BlogLists | Help |
|
Microsoft technologies and what I do for funThis space is mostly regarding Microsoft technologies and what I do for fun, as I consider my work as fun and exciting. October 06 Who says only databases can be mirrored?I have decided to mirror this blog to http://bassplayerdoc.blogspot.com It took me quite a while to make that decision but eventually, I did. For those of you who have benefited from my blog entries, you can still do so on the other site. I still hope to see your positive support over that site as well. September 06 Making a fool out of MSDBI was restoring a SQL Server instance on a different server for DR purposes including system databases. What I have overlooked was the fact that restoring the msdb database would mean keeping the existing settings of the old instance into the new one. While I was trying to delete the database maintenance plans and the jobs, I keep getting an MSX-related error which prevents me from deleting the jobs. I looked at the jobs by running the sp_help_job system stored procedure and found out that the originating_server column happens to be the name of my old SQL Server instance. This was the primary reason why I could not delete the jobs either from Enterprise Manager or running the sp_delete_job system stored procedure. To workaround that issue, I simply modified the originating_server column of the sysjobs table to the name of the current instance. After that, I was able to delete the database maintenance plans and the jobs. Now, my server is ready for DR. Log shipping configuration is the next thing to do. August 31 Installing SCCM 2007 Clients using Software Update PointAfter installing System Center Configuration Manager 2007, we need to deploy the SCCM client. There are a lot of ways to deploy the SCCM client but I will be focusing more on using the Software Update Point as I have been using Windows Server Update Services (WSUS) for patch management. The first thing you need is to make sure that you already have a WSUS 3.0 in your infrastructure as you will be using this as your Software Update Point. The nice thing about this approach is that you already have your infrastructure set for software update management.
Now, we're ready to deploy the SCCM client and our Software Update Point has been configured as well. It's like hitting two birds with one stone. The best way to test whether our configuration is to log in to one of the machines in your domain and run a group policy update (gpupdate /force for Windows XP and Windows Server 2003 or secedit /refreshpolicy machine_policy /enforce for Windows 2000) and manually run a force detect of the Windows Update client (wuauclt /detectnow) If you open your Task Manager, you will see ccmsetup.exe in the Image name under the Processes tab. Another way to find out if the SCCM client is being deployed thru WSUS 3.0 is to look at the WindowsUpdate.log file which contains information regarding the installation of Configuration Manager Client Classic Active Server Pages Allowed? I have ASP.NET 2.0Durnig my installation of System Center Configuration Manager 2007, I intentionally had the Active Server Pages setting to Prohibited in IIS 6.0. This is because I always limit my configuration to only those that I use. Since I assumed that .NET 2.0 is required to install SCCM 2007, I was assuming that it is using ASP.NET 2.0 in the reports. To my surprise, when I launched the Virtual Machine provided for the online virtual hands-onlabs, the URL contains a .asp?some_value. Being a part-time developer as I am, my instincts tell me that I need to Allow Active Server Pages on my IIS for this feature to work. I just don't understand why Microsoft opted for classic ASP when they already have a rich-feature set available from ASP.NET 2.0 to use for generating those reports. August 23 Installing System Center Configuration Manager 2007
It took me a couple of days to finish my installation as I still had to configure my WSUS 3.0 to download the patches I need. September security patches from Microsoft will be the next in the queue August 08 It's officially unofficial - DBCC PAGEIf you search for information about the DBCC PAGE command, the only Microsoft official document you'll find refers to a SQL Server version older than v7. One blog post I found was from Paul Randall of the SQL Server Storage Engine Team which explains how to use DBCC PAGE in conjunction to using DBCC CHECKDB. DBCC PAGE is used to obtain the data that is contained in a SQL Server page structure. Before you can really take advantage of this tool, you need to run the DBCC TRACEON(3604). Exchange Server 2003 Remote Wipe/MobileAdmin problemWhen you deploy Windows Mobile on an Exchange environment, one of the things that you may want to configure is remote wipe. This will enable administrators to wipe the device over-the-air. This is very helpful in cases where a Windows Mobile device is lost or stolen and you want to simply protect company-related data like emails and attachments. While I was testing a device with an Exchange installation, I encountered an error on the site which does the remote wipe.
Now from the looks of it, this seems like a permission/security error on the site. Either this is a web application permission problem or something else. I found this site which solved my problem. It basically recommends that you uncheck the "Require secure channel (SSL)" option on the exadmin virtual directory. This did the trick. Afterwhich, I was able to do a remote wipe on the device I was testing. The only worry I have is that now this web application is no longer secured unless you block access from the public Internet August 05 Disk Defragmenter Analyzer - Windows VistaI was working on my laptop at home which runs Windows Vista Home. I was thinking of doing a disk defragmentation just to check. I haven't defragmented my disks since I bought my laptop. So I used the familiar tools I used - Disk Defragmenter. To my surprise, I don 't see the option to do an analysis first before doing a defragmentation. After a quick search on the Internet, I found out that you still can do analysis before you defragment your hard drive in Windows Vista. Below are the steps outlined to do so.
This will display some statistics of how much your drive is fragmented. This will give you an idea whether or not to perform defragmentation. I was thinking of a thousand and one easons why Microsoft would take this out of the UI for Disk Defragmenter. I found a decent explanation here July 31 Dynamic port detectionAs a follow-up on my blog entry yesterday, I was doing more research on SQL Server port usage when I chanced upon this Microsoft KB. SQL Server clients use DBNETLIB to perform port detection. This is either thru ODBC or SQLOLEDB componentes which loads DBNETLIB. SQL Server clients can use the Client Network Utility for dynamic port detection. This is to make sure that in case SQL Server uses a different port number during service startup or is configured to user dynamic port assignments, the client can map to the port number that a specific instance uses. Now, what if the client is a third party application running on a non-Microsoft platform(like a JSP application running on top of Apache on a Linux box?) How does this port resolution work? July 30 What? I lost my port on a named instance?One thing I realized is that SQL Server port numbers will not be the same for I don't know what reason. I found this out while rebuilding a SQL Server named instance. We had standard settings in setting up SQL Server. But since I am rebuilding my test environment, I just used the default port number settings (which is 1433) during the process. To my surprise, it was using port number 3080 when the service started. Apparently, SQL Server dynamically determines the port it listens on. It will try to listen on the port it used previously. If for some reason it cannot bind to that port, the named instance may bind to a different port - which is obviously the case for my setup. Now this would cause a lot of problems if your SQL Server is interacting with a lot of servers, services and applications as you need to either change the port number to it's original value (which I think would be more appropriate) or change the clients to use the new port number. I have yet to dig up more details on this as to why SQL Server behaves that way. At least I know another place to look at when troubleshooting connectivity problems July 27 The Pains of Collation SettingsCollation settings define the physical storage of character strings in SQL Server. It specifies the bit patterns that represent each character and the rules by which characters are sorted and compared. Collation settings have a direct impact on the databases if you configure them to use a different collation other than the default. When you configure a different collation setting during the installation, the rest of the databases (system and user-defined) will have this setting was their default when you create them unless you specifically defined something different from the default. One case I encountered was that the tempdb database had a different collation setting compared to the user databases. This is because SQL Server was reinstalled and the master and msdb databases were restored from backup together with the user-defined databases. This made the collation settings of the entire database server back to their original configuration - well, almost. Since the model database was not restored (and obviously, the tempdb database does not require a backup), collation settings for the both would be the settings defined during re-installation. A script executed in one of the user-databases would require the use of the tempdb and since they do not have the same collation settings, queries will fail unless the queries themselves take into account collation setting differences. The next best bet is to rebuild the master database and change the collation settings and go through all the grueling task of restoring the system databases, provided that the user-defined databases are still intact. Well, another approach would be to simply restore the model database if you have a backup (or simply look for the old MDF and LDF files if they are still working fine). This is because tempdb database takes the settings of the model database everytime SQL Server service starts. This will resolve collation problems should you encounter a similar case July 26 When backups can't be restoredWe always think that having a backup is more than enough to keep us afloat during a disaster. I always say that any backup will be useless unless it is tested. I came across one case where a SQL Server 2000 backup for the master database cannot be restored because it was generated using a different patch set for SQL Server 2000. The backups were generated before applying SQL Server 2000 hotfix 2191. After the patches were applied, a restore was attempted but failed. An error was encountered which specifies that the backup was generated by an earlier version of SQL Server. A best practice approach is to generate backups before and after a patch will be applied. This makes sure that you have valid backups in case something happened. It may be a bit costly as far as disk space is concerned but it sure beats not having a valid backup. It may even save you from spending sleepless nights trying to rollback to the patchset which generated the backups. July 25 Importing Word and Excel as InfoPath 2007 FormsIf you have been working with business forms, you probably have created a few in either Microsoft Word or Excel. One thing to make managing business forms a lot easy is to upload them in your Sharepoint portal. This makes it easy to have a standardized form easily available to the rest of the organization. You can also port them over as InfoPath forms. In Sharepoint 2007, you have the option to use Forms Services instead of individual forms. This makes it easy for users to have a unified and standardized format plus the advantage of binding the form to a backend database for data collection. If you have existing Word or Excel forms, you can easily import and convert them in InfoPath. Just run the Import Form Wizard in InfoPath to convert your existing Word and Excel forms to InfoPath forms - no need to re-create those forms. For more information, check out the Introduction to importing and exporting form data and form templates
Security Configuration Manager for Windows MobileI was preparing my demos using .NET Compact Framework 3.5 and Visual Studio Orcas. I was using 2 devices for testing - an O2 XDA II mini running Windows Mobile 2003 and an O2 Atom Life running Windows Mobile 6 which I upgraded from v5. I created a very simple PocketPC 2003 project in Visual Studio Orcas - a form with UI like buttons and drop-down lists. Deployment was straight forward in Windows Mobile 2003. So I ported the same project to a Windows Mobile 6 Professional project. Upon deployment on the O2 Atom Life, I get this error:
What I thought was a simple project turned out to be a nightmare. I checked the program Files folder and found out that my application was deployed as I see my EXE file. So I decided to run the EXE file and I got this error.
I checked the Microsoft.NET CF 3.5.LOG file and it looks like I have deployed the .NET Compact Framework 3.5 properly. I was beginning to think that the device has something to do with it as I tried using a Dopod PDA phone and didn't have any problems. I suspect this has something to do with the device security. Upon persistent inquiry (thanks to the guys from Microsoft APAC and Singapore), I was led to do two things - either sign the cab with a test certificate which ships with Visual Studio Orcas and the Windows Mobile SDK using the cabsigntool.exe or disable the device security. Option 1 is not a choice for developers as you will be doing this on a regular basis - creating projects, deploying the projects on the device for testing, etc. Besides, you don't want to be doing this every time you come up with a new project or re-deploy a modified project. So option 2 looks like a preferred choice. In order to disable the device security, you need the Security Configuration Manager tool for Windows Mobile. In Visual Studio Orcas, this is already available. You can check the security level of your device and can be used to turn it off (only possible with Pocket PC - Windows Mobile 6 Professional and Windows Mobile 5 PocketPC). I managed to turn off my device's security and deployment worked like a charm. For more information on these, you can check out the following websites
http://msdn2.microsoft.com/en-us/library/bb278115.aspx June 29 Managing the Windows Internal Database (SQL Server 2005 Embedded Edition)I keep getting questions on the Windows Internal Database. The first time I heard about this, I thought Microsoft may have missed out on informing me about the SQL Server 2005 Embedded Edition as this does not appear in the list of Editions for SQL Server 2005 ;-). This is the replacement for WMSDE which a few of the Microsoft products - Windows Sharepoint Services 3.0 and Windows Software Update Services 3.0, for example- use as a backend database. Most of the questions I get are administration related like how to shrink the database files, move them on a different partition, etc. By default, there is no tool available to manage the database hosted in this instance (MICROSOFT#SSEE). But you can use the available SQL Server 2005 tools to do administration and maintenance. The simplest there is will be to install SQL Server 2005 Management Studio Express. This is an available download from the Microsoft Download Center. You just have to register this instance on the Management Studio Express to be able to administer it. One thing to remember is that during the registration process, you have to specify the Network Protocol option in the New Server Registration window to be Named Pipes as this is the one being used by this instance. Once connected, you can now start managing the databases running on this instance. Another way is to use the sqlcmd tool. This is the command-line utility of choice for SQL Server 2005, although you can still use the osql utility. You need to download the SQL Server 2005 Native Client and SQL Server 2005 Command Line Query Utility from the Microsoft Download Center. You need to install the Native Client first before installing the Command Line Query Utility. Once installed, you can run sqlcmd.exe from the command line. This is typically installed in this directory
To connect to the Windows Internal Database instance (MICROSOFT##SSEE), run this command
Once connected, you can now execute those TSQL scripts that you are familiar with to manage and administer databases in this instance. June 20 Views in SQL Server 2005I normally get inquiries regarding migration from SQL Server 2000 to SQL Server 2005. Most of which have something to do with security mechanisms. Introduced in SQL Server 2005 is the new concept of schemas. Objects are now grouped in schemas unlike in SQL Server 2000 where we refer to objects using their owners. Now, most vendors who did not define their objects in this manner will have problems when they migrate to SQL Server 2005 as their owners are now converted to schemas. This is going to be a big headache if there are a lot of owners owning different objects. One way to do this is to create those schemas if they are not created assign users permissions to those schemas. Another way to do it is to create views. Views provide backward compatibility by defining a view to emulate a table that used to exist but whose schema has changed. This also helps users go through the upgrade process, especially those who frequently access the database by executing TSQL queries. It may be a lot of work but this is what one has to work with if databases have to be migrated to SQL Server 2005. I never thought that this could be a possible inclusion in the migration process from the point of view of both applications and end users Creating Windows Vista Sidebar Gadgets (for infrastructure guys...and gals)As Windows Vista has been being pushed by OEM vendors in both the desktop and mobile computers, application developers are leveraging on the platform to build applications. Windows Vista introduced the Sidebar – an anchored panel on the Windows desktop that can host mini-applications known as gadgets. Gadgets are “mini-applications” presenting functionality and are small, lightweight specialized, residing on the local computer which responds to user interaction They can be created using HTML/DHTML, JavaScript and CSS. Now you might be thinking why I had this under the .NET Development category when I only need HTML to create gadgets. This is because there are .NET APIs which can be accessed by these gadgets. Windows Vista ships with gadgets that can track stock prices, display news feeds, and deliver weather forecasts. Of course, application developers can think of just about anything these gadgets can do like communicating with an aggregated web service and stuff like that. You can check out these references on how to create Windows Sidebar gadgets
As an infrastructure guy, I am more concerned about leveraging gadgets to make my life a bit easier as a systems engineer. This is when I created a gadget that uses WMI. Since I do regular auditing of all our servers within our domain, I created a script which automates just that. I had this initially in VBScript which writes information in a text file (see my previous blog post on this topic). What I simply did was to convert my existing script to a gadget. Do take note that gadgets only run on Windows Vista and not not previous Windows versions. Below is a snippet from my script
This simply displays hardware information from the local machine and displays it in an HTML page (with a little monitor on the available memory resource). Next thing I would probably do is query Active Directory for the registered servers in the domain and execute the same set of functions to retrieve hardware information. This highlights how we can take advantage of Windows Vista as an application platform - not just for developers but also for infrastructure guys who simply want to make their lives a lot easier. Scripting skills are definitely a must here :) May 11 Need to script your SQL Server Database schema with data?This used to be one of my problems before. Whenever we do some tests on custom applications which require backend SQL Server databases, we had to generate the script to create the database schema and populate the database. The problem is that SQL Server does not have this feature. Either you create the database schema script and use DTS to import the data from the old database to the new one. The problem most of the time is that the old and the new databases are not in the same network - probably being deployed to a hosting service provider. There's no way you can do this in DTS. I created a .NET/VB application to do this for me. My application generates a text file which contains INSERT statements for all the data in all of the tables inside the database. This output, together with the script generated by SQL Server has to be both executed on the target database server. Microsoft came up with the Microsoft SQL Server Database Publishing Wizard 1.1. This enables the deployment of SQL Server databases into a hosted environment on either a SQL Server 2000 or 2005 server. It generates a single SQL script file which can be used to recreate a database (both schema and data) in a shared hosting environment where the only connectivity to a server is through a web-based control panel with a script execution window. If supported by the hosting service provider, the Database Publishing Wizard can also directly upload databases to servers located at the shared hosting provider. I wish Microsoft had something like this 7 years ago. It would have probably made my life and a lot of developers' and DBAs' life a lot easier. May 09 Need a new face for your Remote Web Workplace?Remote Web Workplace is one of those cool features in Windows that only Small Business Server has. Using the Remote Web Workplace, you can access your company's server from any Internet-enabled computer such as a home computer, Internet kiosk, or laptop. By default, all users created using a Windows Small Business Server 2003 user template can access the Remote Web Workplace. There are a lot of people who wanted to customize how the Remote Web Workplace looks like when users have successfully logged in. If you're comfortable with HTML and ASP.NET coding, you can modify the admin.aspx (for administrators logging in) and/or client.aspx (for anybody else) inside C:\Inetpub\Remote folder. The web.config file also includes some of the configuration settings for these pages so you might want to have a look at it as well. Just make sure you backup these files before you start making modifications so that you can always revert back to the originals if things screw up. WSUS client not updating? Here's a script to testOne prerequisite for your Windows Update to work is for the Automatic Updates and BITS services to be both started and set to automatic. In some cases, these may be configured not to run due to some security policies being implemented internally. One way to find out is to go to the Services applet and check whether they are started and set to automatic. Being a lazy guy as I am, I always find ways to make life a lot easier (even if doing this is jus a few mouse clicks away). So I wrote a script to do this for me. The script checks if both these services are stopped and if they are will start them. It also includes forcing the group policy just in case something was changed with respect to the GPO for WSUS and forcing the WSUS client to detect new updates. Checking for either Windows 2000, Windows XP and Windows 2003 is also included. Of course, if your WSUS client is totally screwed, you will have to re-register some of the DLLs in order for it to work.
April 24 SERVERENTERPRISE or SERVERENTERPRISECORE?One of the options that you will encounter when you setup Windows Lonhorn Server CTP is to choose between SERVERENTERPRISE and SERVERENTERPRISECORE. But what is really the difference between the two? Administrators can choose to install only the core server functionalities without the additional overhead using the SERVERENTERPRISECORE option. This limits the roles that can be performed by the server but can improve security and reduce management. Imagine a stripped-down version of the server product with this option. You can consider this as a subset of the Longhorn full product package. This is useful for large organizations with many servers performing very specific roles like DNS, DHCP, Terminal Service, etc. Choosing the SERVERENTERPRISE option gives you all of the features that you may want to run similar to that of Windows Server 2003. This is for small to medium sized organizations with few servers running many services in a single machine. Listing Running Web Applications in IIS 6.0Identifying which web application is eating up your server resources is troublesome as the Task Manager will only show you the w3wp.exe process with its corresponding process ID (PID). Good thing that Windows has a script named iisapp.vbs which is stored in the systemroot\system32 folder which you can execute to identify the web application your w3wp.exe process is associated with. Best practices tell us that a web application should be assigned an application pool and identifying the application pool on which a web application runs is just a matter of running the iisapp.vbs script. A full details of the script can be found on the Microsoft TechNet site
A sample output of the script is shown below
This will identify which application is eating up your server resources, probably caused by a bug or inefficient code. This is of course just part of solving the problem of performance issues with web applications. Different platforms behave differently - PHP, JSP, ASP, ASP.NET, etc. the important thing here is we've already narrowed down which one to debug April 09 Uninstalling SQL Server 2005 Embedded EditionI thought I was just seeing things when I saw this in the Services applet - SQL Server 2005 Embedded Edition(MICROSOFT##SSEE). This is the version of SQL Server 2005 that Windows Sharepoint Services 3.0 installs on your server if you simply choose all the defaults. The problem with this is that there is no way for you to manage it from the SQL Server tools we are all familiar with (I tried it with Management Studio and sqlcmd but with no luck as it just throws an error saying that the server instance does not exist). Besides, if you want to scale up your database, you would have to migrate it to either Standard or Enterprise Edition. This renders this instance useless. Most of us will simply recommend uninstalling this version. The problem is, you won't see this in your Add/Remove Programs applet in Windows. It's an invisible instance that the only way to uninstall this is to uninstall Windows Sharepoint Services as well (unless you want to go through the process, I suggest not doing a complete reinstall). So how do you uninstall SQL Server 2005 Embedded Edition? I found it through this website.
To verify, you can check the Services applet and see if the SQL Server 2005 Embedded Edition (MICROSOFT##SSEE) service is no longer there April 07 It Is Screwed (IIS) v6- Installing Microsoft Office Sharepoint Server 2007I was playing around with Microsoft Office Sharepoint Server 2007 and installing it on a virtual machine running Windows Server 2003 R2. I followed the Microsoft documentation on installing MOSS 2007 as a stand-alone server, installing the prerequisites - IIS, .NET Framework 2.0 and 3.0. Installing MOSS2007 went fine until the time that I needed to test the installation by accessing the website. To my surprise, I had a Service Unavailable error on my browser. I checked the Event Log for some clues, restarted a few services, re-installed ASP.NET 2.0, and all sorts of stuff but to no progress. The only option I have left is reinstalling from scratch. Good thing about my virtual setup is that I have a base image of Windows Server 2003 R2 which I am ready to startup anytime. While I was getting ready to re-install, my gut feel prompted me to test IIS before installing .NET Framework 2.0. That's when I found out that it was my IIS that wasn't installed properly. I ran a few tests like creating a simple ASP and HTML pages to view. Re-installing IIS did the trick. After I am sure that IIS is working fine, I went through installing MOSS2007 quick and easy. Installation is one thing, managing is another. I'll work on that in a couple of hours. |
|||||
|
|