<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1714283384790610704</id><updated>2012-01-27T11:36:36.389-06:00</updated><category term='Integration Services'/><category term='Alternatives'/><category term='Powershell'/><category term='Smart Array'/><category term='Database Mirroring'/><category term='ssl certs'/><category term='Samba'/><category term='package building'/><category term='SharePoint Mysite problems'/><category term='SQL Server'/><category term='ASR'/><category term='SharePoint'/><category term='Mediawiki'/><category term='Automatic server recovery'/><category term='Windows'/><category term='Remote Desktop'/><category term='Java'/><category term='Oracle'/><category term='RPM'/><category term='IIS'/><category term='RHEL5'/><category term='VMWare Converter'/><category term='Sun Java'/><category term='SharePoint Backup and Restore'/><category term='LDAP'/><category term='Web'/><category term='AD Integration'/><category term='host headers'/><category term='OpenSolaris'/><category term='Oracle Enterprise Manager'/><category term='PeopleSoft Upgrade'/><category term='Backup'/><category term='PeopleSoft'/><category term='Linux'/><category term='Certificates'/><category term='Authentication'/><category term='VNC'/><category term='MS Office 2007'/><category term='SSL'/><category term='Apache'/><category term='RHEL6'/><category term='SharePoint Errors'/><category term='SSIS'/><category term='Installation'/><category term='AMANDA'/><title type='text'>Lane's Tech Blog</title><subtitle type='html'>From Oracle and SQL Server to MediaWiki, SharePoint, and DSpace:  trying to make it all work.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6215707392344868963</id><published>2012-01-23T19:38:00.000-06:00</published><updated>2012-01-23T20:05:36.770-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Agent job to query multiple SQL Server Instances</title><content type='html'>SSMS provides a nice way to query many SQL Server instances at one time using the Central Management Server (CMS) functionality. &amp;nbsp;You can right-click on a server registration group and query all of the servers in that that group. &amp;nbsp;Very handy. &amp;nbsp;Unfortunately, there isn't anything that simple built in to the SQL Agent engine, so we have to use something else. &amp;nbsp;Here we'll use powershell to run a series of queries against a CMS group of servers to collect a list of databases and save that list in a central location.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span style="font-size: large;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-large;"&gt;The Script&lt;/span&gt;&lt;br /&gt;
For those of you who are anxious simply to try it out, here's the PowerShell script in its entirety right now:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
# Get the list of Instances&lt;br /&gt;
$instanceNameList = invoke-Sqlcmd -query "SELECT server_name as Name FROM msdb.dbo.sysmanagement_shared_registered_servers_internal RS&lt;br /&gt;
join msdb.dbo.sysmanagement_shared_server_groups_internal SG on&lt;br /&gt;
RS.server_group_id = SG.server_group_id where sg.name in ('SQL Server 2008','SQL Server 2005')" -serverinstance cmsserver1&lt;br /&gt;
# We're looking for CMS groups with specific names ('SQL Server 2008', etc), so you'll need to&lt;br /&gt;
# make sure these match what you have in your environment.&lt;br /&gt;
&lt;br /&gt;
$results = @() &amp;nbsp; #Initialze the Array&lt;br /&gt;
# Populate the array with instance and DB information
&lt;br /&gt;
foreach($instanceName in $instanceNameList)&lt;br /&gt;
{$sqlversion=invoke-sqlcmd -query "exec sp_server_info 2" -ServerInstance $instanceName.Name&lt;br /&gt;
$SQLVersion="{0}" -f $sqlversion.attribute_value&lt;br /&gt;
$results += Invoke-Sqlcmd -query "select @@servername as instancename, name as dbname,'$sqlversion' as sqlversion from sys.databases &amp;nbsp;where name not in ('master','model','tempdb','msdb','pubs','northwind')" -ServerInstance $instanceName.Name&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Since we're only interested in the latest information, truncate the DBList table&lt;br /&gt;
invoke-sqlcmd -query "use dba; truncate table DBList;" -serverinstance cmsserver1&lt;br /&gt;
&lt;br /&gt;
# Write the results of the above query to the DBList table&lt;br /&gt;
foreach($db in $results) {&lt;br /&gt;
# Since SQL Agent doesn't handle PowerShell variables entirely well, we work around it&lt;br /&gt;
# by assigning our variables a little backwards&lt;br /&gt;
$instancename="{0}" -f $db.instancename &lt;br /&gt;
$dbname="{0}" -f $db.dbname&lt;br /&gt;
$SQLVersion="{0}" -f $db.sqlversion&lt;br /&gt;
$querytext="insert into dba.dbo.DBList (instancename,sqlversion,dbname) values ( '$instancename', '$sqlversion','$dbname');"&lt;br /&gt;
invoke-sqlcmd -query $querytext -serverinstance cmsserver1 }&lt;/div&gt;
&lt;br /&gt;
Save this as a PowerShell SQL Agent job, and you'll be part-way there. &amp;nbsp;You also will need to make sure that the SQL Agent service account has access to the servers you want to query. &amp;nbsp;Finally, you'll need a table somewhere to store this information&lt;br /&gt;
&lt;br /&gt;
The table DBLIST looks like this referenced in the above query looks like this:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
CREATE TABLE DBLIST (&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;instancename VARCHAR(50)&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;,dbname VARCHAR(200)&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;,sqlversion VARCHAR(50)&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;)&lt;/div&gt;
Of course, you can modify this to meet your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Now we'll dissect this a bit, so you can make changes to fit your environment.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-large;"&gt;Get a list of the SQL Server instances&lt;/span&gt;&lt;br /&gt;
First we'll query the Central Management Server to get a list of the registered SQL Servers:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
$instanceNameList = invoke-Sqlcmd -query "SELECT server_name as Name&lt;br /&gt;
&amp;nbsp;FROM msdb.dbo.sysmanagement_shared_registered_servers_internal RS join msdb.dbo.sysmanagement_shared_server_groups_internal SG&lt;br /&gt;
&amp;nbsp; on RS.server_group_id = SG.server_group_id&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;where sg.name in ('SQL Server 2008','SQL Server 2005')" -serverinstance cmsserver1 &lt;/div&gt;
Here we create an array named instanceNameList that simply contains the names of all of the servers registered in the CMS. &amp;nbsp;Note that these are stored in the MSDB database.&lt;br /&gt;
&lt;br /&gt;
You'll need to change the -serverinstance switch to point to your CMS server.&lt;br /&gt;
&lt;br /&gt;
We're using the invoke-sqlcmd cmdlet to run our queries; our later queries use syntax that isn't available on SQL Server 2000. &amp;nbsp;Because of this, we're limiting our queries to server groups we've defined named "SQL Server 2008" and "SQL Server 2005". &amp;nbsp;You'll need to change these values, as well, to match your environment and needs. &amp;nbsp;Depending on what your environment looks like, you might not even need that where clause at all.&lt;br /&gt;
&lt;br /&gt;
As an aside, note that this is how you can get at the data in the CMS registration: &amp;nbsp;query msdb.dbo.sysmanagement_shared_server_groups_internal.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-large;"&gt;Query the instances one at a time&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now we'll initialize our results array ($results) and iterate through all of the instance names in our $InstanceNameList array. &lt;br /&gt;
&lt;br /&gt;
Because we want the SQL Server version text (SQL Server 2008, etc.) instead of the version number, we have to do a little more work, utilizing the sp_server_info stored procedure. &amp;nbsp;We first assign that output text to the $sqlversion variable. &amp;nbsp;The sp_server_info SP outputs more columns than we want, however, so in the next line we re-assign the $SQLVersion variable to contain only the data in the "attribute_value" column.&lt;br /&gt;
Finally, we run our main query, including the $sqlversion variable as a static selection so that it is a third column in each of the rows.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
$results = @()&lt;br /&gt;
foreach($instanceName in $instanceNameList)&lt;br /&gt;
{$sqlversion=invoke-sqlcmd -query "exec sp_server_info 2" -ServerInstance $instanceName.Name&lt;br /&gt;
$SQLVersion="{0}" -f $sqlversion.attribute_value&lt;br /&gt;
$results += Invoke-Sqlcmd -query "select @@servername as instancename, name as dbname,'$sqlversion' as sqlversion from sys.databases &amp;nbsp;where name not in ('master','model','tempdb','msdb','pubs','northwind')" -ServerInstance $instanceName.Name&lt;br /&gt;
} &lt;/div&gt;
&lt;br /&gt;
When this is complete, you'll have something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width: 436px;"&gt;&lt;colgroup&gt; &lt;col style="mso-width-alt: 3766; mso-width-source: userset; width: 77pt;" width="103"&gt;&lt;/col&gt;   &lt;col style="mso-width-alt: 3401; mso-width-source: userset; width: 70pt;" width="93"&gt;&lt;/col&gt;   &lt;col style="mso-width-alt: 8777; mso-width-source: userset; width: 200pt;" width="300"&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;    &lt;td class="xl65" height="20" style="height: 15.0pt; width: 77pt;" width="103"&gt;&lt;b&gt;&lt;u&gt;instancename&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;    &lt;td class="xl65" style="width: 70pt;" width="93"&gt;&lt;b&gt;&lt;u&gt;dbname&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;    &lt;td class="xl65" style="width: 250pt;" width="300"&gt;&lt;b&gt;&lt;u&gt;SQLversion&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV1&lt;/td&gt;   &lt;td class="xl65"&gt;ProdDB1&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server 2008 - 10.0.4064&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV1&lt;/td&gt;   &lt;td class="xl65"&gt;ProdDB2&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server 2008 - 10.0.4064&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV1&lt;/td&gt;   &lt;td class="xl65"&gt;ProdDB3&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server 2008 - 10.0.4064&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV2&lt;/td&gt;   &lt;td class="xl65"&gt;DBA&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server 2008 R2 - 10.50.2500.0&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV2&lt;/td&gt;   &lt;td class="xl65"&gt;TestDB1&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server 2008 R2 - 10.50.2500.0&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV2&lt;/td&gt;   &lt;td class="xl65"&gt;TestDB2&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server 2008 R2 - 10.50.2500.0&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV3&lt;/td&gt;   &lt;td class="xl65"&gt;CalendarDB&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server Yukon - 9.00.5000&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV4&lt;/td&gt;   &lt;td class="xl65"&gt;WebDB1&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server Yukon - 9.00.5000&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV4&lt;/td&gt;   &lt;td class="xl65"&gt;WebDB2&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server Yukon - 9.00.5000&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height="20" style="height: 15.0pt;"&gt;   &lt;td class="xl65" height="20" style="height: 15.0pt;"&gt;SQLSRV4&lt;/td&gt;   &lt;td class="xl65"&gt;WebDB3&lt;/td&gt;   &lt;td class="xl65"&gt;Microsoft SQL Server Yukon - 9.00.5000&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Note that sp_server_info returns "Microsoft SQL Server Yukon" for SQL Server 2005 instances.  Curious choice, that.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-large;"&gt;Write the results to the reporting table&lt;/span&gt;&lt;br /&gt;
Now we'll iterate through all of the rows in the $results array. &amp;nbsp;Normally we'd do something like this to generate our query text:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
$querytext="insert into dba.db.dblist (instancename, sqlversion,dbname) &lt;br /&gt;
values ('$($db.instancename)','$($db.sqlversion)','$($db.dbname)');"&lt;/div&gt;
&lt;br /&gt;
Unfortunately, the SQL Agent engine, for whatever reason, sees this syntax as an error, and it won't run, even though it runs fine from a SQLPS command prompt.&lt;br /&gt;
Instead, we assign the relevant values to new variables , and it all works OK. &amp;nbsp;Those "{0}" are formatting codes, BTW. &amp;nbsp;You can see a discussion of how that works &lt;a href="http://technet.microsoft.com/en-us/library/ee692795.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
foreach($db in $results) {&lt;br /&gt;
$instancename="{0}" -f $db.instancename&lt;br /&gt;
$dbname="{0}" -f $db.dbname&lt;br /&gt;
$SQLVersion="{0}" -f $db.sqlversion&lt;br /&gt;
$querytext="insert into dba.dbo.DBList (instancename,sqlversion,dbname) values ( '$instancename', '$sqlversion','$dbname');"&lt;br /&gt;
invoke-sqlcmd -query $querytext -serverinstance cmsserver1 }&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6215707392344868963?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6215707392344868963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2012/01/sql-agent-job-to-query-multiple-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6215707392344868963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6215707392344868963'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2012/01/sql-agent-job-to-query-multiple-sql.html' title='SQL Agent job to query multiple SQL Server Instances'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-3077190600649330121</id><published>2011-12-22T09:44:00.002-06:00</published><updated>2011-12-22T13:51:18.878-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Formatting within SSMS</title><content type='html'>I don't think I'm alone in having wished time and again for a good SQL formatting option from within SSMS.  I've posted about &lt;a href="http://lanestechblog.blogspot.com/2011/03/formatting-sql-server-tsql-with-oracles.html"&gt;using Oracle's SQL Developer as a decent SQL formatting tool&lt;/a&gt;, but that's a second-rate option, given that it doesn't understand all of TSQL's unique syntax.&lt;br /&gt;
&lt;br /&gt;
I stumbled across a better option yesterday, one that (a) is free and (b) integrates nicely within SSMS.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;First, the link:  &lt;a href="http://architectshack.com/PoorMansTSqlFormatter.ashx"&gt;http://architectshack.com/PoorMansTSqlFormatter.ashx&lt;/a&gt;: "Poor Man's T-SQL Formatter."&lt;br /&gt;
You'll find decent instructions for installing it on the site; the documentation is pretty good.&lt;br /&gt;
&lt;br /&gt;
If you're using &lt;a href="http://www.ssmstoolspack.com/"&gt;SSMS Tools&lt;/a&gt;, you'll find that the SSMS Tools find function is mapped to the same default keystrokes as for the PoorSQL formatter.  I ended up re-mapping the PoorSQL formatter to use another keystroke combination (CTRL+K, CTRL+Shift+F).&lt;br /&gt;
&lt;br /&gt;
I'm a fan:  this integrates nicely into SSMS, it's free, and it works quite well.  Check it out.&lt;br /&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-3077190600649330121?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/3077190600649330121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2011/12/sql-formatting-withing-ssms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3077190600649330121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3077190600649330121'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2011/12/sql-formatting-withing-ssms.html' title='SQL Formatting within SSMS'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4849929243407792286</id><published>2011-08-17T18:38:00.013-05:00</published><updated>2011-12-22T15:10:51.777-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Estimate recent activity in a SQL Server Database</title><content type='html'>It's a common problem SQL Server (especially) DBAs have:  how do I find out when the last time this database was used?  SQL Server is so prone to sprawl, and so many applications install so many databases; it's hard to keep track of what is in use and what is not.  This is especially true when you're new on the job.&amp;nbsp;  &lt;br /&gt;
&lt;br /&gt;
Here we'll look at a quick-and-dirty method for getting a guess at whether a database has been used.  This comes with a lot of caveats and cautions, but if you're looking for &lt;span style="font-style: italic;"&gt;some kind&lt;/span&gt; of evidence that a system has been used, index usage stats are one place to look.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
A little background is probably in order.  Indexes are used to help the database engine find data.  They organize (and sometimes order) the data within the database so that when you ask for something, the engine has an idea as to where it might be.  That helps speed things up.   The database engine keeps track of some information about the indexes in the database:  last user seek, scan, and update, among other things.  We can use this information to see if any indexes have been utilized in the recent past.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;You can see one of the problems you might run into with using this method immediately:  what if there aren't any indexes to use?  Then it won't work.  True, too, if a user is accessing data that isn't indexed.    Another problem is that index usage stats aren't persisted across SQL Server reboots, so no usage will show up that was prior to the last time SQL Server was restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;So you see, it's not a perfect solution, but it might give you some confirmation of activity (or the lack thereof), instead of just relying on your gut.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;So, to the script:   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;declare @dbname varchar (100)&amp;nbsp;&lt;br /&gt;
set @dbname='dbname'  -- Change this to match the database you want to check.&lt;br /&gt;
select object_name(ius.object_id) as table_name&lt;br /&gt;
, ind.name as index_name&lt;br /&gt;
, obj.type_desc&lt;br /&gt;
, last_user_seek&lt;br /&gt;
, last_user_scan&lt;br /&gt;
, last_user_update&lt;br /&gt;
from sys.dm_db_index_usage_stats ius&lt;br /&gt;
join sys.objects obj on ius.object_id=obj.object_id&lt;br /&gt;
join sys.indexes ind on ind.index_id=ius.index_id&lt;br /&gt;
where database_id in (DB_ID(@dbname))&lt;br /&gt;
and obj.is_ms_shipped=0&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
In short, what we're doing is listing the index usage stats from the dm_db_index_usage_stats DMV.  If the last user seek, scan, and update rows are all NULL for the indexes in the database, then those indexes have not been used by a user session.  That would suggest, if it's a well-indexed database, that the database has not been used since SQL Server was started.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, if those columns do have dates in them, then you know that at least on that date, a user was querying or modifying indexed data, and you have confirmation that it is in use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4849929243407792286?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4849929243407792286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2011/08/estimate-recent-activity-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4849929243407792286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4849929243407792286'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2011/08/estimate-recent-activity-in-sql-server.html' title='Estimate recent activity in a SQL Server Database'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6661477845802518130</id><published>2011-04-04T11:34:00.018-05:00</published><updated>2011-12-22T15:28:24.528-06:00</updated><title type='text'>Keeping a Minimum Number of SQL Server Backups Online using a SQL Agent Job</title><content type='html'>First, a plug:  there's a great "maintenance solution" that is a collection of stored procedures available at &lt;a href="http://ola.hallengren.com/"&gt;http://ola.hallengren.com/&lt;/a&gt;.  This is the basis for a lot of my database maintenance jobs.  If you haven’t taken a look at this, I highly recommend that you do; it’s free, under active maintenance, robust, and easy to implement.  &lt;br /&gt;
When you run the script from that site, you get a variety of stored procedures and you can have it create SQL Agent jobs for you, as well.  I’d recommend doing that, as it can give you a good idea of how the stored procedures work.&lt;br /&gt;
&lt;h2&gt; &lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="SQLServerBackupScript-Thebackupjob"&gt;&lt;/a&gt;The backup job&lt;/h2&gt;When we perform a backup in a SQL Server instance, we want to perform a number of tasks:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Delete old backups &lt;/li&gt;
&lt;li&gt;Backup all of the current databases &lt;/li&gt;
&lt;li&gt;Zip up the backup files &lt;/li&gt;
&lt;li&gt;Copy the zipped backup file(s) to a share on a backup server&lt;a name='more'&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;SQL Server (using xp_delete_file) provides a pretty simple method for deleting files that are older than a certain retention window (time-based retention).  But time-based retention presents a problem:  what if your backups haven’t been running for awhile?  The next time your backup job runs, the older backup files (which are all of them) get deleted.  Worse:  what if there was something wrong with the most recent backup?  Suddenly you don’t have any backups online anymore. &lt;br /&gt;
I prefer a retention policy based on redundancy:  I want to keep at least &lt;em&gt;n&lt;/em&gt; copies online at all times, regardless of how old they are.  It’s true that a combination of the two policies would be the best-case scenario:  keep five days’ worth of backups online, and  make sure that we never have fewer than five backup files available at any given time.  This would allow us to, for instance, have five backups run in a single day without deleting the older backups that we also want to have available.&lt;br /&gt;
But I’ve gone for the simpler route in this case:  I want five backup files online at all times.  SQL Server doesn’t give us an easy built-in way to do this, so we’ll turn to PowerShell for our process.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt; Delete old backups&lt;/h2&gt;Our first step in the job is to delete the backups that aren't used anymore.  In subsequent steps, we have turned off the archive bit on the files we do not need anymore, so we simply delete the files that don't have the archive bit set.  The PowerShell script is below:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="codesnippet"&gt;$backup_dir="path:\to\Backup\dir" &lt;br /&gt;
$files=get-childitem -path $backup_dir &lt;br /&gt;
# we'll delete all files that don't have the archive bit set &lt;br /&gt;
Foreach($file in $files)&lt;br /&gt;
  {  If((Get-ItemProperty -Path $file.fullname).attributes -band [io.fileattributes]::archive)     &lt;br /&gt;
     { Write-output "$file is set to be retained" }&lt;br /&gt;
     ELSE {&lt;br /&gt;
     Write-output "$file does not have the archive bit set.  Deleting."&lt;br /&gt;
     remove-item -recurse $file.fullname&lt;br /&gt;
     $output =$_.ErrorDetails } } &lt;br /&gt;
#end Foreach&lt;/div&gt;Note that the $BACKUP_DIR variable needs to be set to the correct directory for the backups. &lt;br /&gt;
&lt;em&gt;Any&lt;/em&gt; file or directory in the backup directory that does not have the archive bit set will be removed.  Do pay attention to this fact.  You can put a file mask in the get-childitem cmdlet call to modify that behavior, if you choose.&lt;br /&gt;
&lt;h2&gt; &lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="SQLServerBackupScript-RunDatabaseBackup"&gt;&lt;/a&gt;Run DatabaseBackup&lt;/h2&gt;DatabaseBackup is the name of the stored procedure (in the master DB) that backs up each of the databases on the instance.  It is installed as a part of the maintenance solution referenced at the beginning of the page.  Usage is as follows:&lt;br /&gt;
&lt;div class="codesnippet"&gt;EXECUTE [dbo].[DatabaseBackup]&lt;br /&gt;
     @Databases = 'USER_DATABASES',&lt;br /&gt;
     @Directory = @backup_dir,&lt;br /&gt;
     @BackupType = 'FULL',&lt;br /&gt;
     @Verify = 'Y',&lt;br /&gt;
     @CleanupTime = 24,&lt;br /&gt;
     @CheckSum = 'Y'&lt;/div&gt;@Databases can be one of: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;'USER_DATABASES' backs up all user databases &lt;/li&gt;
&lt;li&gt;'SYSTEM_DATABASES' backs up all system databases (master, model, msdb)&lt;/li&gt;
&lt;/ul&gt;@BackupType can be one of &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;'FULL' performs a full backup of the database data files &lt;/li&gt;
&lt;li&gt;'LOG' backs up the transaction log files &lt;/li&gt;
&lt;li&gt;'DIFF' creates a differential backup from the last full backup&lt;/li&gt;
&lt;/ul&gt;So here’s what our next step looks like.  It’s a T-SQL step:&lt;br /&gt;
&lt;div class="codesnippet"&gt;-- change the backup directory/drive appropriately &lt;br /&gt;
declare @backup_dir varchar(100) ='path:\to\backup\dir'  &lt;br /&gt;
EXECUTE [dbo].[DatabaseBackup]&lt;br /&gt;
       @Databases = 'SYSTEM_DATABASES',&lt;br /&gt;
       @Directory = @backup_dir,&lt;br /&gt;
       @BackupType = 'FULL',&lt;br /&gt;
       @Verify = 'Y'  &lt;br /&gt;
&lt;br /&gt;
EXECUTE [dbo].[DatabaseBackup]&lt;br /&gt;
        @Databases = 'USER_DATABASES',&lt;br /&gt;
        @Directory = @backup_dir,&lt;br /&gt;
        @BackupType = 'FULL',&lt;br /&gt;
        @Verify = 'Y'  &lt;br /&gt;
&lt;br /&gt;
EXECUTE [dbo].[DatabaseBackup]&lt;br /&gt;
        @Databases = 'USER_DATABASES',&lt;br /&gt;
        @Directory = @backup_dir,&lt;br /&gt;
        @BackupType = 'LOG',&lt;br /&gt;
        @Verify = 'Y'&lt;/div&gt;The verify switch is quite nice:  after each backup, it runs a 'RESTORE VERIFYONLY FROM DISK=..." to ensure that each file is recoverable.&lt;br /&gt;
Basically, we’re backing up all of the system databases, all of the user databases, and then the t-log files from all of the user databases, and we’re saving those backups to a directory structure at the @backup_dir variable location we specified at the beginning.&lt;br /&gt;
Note that this stored procedure puts its files in directory structure starting in the @backup_dir.  The start of this structure is the server name, with directories under it for each database.&lt;br /&gt;
&lt;h2&gt; &lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="SQLServerBackupScript-Zipthebackupfiles"&gt;&lt;/a&gt;Zip the backup files&lt;/h2&gt;We don’t want to keep the uncompressed backups online all the time, so we’ll compress them using 7-Zip.&lt;br /&gt;
This PowerShell script is more complicated, so we'll go through it in some more detail.  Note that this needs the 7zip executable (and associated .dll).  This script will look for it in the c:\utils directory.  Note that you can copy just the 7z.exe and 7z.dll to a directory; you don’t have to install the entire package in order to use the 7-Zip command line.&lt;br /&gt;
First, here's the whole of our PowerShell script:&lt;br /&gt;
&lt;div class="codesnippet"&gt;$backup_dir="path:\to\backup\dir"  &lt;br /&gt;
$day= get-date -format "yyyyMMdd_HHmm"  &lt;br /&gt;
# Turn on the archive bit on the current backups directory &lt;br /&gt;
# (so it won't get deleted at the next run if the zip process fails) &lt;br /&gt;
attrib $backup_dir\$env:computername +a  &lt;br /&gt;
&lt;br /&gt;
# Zip up the current backup(s) &lt;br /&gt;
# destination for the zip file is $backup_dir\SQLBACKUP-&amp;lt;servername&amp;gt;-DATE_TIME.zip &lt;br /&gt;
C:\utils\7z.exe -tzip -mx1 a $backup_dir\SQLBACKUP-$env:computername-$day.zip $backup_dir\$env:computername  &lt;br /&gt;
&lt;br /&gt;
# if 7zip succeeded, we'll continue &lt;br /&gt;
if ($LASTEXITCODE -gt 0)&lt;br /&gt;
     {Throw "7Zip failed" } &lt;br /&gt;
ELSE {&lt;br /&gt;
     # When the zip is complete, turn off the archive bit on the current backup directory&lt;br /&gt;
     attrib $backup_dir\$env:computername -a  &lt;br /&gt;
&lt;br /&gt;
# Now let's change the archive bit, such that only &lt;br /&gt;
# the last five zipped backups will be kept online  &lt;br /&gt;
$delfiles=0 &lt;br /&gt;
$delfiles= (dir $backup_dir\SQLBACKUP*.zip).count-5  &lt;br /&gt;
if ($delfiles -gt 0)   &lt;br /&gt;
&lt;br /&gt;
#  If there are more than 5 zipped backups, we'll turn off the archive bit on them&lt;br /&gt;
     {dir $backup_dir\SQLBACKUP* | sort-object -property {$_.CreationTime} |&lt;br /&gt;
     select-object -first $delfiles |&lt;br /&gt;
     foreach-object { attrib  $_.FULLNAME -A} }}&lt;/div&gt;So.  The first line sets the backup directory to use.  Next, we set a variable to hold today's date and time to use in creating the zip file.&lt;br /&gt;
Next we turn on the archive bit for the directory created during the previous step, and then we run 7z.exe to create the zip file.  All pretty straightforward up to this point, though do note that we’re using the –mx1 switch in 7Zip.  This is important because 7Zip is optimized for compression, not for speed.  Using the –mx1 switch tells 7zip to use its fastest (and least CPU-intensive) compression routines.  Especially for large files, this is really important.&lt;br /&gt;
Our next step is to check to make sure that 7zip succeeded.  We do that with the $LASTEXITCODE variable:&lt;br /&gt;
&lt;div class="codesnippet"&gt;if ($LASTEXITCODE -gt 0) {Throw "7Zip failed" }&lt;/div&gt;This says, if 7Zip failed (returning an error code that is greater than zero), end (throw) with failure text "7Zip failed".&lt;br /&gt;
If the exit code is zero, then we know 7Zip succeeded, and we'll continue.&lt;br /&gt;
The next step is to turn off the archive bit on the directory we just zipped up; that way it'll be deleted when the job runs next.&lt;br /&gt;
We also want to keep the five most recent backups online on the server.  We don't want to just delete files that are older than five days, though:  if the backup was failing, and there aren't backups from days 1-4, we'd suddenly have lost all of our backups.  So we loop through the files and sort them by date.  Then, if there are more than five files in the directory, we take the oldest files #6 - &lt;em&gt;n&lt;/em&gt; and turn off the archive bit on them.  That way, those files will be deleted the next time the job runs.&lt;br /&gt;
This is the code that does this (thanks, BTW, to Spiceworks for the &lt;a href="http://community.spiceworks.com/scripts/show/324-keep-latest-x-created-files-and-delete-all-other" target="_blank"&gt;example script&lt;/a&gt; on which this is based.):&lt;br /&gt;
&lt;div class="codesnippet"&gt;$delfiles=0 $delfiles= (dir $backup_dir\SQLBACKUP*.zip).count-5&lt;br /&gt;
  if ($delfiles -gt 0)   #  If there are more than 5 zipped backups, we'll turn off the archive bit on them&lt;br /&gt;
  {dir $backup_dir\SQLBACKUP* | sort-object -property {$_.CreationTime} |&lt;br /&gt;
     select-object -first $delfiles |&lt;br /&gt;
     foreach-object { attrib  $_.FULLNAME -A} }&lt;/div&gt;What this does is the following:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span style="background-color: white;"&gt;Count the number of .zip files in the backup directory&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: white;"&gt;If the number of files in the backup directory is &amp;gt; 5, then:&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: white;"&gt;Sort the directory (SQLBACKUP*) by creation time (oldest first)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: white;"&gt;Take the first &lt;em&gt;n&lt;/em&gt; files in the sorted list (where &lt;em&gt;n&lt;/em&gt; is the number of files that are greater than 5) and turn off the archive attribute on them.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h2&gt; &lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="SQLServerBackupScript-Copyfilestothebackupserver"&gt;&lt;/a&gt;Copy files to the backup server&lt;/h2&gt;Finally we'll copy the files to the backup server:&lt;br /&gt;
&lt;div class="codesnippet"&gt;# Make sure you change the backup directory appropriately &lt;br /&gt;
$backup_dir= "path:\to\backup\dir"  &lt;br /&gt;
$day= get-date -format "yyyyMMdd_"  &lt;br /&gt;
# This will copy all of today's backups to the backup server  &lt;br /&gt;
copy-item $backup_dir\SQLBACKUP-$env:computername-$day*.zip \\server\sharename -force&lt;/div&gt;Note that the SQL Agent service account needs to have access to the share in order for this to succeed.  Note, too, that this job will copy all files from today, so if there were multiple runs today, all of those files will get copied again (overwritten; that’s the need for the –force switch).&lt;br /&gt;
So now we have a backup job that will keep the backups around not based on age but on the number of copies.  When you put the scripts above together in a job, the steps look something like this:&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/TZnzJ4vCcCI/AAAAAAAAAPc/C3PnIaKudHo/s1600-h/image%5B3%5D.png"&gt;&lt;img alt="image" border="0" height="130" src="http://lh6.ggpht.com/_QFTS-w4RNtM/TZnzKbMPf4I/AAAAAAAAAPg/nOndk3qGm84/image_thumb%5B1%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="598" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6661477845802518130?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6661477845802518130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2011/04/keeping-minimum-number-of-sql-server.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6661477845802518130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6661477845802518130'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2011/04/keeping-minimum-number-of-sql-server.html' title='Keeping a Minimum Number of SQL Server Backups Online using a SQL Agent Job'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_QFTS-w4RNtM/TZnzKbMPf4I/AAAAAAAAAPg/nOndk3qGm84/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6691438319780061961</id><published>2011-03-02T11:01:00.005-06:00</published><updated>2011-12-22T16:19:45.527-06:00</updated><title type='text'>Formatting SQL Server TSQL with Oracle's SQL Developer</title><content type='html'>If you do much troubleshooting on Microsoft SQL Server, you inevitably will end up having to deal with a poorly-formatted (and hard-to-read) SQL statement from a query using sys.dm_exec_sql_text or the like. &lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
There are lots of online formatters out there, though I've had decidedly mixed results with them.  There also are a lot of add-in and standalone products available that will do a good at this.  Here's another one to add to your list, until SSMS includes a formatting feature:  Oracle's SQL Developer.&lt;/div&gt;
&lt;span id="fullpost"&gt;SQL Developer is a free download (&lt;a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html"&gt;here&lt;/a&gt;) that will, in fact, connect to SQL Server instances. While I do not use it for my day-to-day SQL Server administration tasks, I use it regularly to reformat SQL that I've pulled from the DMVs. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
Here's how it looks using the following SQL Agent task SQL.&lt;/div&gt;
&lt;div&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;(@P1 int,@P2 uniqueidentifier,@P3 int)UPDATE msdb.dbo.sysjobactivity SET run_requested_date = DATEADD(ms, -DATEPART(ms, GetDate()),  GetDate()), run_requested_source = CONVERT(sysname, @P1), queued_date = NULL, start_execution_date = NULL, last_executed_step_id = NULL, last_executed_step_date = NULL, stop_execution_date = NULL, job_history_id = NULL, next_scheduled_run_date = NULL WHERE job_id = @P2 and session_id = @P3&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span id="fullpost"&gt;First we paste this in to a new page in SQL Developer:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span id="fullpost"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5579535498058420818" src="http://2.bp.blogspot.com/-L8WXK8gXzHI/TW59-U10UlI/AAAAAAAAAPE/LxSCMtRirn8/s400/sqldev_format1.PNG" style="cursor: hand; cursor: pointer; margin: 0 10px 10px 0;" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span id="fullpost"&gt;And then we hit CTRL-F7 (or right-click and select "Format"):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span id="fullpost"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5579536015001531330" src="http://4.bp.blogspot.com/-T_QqwJSLiiM/TW5-camqM8I/AAAAAAAAAPM/iaUEyWdlo9Y/s400/sqldev_format2.png" style="cursor: hand; cursor: pointer; height: 400px; width: 364px;" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span id="fullpost"&gt;Which gives us very nicely formatted SQL.  One gotcha here:  SQL Developer doesn't know what to do with the 'GO' statement, so it puts it on the same line as other SQL commands.  This will keep your code from running, so there's one piece of cleanup that is necessary when using SQL Developer.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span id="fullpost"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5579537205438552562" src="http://4.bp.blogspot.com/-63ZXUKccPvA/TW5_htU9mfI/AAAAAAAAAPU/wPwa-wDKyQI/s400/sqldev_format3.PNG" style="cursor: hand; cursor: pointer; height: 322px; width: 400px;" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6691438319780061961?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6691438319780061961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2011/03/formatting-sql-server-tsql-with-oracles.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6691438319780061961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6691438319780061961'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2011/03/formatting-sql-server-tsql-with-oracles.html' title='Formatting SQL Server TSQL with Oracle&apos;s SQL Developer'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-L8WXK8gXzHI/TW59-U10UlI/AAAAAAAAAPE/LxSCMtRirn8/s72-c/sqldev_format1.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-394805607306543816</id><published>2011-02-25T10:56:00.004-06:00</published><updated>2011-12-22T16:22:42.084-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to Change the Owner of All SQL Agent Jobs in a SQL Server Instance</title><content type='html'>Each job in a SQL Server instance has an owner, and you may run into a situation in which that owner needs to be changed. &lt;br /&gt;
If there are a lot of jobs that were created by that owner, this can be a tedious task. &lt;br /&gt;
Here we’re opening a cursor and looping through the SQL Agent Jobs in the instance that are owned by the old user (@olduser) and executing the sp_update_job stored procedure to change that to match @newuser.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
USE MSDB&lt;br /&gt;
GO&lt;br /&gt;
declare @jobname varchar (200)      &lt;br /&gt;
declare @oldusername varchar (30) &lt;br /&gt;
declare @newusername varchar(30) &lt;br /&gt;
set @oldusername=’DOMAIN\oldusername’      &lt;br /&gt;
set @newusername=’DOMAIN\newusername’ &lt;br /&gt;
declare cur_jobname cursor LOCAL&lt;br /&gt;
for select name from sysjobs&lt;br /&gt;
where suser_sname(sysjobs.owner_sid) =@oldusername&lt;br /&gt;
open cur_jobname&lt;br /&gt;
fetch next from cur_jobname&lt;br /&gt;
into @jobname&lt;br /&gt;
While @@FETCH_STATUS = 0&lt;br /&gt;
begin&lt;br /&gt;
EXEC msdb.dbo.sp_update_job @job_name=@jobname,&lt;br /&gt;
@owner_login_name=@newusername&lt;br /&gt;
fetch next from cur_jobname&lt;br /&gt;
into @jobname&lt;br /&gt;
end&lt;br /&gt;
close cur_jobname&lt;br /&gt;
deallocate cur_jobname&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-394805607306543816?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/394805607306543816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2011/02/how-to-change-owner-of-all-sql-agent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/394805607306543816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/394805607306543816'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2011/02/how-to-change-owner-of-all-sql-agent.html' title='How to Change the Owner of All SQL Agent Jobs in a SQL Server Instance'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2029858970845155743</id><published>2011-02-25T10:23:00.005-06:00</published><updated>2011-12-22T16:24:21.165-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to Change the Owner of All Databases in a SQL Server Instance</title><content type='html'>Each database in a SQL Server instance has an owner, and you may run into a situation in which that owner needs to be changed.  One example of this would be a case when a DBA moves departments, but stays in the organization.  In that case, the account would still be active, but you’d probably want to change the database owner.&lt;br /&gt;
If there are a lot of databases that were created by that owner, this can be a tedious task.  &lt;br /&gt;
Here, we’re opening a cursor and looping through the databases in the instance that are owned by the old user (@olduser) and executing the sp_changedbowner stored procedure to change that to match @newuser.&lt;br /&gt;
&lt;div class="codesnippet"&gt;USE MASTER &lt;br /&gt;
GO &lt;br /&gt;
declare @dbname varchar (50) &lt;br /&gt;
declare @oldowner varchar (30) &lt;br /&gt;
declare @newowner varchar (30) &lt;br /&gt;
declare @sql varchar (300) &lt;br /&gt;
set @oldowner='DOMAIN\oldusername' &lt;br /&gt;
set @newowner='DOMAIN\newusername' &lt;br /&gt;
SET @sql='' &lt;br /&gt;
declare cur_dbname cursor LOCAL&lt;br /&gt;
  for SELECT name&lt;br /&gt;
    FROM master.sys.databases where SUSER_SNAME(owner_sid)=@oldowner&lt;br /&gt;
  open cur_dbname&lt;br /&gt;
  fetch next from cur_dbname&lt;br /&gt;
    into @dbname&lt;br /&gt;
  While @@FETCH_STATUS = 0&lt;br /&gt;
    begin&lt;br /&gt;
      set @sql='exec ['+@dbname+'].sys.sp_changedbowner ''' + @newowner + ''''&lt;br /&gt;
      --    PRINT @sql&lt;br /&gt;
      EXEC (@sql)&lt;br /&gt;
      fetch next from cur_dbname&lt;br /&gt;
      into @dbname&lt;br /&gt;
    end &lt;br /&gt;
 close cur_dbname&lt;br /&gt;
 deallocate cur_dbname&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2029858970845155743?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2029858970845155743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2011/02/how-to-change-owner-of-all-databases-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2029858970845155743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2029858970845155743'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2011/02/how-to-change-owner-of-all-databases-in.html' title='How to Change the Owner of All Databases in a SQL Server Instance'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2049813815242548879</id><published>2010-11-29T16:49:00.007-06:00</published><updated>2012-01-24T08:45:33.479-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='RHEL6'/><category scheme='http://www.blogger.com/atom/ns#' term='RHEL5'/><category scheme='http://www.blogger.com/atom/ns#' term='AD Integration'/><title type='text'>AD Authentication with RHEL 6</title><content type='html'>We’ve been using AD authentication with our RHEL and CENTOS 4 and 5 systems for some time, now, so I was anxious to see what kinds of changes might have come up with RHEL6.  Not much, happily, but there was one change that took a little while to figure out.  We’ll run through all the steps, from beginning to end, here.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Install the prerequisites&lt;/h2&gt;
We’re using samba and samba-winbind for this, so make sure these are installed.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
yum install samba samba-winbind&lt;/div&gt;
If you’re running RHEL5 and a Windows 2008 R2 domain, you’ll want to use samba3x, instead of the samba.  See &lt;a href="http://lanestechblog.blogspot.com/2010/06/ntstatuspipedisconnected-with-winbind.html"&gt;this article&lt;/a&gt; for more information on that front.&lt;br /&gt;
&lt;h2&gt;
Edit the Configuration Files&lt;/h2&gt;
you’ll want to have the following settings.  I’ve grouped them here to make it all more readable.  Changes from the default are in blue.&lt;br /&gt;
&lt;h3&gt;
/etc/krb5.conf&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
&lt;span style="color: blue;"&gt;&lt;br /&gt;
default_realm = EXAMPLE.COM &lt;br /&gt;
dns_lookup_realm = true &lt;br /&gt;
dns_lookup_kdc = true &lt;br /&gt;
ticket_lifetime = 24h &lt;br /&gt;
renew_lifetime = 7d &lt;br /&gt;
forwardable = yes  &lt;br /&gt;
[realms] &lt;br /&gt;
EXAMPLE.COM = { &lt;br /&gt;
default_domain = example.com &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
[domain_realm] &lt;br /&gt;
.example.com = EXAMPLE.COM &lt;br /&gt;
example.com = EXAMPLE.COM&lt;/span&gt;&lt;/div&gt;
Here we’re defining the kerberos realm and domains.  “example.com” will be replaced with your AD domain name.  Do note the capitalization; it matters.&lt;br /&gt;
&lt;h3&gt;
/etc/samba/smb.conf&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
&lt;span style="color: blue;"&gt;&lt;br /&gt;
workgroup = example &lt;br /&gt;
realm = EXAMPLE.COM &lt;br /&gt;
security = ads &lt;br /&gt;
idmap uid = 10000-500000 &lt;br /&gt;
idmap gid = 10000-500000 &lt;br /&gt;
template shell = /bin/bash &lt;br /&gt;
winbind use default domain = true &lt;br /&gt;
winbind offline logon = false &lt;br /&gt;
winbind nested groups = yes &lt;br /&gt;
encrypt passwords = yes&lt;/span&gt;&lt;/div&gt;
Here we’ve told samba to use the kerberos realm EXAMPLE.COM (you’ll substitute your domain from the krb5.conf file).  We’re using ads for security (Windows-style), and we’re allocating a bunch of UIDs and GIDs for mapping the domain users and groups to the Linux equivalents.&lt;br /&gt;
&lt;h3&gt;
/etc/nsswitch.conf&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
&lt;span style="color: blue;"&gt;&lt;br /&gt;
passwd:     files winbind &lt;/span&gt;&lt;br /&gt;
shadow:     files &lt;span style="color: blue;"&gt;&lt;br /&gt;
group:      files winbind&lt;/span&gt;&lt;/div&gt;
Here we’re telling the system to look not only in the /etc/passwd and /etc/group files for authentication, but also to use winbind.&lt;br /&gt;
&lt;h2&gt;
Join the Domain&lt;/h2&gt;
Now’s the fun part:  we can join the system to the domain.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
chkconfig smb on &lt;br /&gt;
service smb restart &lt;br /&gt;
net ads join –U &lt;em&gt;username&lt;/em&gt;&lt;/div&gt;
where &lt;em&gt;username&lt;/em&gt; is a domain user who has permissions to join a computer to the domain.  You should get a response that the server has joined your realm.&lt;br /&gt;
Depending on your DNS configuration, you might get some errors like the following:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
[root@linuxserver1]# net ads join -U username &lt;br /&gt;
Enter username's password:  &lt;br /&gt;
Using short domain name – EXAMPLE &lt;br /&gt;
Joined 'LINUXSERVER1' to realm 'example.com'  &lt;br /&gt;
[2010/11/29 16:11:20.643445,  0] libads/kerberos.c:333(ads_kinit_password) kerberos_kinit_password LINUXSERVER1$@EXAMPLE.COM failed: Client not found in Kerberos database &lt;br /&gt;
[2010/11/29 16:11:20.644894,  0] utils/net_ads.c:1147(net_update_dns_internal) net_update_dns_internal: Failed to connect to our DC! DNS update failed!&lt;/div&gt;
So long as your server created a machine account in the domain, you can ignore the above errors.  It’s trying to update your DNS server, and if you’re not using a Microsoft DNS server as a part of your domain, it will fail.  That’s OK.&lt;br /&gt;
Once you’ve joined the domain, we need to start winbind&lt;br /&gt;
&lt;div class="codesnippet"&gt;
chkconfig winbind on &lt;br /&gt;
service winbind start&lt;/div&gt;
Assuming winbind starts without any errors, you can test your membership and domain communication with the wbinfo command:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
wbinfo –g&lt;/div&gt;
This command should list out all of the groups you’ve got configured in your domain.  &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Configure the home directories&lt;/h2&gt;
We’ll first want to edit the  /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf file; this defaults to  creating home directories that are group- and world-readable.  We don’t  want that.  This, BTW, is a change from what we did in RHEL 5 and below.&lt;br /&gt;
There are two lines in the /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf file that look like this:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&amp;lt;helper exec="/usr/libexec/oddjob/mkhomedir -u 0022"&lt;/div&gt;
Change them to read:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span style="color: blue;"&gt;&amp;lt;helper exec="/usr/libexec/oddjob/mkhomedir -u 0077"&lt;/span&gt;&lt;/div&gt;
Then restart the oddjobd service&lt;br /&gt;
&lt;div class="codesnippet"&gt;
service oddjobd restart&lt;/div&gt;
&lt;h3&gt;
Set the domain home permissions&lt;/h3&gt;
*Note: &amp;nbsp;&lt;span style="font-size: x-small;"&gt;the behavior below is reported as fixed in advisory&lt;/span&gt;&amp;nbsp;&lt;span style="background-color: white; color: #333333; font-family: 'Liberation Sans', 'Lucida Grande', 'Trebuchet MS', 'Bitstream Vera Sans', helvetica, verdana, arial, sans-serif; font-size: 12px; text-align: left;"&gt;&lt;a href="http://rhn.redhat.com/errata/RHBA-2011-0339.html"&gt;RHBA-2011:0339-2&lt;/a&gt;, but I'm leaving the information here for posterity's sake. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
There's a curiousity with the way oddjobd works, here:  it seems to  be assuming that the default umask is 0022 (644 permissions equivalent).   When we change the umask 0077 (700), it not only creates the users'  home directories with these permissions, but *&lt;span style="font-style: italic; font-weight: bold;"&gt;also the domain home&lt;/span&gt;*.  As  it turns out, the domain home (/home/DOMAIN) is owned by root.  This  prevents anyone from being able to get to their home directory. &lt;br /&gt;
Unless we change this, users will receive the following error:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
Could not chdir to home directory /home/DOMAIN/user: Permission denied &lt;br /&gt;
-bash: /home/DOMAIN/user/.bash_profile: Permission denied&lt;/div&gt;
But if we pre-create the domain home, we should be in good shape: &lt;br /&gt;
&lt;div class="codesnippet"&gt;
mkdir /home/DOMAIN &lt;br /&gt;
chmod 711 /home/DOMAIN&lt;/div&gt;
Where DOMAIN is the short name of your AD domain.&lt;br /&gt;
There's a bug for this behavior, BTW, at https://bugzilla.redhat.com/show_bug.cgi?id=666418, if you're interested in such things. &lt;br /&gt;
This should set you up so that everyone can change directories to  this, but no one can read or write to this directory.  If you prefer  users to be able to enumerate the contents of your DOMAIN directory,  change the permissions to 755 instead of 711. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Restrict Logins&lt;/h2&gt;
We’ll first edit the /etc/pam.d/password-auth file (you can have the OS do this with a GUI front-end for you, if you run authconfig-gtk). This tells pam to use, in addition to the local user store, winbind for authentication.&lt;br /&gt;
&lt;br /&gt;
Domain authentication isn’t that useful unless you can use it to control who can and cannot log in to your server.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
#%PAM-1.0 &lt;br /&gt;
# This file is auto-generated. &lt;br /&gt;
# User changes will be destroyed the next time authconfig is run. &lt;br /&gt;
auth        required      pam_env.so &lt;br /&gt;
auth        sufficient    pam_unix.so nullok try_first_pass &lt;br /&gt;
auth        requisite     pam_succeed_if.so uid &amp;gt;= 500 quiet &lt;span style="color: blue;"&gt;&lt;br /&gt;
auth        sufficient    pam_winbind.so use_first_pass &lt;/span&gt;&lt;br /&gt;
auth        required      pam_deny.so &lt;br /&gt;
account     required      pam_unix.so broken_shadow &lt;br /&gt;
account     sufficient    pam_localuser.so &lt;br /&gt;
account     sufficient    pam_succeed_if.so uid &amp;lt; 500 quiet &lt;span style="color: blue;"&gt;&lt;br /&gt;
account     [default=bad success=ok user_unknown=ignore] pam_winbind.so &lt;/span&gt;&lt;br /&gt;
account     required      pam_permit.so &lt;br /&gt;
password    requisite     pam_cracklib.so try_first_pass retry=3 type= &lt;br /&gt;
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok &lt;span style="color: blue;"&gt;&lt;br /&gt;
password    sufficient    pam_winbind.so use_authtok &lt;/span&gt;&lt;br /&gt;
password    required      pam_deny.so &lt;br /&gt;
session     optional      pam_keyinit.so revoke &lt;br /&gt;
session     required      pam_limits.so &lt;span style="color: blue;"&gt;&lt;br /&gt;
session     optional      pam_oddjob_mkhomedir.so &lt;/span&gt;&lt;br /&gt;
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid &lt;br /&gt;
session     required      pam_unix.so&lt;/div&gt;
The mkhomedir line has PAM create a home directory (defaulting to /home/DOMAIN/username).  That’s usually a good idea.&lt;br /&gt;
It’s possible to put login restrictions here in the system-auth file, but it’s usually considered best practices to put those in the individual files for the connection methods.  We’ll do that now.&lt;br /&gt;
&lt;h3&gt;
/etc/pam.d/sshd&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
#%PAM-1.0 &lt;br /&gt;
auth       required     pam_sepermit.so &lt;br /&gt;
auth       include      password-auth &lt;br /&gt;
auth       include      system-auth &lt;br /&gt;
account    required     pam_nologin.so &lt;br /&gt;
account    include      system-auth &lt;br /&gt;
account    sufficient   pam_localuser.so &lt;span style="color: blue;"&gt;&lt;br /&gt;
account    required    pam_succeed_if.so user ingroup DOMAIN\linuxadmins &lt;/span&gt;&lt;br /&gt;
password   include      system-auth &lt;br /&gt;
# pam_selinux.so close should be the first session rule &lt;br /&gt;
session    required     pam_selinux.so close &lt;br /&gt;
session    required     pam_loginuid.so &lt;br /&gt;
# pam_selinux.so open should only be followed by sessions to be executed in the user context &lt;br /&gt;
session    required     pam_selinux.so open env_params &lt;br /&gt;
session    optional     pam_keyinit.so force revoke &lt;br /&gt;
session    include      password-auth &lt;/div&gt;
Here we’re telling pam that only users who are in the group &lt;em&gt;linuxadmins&lt;/em&gt; are allowed to connect to our server though ssh.&lt;br /&gt;
&lt;h3&gt;
/etc/pam.d/gdm&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
#%PAM-1.0 &lt;br /&gt;
auth     [success=done ignore=ignore default=bad] pam_selinux_permit.so &lt;br /&gt;
auth       required    pam_succeed_if.so user != root quiet &lt;br /&gt;
auth       required    pam_env.so &lt;br /&gt;
auth       substack    system-auth &lt;br /&gt;
auth       optional    pam_gnome_keyring.so &lt;br /&gt;
account    required    pam_nologin.so &lt;br /&gt;
account    include     system-auth &lt;span style="color: blue;"&gt;&lt;br /&gt;
account    sufficient  pam_succeed_if.so user = DOMAIN\user34 &lt;br /&gt;
account    sufficient  pam_succeed_if.so user ingroup DOMAIN\linuxadmins &lt;br /&gt;
account    required    pam_succeed_if.so user ingroup DOMAIN\domainadmins &lt;/span&gt;&lt;br /&gt;
password   include     system-auth &lt;br /&gt;
session    required    pam_selinux.so close &lt;br /&gt;
session    required    pam_loginuid.so &lt;br /&gt;
session    optional    pam_console.so &lt;br /&gt;
session    required    pam_selinux.so open &lt;br /&gt;
session    optional    pam_keyinit.so force revoke &lt;br /&gt;
session    required    pam_namespace.so &lt;br /&gt;
session    optional    pam_gnome_keyring.so auto_start &lt;br /&gt;
session    include     system-auth&lt;/div&gt;
We’re giving more people access to the GUI login, though.  Notice that we’re allowing user34, linuxadmins, and domainadmins to log in through GDM.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2049813815242548879?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2049813815242548879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html#comment-form' title='41 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2049813815242548879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2049813815242548879'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html' title='AD Authentication with RHEL 6'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>41</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5472789274052567292</id><published>2010-11-27T23:04:00.004-06:00</published><updated>2011-12-23T09:28:28.550-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><title type='text'>Using Error (and other multiple) Paths in SSIS</title><content type='html'>SSIS provides for multiple paths between tasks.&amp;nbsp; Very helpful stuff; here we’ll look at a simple solution to a common scenario.&lt;br /&gt;
Below is a job that stops a blocking service, reads from the source DB (SQL CE) file, truncates the destination table, and then copies the data from the source to destination.&amp;nbsp; Finally, it starts the service again.&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/TPHitmMb69I/AAAAAAAAAMU/j0rEIC1VOSg/s1600-h/image%5B3%5D.png"&gt;&lt;img alt="image" border="0" height="324" src="http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiuAFzHsI/AAAAAAAAAMY/oPhpQ6_K_cU/image_thumb%5B1%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="410" /&gt;&lt;/a&gt;&lt;br /&gt;
What if, however, our test job fails after stopping the service?&amp;nbsp; We can provide for failure notification through SQL Agent jobs, but wouldn’t it be nice, also, to have the service start again, even after a failure?&lt;br /&gt;
We’ll set that up using failure paths, such that the tasks will go directly to the start service task in the event of a failure.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;First, we want to highlight the rest read task.&amp;nbsp; When we do, we have the option of creating another job path (highlighted below).&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiuVEWedI/AAAAAAAAAMc/2PB6UonbTo4/s1600-h/image%5B6%5D.png"&gt;&lt;img alt="image" border="0" height="170" src="http://lh6.ggpht.com/_QFTS-w4RNtM/TPHiuk9ShpI/AAAAAAAAAMg/a8rHnEAFUeM/image_thumb%5B2%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="216" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;We’ll drag this new path to the start service task:&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiu2hc5aI/AAAAAAAAAMk/b7PA-NcO-C4/s1600-h/image%5B10%5D.png"&gt;&lt;img alt="image" border="0" height="197" src="http://lh3.ggpht.com/_QFTS-w4RNtM/TPHivA5Bf5I/AAAAAAAAAMo/2KAcYL_NjNI/image_thumb%5B4%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="393" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Now we’ve got two paths from the test read task, but they’re both success paths.&amp;nbsp; To change that, double-click on the green arrow between the test read and the start service paths.&amp;nbsp; When you do, you’ll see a window like the one below, showing the defaults:&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/TPHivl1gRbI/AAAAAAAAAMs/8BZTHtRZZv8/s1600-h/image%5B14%5D.png"&gt;&lt;img alt="image" border="0" height="354" src="http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiv_RkbKI/AAAAAAAAAMw/86qAf1itLio/image_thumb%5B6%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="418" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;We need to change a couple of things here.&amp;nbsp; First, we want this to be a path for failures, so change the success value field to “failure.”&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Next, we want to change this to an OR operation.&amp;nbsp; SSIS allows you to say, “only proceed to this next step if all of the conditions pointing to it are true.”&amp;nbsp; That is, you can have multiple branches in a job that converge on a single task, and that task will not fire until all of the previous tasks have completed successfully (or not; your choice).&amp;nbsp; So it’s really powerful stuff.&amp;nbsp; In our case, we’re going for simple:&amp;nbsp; we will only have a single path to the final task in any given execution, which is the definition of an OR.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiwJtbBAI/AAAAAAAAAM0/VxJucD9WUFc/s1600-h/image%5B18%5D.png"&gt;&lt;img alt="image" border="0" height="321" src="http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiwVMmfiI/AAAAAAAAAM4/_CBz297w3hc/image_thumb%5B8%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="382" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Now, once we click on OK, we’ll notice a couple of things.&amp;nbsp; First, the path from the test read task is red and dotted.&amp;nbsp; Second, the green path from our copy task is also dotted.&amp;nbsp; This is how SSIS signifies that these are OR operations.&amp;nbsp; Note that the constraint setting belongs to the target task, not to the paths, themselves.&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/TPHiww8L3XI/AAAAAAAAAM8/Fujb9pynVDw/s1600-h/image%5B22%5D.png"&gt;&lt;img alt="image" border="0" height="192" src="http://lh3.ggpht.com/_QFTS-w4RNtM/TPHixDZ1t1I/AAAAAAAAANA/FKkWKmjPYyg/image_thumb%5B10%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="368" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;We need to do one more thing to keep SSIS from stopping the package execution when this task fails.&amp;nbsp; Right-click on the task and select properties.&amp;nbsp; We want to change the “FailPackageOnFailure” field from True (default) to false.&amp;nbsp; If it’s set to true, processing stops when the task fails.&amp;nbsp; We do, however, want to make sure the “failParentOnFailure” is set to true.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/TPHixhkPAXI/AAAAAAAAANE/glarlNnq7m4/s1600-h/image%5B28%5D.png"&gt;&lt;img alt="image" border="0" height="211" src="http://lh6.ggpht.com/_QFTS-w4RNtM/TPHix4W5jlI/AAAAAAAAANI/BR5mX3cpdxU/image_thumb%5B12%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="222" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;So now we’re handling a source read failure more gracefully.&amp;nbsp; What about a failure on the destination, though?&amp;nbsp; We probably ought to handle those, as well, right?&amp;nbsp; So we’ll do the same process with the truncate task.&amp;nbsp; When we’ve done that, our task looks like this:&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/TPHizk4XEaI/AAAAAAAAANQ/uEZbKXhLvuc/s1600-h/image%5B32%5D.png"&gt;&lt;img alt="image" border="0" height="334" src="http://lh4.ggpht.com/_QFTS-w4RNtM/TPHiz-vLsEI/AAAAAAAAANU/i62pIQvO5H4/image_thumb%5B14%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="430" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;So far so good.&amp;nbsp; What about that copy task, though?&amp;nbsp; It’d sure be nice to handle failures on that one.&amp;nbsp; We can’t, though, have two paths going between those last two steps.&amp;nbsp; Happily, we have more than just success and failure as options.&amp;nbsp; Double-click on the arrow between the last two tasks, and change the constraint option from “success” to “completion.”&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/TPHi0BTYW_I/AAAAAAAAANY/VvEK4F9ol3E/s1600-h/image%5B37%5D.png"&gt;&lt;img alt="image" border="0" height="76" src="http://lh6.ggpht.com/_QFTS-w4RNtM/TPHi0-RtlHI/AAAAAAAAANc/QAGI73bGnPU/image_thumb%5B17%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="430" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Now, that arrow is colored blue, to indicate that it will proceed to the next step regardless of whether the previous step succeeded or failed.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/TPHi1BluPsI/AAAAAAAAANg/4WSUjesiU5Q/s1600-h/image%5B42%5D.png"&gt;&lt;img alt="image" border="0" height="338" src="http://lh4.ggpht.com/_QFTS-w4RNtM/TPHi1Y6lZAI/AAAAAAAAANk/Ye3JjHEwcgo/image_thumb%5B20%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="421" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;And now, without much work or time, we have completed a project that would take a lot of work to do with traditional server scripting tools, and we’ve done it all within a single SSIS project.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5472789274052567292?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5472789274052567292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/11/using-error-and-other-multiple-paths-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5472789274052567292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5472789274052567292'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/11/using-error-and-other-multiple-paths-in.html' title='Using Error (and other multiple) Paths in SSIS'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_QFTS-w4RNtM/TPHiuAFzHsI/AAAAAAAAAMY/oPhpQ6_K_cU/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2501507025861206978</id><published>2010-11-27T14:10:00.011-06:00</published><updated>2011-12-23T09:29:16.612-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Creating a SSIS SQL Compact Data Source</title><content type='html'>There’s no out-of-the-box SQL Compact data source in SSIS, which presents a problem when you’re needing to copy data from a SQLCE data file.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;It turns out, though, that it’s easy to repurpose a OLEDB connection to read from a SQL Compact DB.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
OLEDB is a generic connection method:  so long as you know the correct connection string to use, you can manually edit the connection properties for another OLEDB connection.&lt;br /&gt;
&lt;span id="fullpost"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Start out by creating a new OLE DB Connection in the connection manager.  Right-click in the connection managers pane and select “New OLE DB Connection…”&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;  &lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/TPFlnx5cFfI/AAAAAAAAAL0/2ck3ieOM-40/s1600-h/image%5B3%5D.png"&gt;&lt;img alt="image" border="0" height="308" src="http://lh5.ggpht.com/_QFTS-w4RNtM/TPFloYAKa3I/AAAAAAAAAL4/L0DUhNwseZE/image_thumb%5B1%5D.png?imgmax=800" style="background-image: none; border: 0px none; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="362" /&gt;&lt;/a&gt;&lt;br /&gt;
  Click on the “New…” button within the connection manager configuration window.&lt;br /&gt;
  In the Connection Manager provider field, select “Native OLE DB\Microsoft OLE DB Simple Provider.”  In the “Server or file name” field, enter a dummy file name.  We’ll change this to point to the correct file in a moment.&lt;br /&gt;
  &lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/TPFlo6ap6sI/AAAAAAAAAL8/H6-vfcgwCPw/s1600-h/image%5B8%5D.png"&gt;&lt;img alt="image" border="0" height="428" src="http://lh4.ggpht.com/_QFTS-w4RNtM/TPFlpBjadrI/AAAAAAAAAMA/4PjH1MDqQL4/image_thumb%5B4%5D.png?imgmax=800" style="background-image: none; border: 0px none; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="414" /&gt;&lt;/a&gt;&lt;br /&gt;
  Click on OK.  &lt;br /&gt;
  Now you’ll see your dummy OLE DB connection manager in the connection managers window.  If you right click on it and select Properties, you’ll see the information below:&lt;br /&gt;
  &lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/TPFlp99kzkI/AAAAAAAAAME/_T5gvzE9pxQ/s1600-h/image%5B16%5D.png"&gt;&lt;img alt="image" border="0" src="http://lh4.ggpht.com/_QFTS-w4RNtM/TPFlqGN2PeI/AAAAAAAAAMI/O1Htvyesrbg/image_thumb%5B8%5D.png?imgmax=800" style="background-image: none; border: 0px none; display: inline; height: 276px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 615px;" title="image" /&gt;&lt;/a&gt;&lt;br /&gt;
  Now we can change the connection string manually.  &lt;br /&gt;
  The format for a SQL Compact connection string is as follows:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
Data Source=path\to\filename.ext;Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;File Mode=Read Only;&lt;/div&gt;
The FileMode setting is optional, and I’ve not been able to have it make a difference when opening a SQL Compact file from within SSIS.&lt;br /&gt;
  You’ll also want to change the name of the connection to something that is more descriptive.&lt;br /&gt;
  Once you’ve changed the connection string (example below; sorry for the blurry image; click on it for a clearer view), you’re able to use this connection as a data source through the OLE DB Source toolbox.&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_QFTS-w4RNtM/TPlqQiWw0oI/AAAAAAAAANw/vCbhNxRPTvI/s1600/sqlce_connectionstring.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5546581248416207490" src="http://2.bp.blogspot.com/_QFTS-w4RNtM/TPlqQiWw0oI/AAAAAAAAANw/vCbhNxRPTvI/s1600/sqlce_connectionstring.JPG" style="cursor: pointer;" /&gt;&lt;/a&gt;&lt;br /&gt;
  Note that once you’ve made this change, you’ll no longer be able to double-click on the data connection manager to modify its settings.  You’ll receive an error like this:&lt;br /&gt;
  &lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/TPFlqRcfYsI/AAAAAAAAAMM/tiDrXiZQORI/s1600-h/image%5B21%5D.png"&gt;&lt;img alt="image" border="0" height="108" src="http://lh4.ggpht.com/_QFTS-w4RNtM/TPFlq3rvIvI/AAAAAAAAAMQ/q8ty5urBtWo/image_thumb%5B11%5D.png?imgmax=800" style="background-image: none; border: 0px none; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="525" /&gt;&lt;/a&gt;&lt;br /&gt;
  This isn’t an error to worry about:  the problem is that the GUI isn’t set up to handle SQL Compact databases as an OLE DB connection.  But it still will work within your data flow, both as a source and as a destination.&lt;br /&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2501507025861206978?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2501507025861206978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/11/creating-ssis-sql-compact-data-source.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2501507025861206978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2501507025861206978'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/11/creating-ssis-sql-compact-data-source.html' title='Creating a SSIS SQL Compact Data Source'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_QFTS-w4RNtM/TPFloYAKa3I/AAAAAAAAAL4/L0DUhNwseZE/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5006699302630536259</id><published>2010-09-22T16:53:00.005-05:00</published><updated>2010-09-22T17:12:05.844-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PeopleSoft Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='PeopleSoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Connection Failed error message with PeopleTools Change Assistant on 64 Bit Windows</title><content type='html'>&lt;div style="text-align: left;"&gt;
&lt;/div&gt;With PeopleTools 8.5, Oracle moved the app servers into 64-bit territory.  That was welcome news.  Unfortunately, the whole stack isn't quite there, yet, and we ran into an irritating problem when running Change Assistant to upgrade from 8.49 to 8.51.
&lt;span id="fullpost"&gt;
Specifically, when setting up the environment, we recevied a "connection failed!" error when testing the connection.  Here's what we saw:

&lt;span id="fullpost"&gt;&lt;a href="http://2.bp.blogspot.com/_QFTS-w4RNtM/TJp_C58SHRI/AAAAAAAAALc/Np6-flau0xk/s1600/psca_error.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 515px; height: 364px;" src="http://2.bp.blogspot.com/_QFTS-w4RNtM/TJp_C58SHRI/AAAAAAAAALc/Np6-flau0xk/s400/psca_error.JPG" alt="" id="BLOGGER_PHOTO_ID_5519863981186096402" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;
No logs, no details.  Just failed.

But then, finally, a hint:  Data mover (which shouldn't connect, since the database is still at 8.49) wouldn't even run:  it failed with an error "missing or invalid version of sql library psora".  Aha!  Now that is something one can work with.

It turns out it needs the 32-bit Oracle client.  Install that, and everything is good, again.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5006699302630536259?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5006699302630536259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/09/connection-failed-error-message-with.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5006699302630536259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5006699302630536259'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/09/connection-failed-error-message-with.html' title='Connection Failed error message with PeopleTools Change Assistant on 64 Bit Windows'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_QFTS-w4RNtM/TJp_C58SHRI/AAAAAAAAALc/Np6-flau0xk/s72-c/psca_error.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-1835005728218995563</id><published>2010-07-16T12:52:00.008-05:00</published><updated>2011-12-23T09:30:22.536-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>How to Delegate Services control in Windows</title><content type='html'>Microsoft offers a very helpful document &lt;a href="http://support.microsoft.com/kb/288129/en-us/"&gt;here &lt;/a&gt;and &lt;a href="http://support.microsoft.com/kb/325349"&gt;here&lt;/a&gt; detailing how to use subinacl to give control over a service to a user.  Unfortunately, they’ve not updated that article in quite some time, and it’s now out of date:  beginning with Windows Server 2003 SP1, authenticated users no longer can enumerate services.  &lt;br /&gt;
While that’s a good thing, it renders the solution presented by Microsoft only partially complete.&lt;br /&gt;
So we’ll correct that, going through all the steps that are necessary to give an (otherwise) unprivileged user permissions to control any given services through the services control panel.  This will work on Windows Server through v2008 R2.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;
&lt;span id="fullpost"&gt;Assemble the Tools&lt;/span&gt;&lt;/h1&gt;
&lt;span id="fullpost"&gt;
We’ll use three command-line tools, two of which will need to be installed on the destination server.  The first is sc, which is installed by default, happily.  &lt;br /&gt;

The second is subinacl.  It’s possible to use sc instead of subinacl, but the learning curve for subinacl is much less steep.
Subinacl can be downloaded from &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=e8ba3e56-d8fe-4a91-93cf-ed6985e3927b&amp;amp;displaylang=en"&gt;Microsoft here&lt;/a&gt;.&lt;br /&gt;

You’ll also need access to dsquery; this is installed on Windows 7 and Server 2008 if you’ve installed the Active Directory Domain Controller Tools feature (see below for a screen shot on how to install that feature in Windows Server 2008).&lt;br /&gt;

&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/TECcb3M7wLI/AAAAAAAAAK0/dqDCuYWQ4Zc/s1600-h/image%5B4%5D.png"&gt;&lt;img alt="image" border="0" height="393" src="http://lh6.ggpht.com/_QFTS-w4RNtM/TECccdMUvZI/AAAAAAAAAK4/QbhVVDQJkYY/image_thumb%5B2%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="517" /&gt;&lt;/a&gt; &lt;br /&gt;


&lt;h1&gt;
Grant Permissions to Enumerate Services&lt;/h1&gt;
So with Windows Server 2003 SP1, authenticated users no longer can enumerate services by default.  Probably a good choice, but that means we need to grant that permission before our delegate can run the services control panel and connect it to our server.&lt;br /&gt;

&lt;h3&gt;
Determine the SID of the user you’re wanting to grant access to&lt;/h3&gt;
Because SC uses SIDs, rather than usernames, we’ve got to get the SID of the user we want to deal with.  We’ll use dsquery to do this, thus:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
dsquery * -filter "&amp;amp;(objectcategory=user)(samaccountname=&amp;lt;username&amp;gt;)" -attr objectsid&lt;/div&gt;
where &amp;lt;username&amp;gt; is the login name for the user we want.  The above will return the SID, something like this:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
C:\&amp;gt;dsquery * -filter "&amp;amp;(objectcategory=user)(samaccountname=testuser)" -attr objectsid
&lt;br /&gt;
objectsid
S-1-5-21-214A909598-1293495619-13Z157935-75714&lt;/div&gt;
Note the SID; we’ll use it below.&lt;br /&gt;

&lt;h3&gt;
Grant access to run the Services Control Panel&lt;/h3&gt;
We’ll use sc to do this.  First, run sc to get the current SDDL for the services control manager:&lt;br /&gt;

sc sdshow scmanager&lt;br /&gt;

You’ll get something like this:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
D:(A;;CC;;;AU)(A;;CCLCRPRC;;;IU)(A;;CCLCRPRC;;;SU)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)&lt;/div&gt;
This is SDDL, and if you’re interested, you can start reading with &lt;a href="http://support.microsoft.com/kb/914392"&gt;Microsoft’s KB914392&lt;/a&gt; for more information.&lt;br /&gt;

For our purposes, though, it’s enough to do this:&lt;br /&gt;
  &lt;ul&gt;
&lt;li&gt;&lt;span style="background-color: white;"&gt;Copy the results of the above command (sc sdshow scmanager) to a text editor.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: white;"&gt;Copy the section of the SDDL that ends in IU (interactive users) to just before the S: in the SDDL line.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: white;"&gt;In the copied text, replace ‘IU’ with the SID of the user to whom you are granting access, such that your SDDL looks something like that below:&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="codesnippet"&gt;
D:(A;;CC;;;AU)(A;;CCLCRPRC;;;IU)(A;;CCLCRPRC;;;SU)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)&lt;u style="color: #3333ff;"&gt;(A;;CCLCRPRC;;;S-1-5-21-214A909598-1293495619-13Z157935-75714)&lt;/u&gt;S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)&lt;/div&gt;
Now we’ll run the set command:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
sc sdset scmanager "D:(A;;CC;;;AU)(A;;CCLCRPRC;;;IU)(A;;CCLCRPRC;;;SU)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)(A;;CCLCRPRC;;;S-1-5-21-214A909598-1293495619-13Z157935-75714)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)"&lt;/div&gt;
Note that we’re replacing the permissions on scmanager; this isn’t additive.  That’s why we needed to copy the existing permissions.  So if you’re needing to grant access to another person, you’ll need to duplicate the section with the SID and add another.&lt;br /&gt;


&lt;h1&gt;
Grant access to the Service&lt;/h1&gt;
Now that our user can enumerate services, we’ll grant access to control a service.  In our example here, we’ll use the Print Spooler service, since that’s a harmless one, but you can do this with any service(s) you require.&lt;br /&gt;

This is where we’ll use subinacl, and the format is simple:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
subinacl /verbose /service "service name" /grant=DOMAIN\username=F&lt;/div&gt;
Note that the service name is the “short” format.  You can query that using sc:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
sc getkeyname “service name from services control panel”&lt;/div&gt;
thus:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
C:\&amp;gt;sc getkeyname "print spooler"
[SC] GetServiceKeyName SUCCESS
Name = Spooler&lt;/div&gt;
So in our case, we’ll do this:&lt;br /&gt;

&lt;div class="codesnippet"&gt;
subinacl /verbose /service “Spooler” /grant=TEST\testuser=F&lt;/div&gt;
‘F’, by the way, is full control.&lt;br /&gt;

The double quotes aren’t necessary, except in cases where the service name has spaces.&lt;br /&gt;

Our user now can run the services control panel on a remote workstation and connect to the server to control the print spooler service.  &lt;br /&gt;

Note that even though the user can see other services, there’s isn’t any permission to control them.&lt;br /&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-1835005728218995563?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/1835005728218995563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/07/how-to-delegate-services-control-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1835005728218995563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1835005728218995563'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/07/how-to-delegate-services-control-in.html' title='How to Delegate Services control in Windows'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_QFTS-w4RNtM/TECccdMUvZI/AAAAAAAAAK4/QbhVVDQJkYY/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5084505143227800505</id><published>2010-06-27T16:42:00.005-05:00</published><updated>2011-12-23T09:32:31.017-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Samba'/><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='AD Integration'/><title type='text'>Linux error id: cannot find name for user ID xxxxx when using Domain Authentication</title><content type='html'>We recently had a problem, after re-doing some samba configurations on RHEL 5, in which a user would log in (successfully), but then be presented with the follow errors:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
id: cannot find name for user ID 10001&lt;br /&gt;
id: cannot find name for group ID  10000&lt;br /&gt;
id: cannot find name for user ID 10001&lt;/div&gt;
Of course, none of our domain ACLs worked for this user, either, which was a real problem.

Finally, after running through the more obvious problems (communication with domain controllers:  verified with wbinfo; uid and gid allocation and linking:  set explicitly with wbinfo; winbind cache (cleared, both in /var/cache/samba and /var/lib/samba); date/time discrepancies; domain membership), we found the culprit:  file permissions.
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;
&lt;span id="fullpost"&gt;
One of the perplexing things about this problem was that it was user-specific:  all other users could log in just fine, and in fact, this user could be identified on the domain by other users.
If you run into this problem, there are a couple of really useful troubleshooting commands:
&lt;/span&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;id&lt;span style="font-style: italic;"&gt; &lt;username&gt;&lt;/username&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id="fullpost"&gt;
Id gives information about users and groups.  In this case, other users could get information about this user using the id command, but the user couldn't get any data either about his own ID or anyone else's.

&lt;div class="codesnippet"&gt;
strace &lt;span style="font-style: italic;"&gt;&lt;command&gt;&lt;/command&gt;&lt;/span&gt;&lt;/div&gt;
Ah, how I love strace.  I often forget to use it, which is a shame, because it would short-circuit a lot of my problems.  (&lt;span style="font-style: italic;"&gt;man strace&lt;/span&gt; for more info; you'll be glad you did.)

In this case, the strace stack for &lt;span style="font-style: italic;"&gt;id &lt;username&gt;&lt;/username&gt;&lt;/span&gt; when run as the offending user included the following:
&lt;div class="codesnippet"&gt;
connect(3,  {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 EACCES  (Permission denied)&lt;/div&gt;
Our GID mapping had gotten out of whack, and the /var directory, as it turned out, had some extended permissions (ACLs) that excluded this particular user from accessing anything within the /var directory.
Removing those extended permissions cleared up the problem for us.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5084505143227800505?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5084505143227800505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/06/linux-error-id-cannot-find-name-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5084505143227800505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5084505143227800505'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/06/linux-error-id-cannot-find-name-for.html' title='Linux error id: cannot find name for user ID xxxxx when using Domain Authentication'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-3615430820034334471</id><published>2010-06-21T12:26:00.005-05:00</published><updated>2011-12-23T09:33:37.928-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='AD Integration'/><title type='text'>NT_STATUS_PIPE_DISCONNECTED with Samba Winbind and Windows Server 2008 R2 Domain Controller</title><content type='html'>We recently upgraded our domain controllers to Windows Server 2008 R2, and our RHEL 5 authentication through our Windows domain immediately broke.&lt;br /&gt;
Here was the error:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
[2010/06/21 09:32:57, 0] rpc_client/cli_pipe.c:rpc_api_pipe(790)
rpc_api_pipe: Remote machine adserver.my.edu pipe \NETLOGON fnum 0x8007returned critical error. Error was NT_STATUS_PIPE_DISCONNECTED&lt;/div&gt;
A little searching online shows a lot of people with this or related problems, but the solutions appear to be many, and there mostly isn’t a solution posited.&lt;br /&gt;
But there is this:  &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=561325" title="https://bugzilla.redhat.com/show_bug.cgi?id=561325"&gt;https://bugzilla.redhat.com/show_bug.cgi?id=561325&lt;/a&gt;&lt;br /&gt;
In short: there's a bug in the samba package that prevents it from working with Windows Server 2008 R2 domains.  If you’re running into this problem, the solution is to remove your existing samba installation and install, instead, the samba3x packages.
&lt;br /&gt;
Note that samba3x was a "technology preview" from RedHat, which means that it offered little support for it.  This has changed, and it's now a supported package in RHEL 5.
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
yum erase samba samba-common&lt;br /&gt;
yum install samba3x samba3x-client&lt;/div&gt;
You’ll have to re-do your configuration, so it might be worthwhile to back up your /etc/samba/smb.conf file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-3615430820034334471?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/3615430820034334471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/06/ntstatuspipedisconnected-with-winbind.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3615430820034334471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3615430820034334471'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/06/ntstatuspipedisconnected-with-winbind.html' title='NT_STATUS_PIPE_DISCONNECTED with Samba Winbind and Windows Server 2008 R2 Domain Controller'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2003383095688862776</id><published>2010-04-25T22:26:00.003-05:00</published><updated>2011-12-23T09:34:18.485-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Simple Method to Validate Data Read at the beginning of an SSIS Package</title><content type='html'>&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/S9UHw-zo-WI/AAAAAAAAAKc/eteYsA84c1Y/s1600-h/image%5B9%5D.png"&gt;&lt;img align="left" alt="image" border="0" height="277" src="http://lh3.ggpht.com/_QFTS-w4RNtM/S9UHxGMt7xI/AAAAAAAAAKg/-IIX65y3Elg/image_thumb%5B5%5D.png?imgmax=800" style="border: 0px none; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="175" /&gt;&lt;/a&gt; &lt;br /&gt;
We’ve looked at using &lt;a href="http://lanestechblog.blogspot.com/2010/04/utilizing-transactions-in-ssis-to.html"&gt;transactions in an SSIS package&lt;/a&gt; to ensure that, for instance, the read data step in your package doesn’t fail after you’ve deleted the data it’s set to replace.&lt;br /&gt;
This is a very effective and really useful method, and it’s exceedingly flexible.&lt;br /&gt;
If your project spans multiple servers, though, this will require changes to the DST service settings that you might not be able to make.&lt;br /&gt;
There’s a simpler way, though it doesn’t offer all of the protections of wrapping your package in a transaction.  We’ll take a look at that, here.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style="clear: both;"&gt;
&lt;/div&gt;
&lt;span id="fullpost"&gt;  &lt;h1&gt;
First:  the problem&lt;/h1&gt;
The stereotypical SSIS package looks like the one above:  delete data in the destination database, then import new data into the target.  The problem is also displayed above:&lt;br /&gt;
  What if you are successful in deleting the data, but then there’s a failure, either in reading the new data?  This failure could be from a password change, permissions problems on the source, or, in the case of a flat file source, a nonexistent file. &lt;br /&gt;
  In any of those scenarios, we’re faced with data that already has been deleted, but there’s nothing to replace it with.&lt;br /&gt;
    &lt;h1&gt;
Solutions&lt;/h1&gt;
There are a couple of possible solutions to this problem, including &lt;a href="http://lanestechblog.blogspot.com/2010/04/utilizing-transactions-in-ssis-to.html"&gt;using transactions&lt;/a&gt; or building in a failure step that would copy the data back from your backup.  The first option, utilizing transactions, is certainly the most robust option.  But it often requires some server-side settings that not every DBA or data analyst has access to change.  &lt;br /&gt;
  The second option, building in some failure events in your job, is easy enough, but it can complicate what is an otherwise very straightforward process.&lt;br /&gt;
  A third option is simply to test your read in a task that executes before your main task.  This is the option we’ll use here, as it’s very simple, both conceptually and in implementation.  Plus, it meets our basic requirements of providing a failure before data is deleted.&lt;br /&gt;
    &lt;h1&gt;
The details&lt;/h1&gt;
Here’s a data flow task that we use daily.  We read from the source, do some data transformations, and then write the data to a destination table.  That table has already been truncated in an earlier task.&lt;br /&gt;
  &lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/S9UHxR2yMKI/AAAAAAAAAKk/SrNJrNETfIk/s1600-h/image%5B13%5D.png"&gt;&lt;img alt="image" border="0" height="318" src="http://lh5.ggpht.com/_QFTS-w4RNtM/S9UHxkWZ4KI/AAAAAAAAAKo/nJvQ9HB7Xto/image_thumb%5B7%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="493" /&gt;&lt;/a&gt; &lt;br /&gt;
  Because the truncate already has happened, if there’s an error at the source read step here, we’re in trouble.&lt;br /&gt;
  So we create a new data flow task before our delete step.  That data flow task consists of one thing only:  the read from source step from the above task.  Just copy and past.&lt;br /&gt;
  We don’t actually do anything with this data, and, in fact, were it a really large data read, we could do something like retrieve the top 10,000 rows, just to be sure that all is well on our source.&lt;span id="fullpost"&gt;&lt;span id="fullpost"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/S9UHx5IKPkI/AAAAAAAAAKs/98QORqHDkMU/s1600-h/image%5B20%5D.png"&gt;&lt;img align="left" alt="image" border="0" height="391" src="http://lh3.ggpht.com/_QFTS-w4RNtM/S9UHyAiFbGI/AAAAAAAAAKw/W3Rx059OTAw/image_thumb%5B12%5D.png?imgmax=800" style="border: 0px none; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="202" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;span id="fullpost"&gt;&lt;/span&gt;&lt;br /&gt;
As you can see, if that read step fails, now, the package fails, and no data has been lost.  &lt;br /&gt;
While we’ve not provided bulletproof failure protection, we’ve eliminated the most likely failure scenario, and for a lot of folks, that’s a really big improvement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2003383095688862776?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2003383095688862776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/04/simple-method-to-validate-data-read-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2003383095688862776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2003383095688862776'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/04/simple-method-to-validate-data-read-at.html' title='Simple Method to Validate Data Read at the beginning of an SSIS Package'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_QFTS-w4RNtM/S9UHxGMt7xI/AAAAAAAAAKg/-IIX65y3Elg/s72-c/image_thumb%5B5%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5414769297843055700</id><published>2010-04-23T16:41:00.012-05:00</published><updated>2011-12-23T09:34:52.053-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Utilizing Transactions in SSIS to Rollback After a Failed Import</title><content type='html'>SSIS is used primarily to import data into a database, particularly from flat files, but also from other databases.  The typical SSIS &lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/S9IT7DIGtdI/AAAAAAAAAJs/r8r6Aj0JOuo/s1600-h/image%5B39%5D.png"&gt;&lt;img align="left" alt="image" border="0" height="368" src="http://lh4.ggpht.com/_QFTS-w4RNtM/S9IT7Sl8VmI/AAAAAAAAAJw/sBNpfS79RMw/image_thumb%5B27%5D.png?imgmax=800" style="border: 0px none; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="232" /&gt;&lt;/a&gt;package  for doing this task looks something like the picture at the left:  backup the current data, delete the current data from the destination table, and then import the data from the source.&lt;br /&gt;
This is all good, and it works well.  When it works.  The problem is that if there’s a problem with reading the data from the source (say, the credentials for the source database changed), you’ve already blown away the current (production) data.  The job fails, and the data remains missing.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div style="clear: both;"&gt;
&lt;/div&gt;
&lt;span id="fullpost"&gt;
&lt;h1&gt;
Configure MSDTC&lt;/h1&gt;
If you’re running the SSIS package on the destination database server, you can skip this step.  We’ve chosen to have SSIS on a dedicated instance, which has made keeping track of packages and scheduled jobs much easier.  But it also means we’ve got to do a little work on the back-end before we can make our packages use a single transaction&lt;br /&gt;
  The MSDTC service (Distributed Transaction Coordinator) facilitates this process, and by default, it doesn’t allow remote communication.  So we’ve got to change the settings on two systems:  the database server and the server on which the job is executed.  In our example, we’ll say that the db server runs Windows Server 2003 and the Server 2008; setting up the MSDTC service under each OS is just a tiny bit different.&lt;br /&gt;

&lt;h2&gt;
Configure MSDTC in Windows Server 2003&lt;/h2&gt;
Run the component service control panel:  Start -&amp;gt; Administrative Tools -&amp;gt; Component services (or Start -&amp;gt; run -&amp;gt; dcomcnfg)&lt;br /&gt;
  Go to Component Services -&amp;gt; Computers and right click on My Computer.  Select Properties.&lt;br /&gt;
  &lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/S9IT744H3eI/AAAAAAAAAJ0/fm1jWIn_BXI/s1600-h/image%5B27%5D.png"&gt;&lt;img alt="image" border="0" height="229" src="http://lh4.ggpht.com/_QFTS-w4RNtM/S9IT8OMl5NI/AAAAAAAAAJ4/z-XVbRNkKIs/image_thumb%5B19%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="401" /&gt;&lt;/a&gt; &lt;br /&gt;
  The properties window has a MSDTC tab.  Click on the &lt;strong&gt;Security Configuration &lt;/strong&gt;button in the MSDTC tab.&lt;br /&gt;
  In the security configuration window (below), you'll need to grant Network DTC Access, allowing remote clients, both inbound and outbound.  You do not need to allow remote administration, though doing so would allow these settings to be (re)configured remotely.&lt;br /&gt;
  The settings below are what are required for a database server.  &lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/S9IT8fOicFI/AAAAAAAAAJ8/HhC4kKq2fCk/s1600-h/image%5B28%5D.png"&gt;&lt;img align="left" alt="image" border="0" height="365" src="http://lh3.ggpht.com/_QFTS-w4RNtM/S9IT8k7WxMI/AAAAAAAAAKA/Uuh5DW8RsAU/image_thumb%5B20%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="370" /&gt;&lt;/a&gt;&lt;br /&gt;
      Basically, we want our SSIS server to be able to communicate to the MSDTC service on our database server, and we want our service to be able to talk back to the SSIS box.&lt;br /&gt;
    When you click on &amp;lt;OK&amp;gt;, the system will restart the Distributed Transaction Coordinator service.&lt;br /&gt;


&lt;div style="clear: both;"&gt;
&lt;/div&gt;
&lt;h2&gt;
Configure MSDTC in Windows Server 2008&lt;/h2&gt;
The actual configuration settings and windows are identical in Windows Server 2008 to those in Windows Server 2003.  There is a difference, though, in how you get to those settings:&lt;br /&gt;
  Run the component service control panel:  Start -&amp;gt; Administrative Tools -&amp;gt; Component services (or Start -&amp;gt; run -&amp;gt; dcomcnfg)&lt;br /&gt;
  Go to Component Services -&amp;gt; Computers -&amp;gt; My Computer -&amp;gt; Distributed Transaction Coordinator&lt;br /&gt;
  Right-click on on "Local DTC" and select properties.  There is a &lt;strong&gt;Security&lt;/strong&gt; tab on that window.  The settings below are required on the server that is executing the SSIS job:&lt;br /&gt;
  &lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/S9IT9LBYMaI/AAAAAAAAAKE/3CoZ3jSGC10/s1600-h/image%5B29%5D.png"&gt;&lt;img align="left" alt="image" border="0" height="332" src="http://lh6.ggpht.com/_QFTS-w4RNtM/S9IT9YsmToI/AAAAAAAAAKI/arDbSaROTz8/image_thumb%5B21%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="379" /&gt;&lt;/a&gt; &lt;br /&gt;
  Here we don’t need remotely-initiated connections to the MSDTC service, so we’re not allowing remote clients or inbound communications; outbound is all we need.&lt;br /&gt;
&lt;div style="clear: both;"&gt;
&lt;/div&gt;
By the way, if we don’t do this configuration of the MSDTC service, we’ll get the following error when we try to run our package:&lt;br /&gt;
  &lt;blockquote&gt;
[Connection manager "DestinationConnectionOLEDB"] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x8004D024.&lt;/blockquote&gt;
and &lt;br /&gt;
  &lt;blockquote&gt;
[Connection manager "DestinationConnectionOLEDB"] Error: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024 "The transaction manager has disabled its support for remote/network transactions.".&lt;/blockquote&gt;
&lt;h1&gt;
Configuring your Package for Transaction Support&lt;/h1&gt;
There’s a pretty good Microsoft article on using transactions in SSL at &lt;a href="http://msdn.microsoft.com/en-us/library/ms137690.aspx" title="http://msdn.microsoft.com/en-us/library/ms137690.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms137690.aspx&lt;/a&gt;; I’d recommend it to you.&lt;br /&gt;
  Here’s how it plays out.&lt;br /&gt;
  You can set packages, loops, tasks, and sequence containers to use transactions, which really helps in ensuring consistency.&lt;br /&gt;
  In our case, we’ll enable transactions at the package level, and then we’ll have the option of having our tasks be a part of that transaction:&lt;br /&gt;
  Double-click on your package in SQL Server Business Intelligence Development Studio (BITS from now on).  That opens the package.  Now, right-click on the background and select properties, as below:&lt;br /&gt;
  &lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/S9IT9q9TTTI/AAAAAAAAAKM/eSVXX1oJCjA/s1600-h/image%5B33%5D.png"&gt;&lt;img alt="image" border="0" height="413" src="http://lh4.ggpht.com/_QFTS-w4RNtM/S9IT99aWY2I/AAAAAAAAAKQ/G7l-_x9TVkY/image_thumb%5B23%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="418" /&gt;&lt;/a&gt; &lt;br /&gt;
  The properties data shows up on the right-hand side of the screen, and at the end of the list of properties, you’ll see “TransactionOption.”  This is how we tell SSIS how to utilize transactions in the execution of the package.  The options are as follows:&lt;br /&gt;
  &lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Required&lt;/strong&gt; – Either start a new transaction, or join the transaction that was started by the parent to this object&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Supported&lt;/strong&gt; – Join a transaction, if the parent container was a part of one, but don’t start one.  This is the default setting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NotSupported&lt;/strong&gt; – Don’t join a transaction, under any circumstances.&lt;/li&gt;
&lt;/ul&gt;
We’ll set the TransactionOption for our package to “Required.”  &lt;br /&gt;
  &lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/S9IT-aMXV7I/AAAAAAAAAKU/TvaFAIe_Syk/s1600-h/image%5B43%5D.png"&gt;&lt;img alt="image" border="0" height="229" src="http://lh6.ggpht.com/_QFTS-w4RNtM/S9IT-1wkMYI/AAAAAAAAAKY/3ARbsoHw-Hg/image_thumb%5B29%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="429" /&gt;&lt;/a&gt; &lt;br /&gt;
  Now we can click one of our tasks, like the “Backup Original Table” task, and we’ll see that, since its setting is “Supported,” it’ll be a part of our package’s transaction.  &lt;br /&gt;
  Here’s something to consider:  there are only certain transactions that can be rolled back.  This is especially important to remember when we’re wanting to allow the rollback of deleted data.  &lt;br /&gt;
  There are circumstances in which cannot rollback a drop table, which often is used for these operations.  Instead, unless you’re looking at a *ton* of data, use a “delete from” SQL statement.  A truncate command will work in most instances, but check the rollback process in a test instance before putting it in production.  This will ensure your original data can be rolled back with the transaction.&lt;br /&gt;
  That’s all that’s required.  Now, if we have a failure at the end of the process, when data is imported, that failure will trigger a rollback of our delete task.&lt;br /&gt;
  &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5414769297843055700?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5414769297843055700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/04/utilizing-transactions-in-ssis-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5414769297843055700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5414769297843055700'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/04/utilizing-transactions-in-ssis-to.html' title='Utilizing Transactions in SSIS to Rollback After a Failed Import'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_QFTS-w4RNtM/S9IT7Sl8VmI/AAAAAAAAAJw/sBNpfS79RMw/s72-c/image_thumb%5B27%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-3729038899800525879</id><published>2010-04-01T11:06:00.010-05:00</published><updated>2011-12-23T09:38:42.732-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Automatic server recovery'/><category scheme='http://www.blogger.com/atom/ns#' term='ASR'/><title type='text'>Disabling ASR on a Windows Server</title><content type='html'>ASR stands for automatic server recovery.  It's a service whereby the iLO features of a HP server will reboot it, should it detect that something has gone wrong with the operating system.  Good idea, except when the detected failure isn't really a failure.  Or you want to be able to troubleshoot the problem while it's occurring.  &lt;br /&gt;
The most straightforward method for changing this setting is to boot the server into the BIOS setup  (F9) screen, and browse to Server Availability –&amp;gt; ASR Status.&lt;br /&gt;
Sometimes, you’d like to make this change without downtime, however.  It appears it’s possible.  Unfortunately, it also appears that a reboot, at some point, still is necessary.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Disabling ASR on-the-fly requires a couple of things, one an installation, and one a configuration change.
&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;The installation that's necessary is net-snmp, a set of snmp tools.  They can be got here:  &lt;a href="http://www.net-snmp.org/"&gt;http://www.net-snmp.org/&lt;/a&gt;
It's an install, rather than a set of standalone tools, but you can (and should) opt not to install the trap and snmp services.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;  Once that's installed, double-click on the SNMP Service on the target server.  You should see something like the screen shot below:&lt;br /&gt;
  &lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/S7TEZyahadI/AAAAAAAAAJk/JqGuEwmf7Xo/s1600-h/snmp_settings%5B3%5D.jpg"&gt;&lt;img alt="snmp_settings" border="0" height="389" src="http://lh3.ggpht.com/_QFTS-w4RNtM/S7TEaTHl7II/AAAAAAAAAJo/GOzidEGReiY/snmp_settings_thumb%5B1%5D.jpg?imgmax=800" style="border: 0px none; display: inline;" title="snmp_settings" width="475" /&gt;&lt;/a&gt; &lt;br /&gt;
  In order to change the ASR setting, the appropriate community (name changed here to ‘community’) needs read/write access.  So edit that line and change that setting.  A restart of the service is necessary for this change to take effect.&lt;br /&gt;
  Once you've made that change, you can use the &lt;code&gt;snmpget &lt;/code&gt;and &lt;code&gt;snmpset &lt;/code&gt;commands to disable ASR.&lt;br /&gt;
  To read the current setting for ASR, run &lt;code&gt;snmpget&lt;/code&gt;:&lt;br /&gt;
  &lt;/span&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;C:\&amp;gt;snmpget -c community -v 1 localhost .1.3.6.1.4.1.232.6.2.5.1.0&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;SNMPv2-SMI::enterprises.232.6.2.5.1.0 = INTEGER: 4&lt;/span&gt;&lt;/div&gt;
&lt;span id="fullpost"&gt;
Three is disabled.  Four is enabled.  So we can see that ASR is enabled on the system above.  Let's change that.&lt;br /&gt;

&lt;div class="codesnippet"&gt;
C:\&amp;gt;snmpset -c community -v 1 localhost .1.3.6.1.4.1.232.6.2.5.1.0 i 3&lt;br /&gt;
SNMPv2-SMI::enterprises.232.6.2.5.1.0 = INTEGER: 3&lt;/div&gt;
And now we can double-check our setting:
&lt;div class="codesnippet"&gt;
C:\&amp;gt;snmpget -c community -v 1 localhost .1.3.6.1.4.1.232.6.2.5.1.0&lt;br /&gt;
SNMPv2-SMI::enterprises.232.6.2.5.1.0 = INTEGER: 3&lt;/div&gt;
It does appear that a reboot is necessary for this change to take effect, though (HP System Management Homepage still reports ASM as enabled after this change).  That’s unfortunate, and if anyone has a notion if this will take effect without a reboot, it’d be great to hear about that.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-3729038899800525879?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/3729038899800525879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/04/disabling-asr-on-windows-server.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3729038899800525879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3729038899800525879'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/04/disabling-asr-on-windows-server.html' title='Disabling ASR on a Windows Server'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_QFTS-w4RNtM/S7TEaTHl7II/AAAAAAAAAJo/GOzidEGReiY/s72-c/snmp_settings_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2203044760475934150</id><published>2010-01-14T11:04:00.009-06:00</published><updated>2011-12-23T09:40:18.987-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Adding an Oracle home to an agent inventory</title><content type='html'>When an Oracle inventory is saved in a non-standard location, the Oracle Grid Control agent can be unable to enumerate the software that is in that Oracle Home. This is true even when it can find the home itself.&lt;br /&gt;
In OEM, you’ll run into an error like that below when you click on the home in the Targets list:&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
Error Could not find Oracle Home &lt;em&gt;&amp;lt;ORACLE_HOME&amp;gt;&lt;/em&gt;&lt;code&gt; in the inventory collected for &lt;/code&gt;&lt;em&gt;&amp;lt;hostname&amp;gt;&lt;/em&gt;&lt;/div&gt;
&lt;em&gt;&lt;/em&gt;&lt;br /&gt;
We’ll use TESTSRV2 as a troubleshooting example.&lt;br /&gt;
&lt;span id="fullpost"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;Locate the oraInst.loc file&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;  The oraInst.loc file contains the inventory for all of the Oracle software. Normally, Oracle maintains a single copy of this file, but when one is saved in a non-standard directory, it can get left out.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
  The first thing we’ll do is find out where all of the oraInst.loc files are located.&lt;br /&gt;
  &lt;div class="codesnippet"&gt;
[root@testsrv2 ~]# locate oraInst.loc&lt;br /&gt;
/oracle/install/920/scripts/silent/oraInst.loc&lt;br /&gt;
/oracle/install/817/scripts/silent/oraInst.loc&lt;br /&gt;
/OLD_TREES/a18_1/oracle/install/920/scripts/silent/oraInst.loc
/OLD_TREES/a18_1/oracle/install/817/scripts/silent/oraInst.loc&lt;br /&gt;
/app/oraInventory/oraInst.loc&lt;br /&gt;
/app/oracle/product/920/oraInst.loc&lt;br /&gt;
/app/oracle/product/102/oraInst.loc&lt;br /&gt;
/app/oracle/OracleHomes/agent10g/oraInst.loc&lt;/div&gt;
We can see that there are a lot of oraInst.loc files on this server. The file in the OracleHome/agent10g directory is the agent inventory. Some looking shows that the oraInst.loc file in the /app/oracle/product/102 directory is the most recent of all of the others, so we’ll use that one.&lt;br /&gt;
  &lt;h3&gt;
Add the additional inventory file to the agent search&lt;/h3&gt;
There is a file that the agent uses to add inventories to its search list. This is the OUInventories.add file in the &amp;lt;AGENT_HOME&amp;gt;/sysman/config/ directory. So we edit it:&lt;br /&gt;
  &lt;div class="codesnippet"&gt;
[root@testsrv2 ~]# vim /app/oracle/OracleHomes/agent10g/sysman/config/OUIinventories.add&lt;br /&gt;
[root@testsrv2 ~]#&lt;/div&gt;
And add the appropriate line:&lt;br /&gt;
  &lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/S09OkGmf_TI/AAAAAAAAAJI/m3-17rlbsTs/s1600-h/image%5B3%5D.png"&gt;&lt;img alt="image" border="0" height="364" src="http://lh4.ggpht.com/_QFTS-w4RNtM/S09Okl-KUiI/AAAAAAAAAJM/MNBeKCoez_g/image_thumb%5B1%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="595" /&gt;&lt;/a&gt; &lt;br /&gt;
  Save that file and exit the editor.&lt;br /&gt;
  &lt;h3&gt;
Restart the agent&lt;/h3&gt;
This change requires a restart of the agent:&lt;br /&gt;
  &lt;div class="codesnippet"&gt;
/app/oracle/OracleHomes/agent10g/bin/emctl stop agent
/app/oracle/OracleHomes/agent10g/bin/emctl start agent&lt;/div&gt;
&lt;h3&gt;
Refresh the Host Configuration&lt;/h3&gt;
Having restarted the agent, we now have to tell Grid Control to refresh its list of the software on that host:&lt;br /&gt;
  Navigate to Depoloyments -&amp;gt; Refresh Host Configuration&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/S09Ok-Co7OI/AAAAAAAAAJQ/38MF8LKasXM/s1600-h/clip_image006%5B3%5D.jpg"&gt;&lt;img alt="clip_image006" border="0" height="47" src="http://lh6.ggpht.com/_QFTS-w4RNtM/S09OlLdiSDI/AAAAAAAAAJU/EEXPqs65xXI/clip_image006_thumb.jpg?imgmax=800" style="border: 0px none; display: inline;" title="clip_image006" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;
  &lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/S09OlFbLi0I/AAAAAAAAAJY/Hdh-S_yyB_g/s1600-h/clip_image004%5B3%5D.jpg"&gt;&lt;img alt="clip_image004" border="0" height="97" src="http://lh6.ggpht.com/_QFTS-w4RNtM/S09Olkf4a2I/AAAAAAAAAJc/glpBKoqYnJY/clip_image004_thumb.jpg?imgmax=800" style="border: 0px none; display: inline;" title="clip_image004" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;
  Add the host to the “selected hosts” pane and click on the “refresh hosts” button. This will populate the appropriate agent data, and you’re done.&lt;br /&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2203044760475934150?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2203044760475934150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/01/adding-oracle-home-to-agent-inventory.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2203044760475934150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2203044760475934150'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/01/adding-oracle-home-to-agent-inventory.html' title='Adding an Oracle home to an agent inventory'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_QFTS-w4RNtM/S09Okl-KUiI/AAAAAAAAAJM/MNBeKCoez_g/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-1229884554129907967</id><published>2010-01-04T13:33:00.004-06:00</published><updated>2011-12-23T09:41:36.430-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Backup'/><title type='text'>Oracle Database loses its OEM configuration after a Cold Backup</title><content type='html'>This was an annoying problem that took awhile to track down.  In short:  after our scheduled cold backups, an Oracle (11g) database would lose its configuration in Oracle Enterprise Manager.  It would present a "Metric Collection Error" that would go away after reconfiguring the database.  The fix, as it turned out, was pretty simple, but it took awhile to tease out. &lt;span id="fullpost"&gt;  The problem was that the trace directory (bdump in 10g) was too full.  Specifically, the metric collection (the process by which OEM gathers data about the database) was timing out.  We ruled out performance problems on the database side; the system is not utilized much at all.  Instead, we discovered that because there were a lot of files in the trace directory (&amp;gt; 31k), it was taking a long time for the OEM agent to get to the alert log, which is one of the metrics that it collects.  This was hinted at in the emagent.trc file:  &lt;/span&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;2010-01-04 13:01:53,087 Thread-47647632 ERROR TargetManager: TIMEOUT reached in computing dynamic properties for target TESTDB,&lt;br /&gt;
oracle_database::compute timings were [decideIncludeDB:0-0] [SystemTablespaceNumber:0-0] [SysauxTablespaceNumber:0-0 ... &lt;br /&gt;
&lt;span style="color: #660000;"&gt;[DeduceAlertLogFile:1-1]&lt;/span&gt; [GetCPUCount:1-1] [EnabledFeatures:1-1] [GetOSMInstance:1-1] [GetNLSParam:1-1] [GetAdrBase:1-(1)]&lt;/span&gt;&lt;/div&gt;
So you can see above that one of the things it was trying to do was get at the alert log.  It took a long time to enumerate all of the small files in the trace directory, so we shut down the instance, cleared out the trace directory, and restarted the instance.  That took care of the problem.  In troubleshooting this problem, we also increased the dynamic properties timeout setting (dynamicPropsComputeTimeout_oracle_database) in the emd.properties file (in [agent_home]/sysman/config), changing the value from the default (120) to a larger setting (240).  That did not help, though it's a good troubleshooting step, should you run into a similar problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-1229884554129907967?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/1229884554129907967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2010/01/oracle-database-loses-its-oem.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1229884554129907967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1229884554129907967'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2010/01/oracle-database-loses-its-oem.html' title='Oracle Database loses its OEM configuration after a Cold Backup'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-7345863790174519627</id><published>2009-12-01T13:24:00.007-06:00</published><updated>2011-12-23T09:42:54.028-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Installing Oracle Enterprise Manager 10.2 on Windows Server 2008</title><content type='html'>One would suppose that installing OEM on Windows Server 2008 would be like installing it pretty much in any other Windows environment; Oracle did a pretty good job of making it easy to install and run out-of-the-box under earlier versions of Windows, so it should be easier with the latest version of OEM and Windows, correct?&lt;br /&gt;
Wrong.  There are a variety of reasons, and we’ll run through them in this exercise, as we install Oracle Enterprise Manager 10.2.0.5 on Windows Server 2008 (NOT R2; this is important!).  &lt;br /&gt;
As an added bonus, we’ll get the OEM repository database up to 11g.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;
  &lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;Make sure you’ve got the right operating system&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;  Start with the OS:  Windows Server 2008, 32-bit (OEM is a 32-bit application, and putting it on a 64-bit system is asking for trouble).  Windows Server 2008 R2 begins the march to 64-bit only, so make sure you're not installing it.&lt;br /&gt;
  &lt;h3&gt;
Install OEM 10.2.0.2&lt;/h3&gt;
First, we have to download OEM 10.2.0.2, as that’s the latest version that is available as something besides an upgrade.  You can get that install here:  &lt;a href="http://www.oracle.com/technology/software/products/oem/index.html" title="http://www.oracle.com/technology/software/products/oem/index.html"&gt;http://www.oracle.com/technology/software/products/oem/index.html&lt;/a&gt;.  Note that 10.2.0.3 and above are only available as patch installers, rather than as a full installation.&lt;br /&gt;
  Don’t install OEM, yet.&lt;br /&gt;
  &lt;h2&gt;
Install Oracle Database 10.2.0.3&lt;/h2&gt;
The database that ships with OEM 10.2.0.2 is v10.1.0.4, which doesn't work on Windows Server 2008.  So you have to create the repository database yourself.  &lt;br /&gt;
  If you find yourself installing OEM and getting an error starting the database (installation fails when configuring the database), this is your problem.  You’ll also see the following in the application event log:&lt;br /&gt;
  &lt;div class="codesnippet"&gt;
Faulting application ORACLE.EXE, version 10.1.0.4&lt;/div&gt;
Again, this is because earlier versions of Oracle don't work on Server 2008; make sure you've downloaded the correct version as below.&lt;br /&gt;
  Installation files for Win 2008 32-bit can be downloaded &lt;a href="http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10203vista.html"&gt;here&lt;/a&gt;. Note that there is a separate installation for Vista and Windows Server 2008; make sure you get that.&lt;br /&gt;
  &lt;u&gt;Don't create a database as a part of the installation.&lt;/u&gt;&lt;br /&gt;
  After installation, run the Database Configuration Assistant and create a basic database &lt;em&gt;without configuring it for Enterprise Manager console&lt;/em&gt;.&lt;br /&gt;
  Once the database is created, connect to it as sys and run the following commands to prepare the system for OEM.  Note that the below commands assume you’re using an spfile.  Make sure you’ve created one before running this.&lt;br /&gt;
  &lt;div class="codesnippet"&gt;
alter system set session_cached_cursors=200 scope=spfile;
alter system set aq_tm_processes=1 scope=spfile;
alter system set job_queue_processes=10 scope=both;
@?/rdbms/admin/dbmspool.sql;
shutdown immediate;
startup; &lt;/div&gt;
&lt;h2&gt;
Run Net Configuration Assistant&lt;/h2&gt;
This will create the listener. &lt;br /&gt;
  &lt;div style="font-family: courier new;"&gt;
Start -&amp;gt; All Programs -&amp;gt; Oracle - OraDb10g_home1 -&amp;gt; Configuration and Management Tools -&amp;gt; Net Configuration Assistant&lt;/div&gt;
Net Configuration Assistant won't update your tnsnames.ora file for your database; you'll need to make sure you do that.  Net manager will, should you want to use a GUI to get that done.  You can, of course, use other net naming methods, as well…&lt;br /&gt;
  &lt;h2&gt;
Install OEM with the Option for using an existing database&lt;/h2&gt;
&lt;h6&gt;
Tell setup not to check for system prerequisites&lt;/h6&gt;
Windows Server 2008 didn't exist when 10.2.0.2 was created, so when installing, you've first got to tell it not to check system prerequisites:&lt;br /&gt;
  &lt;pre&gt;&lt;div class="codesnippet"&gt;
setup.exe -IgnoreSysPrereqs&lt;/div&gt;
&lt;/pre&gt;
Otherwise, you'll get this error:

&lt;pre&gt;&lt;div class="codesnippet"&gt;
Checking operating system version: must be 4.0, 5.0, 5.1 or 5.2. Actual 6.0
Failed &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/div&gt;
&lt;/pre&gt;
&lt;h6&gt;
Set the TimeZone&lt;/h6&gt;
This seems silly, but it appears to have been a fatal error in bringing up the agent.  If the installation fails at configuring the agent, this might be the problem.  Here is the relevant section of the log at
&lt;code&gt;c:\oraclehomes\agent10g\sysman\log\emagent.nohup&lt;/code&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
Tue Nov 17 12:19:39 2009::The agentTZRegion value in C:\OracleHomes\agent10g/sysman/config/emd.properties is not in agreement with what agent thinks it should be.
Please verify your environment to make sure that TZ setting has not changed since the last start of the agent.&lt;/div&gt;
So open the emd.properties ($OracleHome\agent10g\sysmand\config\emd.properties) file and change the agentTZRegion line from GMT to the appropriate time zone code.

&lt;h6&gt;
Change the local firewall settings&lt;/h6&gt;
Open ports 1159, 4889, and 1521 to allow Oracle and OEM to communicate.
&lt;h6&gt;
Test OEM 10.2.0.2&lt;/h6&gt;
Version 10.2.0.5 requires that 10.2.0.2 be working before installing it, so make sure OEM is providing basic functionality before you start with the 10.2.0.5 installation.

&lt;h6&gt;
Upgrade OEM to 10.2.0.5&lt;/h6&gt;
Once 10.2.0.2 is working, run the install to upgrade it to v10.2.0.5.
Stop enterprise manager Start -&amp;gt; All Programs -&amp;gt; Oracle application server -&amp;gt; Stop EnterpriseManager&lt;br /&gt;


If you don't do this, you'll get the following error:&lt;br /&gt;
&lt;img alt="image" border="0" height="226" src="http://lh4.ggpht.com/_QFTS-w4RNtM/SxVtYUl1mlI/AAAAAAAAAII/foRz7eWj6mo/image%5B4%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="398" /&gt; &lt;br /&gt;

&lt;pre&gt;Management Servers cannot be connected to the management repository during upgrade&lt;/pre&gt;
They tell you to wait four minutes after stopping the server, and they're not kidding; you really do have to wait.
Run setup.exe from the &lt;a href="http://www.oracle.com/technology/software/products/oem/index.html"&gt;OEM download&lt;/a&gt;. &lt;br /&gt;
When it asks for the IAS_ADMIN password, this is the password you entered to secure the agent communication.  &lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/SxVtY6cIEDI/AAAAAAAAAIM/o2SKiRXPBxE/s1600-h/image%5B8%5D.png"&gt;&lt;img alt="image" border="0" height="362" src="http://lh6.ggpht.com/_QFTS-w4RNtM/SxVtZaJnxnI/AAAAAAAAAIQ/oHuSi8Cvlqs/image_thumb%5B3%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="466" /&gt;&lt;/a&gt; &lt;br /&gt;
Once the upgrade to 10.2.0.5 is complete, make sure that OEM still is working.  (Browser to your server on port 1159.)  Having verified that, we'll start to upgrade the database.

&lt;h2&gt;
Upgrade the database to 11g&lt;/h2&gt;
Now that we’ve got OEM up to 10.2.05, we have the option of running the back-end database on 11g.  Here’s how to get that:

First install 11g on the same system &lt;em&gt;without creating a database&lt;/em&gt; into a new Oracle Home.  Suggested:  c:\oracle\product\11.1.0
use c:\oracle as the Oracle Base location.&lt;br /&gt;
Once installation is complete, run the DBUA (DataBase Upgrade Assistant) and select the instance you want to upgrade.  Don't move the database files when doing the upgrade unless you had them stored in the oracle_home from 10g.
DBUA takes a long time to run.&lt;br /&gt;
&lt;h4&gt;
Re-set the Sys password and parameter&lt;/h4&gt;
After upgrading to 11g, the agent likely will not be able to connect to the OEM instance anymore.  This is pretty easy to fix:
in the OEM instance, make sure the following parameter is set:
&lt;br /&gt;
&lt;pre&gt;alter system set remote_login_passwordfile=exclusive scope=spfile;&lt;/pre&gt;
Then make sure you've got a pwd file:&lt;br /&gt;
&lt;pre&gt;c:\oracle\product\11.1.0\db_1\dbs\orapwd file=C:\oracle\product\11.1.0\db_1\database\pwdSID.ora password=xxxxxx entries=5&lt;/pre&gt;
&lt;em&gt;Note that the above command has to be run as administrator&lt;/em&gt; (right-click on the cmd icon and select "Run as administrator").
Now log in to OEM and click on &lt;strong&gt;Targets -&amp;gt; All Targets&lt;/strong&gt;.  Select the database instance and click the configure button (see below)&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/SxVtZho7QsI/AAAAAAAAAIU/_ALRyR1ob-g/s1600-h/image%5B12%5D.png"&gt;&lt;img alt="image" border="0" height="202" src="http://lh6.ggpht.com/_QFTS-w4RNtM/SxVtZ9qlALI/AAAAAAAAAIY/eMGHL8eTUmc/image_thumb%5B5%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="496" /&gt;&lt;/a&gt; &lt;br /&gt;
Re-set the sys password (making sure it's set to connect as sysdba) and save your changes.  Now restart the instance and the agent; you should be good to go.
&lt;h4&gt;
Troubleshooting&lt;/h4&gt;
If installing OEM fails with a "RepManager Create Repository Error = 14" message, then you probably need to get rid of some DB users and objects.  The following command will do this (from support doc ID # 358627.1)&lt;br /&gt;
&lt;pre&gt;repmanager [hostname] 1521 [SID] -action drop&lt;/pre&gt;
There's another gotcha in that command, though:  it has to be run with Windows' administrator privileges.  If you see the following when attempting this command, you need to start a command console as administrator.&lt;br /&gt;
&lt;pre&gt;&lt;div class="codesnippet"&gt;
Enter repository user name : sysman
Getting temporary tablespace from database...
Found temporary tablespace: TEMP
Checking SYS Credentials ... Access is denied.
Failed
SYS credentials or connect string is invalid.
&lt;/div&gt;
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-7345863790174519627?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/7345863790174519627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/12/installing-oracle-enterprise-manager.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7345863790174519627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7345863790174519627'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/12/installing-oracle-enterprise-manager.html' title='Installing Oracle Enterprise Manager 10.2 on Windows Server 2008'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_QFTS-w4RNtM/SxVtYUl1mlI/AAAAAAAAAII/foRz7eWj6mo/s72-c/image%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5233017551450658138</id><published>2009-09-04T15:54:00.020-05:00</published><updated>2011-12-23T09:51:49.891-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Integration Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>An Introduction to SSIS - A Beginning Step-by-Step Tutorial</title><content type='html'>SQL Server Integration Services (SSIS) is a *really* powerful data
transformation and import tool; it allows for all kinds of data
manipulation, both between databases and within them.
&lt;br /&gt;
The problem is that it’s not entirely intuitive; the learning curve is steep.  But you really shouldn’t let that stop you from trying it out:  once you’ve got the basics, it’s really quite accessible.&lt;br /&gt;
In this series of posts, we’ll do some basic, step-by-step data manipulation with SSIS, starting with importing data from a CSV file into a SQL Server 2008 database.  We’ll move on to copying data between Oracle and SQL Server.
&lt;br /&gt;
For more complicated data, bulk insert allows for some reasonably full choices.  You can read about using it in my post &lt;a href="http://lanestechblog.blogspot.com/2008/08/sql-server-bulk-insert-using-format.html"&gt; here&lt;/a&gt;.
&lt;span id="fullpost"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;
Importing data from a CSV file into SQL Server
&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;SQL Server allows for a few ways to import data from a text file, most directly with the &lt;a href="http://msdn.microsoft.com/en-us/library/ms141209.aspx"&gt;import wizard&lt;/a&gt;, which is a pretty accessible way to import uncomplicated data.  This, by the way, uses SSIS in doing the import, though it wraps it all in a wizard.
&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;  SSIS, though, offers the most flexibility, both in terms of data source and destination, as well as what you’d like to do with the data as you’re copying it.
&lt;br /&gt;
&lt;h3&gt;
    How do I get SSIS?
&lt;/h3&gt;
SSIS is included with SQL Server 2005 and 2008.  It’s installed by default, and you can specify its installation specifically by selecting the “Integration Services” components of SQL Server when you’re doing the installation.
&lt;br /&gt;
Note, by the way, that SSIS does not require a SQL Server instance in order to run.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt; &lt;br /&gt;
&lt;h3&gt;
    How do I use SSIS?
&lt;/h3&gt;
Ah, here is where the rubber hits the road.  The short answer is:  you develop packages for SSIS to use with the SQL Server Business Intelligence Development Studio (whew!).  We’ll call it BIDS from now on.  Packages that you create are run either through the development studio or on a server with Integration Services installed; we’ll begin with a simple and uncomplicated import from a standard, unformly-formatted CSV file:
&lt;br /&gt;
&lt;h1&gt;
    Importing Uniform Data using SSIS
&lt;/h1&gt;
Let’s begin with a CSV file that looks like this:
&lt;br /&gt;
  &lt;div class="codesnippet"&gt;
Last Name,First Name,Phone,Age
Lastname1,Firstname1,555-555-1111,25
Lastname2,Firstname2,555-555-1112,30
Lastname3,Firstname3,555-555-1113,55
Lastname4,Firstname4,555-555-1114,84
Lastname5,Firstname5,555-555-1115,22
Lastname6,Firstname6,555-555-1116,44
Lastname7,Firstname7,555-555-1117,66
Lastname8,Firstname8,555-555-1118,31
Lastname9,Firstname9,555-555-1119,30
Lastname10,Firstname10,555-555-1120,21&lt;/div&gt;
Let’s save this to a file named test.csv.
&lt;br /&gt;
&lt;h3&gt;

Launch BIDS
&lt;/h3&gt;
Click on the start button and browse to &lt;strong&gt;All Programs –&amp;gt; Microsoft SQL Server 2008 –&amp;gt; SQL Server Business Intelligence Development Studio&lt;/strong&gt;.
&lt;br /&gt;
I hope I don’t have to type that whole name again.
&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/SqF-hygndLI/AAAAAAAAAGQ/ROPlQIBReVo/s1600-h/image%5B4%5D.png"&gt;
&lt;img align="right" alt="image" border="0" height="259" src="http://lh3.ggpht.com/_QFTS-w4RNtM/SqF-iPixb5I/AAAAAAAAAGU/Ceq2anXWHeE/image_thumb%5B2%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="351" /&gt;&lt;/a&gt;
&lt;br /&gt;

When it launches, you’ll see a screen that looks something like the image to the right (click for a larger version).
&lt;br /&gt;

In the top-left pane, you’ll see a few options (below).  Click on the &lt;strong&gt;Create Project&lt;/strong&gt; link to start a new project. &lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/SqF-ieABYaI/AAAAAAAAAGY/Voxt8BO3GVI/s1600-h/image%5B7%5D.png"&gt;
&lt;img alt="image" border="0" height="244" src="http://lh5.ggpht.com/_QFTS-w4RNtM/SqF-iojNx7I/AAAAAAAAAGc/YDv3OuTx44M/image_thumb%5B3%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="218" /&gt;&lt;/a&gt;
&lt;br /&gt;
A new window will open, asking what kind of project you’d like to create.  Select “Integration Services Project” and give it a name. You can choose a shorter path to which to save your project, as well.  Click on OK to begin designing your project. &lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/SqF-i0eYYzI/AAAAAAAAAGg/Nkzfbm26EnU/s1600-h/image%5B11%5D.png"&gt;
&lt;img alt="image" border="0" height="400" src="http://lh3.ggpht.com/_QFTS-w4RNtM/SqF-jPlRTBI/AAAAAAAAAGk/Zmv0Y-R54UM/image_thumb%5B5%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="582" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;h3&gt;

Create A Source Connection
&lt;/h3&gt;
When you click on OK, you’ll see a window like the one below.  What we want to do is create a new connection,  which is just another way of saying that we want to set up a data source.  In our case, we’re going to use a CSV file, so right-click on the Connection Manager pane at the bottom and select “New Flat File Connection.”
&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb7r-LbzGI/AAAAAAAAAGo/SQ4whVMllM4/s1600-h/image15.png"&gt;
&lt;img alt="image" border="0" height="550" src="http://lh6.ggpht.com/_QFTS-w4RNtM/Sqb7suExOWI/AAAAAAAAAGs/6gatqpJihXA/image_thumb7.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="568" /&gt;&lt;/a&gt;
&lt;br /&gt;
That will bring up the following page.  I’ve gone ahead and filled in the details.&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/SqF-hygndLI/AAAAAAAAAGQ/ROPlQIBReVo/s1600-h/image%5B4%5D.png"&gt; &lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/Sqb7tAb1M_I/AAAAAAAAAGw/Gnq7DTE_RJs/s1600-h/image19.png"&gt;
&lt;img alt="image" border="0" height="507" src="http://lh3.ggpht.com/_QFTS-w4RNtM/Sqb7tuOasxI/AAAAAAAAAG0/iIYdTmMCbig/image_thumb9.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="501" /&gt;&lt;/a&gt;
&lt;br /&gt;
Basically, we’re telling SSIS that we want to set up a data source using this file (test.csv).  You can see that it’s (by default) set to parse the file as a “delimited” text file, which is what a CSV file is.  Note that the first row in our file contains the names of the columns; as a result, we’ve checked “Column names in the first data row.”  Leave that blank if your data doesn’t have column names in the first row.
&lt;br /&gt;
Likewise, SSIS allows you to skip &lt;em&gt;n&lt;/em&gt; rows before looking at the data.  This is useful, especially, when using automated processes that insert a lot of commands or comments at the front of the file. &lt;br /&gt;
One other piece of this screen is very useful, such that it’s worth digressing just a bit:  the “Text qualifier” field allows you to define a character that will set a field as a text string.  This usually is a double quote.  Lots of times you’ll run into a CSV that looks something like this:
&lt;br /&gt;

&lt;div class="codesnippet"&gt;
FirstName,LastName,Birthdate
Brad,Benson,3/3/1970
Sam,"Watson, Jr.",7/20/1971&lt;/div&gt;
(This is an example from a comment on &lt;a href="http://lanestechblog.blogspot.com/2008/08/sql-server-bulk-insert-using-format.html"&gt; another post on bulk insert&lt;/a&gt; here.)

You can see the problem:  there’s a comma in the person’s first name, and it’s set apart by quotes.  Bulk insert will parse that first name as two separate fields.

Using this Text qualifier field, SSIS will render the above CSV correctly, thus:
&lt;table border="1" cellpadding="2" cellspacing="0" style="width: 301px;"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td valign="top" width="100"&gt;FirstName &lt;/td&gt; &lt;td valign="top" width="100"&gt;LastName &lt;/td&gt; &lt;td valign="top" width="99"&gt;Birthdate &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td valign="top" width="100"&gt;Brad &lt;/td&gt; &lt;td valign="top" width="100"&gt;Benson &lt;/td&gt; &lt;td valign="top" width="99"&gt;3/3/1970 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td valign="top" width="100"&gt;Sam &lt;/td&gt; &lt;td valign="top" width="100"&gt;Watson, Jr. &lt;/td&gt; &lt;td valign="top" width="99"&gt;7/20/1971 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;
&lt;h2&gt;
OK, back to our task.
&lt;/h2&gt;
You can take a look at the settings in this window; for our purposes, the defaults should work nicely.  You can preview the data by clicking on the &lt;strong&gt;preview&lt;/strong&gt; link on the left-hand side; this should show you the contents of our CSV file, broken down into a table.
&lt;br /&gt;
&lt;h3&gt;
        Create a Destination Connection
&lt;/h3&gt;
Now that we’ve got the source defined, we need to do something similar for the destination.  Right-click in the connection manager window again and select “New OLE DB Connection”.  Click on the “New” button to create a new connection.
&lt;br /&gt;
When you do, you’ll see a window like that below:
&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb7ubVNyjI/AAAAAAAAAG4/ERKj9wpqR9o/s1600-h/image23.png"&gt;
&lt;img alt="image" border="0" height="438" src="http://lh4.ggpht.com/_QFTS-w4RNtM/Sqb7u4WKjeI/AAAAAAAAAG8/7mGZhkktL54/image_thumb11.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="570" /&gt;&lt;/a&gt;
&lt;br /&gt;
Fill in the server name and database name appropriately and click on OK.  I’ve selected the adventureworks database.  You’ll notice that there’s not a place here to name the connection; that’s OK, because it’ll be named SERVERNAME\.DBName.
&lt;br /&gt;
&lt;h3&gt;
        Create a Data Flow Task
&lt;/h3&gt;
SSIS uses workflows to step through its process, and most of your work will be done in the data flow task.  Note that the data flow task will contain other sub-tasks.
&lt;br /&gt;
While in the Control Flow tab, mouse over the Toolbox in the top-left corner (highlighted below). &lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/Sqb7vSiXPdI/AAAAAAAAAHA/7lsxThmwUlM/s1600-h/image%5B5%5D.png"&gt;
&lt;img alt="image" border="0" height="185" src="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb7vwLvlvI/AAAAAAAAAHE/yofC_pWJRts/image_thumb%5B2%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="369" /&gt;&lt;/a&gt;
&lt;br /&gt;
When you do, the Toolbox will open, as below:
&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/Sqb7wdu6esI/AAAAAAAAAHI/Q-TL_GPnL1Q/s1600-h/image%5B15%5D.png"&gt;
&lt;img align="left" alt="image" border="0" height="467" src="http://lh3.ggpht.com/_QFTS-w4RNtM/Sqb7yLDUHRI/AAAAAAAAAHM/Sf8QGK87ugI/image_thumb%5B10%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="198" /&gt;&lt;/a&gt;
&lt;br /&gt;

Click on the “Data Flow Task” item, and drag it to the main screen. You’ll see an icon like that below.  Double-click on that icon to open it.
&lt;br /&gt;

&lt;a href="http://lh3.ggpht.com/_QFTS-w4RNtM/Sqb7ybR7mwI/AAAAAAAAAHQ/nPaSM9qbemU/s1600-h/image%5B18%5D.png"&gt;
&lt;img alt="image" border="0" height="126" src="http://lh6.ggpht.com/_QFTS-w4RNtM/Sqb7yuZpqKI/AAAAAAAAAHU/avilRIv-RLk/image_thumb%5B11%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="229" /&gt;&lt;/a&gt;
&lt;br /&gt;

When you double-click on the task, it appears that you have just erased it, but in reality, you’ve changed to the Data Flow tab; look at the top of the screen, and you’ll see that you’re no longer on the control flow tab.  You can go back and forth between these as you choose.
&lt;br /&gt;
&lt;h4&gt;
        Add the Source task
&lt;/h4&gt;
Now that we’re editing our data flow task, click on the toolbox again to drag the &lt;strong&gt;Flat File Source&lt;/strong&gt; to the main screen.  By default, it’ll be populated with the CSV connection we set up earlier.
&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/Sqb7z3toU3I/AAAAAAAAAHY/fRzQvusvbOA/s1600-h/image%5B31%5D.png"&gt;
&lt;img alt="image" border="0" height="225" src="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb70fhtgZI/AAAAAAAAAHc/ZDT5aTJBc_g/image_thumb%5B18%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="508" /&gt;&lt;/a&gt;
&lt;br /&gt;
One thing to note is the “Retain null values from the source as null values in the data flow.”  This is disabled by default, which means that null values in the source will be treated as empty strings, instead.
&lt;br /&gt;
You can click on the Preview button to double-check your file.
&lt;br /&gt;
&lt;h4&gt;
        Create the Data Destination
&lt;/h4&gt;
Now that we’re reading the data, we need to insert it into the database.  Click on the Toolbox again and scroll down to the Data Flow Destinations section.  Drag the &lt;strong&gt;OLE DB Destination&lt;/strong&gt; to the main window.
&lt;br /&gt;
Before we can write any data, we have to tell SSIS how to map the data.  In our example, we’re going to create a new table in the Adventureworks database, but the process for using an existing table is the same.
&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb707MzMwI/AAAAAAAAAHg/SHOwsHaxPBE/s1600-h/image%5B35%5D.png"&gt;
&lt;img align="left" alt="image" border="0" height="180" src="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb71DNGr4I/AAAAAAAAAHk/LBcKKbbAoYk/image_thumb%5B20%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="185" /&gt;&lt;/a&gt;First, click on the Flat File source icon and drag the green arrow to the OLE DB Destination icon.
&lt;br /&gt;


Next, double-click on the Destination icon to edit it:
Notice that this also allows you to keep nulls.  In our example, we’re going to create a new table, but if you have a table already created, you can select it from the table drop-down menu. &lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb71uoAKCI/AAAAAAAAAHo/Aapk6jhZT3U/s1600-h/image%5B44%5D.png"&gt;
&lt;img alt="image" border="0" height="419" src="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb72dABiHI/AAAAAAAAAHs/CSF9OEIZ2KE/image_thumb%5B25%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="399" /&gt;&lt;/a&gt;
&lt;br /&gt;
Clicking on the &lt;strong&gt;New…&lt;/strong&gt; button will bring the the following screen:
&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_QFTS-w4RNtM/Sqb7200s-FI/AAAAAAAAAHw/jX-2k1cc9Cg/s1600-h/image%5B56%5D.png"&gt;
&lt;img align="left" alt="image" border="0" height="141" src="http://lh3.ggpht.com/_QFTS-w4RNtM/Sqb73QhLSWI/AAAAAAAAAH0/iCAqu7B6Wig/image_thumb%5B33%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="343" /&gt;&lt;/a&gt; Change the table name in the SQL statement (I chose “importTest”).  Of course, we’d also normally want to change the data types; the age field would be better as an integer field, and we wouldn’t normally want the phone number to be a 50-character field.  We’ll leave it with defaults for our demonstration, however.  Click on OK.
&lt;br /&gt;
Finally, we need to set the mappings:  click on the Mappings option on the left-hand side of the screen:
&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_QFTS-w4RNtM/Sqb73ywyGSI/AAAAAAAAAH4/x6iX0cNsoKg/s1600-h/image%5B62%5D.png"&gt;
&lt;img alt="image" border="0" height="301" src="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb7436zQQI/AAAAAAAAAH8/MMu13JZAld8/image_thumb%5B37%5D.png?imgmax=800" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="image" width="418" /&gt;&lt;/a&gt;
&lt;br /&gt;
The defaults should be fine for our purposes, so you can click on OK.
&lt;br /&gt;
&lt;h3&gt;
        Test it out
&lt;/h3&gt;
We should be good to go.  Hit &amp;lt;F5&amp;gt; to run your package.  You
should see each step turn green as the data is read and written.
&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_QFTS-w4RNtM/Sqb75D--zCI/AAAAAAAAAIA/pDTmzXAG0Eo/s1600-h/image%5B65%5D.png"&gt;
&lt;img alt="image" border="0" height="205" src="http://lh6.ggpht.com/_QFTS-w4RNtM/Sqb75uPh7sI/AAAAAAAAAIE/M_I27jotqh4/image_thumb%5B38%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;
&lt;br /&gt;

We’ll spend some time in another post on scheduling SSIS packages;
there are a lot of things that can complicate that process.
&lt;br /&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5233017551450658138?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5233017551450658138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/09/introduction-to-ssis.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5233017551450658138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5233017551450658138'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/09/introduction-to-ssis.html' title='An Introduction to SSIS - A Beginning Step-by-Step Tutorial'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_QFTS-w4RNtM/SqF-iPixb5I/AAAAAAAAAGU/Ceq2anXWHeE/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-7260207012245224880</id><published>2009-08-05T22:25:00.005-05:00</published><updated>2009-08-06T08:38:36.939-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>ORA-29275 when Accessing a UTF8 Database with SSIS</title><content type='html'>So when I first started looking into SQL Server Integration Services (SSIS), I was told that the learning curve was steep, and that it was worth it to learn what you're doing with it.
Truly said.

SSIS presents a myriad of possibilities for data, and once you get your head around some of the terminology, creating simple transformations and data imports is a snap.

But what about when the problems you encounter span two different products?  What if one is Oracle?  What if it's 64-bit, on Linux?  UTF8?  That's really what SSIS is for, and it's possible.  But.  Lots of Googling.

Here's one roadblock I encountered in importing data from an Oracle database into SQL server, along with an unsatisfying workaround.  But it does work, and it's easy.

If you know of a better solution, I'd love to hear from you!
&lt;span id="fullpost"&gt;
&lt;h3&gt;The Problem&lt;/h3&gt;
So here's the problem in a nutshell:  the Oracle database uses a utf8 character set.  SSIS, when connecting with either the OLEDB or ADO.NET data sources, would use something else.  What, precisely, I'm unable to discern.  I can say that the Unicode setting was set to &lt;span style="font-weight: bold;"&gt;true &lt;/span&gt;in the data manager.

This was manifest by a startling Oracle error during the load from the data source:  ORA-29275, which is a "partial multibyte character" error.  This means that the data doesn't fit the database's character set, which (one assumes) is terrible:  such data is almost by definition corrupted, and getting it back reliably is a tricky proposition.  Oracle says, basically, that you've got bogus data when you see this error.

I was prepared to believe that, as this error occurred even in a simple select statement from the DB server itself.

&lt;h3&gt;The Clue&lt;/h3&gt;
The curious thing about this situation is that, in trying to figure out what was going on, another user had logged into the server using a different OS username.  When he connected to the database &lt;span style="font-style: italic;"&gt;using the same Oracle user ID&lt;/span&gt;, he didn't get any errors.

Aha.  Environment.  NLS_LANG, to be exact.  Setting that to American_America.UTF8 took care of the error on the server, and on clients running SQLPLUS, to boot.  All should be well, correct?

No.  The SSIS package continues to fail.

Oh, yes:  the registry.  Don't forget that Oracle stores client NLS data there, as well:  &lt;code&gt;HKLM/Software/Oracle/$ORACLE_HOME/NLS_LANG&lt;/code&gt;
Watch out for any dangling NLS_LANG settings in &lt;code&gt;HKLM/Software/Oracle&lt;/code&gt;

That surely will fix it, right?  Sadly, it didn't, and a desperation reboot didn't help.

&lt;h3&gt;The Work-Around&lt;/h3&gt;
So Google leads me to hints that ADO.NET and OLEDB from Oracle don't really pay much attention to the local NLS_LANG settings.  That appears to be the case, or, at least, they don't get their settings from the same place everything else does.

So, I return, sadly, to ODBC.  And it works!  It works well.  But it's so non-portable, and, let's face it:  ODBC is not anything new and shiny; it'd sure be nice to have all of our SSIS packages all new, self-contained, and .NET-ed.

So if you, like me, run into this problem, know that ODBC can be your friend.
If you, unlike me, know of a better solution, please let us know!  I'll post updates as I encounter them.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-7260207012245224880?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/7260207012245224880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/08/ora-29275-when-accessing-utf8-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7260207012245224880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7260207012245224880'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/08/ora-29275-when-accessing-utf8-database.html' title='ORA-29275 when Accessing a UTF8 Database with SSIS'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-8353900467867904433</id><published>2009-08-03T15:14:00.004-05:00</published><updated>2009-08-03T15:33:52.126-05:00</updated><title type='text'>Creating a Floppy Image in Windows</title><content type='html'>It's not too often any more that we need a floppy drive image created, but there are times (such as when accessing a server through iLO) when it's handy to have a virtual floppy drive.

There are a lot of shareware and commercial programs out there that will create a .img file from other files on your file system, but I had a hard time finding a free floppy image creation package.
&lt;span id="fullpost"&gt;
BFI (Build Floppy Image), thank goodness, still is around.  It's a very easy-to-use floppy image creation command line tool that is fully free.  It's old, and it's unsupported, but it works.

Rather than hosting the files here, I'll link to &lt;a href="http://www.nu2.nu/bfi/"&gt;BFI's home page&lt;/a&gt;.  If you find that the page or files are down, let me know, and I'll post it here.

In short, what you do is put the files you want to write to your image in their own directory.  Here's an example of its usage.

Say I want to create a floppy image file at c:\temp\myfloppy.img, containing all of the files in c:\temp\floppyfiles.  The command I'd use to do this is:
&lt;div class="codesnippet"&gt;bfi -f=c:\temp\myfloppy.img c:\temp\floppyfiles&lt;/div&gt;

That's it.  Enjoy your new (free and legal) floppy disk image!
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-8353900467867904433?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/8353900467867904433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/08/creating-floppy-image-in-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/8353900467867904433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/8353900467867904433'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/08/creating-floppy-image-in-windows.html' title='Creating a Floppy Image in Windows'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6727433716619544838</id><published>2009-07-27T22:20:00.010-05:00</published><updated>2011-12-23T09:52:59.454-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Installing Oracle on RHEL 5 (32 and 64 bit) - Part 3</title><content type='html'>In &lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64.html"&gt;part one&lt;/a&gt; of this series, we got the operating system ready for the installation of Oracle.

In &lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_26.html"&gt;part two&lt;/a&gt;, we got Oracle installed and running.

In this, our final (for now) post on Oracle and Linux, we'll look at some of the tweaks that make it better, as well as some of the surprising bumps one encounters when using Oracle on Linux.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;
&lt;span id="fullpost"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h1&gt;
&lt;span id="fullpost"&gt;Troubleshooting&lt;/span&gt;&lt;/h1&gt;
&lt;span id="fullpost"&gt;
&lt;h3&gt;
ORA-00845 - MEMORY_TARGET not supported on this system&lt;/h3&gt;
This error is common, and it occurs most frequently when the Linux /dev/shm mount point isn't large enough.  Specifically, your SGA and PGA are sized such that there isn't enough space in /dev/shm for the instance to start.

So, to fix it:
&lt;div class="codesnippet"&gt;
mount -t tmpfs shmfs -o size=1300m /dev/shm &lt;/div&gt;
where 1300m is whatever size that will at least cover your MEMORY_TARGET parameter.

Once you've got a value for /dev/shm set that works, you can add it to /etc/fstab, such that it'll be a permanent change.  Edit /etc/fstab, and add the following line, adjusting the size to fit your environment:
&lt;div class="codesnipopet"&gt;
shmfs  /dev/shm   tmpfs   size=1300m  0 0&lt;/div&gt;
&lt;h1&gt;
Enable Arrow Keys in SQLPlus&lt;/h1&gt;
One of the best things about using SQLPlus is the ability to up arrow through your command history.  As it turns out, though, this functionality isn't available in sqlplus on Linux.  It makes for a most unsatisfying experience.  Fortunately, there's a simple program -- rlwrap -- that can fix this for us.

&lt;h3&gt;
Download rlwrap&lt;/h3&gt;
Download the rlwrap archive &lt;a href="http://freshmeat.net/projects/rlwrap/"&gt;here&lt;/a&gt;, and extract it to a temporary directory.

The INSTALL document is pretty straightforward for compiling and installing it.
Once it's installed, you can create an alias using rlwrap, such that it'll provide a keyboard wrapper for sqlplus, allowing you to use the arrow keys.

&lt;h3&gt;
Create the rlwrap alias&lt;/h3&gt;
There are two thoughts on what to do with the alias for sqlplus.  I'll lay them out, and you can decide which is the better option.

&lt;span style="font-weight: bold;"&gt;Option One&lt;/span&gt; is simply to create an alias called "sqlplus", in essence replacing the program call with the alias.

This has simplicity in its favor:  whenever you or anyone else log in to the system to run sqlplus, it'll behave as it should, and you won't have to think about it.

But there's a downside, as well:  when someone calls a program by name, it's usually expected that the program is what is running.  When you create an alias using the program's name, you introduce the possibility of confusion in troubleshooting a problem later on.  Should something happen with rlwrap or one of the libraries it relies upon, sqlplus (unless called with a fully qualified path) could quit working.

The risk of confusion is especially great if the person doing the troubleshooting isn't the person who set up the alias:  then there's no chance of remembering that the alias is there.

Here, should you choose option one, is how you'd set up the rlwrap alias (we'll throw in rman as a bonus):
&lt;div class="codesnippet"&gt;
alias sqlplus='rlwrap sqlplus'&lt;br /&gt;
alias rman='rlwrap rman'&lt;/div&gt;
So enter &lt;span style="font-weight: bold;"&gt;Option Two&lt;/span&gt;.  This is just creating an alias -- just as above -- with a name besides sqlplus.

Using a name that isn't the program name has the advantage of avoiding any possible confusion about what you're doing:  if it quits working, it's easy to see if the problem lies with sqlplus or with the alias.

The downside is that it's a different command.  Sqlplus is &lt;span style="font-style: italic;"&gt;the&lt;/span&gt; program one uses to execute SQL in Oracle; it will not occur to anyone to use something else.

Here's something like what you'd use to create an alias (we'll call them sqlp and rmanp, but they can be pretty much anything):
&lt;div class="codesnippet"&gt;
alias sqlp='rlwrap sqlplus'&lt;br /&gt;
alias rmanp='rlwrap rman'&lt;/div&gt;
Both options offer something good, and both have a downside.  Pick the one that works for you, and make sure your colleagues all know about the changes you made.

&lt;h3&gt;
A third option&lt;/h3&gt;
There exist a handful of drop-in sqlplus replacements that many opt for, as well.  &lt;a href="http://gqlplus.sourceforge.net/"&gt;gqlplus&lt;/a&gt; is one of these.  For my part, I prefer to stay away from compiled replacements for sqlplus; whatever wrapper goes in front of the application, when it's all said and done I want the Oracle-supplied application communicating with the database.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6727433716619544838?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6727433716619544838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_27.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6727433716619544838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6727433716619544838'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_27.html' title='Installing Oracle on RHEL 5 (32 and 64 bit) - Part 3'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4976242313266389026</id><published>2009-07-26T09:41:00.011-05:00</published><updated>2011-12-23T09:59:10.643-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Installing Oracle on RHEL 5 (32 and 64 bit) - Part 2</title><content type='html'>In &lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64.html"&gt;part one&lt;/a&gt; of this series, we got the operating system ready for the installation of Oracle.  In this post, we'll actually install Oracle and get it up and running.

In &lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_27.html"&gt;part three&lt;/a&gt;, we'll look at some of the things you can do to make Oracle a bit more usable on the Linux platform.
&lt;span id="fullpost"&gt;
Oracle recommends using the GUI installer.  I think they're right:  it's the most accessible way to get Oracle installed.  If you only have remote access to your system, and SSH is the only remote access you've got, you can &lt;a href="http://lanestechblog.blogspot.com/2009/02/setting-up-non-persistent-remote-gui.html"&gt;set up VNC&lt;/a&gt; reasonably quickly to have remote GUI access to your system.&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span id="fullpost"&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;h1&gt;
&lt;span id="fullpost"&gt;Download and extract Oracle&lt;/span&gt;&lt;/h1&gt;
&lt;span id="fullpost"&gt;
I'll leave it to you to &lt;a href="http://www.oracle.com/technology/software/products/database/index.html"&gt;download the appropriate package&lt;/a&gt; from Oracle.  The &lt;a href="http://www.oracle.com/technology/software/products/database/xe/index.html"&gt;free version of Oracle&lt;/a&gt; (Express Edition), at the time of this writing, isn't available for 11g, so 10g is the latest version you'll be able to get.  These instructions will work for that, as well.

Unzip the install files to a temporary location.
&lt;div class="codesnippet"&gt;
mkdir /tmp/oracle
cd /tmp/oracle
unzip linux_11gR1_database.zip&lt;/div&gt;
&lt;h1&gt;
Launch the Installer&lt;/h1&gt;
The installation needs to happen as the Oracle user.  Either log in as the user Oracle, or issue the following command:
&lt;div class="codesnippet"&gt;
su - oracle&lt;/div&gt;
Then, from the temp location that has the unzipped archive, run the installer:
&lt;div class="codesnippet"&gt;
./runInstaller&lt;/div&gt;
Most of the defaults will be sufficient for your needs; I'd choose *not* to install the starter database, unless you're wanting to use it for tutorial purposes.

As an aside, it's worth noting that Oracle licenses all of its products for development/tutorial purposes without charge:
&lt;blockquote&gt;
All software downloads are free, and each comes with a Development License that allows you to use full versions of the products at no charge while developing and prototyping your applications (or for strictly self-educational purposes). In some cases, certain downloads (such as Beta releases) have licenses with slightly different terms. You can buy products with full-use licenses at any time from the online Store or from your sales representative.
(from http://www.oracle.com/technology/software/index.html)&lt;/blockquote&gt;
&lt;h1&gt;
Set up the Listener&lt;/h1&gt;
The installer does an OK job at setting up your TNS listener, but it's worth knowing how to edit your tnsnames.ora file both for troubleshooting and for adding instances to it as you install them.

Below is a sample tnsnames.ora
&lt;div class="codesnippet"&gt;
#&amp;nbsp;###&amp;nbsp;#&amp;nbsp;#&lt;br /&gt;
#  11.1 64-bit
##&lt;br /&gt;
#  Test Oracle Database&amp;nbsp;#&lt;br /&gt;
# ##############&lt;br /&gt;
oratst =
 (DESCRIPTION =
   (ADDRESS_LIST =&lt;br /&gt;
&amp;nbsp;(ADDRESS = (PROTOCOL = TCP)&lt;br /&gt;
(HOST = oraclsrv1.example.com)(PORT = 1521)))&lt;br /&gt;
(CONNECT_DATA = (SID = ORATST)&lt;br /&gt;
(SERVER = DEDICATED)))&lt;/div&gt;
The "oratst" line is the name of the database, as you want it accessed from the client.  It's most straightforward to keep this the same as the instance SID, but you can do some cool sleight-of-hand stuff with a TNSNAMES.ORA file in switching an application from one DB to another with minimal downtime.&amp;nbsp; &lt;/span&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
That is to say:  that first line with the database name can be pretty much whatever you want it to be.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
The ADDRESS line lists the DB host, and the connect_data tells the client how to address the database.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
The SERVER setting bears a little explanation.  It can be either "DEDICATED" (as above) or "SHARED".  Dedicated means that each connecting client gets its own Oracle process, while Shared means that individual connections share a pool of connection processes.  Most folks have little to no reason to use the shared connection setting.  This is a database setting, and the TNSNAMES.ORA file simply tells the client which is being used.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;For more in-depth discussion about dedicated vs. shared servers, check out &lt;a href="http://www.dba-oracle.com/t_mts_multithreaded_servers_shared.htm"&gt;this link&lt;/a&gt;.  It's a pretty good run-down of the strengths and (mostly) weaknesses of shared servers.

&lt;h1&gt;
Test your connection&lt;/h1&gt;
Try the following command to make sure that you've got your tnsnames set up correctly:
&lt;div class="codesnippet"&gt;
tnsping &amp;lt;DB_SID&amp;gt;&lt;/div&gt;
where DB_SID is the name listed for your database in your tnsnames.ora file.

You should get something like the output below:
&lt;div class="codesnippet"&gt;
[oracle@tcudspc1 admin]$ tnsping oratst&lt;br /&gt;
TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 26-JUL-2009 20:39:42

Copyright (c) 1997, 2007, Oracle.  All rights reserved.&lt;br /&gt;
&amp;nbsp;Used parameter files:

Used TNSNAMES adapter to resolve the alias
(CONNECT_DATA = (SID = oratst)(SERVER = DEDICATED)))U)(PORT = 1521)))&lt;br /&gt;
OK (10 msec)&lt;/div&gt;
If you get something else, there's a problem, most likely either with your tnsnames.ora file.  It's also very possible that your listener process isn't running. 

Which brings us to part 3:  stopping and starting Oracle, and making it easier to use.

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4976242313266389026?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4976242313266389026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_26.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4976242313266389026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4976242313266389026'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_26.html' title='Installing Oracle on RHEL 5 (32 and 64 bit) - Part 2'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4001706494108314920</id><published>2009-07-23T21:53:00.031-05:00</published><updated>2011-12-23T10:02:18.786-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Installing Oracle on RHEL 5 (32 and 64 bit) - Part 1</title><content type='html'>With the then-hyped &lt;a href="http://www.oracle.com/technologies/linux/index.html"&gt;Oracle Enterprise Linux &lt;/a&gt;rollout, and Ellison's &lt;a href="http://www.infoworld.com/t/platforms/ellison-linux-will-wipe-microsoft-out-data-center-198"&gt;evident disdain for Microsoft&lt;/a&gt;, you'd have thought that Oracle would go out of their way to make it straightforward to install and use Oracle database on Linux.  It's not so, unfortunately.  Not that it can't--or shouldn't--be done, mind you:  it works great; you just need some persistence.

This is part one of a three-part series on Oracle on Linux.  This post looks at getting the OS ready for Oracle. 
&lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_26.html"&gt;Part 2&lt;/a&gt; looks at installing the database software, and
&lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_27.html"&gt;Part 3 &lt;/a&gt;talks about some of the things that can be done to make running and maintaining Oracle easier on Linux.

&lt;span id="fullpost"&gt;Oracle has a document &lt;a href="http://www.oracle.com/technology/pub/articles/smiley-11gr1-install.html"&gt;here&lt;/a&gt; that does a pretty good job of outlining the steps necessary to install Oracle on linux.  I quibble with some of their instructions, particularly their directions to use the package rpms from the Oracle install CD.  If they're going to go to the trouble of providing the requisite rpms, it seems like they'd also install them during the installation process, if they're needed.  Instead, it seems like a *much* better option to install them from your repository (CENTOS or RedHat are most pertinent to this guide).  They also have you using rpm, which is fine, but it won't find dependencies for you like yum will.  In any case, I do recommend that document for additional information.

It's my hope that this series will help navigate the installation process and make it easier.  I've broken this into several posts so as to keep the length of each one a little smaller, anyway.  In this post, we'll get the OS prepped and ready for the&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span id="fullpost"&gt; Oracle software installation.

&lt;/span&gt;&lt;br /&gt;
&lt;h1&gt;
&lt;span id="fullpost"&gt;Prerequisites&lt;/span&gt;&lt;/h1&gt;
&lt;span id="fullpost"&gt;
It's important to make sure you've got all the necessary software installed on your server before beginning the installation of Oracle.  They've done a better job with 11g of testing for the existence of prerequisite software, so you get some better error messages when you are lacking a particular package.  Here are the prerequisites that you don't have with a default RHEL install:
&lt;ul&gt;
&lt;li&gt;compat-libstdc++-33&lt;/li&gt;
&lt;li&gt;elfutils-libelf-devel&lt;/li&gt;
&lt;li&gt;gcc&lt;/li&gt;
&lt;li&gt;gcc-c++&lt;/li&gt;
&lt;li&gt;glibc-devel&lt;/li&gt;
&lt;li&gt;libaio-devel&lt;/li&gt;
&lt;li&gt;libstdc++-devel&lt;/li&gt;
&lt;li&gt;sysstat&lt;/li&gt;
&lt;li&gt;unixODBC&lt;/li&gt;
&lt;li&gt;unixODBC-devel&lt;/li&gt;
&lt;/ul&gt;
So:
&lt;div class="codesnippet"&gt;
yum install compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-devel libaio-devel libstdc++-devel sysstat unixODBC unixODBC-devel&lt;/div&gt;
Now, another thing that has gotten better with 11g is the documentation about prerequisites for 64-bit systems.  It turns out that you've got to have both the 64-bit &lt;span style="font-style: italic;"&gt;and&lt;/span&gt; 32-bit versions of some packages in order for things to go smoothly.  The 64-bit prereqs that aren't installed as a part of a standard RHEL install are:
&lt;ul&gt;
&lt;li&gt;compat-libstdc++-33&lt;/li&gt;
&lt;li&gt;compat-libstdc++-33 (32 bit)&lt;/li&gt;
&lt;li&gt;elfutils-libelf-devel&lt;/li&gt;
&lt;li&gt;gcc&lt;/li&gt;
&lt;li&gt;gcc-c++&lt;/li&gt;
&lt;li&gt;glibc-devel&lt;/li&gt;
&lt;li&gt;glibc-devel (32 bit)&lt;/li&gt;
&lt;li&gt;libaio-devel&lt;/li&gt;
&lt;li&gt;libstdc++-devel&lt;/li&gt;
&lt;li&gt;sysstat&lt;/li&gt;
&lt;/ul&gt;
Which translates to
&lt;div class="codesnippet"&gt;
yum install  compat-libstdc++-33 compat-libstdc++-33*.i386 elfutils-libelf-devel gcc gcc-c++ glibc-devel glibc-devel*.i386 libaio-devel libstdc++-devel sysstat&lt;/div&gt;
&lt;h1&gt;
Set up the OS for Oracle&lt;/h1&gt;
These, again, seem like things that could be done easily by the installer.  I know:  you don't want to assume folks are installing as root.  But why not, instead, require that the installation be done as root and allow the installer to choose these things from the UI?  Again, I'm not saying these things are hard, but if you're wanting to increase your install base...

Here the instructions for Oracle are quite good, BTW.

Create the user account and install directory:
&lt;div class="codesnippet"&gt;
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle

mkdir -p /oracle
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle
&amp;gt;passwd oracle
&lt;/div&gt;
Oracle uses /u01/app/oracle for their default installation location.  Seems to me that /oracle makes more sense.
In any case, pick what works for you, and use that in the commands above.

&lt;h3&gt;
Set kernel parameters and user limits&lt;/h3&gt;
Again, the Oracle docs are quite helpful on this front:
&lt;div class="codesnippet"&gt;
cat &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&amp;lt;&amp;lt;EOF&lt;br /&gt;
kernel.shmmni = 4096&lt;br /&gt;
kernel.sem = 250 32000 100 128&lt;br /&gt;
fs.file-max = 65536&lt;br /&gt;
net.ipv4.ip_local_port_range = 1024 65000&lt;br /&gt;
net.core.rmem_default=4194304&lt;br /&gt;
net.core.wmem_default=262144&lt;br /&gt;
net.core.rmem_max=4194304&lt;br /&gt;
net.core.wmem_max=262144&lt;br /&gt;
EOF&lt;br /&gt;
/sbin/sysctl -p

cat &amp;gt;&amp;gt; /etc/security/limits.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
oracle soft nproc 2047&lt;br /&gt;
oracle hard nproc 16384&lt;br /&gt;
oracle soft nofile 1024&lt;br /&gt;
oracle hard nofile 65536&lt;br /&gt;
&amp;nbsp;EOF&lt;br /&gt;
&amp;nbsp;cat &amp;gt;&amp;gt; /etc/pam.d/login&lt;br /&gt;
&amp;nbsp;&amp;lt;&amp;lt;EOF&lt;br /&gt;
session required /lib/security/pam_limits.so&lt;br /&gt;
EOF&lt;/div&gt;
Oracle has you set some OS limits on the Oracle user by editing the main system profile file.  Their script generates a "unary operator expected" error (at least under some circumstances), so it seems a lot more direct to add that limit to the Oracle user's .bash_profile (assuming you're using bourne).

So add the following to /home/oracle/.bash_profile
&lt;div class="codesnippet"&gt;
ulimit -u 16384 -n 65536&lt;br /&gt;
umask 022&lt;/div&gt;
I find it frustrating not to have tools like SQLPLUS and TNSPING in the path, and I want the Oracle environment variables set automatically, so add the following (modified to match your environment, of course) to .bash_profile, as well.  If this is a system that hosts a lot of databases, it might not make sense to set the ORACLE_SID variable; that's up to you.  Oracle's recommended method for taking care of this is to use the oraenv script, which is at /oracle/product/11.1.0/db_1/bin/
&lt;div class="codesnippet"&gt;
export ORACLE_BASE=/oracle&lt;br /&gt;
export ORACLE_SID=&amp;lt;db_sid&amp;gt;&lt;br /&gt;
export ORACLE_HOME=/oracle/product/11.1.0/db_1&lt;br /&gt;
export PATH=$PATH:/oracle/product/11.1.0/db_1/bin/
&lt;/div&gt;
&lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704#asdf" name="others"&gt;Click here to see the code to use for korn shell and c-shell.&lt;/a&gt;
&lt;div id="hidediv"&gt;
If you're using korn (ksh), add the following to /home/oracle/.profile
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
ulimit -p 16384
ulimit -n 65536
umask 022&lt;/div&gt;
And, finally, if you're using c-shell, add the following to /home/oracle/.login
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
limit maxproc 16384&lt;br /&gt;
limit descriptors 65536&lt;br /&gt;
umask 022&lt;/div&gt;
&lt;/div&gt;
That should get things ready for the Oracle installation.  In &lt;a href="http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64_26.html"&gt;Part 2&lt;/a&gt;, we'll get Oracle installed.


&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4001706494108314920?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4001706494108314920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4001706494108314920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4001706494108314920'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/installing-oracle-on-rhel-5-32-and-64.html' title='Installing Oracle on RHEL 5 (32 and 64 bit) - Part 1'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6153029487293153117</id><published>2009-07-13T16:32:00.005-05:00</published><updated>2009-07-13T16:37:46.286-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>ORA-00911 when writing a query for SSIS</title><content type='html'>Coming from the Oracle world, I'm in the habit of putting a semicolon at the end of all of my SQL queries.  Not a good idea when you're writing an Oracle query for import/export in SSIS (SQL Server Integration Services).

The problem is that SSIS takes care of that for you, and you'll get an entirely unhelpful "ORA-00911: invalid character" error message.  Just remove that final semicolon, and you should be in OK shape.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6153029487293153117?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6153029487293153117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/ora-00911-when-writing-query-for-ssis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6153029487293153117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6153029487293153117'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/07/ora-00911-when-writing-query-for-ssis.html' title='ORA-00911 when writing a query for SSIS'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6736078226007369872</id><published>2009-05-15T22:34:00.011-05:00</published><updated>2011-12-23T10:02:45.296-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='VMWare Converter'/><title type='text'>Converting a Physical Linux system to a VMWare VirtualCenter VM</title><content type='html'>This is a daunting task.  At least, it is until you figure out how to do it.  Once you've got the steps, it's quite simple, and relatively quick.

We'll be importing a physical Linux (CENTOS 5) server -- using IDE drives -- into a VMWare VirtualCenter-managed host.  So immediately, one thing needs to be made clear:  the tools we're using in this exercise aren't free.  There are a variety of tools out there that are free, and I may get around to exploring those for this situation, as well.  In the mean time, however, we're talking about VMWare Enterprise Converter 4 (v3 works, as well), which isn't available (yet, anyway) without cost.

So enough of the fine print:  let's get to it.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;
&lt;span id="fullpost"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;Downloading the Converter Boot ISO&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;This seems like it'd be obvious, but it wasn't to me:  Click on the &lt;a href="http://vmware.com/download/"&gt;downloads &lt;/a&gt;link at www.vmware.com, and instead of clicking on the download link for VMWare Converter, choose &lt;a href="http://vmware.com/download/vi/"&gt;VMware Infrastructure 3&lt;/a&gt;, instead.

Now click on the download link for &lt;span style="font-weight: bold;"&gt;VMware vCenter Server 2.5&lt;/span&gt;.  This is where you log in (see:  I told you it wasn't free).  Having done so, you'll see a link to download &lt;span style="font-weight: bold;"&gt;VMware vCenter Converter BootCD for vCenter Server&lt;/span&gt;.  That's what you want.

I know:  it was obvious to you; I'm just slow.

Burn that CD, and we'll move on to the next step.

&lt;h3&gt;
Boot the Converter CD&lt;/h3&gt;
There aren't a lot of options for using the converter CD, so I'll skip much detail about it, unless someone requests more.  There is one very important gotcha, however:
Network Autonegotiation Speed.  It doesn't do it well.  At least, it doesn't do it well with all network cards.

Here's the problem:  VMWare simply took their Windows-only converter application and put it on a Windows PE boot disk.  And the network drivers don't appear to be terribly robust, at least, not for all network cards.

So here's what you do:  when the system boots, choose to edit the network settings manually (if you've already gotten past that point, you can edit them from the Network Settings menu in the Converter application), and set the speed from &lt;span style="font-weight: bold;"&gt;auto &lt;/span&gt;to whatever speed your system supports (in my case with this system, 100Mb Full duplex).  This will make things work much, much better.

I'll note that, if your import process is taking a *really* long time, and failing often during the process, this is most likely your problem.

&lt;h3&gt;
Edit your new VM&lt;/h3&gt;
&lt;h4&gt;
 Try a quick Boot&lt;/h4&gt;
Once the import process is complete, go ahead and try powering the system on.  It almost certainly will fail with a kernel panic, as below:
&lt;div class="codesnippet"&gt;
Kernel panic - not syncing: Attempted to kill init!
VFS: Cannot open root device "LABEL=/" or 00:00
Please append a correct = "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00 &lt;/div&gt;
it may also say something like
&lt;div class="codesnippet"&gt;
VFS: Cannot open root device "VolGroup00/LogVol00" or unknown-block(0,0)&lt;/div&gt;
Depending upon your configuration.

If not, you're done.  You're probably not done, though; the problem we're witnessing here is that Linux is still looking for an IDE disk.  That drive no longer exists:  it's been converted to a SCSI disk, so we need to tell Linux how to read its new disk.

&lt;h4&gt;
Change the VM SCSI controller type&lt;/h4&gt;
Set your VM SCSI controller to use LSI Logic instead of BusLogic.  VMWare says either will work, but I've had much better luck with LSI.
Right-click on your VM and select &lt;span style="font-weight: bold;"&gt;Edit Settings&lt;/span&gt;.  Click on the SCSI Controller and click on the Change Type button, if it's not already set to LSI Logic.

&lt;h3&gt;
Boot to the Linux Install CD&lt;/h3&gt;
Power your VM on and mount the ISO (or actual CD) for Disk 1 of the Linux install set.  If you installed from a DVD, just use that.

When prompted for boot options, type
&lt;div class="codesnippet"&gt;
linux rescue&lt;/div&gt;
When the boot process is complete, it will ask you if you want to mount your file system.  Don't do it read only; just click on &lt;span style="font-weight: bold;"&gt;Continue&lt;/span&gt;.

We'll change our root at this point, to make things easier:
&lt;div class="codesnippet"&gt;
chroot /mnt/sysimage&lt;/div&gt;
/mnt/sysimage, by the way, is where the linux rescue system mounts your original file system.  If there is nothing mounted there, you have a problem.  The best I can offer at this point is to power off the system and change the scsi controller to whatever it isn't set to right now.

Having done that, there are a few files to edit, and then we'll re-create the boot image with the updated settings:

&lt;h3&gt;
Edit the files&lt;/h3&gt;
Edit the following three files and replace all occurrences of &lt;span style="font-weight: bold;"&gt;/dev/hda&lt;/span&gt; with &lt;span style="font-weight: bold;"&gt;/dev/sda&lt;/span&gt; (if you're coming from IDE).  If you're coming from physical SCSI devices, you'll find, in addition to /dev/hda, /dev/cciss/c0d0.  Change these to /dev/sda.  If you're unsure. make a backup of these files first. 

&lt;div class="codesnippet"&gt;
vim /etc/fstab
vim /boot/grub/device.map
vim /boot/grub/grub.conf&lt;/div&gt;
Now edit /etc/modprobe.conf:
&lt;div class="codesnippet"&gt;
vim /etc/modprobe.conf&lt;/div&gt;
While we're in here, VMWare suggests making sure the ethernet adapter has been updated:  for each eth&lt;span style="font-style: italic;"&gt;x&lt;/span&gt; (x is a number) alias in modprobe.conf, set the module entry to &lt;span style="font-weight: bold;"&gt;pcnet32&lt;/span&gt;.

Now, since we're using LSI Logic for our SCSI controller, we'll add (usually; if the settings are in there, make sure their values are correct) the following:
&lt;div class="codesnippet"&gt;
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptscsih&lt;/div&gt;
If you're using BusLogic, the above setting is &lt;span style="font-weight: bold;"&gt;BusLogic&lt;/span&gt; instead of mptscsih.

&lt;h3&gt;
Create the new Boot Image&lt;/h3&gt;
Now we're (almost) ready to create our new boot image.

Looking at the files in /boot, you'll likely see a whole bunch of different initrd*.img files.  One of those is going to be replaced by what we're about to do.  Look in /etc/grub.conf to see which one:
&lt;div class="codesnippet"&gt;
cat /etc/grub.conf&lt;/div&gt;
Note the initrd*.img file that is listed in the above file, as well as the kernel version (usually the same).  This is what we'll be using.

&lt;h4&gt;
Fix a RedHat bug&lt;/h4&gt;
If you're running RedHat Enterprise Linux (RHEL) or CENTOS, you're almost certainly going to run into a mkinitrd bug.  Let's nip that before it comes up:
&lt;div class="codesnippet"&gt;
echo "DMRAID=no" &amp;gt; /etc/sysconfig/mkinitrd/noraid
chmod 755 /etc/sysconfig/mkinitrd/noraid&lt;/div&gt;
In short, the bug makes this happen when you run mkinitrd:
&lt;div class="codesnippet"&gt;
No module dm-mem-cache found for kernel &lt;span id="fullpost"&gt;2.6.18-92.1.1.el5&lt;/span&gt;, aborting.&lt;/div&gt;
If you want more information on it, it's described &lt;a href="http://kbase.redhat.com/faq/docs/DOC-16528"&gt;here&lt;/a&gt;.

&lt;h4&gt;
Run mkinitrd&lt;/h4&gt;
Simply run &lt;span style="font-style: italic;"&gt;mkinitrd -v -f&lt;/span&gt; followed by the /boot/initrd-*.img filename and then the kernel version that you noted from /etc/grub.conf above.  In my case, it looked like this:
&lt;div class="codesnippet"&gt;
mkinitrd -v -f /boot/initrd-2.6.18-92.1.1.el5.img 2.6.18-92.1.1.el5&lt;/div&gt;
When that runs to completion, you should be able to boot.

Note that you'll want to make sure that Grub boots to that version when you reboot your VM.  To ensure that, when the grub message comes up "hit any key to enter boot menu", do so, and select the appropriate kernel from the list.

Make sure you update your system after it has booted; you may have ended up with an older boot kernel than you want.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6736078226007369872?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6736078226007369872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/05/converting-physical-linux-system-to.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6736078226007369872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6736078226007369872'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/05/converting-physical-linux-system-to.html' title='Converting a Physical Linux system to a VMWare VirtualCenter VM'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6317464248099163560</id><published>2009-05-10T10:38:00.004-05:00</published><updated>2009-05-10T10:48:18.072-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS Office 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><title type='text'>Microsoft Office 2007 button menu not dislaying</title><content type='html'>A quick Google search will show that a few people here and there report instances in which the Office Button (the icon at the top-left-hand corner of Office 2007 applications) menu won't display when you click on it.

If you do some digging, it turns out that you can navigate the menu with keystrokes, even though it's not appearing.
&lt;span id="fullpost"&gt;
The problem, it turns out, is with remote control software.  We ran into this, and it was puzzling, both the problem and the fact that there isn't much out there that is easy to find (hence this post).  We were using an older VNC (&lt;a href="http://www.tightvnc.com/"&gt;TightVNC&lt;/a&gt; 1.3.8, to be specific, with which I'm not enamored, anyway).  It's unclear to me under what circumstances this occurs (we have many servers running that version of TightVNC, without exhibiting this problem), but using RDP (MS Remote Desktop) does clear up the problem, as does installing &lt;a href="http://www.realvnc.com/"&gt;RealVNC&lt;/a&gt;.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6317464248099163560?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6317464248099163560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/05/microsoft-office-2007-button-menu-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6317464248099163560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6317464248099163560'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/05/microsoft-office-2007-button-menu-not.html' title='Microsoft Office 2007 button menu not dislaying'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-771317229327496199</id><published>2009-04-03T14:22:00.027-05:00</published><updated>2011-12-23T09:48:29.661-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl certs'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Certificates'/><category scheme='http://www.blogger.com/atom/ns#' term='host headers'/><title type='text'>Creating SSL Certificates with Multiple Host Names</title><content type='html'>&lt;h1&gt;
Creating an SSL Certificate with Multiple Hostnames   &lt;/h1&gt;
There's another article on &lt;a href="http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl_13.html"&gt;creating wildcard certificates in apache&lt;/a&gt; (and &lt;a href="http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl.html"&gt;here on IIS&lt;/a&gt;), but we've not discussed the possibility of having a single certificate answer to several hostnames (DNS cnames, and http host headers). This uses an SSL feature called SubjectAlternativeName (or SAN, for short).

Not only is this possible, but it's reasonably easy. We'll talk about generating the certificates using openssl on linux, but openssl is available for Windows, also, and the procedure is the same.

Note that Windows' selfssl utility doesn't provide the ability to generate a certificate request file with SANs, so if you want to use this on Windows, you'll need to use openssl or another ssl utility.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;

&lt;span id="fullpost"&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;Generate the Certificate Request File&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;
For a generic SSL certificate request (CSR), openssl doesn't require much fiddling. Since we're going to add a SAN or two to our CSR, we'll need to add a few things to the openssl.cnf file.

&lt;/span&gt; &lt;span id="fullpost"&gt;&lt;h4&gt;

Edit openssl.cnf
&lt;/h4&gt;
Edit your openssl.cnf file (by default, in RHEL v5, at &lt;code&gt;/etc/pki/tls/openssl.cnf&lt;/code&gt;).
&lt;pre style="margin-left: 40px;"&gt;vim /etc/pki/tls/openssl.cnf
&lt;/pre&gt;
You should see, about a th&lt;/span&gt; &lt;span id="fullpost"&gt;ird of the way down, a section that begins with &lt;u&gt;&lt;strong&gt;&lt;code&gt;[ req ]&lt;/code&gt;&lt;/strong&gt;&lt;/u&gt;. This is the section that tells openssl what to do with certificate requests (CSRs).
Within that section should be a line that begins with &lt;u&gt;&lt;strong&gt;&lt;code&gt;req_extensions&lt;/code&gt;&lt;/strong&gt;&lt;/u&gt;. We'll want that to read as follows:
&lt;pre style="margin-left: 40px;"&gt;req_extensions = v3_req
&lt;/pre&gt;
This tells openssl to includ&lt;/span&gt; &lt;span id="fullpost"&gt;e the v3_req section in CSRs.
Now we'll go own down to the v3_req section and make sure that it includes the following:
&lt;div class="codesnippet"&gt;
[ v3_req ]&lt;br /&gt;
# Extensions to add to a certificate request&lt;br /&gt;
basicConstraints = CA:FALSE&lt;br /&gt;
keyUsage = nonRepudiation, digitalSignature, keyEncipherment&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;subjectAltName = @alt_names&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;[alt_names]&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;DNS.1 = kb.example.com&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;DNS.2 = helpdesk.example.com&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;DNS.3 = systems.example.com&lt;/span&gt;&lt;/div&gt;
You'll notice that in our example above, we've added three SANs.
&lt;/span&gt;
&lt;span id="fullpost"&gt;&lt;em&gt;Note that whatever we put here will appear on all CSRs generated from this point on&lt;/em&gt;: if at a later date you want to generate a CSR with different SANs, you'll need to edit this file and change the DNS.x entries.
&lt;/span&gt;
&lt;span id="fullpost"&gt;&lt;h4&gt;

Generate a private key
&lt;/h4&gt;
You'll need to make sure your server has a private key created. It usually does (in&lt;code&gt;/etc/pki/tls/private&lt;/code&gt;, normally called &lt;code&gt;localhost.key&lt;/code&gt;), but it not, you'll need to create one:

&lt;div class="codesnippet"&gt;
openssl genrsa -out /etc/pki/tls/private/domainname.key 1024&lt;/div&gt;
Where &lt;em&gt;domanname&lt;/em&gt; is the FQDN of the server you're using. That's not necessary, BTW, but it makes things a lot clearer later on.

&lt;span style="color: #993300;"&gt;&lt;strong&gt;&lt;em&gt;Do not&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; enter a passphrase for this private key! Doing so will require a password to be entered each time apache starts, which, on the whole, is a terrible thing.

Make sure that your ssl.conf file (/etc/httpd/conf.d/ssl.conf or whichever is the active httpd &lt;/span&gt;&lt;span id="fullpost"&gt;&lt;span id="fullpost"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span id="fullpost"&gt;conf file) contains the line:

&lt;div class="codesnippet"&gt;
SSLCertificateKeyFile /etc/pki/tls/private/domainname.key&lt;/div&gt;
Otherwise, Apache won't have the information necessary to decrypt the SSL traffic.

&lt;h4&gt;
&lt;span id="fullpost"&gt;&lt;span id="fullpost"&gt;  &lt;/span&gt;&lt;/span&gt;
Create the CSR file
&lt;/h4&gt;
Now we're ready to create the CSR.

&lt;div class="codesnippet"&gt;
openssl req -new -out /tmp/domainname.csr -key /etc/pki/tls/private/domainname.key  &lt;/div&gt;
Where &lt;em&gt;/tmp/domainname.csr&lt;/em&gt; includes the FQDN of the server, and &lt;em&gt;domainname.key&lt;/em&gt; is the private key referred to above.

You'll be prompted for information about your organization, and it'll ask if you want to include a passphrase (you don't). It'll then finish with nothing much in the way of feedback. But you can see that /tmp/domainname.csr has been created.

It's nice to check our work, so we can take a look at what the csr contains with the following command:

&lt;div class="codesnippet"&gt;
openssl req -text -noout -in /tmp/domainname.csr&lt;/div&gt;
You should see some output like below. Note the Subject Alternative Name section:

&lt;div class="codesnippet"&gt;
[root@domainname /]# openssl req -text -noout -in /tmp/domainname.csr&lt;br /&gt;
Certificate Request:&lt;br /&gt;
Data:
Version: 0 (0x0)&lt;br /&gt;
Subject: C=US, ST=Texas, L=Fort Worth, O=My Company, OU=My Department, CN=server.example.com/emailAddress=notreal@example.com&lt;br /&gt;
Subject Public Key Info:&lt;br /&gt;
Public Key Algorithm: rsaEncryption&lt;br /&gt;
RSA Public Key: (1024 bit)
Modulus (1024 bit): &lt;span style="font-style: italic;"&gt;blahblahblah&lt;/span&gt;
Exponent: 65537 (0x10001)&lt;br /&gt;
Attributes:&lt;br /&gt;
Requested Extensions: X509v3&lt;br /&gt;
Basic Constraints: CA:FALSE
X509v3&lt;br /&gt;
Key Usage: Digital Signature, Non Repudiation, Key Encipherment&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;&lt;strong&gt;X509v3 Subject Alternative Name:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;&lt;strong&gt;DNS:kb.example.com,&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;&lt;strong&gt;DNS:helpdesk.example.com,&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #ffff99; color: black;"&gt;&lt;strong&gt;DNS:systems.example.com&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;Signature Algorithm: sha1WithRSAEncryption&lt;/span&gt;
&lt;span style="font-style: italic;"&gt;blahblahblah&lt;/span&gt;&lt;/div&gt;
So now we've got a shiny new CSR. But, of course, we have to sign it.

&lt;h3&gt;

Sign the CSR and create a new certificate&lt;/h3&gt;
Openssl has certificate authority signing functionality, but frankly, I found it wanting a bit more than I was willing to give it (serial number files, etc.). Not that it's difficult: there's a great step-by-step guide to using openssl to sign CSRs at &lt;a class="external" href="http://www.flatmtn.com/article/setting-openssl-create-certificates" rel="external nofollow" target="_blank" title="http://www.flatmtn.com/article/setting-openssl-create-certificates"&gt;http://www.flatmtn.com/article/setti...e-certificates&lt;/a&gt;.

Instead, I found it easier to download and install SimpleAuthority. It's a free utility for signing CSRs, and it can be downloaded at &lt;a class="external" href="http://simpleauthority.com/download.html" rel="external nofollow" target="_blank" title="http://simpleauthority.com/download.html"&gt;http://simpleauthority.com/download.html&lt;/a&gt;. It works on Windows, Mac, and linux, though you should note that the linux version requires using the SUN Java package (intructions for setting up &lt;a class="internal" href="http://lanestechblog.blogspot.com/2008/03/using-alternatives-in-linux-to-use.html" rel="internal"&gt;here&lt;/a&gt;) as well as the unlimited encryption strength cryptology encryption files (see the bottom of the &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Sun download page&lt;/a&gt;, under "other downloads").

When you run simpleauthority the first time, it'll prompt you to create a new user and to create a new CA. There are two things that are especially important in this step:
&lt;ol&gt;
&lt;li&gt;Make sure you remember the password you create; you'll need it each time you sign a CSR.
&lt;/li&gt;
&lt;li&gt;Make the CA last for 10 years; we don't need these expiring.
&lt;/li&gt;
&lt;/ol&gt;
Having created the CA, you need to sign the CSR:

From the tools menu, select &lt;strong&gt;Import -&amp;gt; Certificate Signing Request&lt;/strong&gt;.

SimpleAuthority will prompt for the .csr filename we created in the previous steps. Select that file and click on Open.

When you open the csr, you'll be promptd with the following: The requested dname is "...". SimpleAuthority normally only includes CN, OU (x1), O and C fields in the Subject dname. Do you want to include the extra fields in the certificate?

&lt;a href="http://2.bp.blogspot.com/_QFTS-w4RNtM/SdZvstWjMBI/AAAAAAAAAEo/hJ-pUq4mBy8/s1600-h/simpleauthority2.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5320562823663923218" src="http://2.bp.blogspot.com/_QFTS-w4RNtM/SdZvstWjMBI/AAAAAAAAAEo/hJ-pUq4mBy8/s320/simpleauthority2.JPG" style="cursor: pointer; display: block; height: 46px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;
The answer is yes.

When you click on Yes, you'll see another dialog box asking for the type of certificate to create.

&lt;a href="http://3.bp.blogspot.com/_QFTS-w4RNtM/SdZwSX99-4I/AAAAAAAAAEw/oNbhQmdCx3o/s1600-h/simpleauthority3.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5320563470758706050" src="http://3.bp.blogspot.com/_QFTS-w4RNtM/SdZwSX99-4I/AAAAAAAAAEw/oNbhQmdCx3o/s320/simpleauthority3.JPG" style="cursor: pointer; float: left; height: 207px; margin: 0pt 10px 10px 0pt; width: 269px;" /&gt;&lt;/a&gt;

Select SSL Server and increase the certificate validity to 3650 days. There's no reason not to make it 10 years.

Make sure you've checked the "include extension requests" box; this tells SimpleAuthority to use the SAN fields from the CSR.

When you click on OK, your new certificate will be created. you'll see it listed in the main screen. To export this to a file (and copy back to the server), click on the server name in the left-hand panel and then right-click on the certificate listed at the bottom-right. Select &lt;strong&gt;export certificate&lt;/strong&gt;.

&lt;a href="http://1.bp.blogspot.com/_QFTS-w4RNtM/SdZwX0VFuRI/AAAAAAAAAE4/TN5aum9vmJo/s1600-h/simpleauthority.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5320563564271221010" src="http://1.bp.blogspot.com/_QFTS-w4RNtM/SdZwX0VFuRI/AAAAAAAAAE4/TN5aum9vmJo/s320/simpleauthority.JPG" style="cursor: pointer; display: block; height: 216px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;

When you choose to export the cert, you'll be prompted for the file type. Select PEM format and click on export.

Choose a filename, and your pem file will be created.

&lt;h3&gt;
Install your new certificate&lt;/h3&gt;
&lt;h4&gt;
Apache&lt;/h4&gt;
In apache, all that's required is to edit your ssl.conf file and make sure the SSLCertificateFile points to your new .pem file. It's recommended that you place it in /etc/pki/tls/certs. Then restart apache:
&lt;div class="codesnippet"&gt;
service httpd restart&lt;/div&gt;
&lt;h4&gt;
IIS&lt;/h4&gt;
In IIS , you've got to convert this file to a .pfx format:
&lt;div class="codesnippet"&gt;
openssl pkcs12 -export -in domainname.pem -inkey /etc/pki/tls/private/domainname.key -out /tmp/domainname.pfx -name "domainname"&lt;/div&gt;
The above command will convert the pem file to pfx format, which you can import into IIS:

Right click on the web site and select properties. Click on the directory security tab and then on the server certificate button. A wizard will pop up; click &lt;strong&gt;next&lt;/strong&gt;, and then you can select to import a pfx certificate. That should be it.

&lt;h4&gt;
Note the CA Certificate!&lt;/h4&gt;
There's a rub in doing this:  your CA, as a matter of course, won't be trusted by anyone.  This normally isn't a problem, as it's true of self-signed certificates, as well.  However, many applications (PrinceXML, for example) that retrieve documents from your web site will fail if they don't trust your CA.  You'll want to make sure that you export your CA certificate (&lt;span style="font-weight: bold;"&gt;Tools -&amp;gt; Export -&amp;gt; CA Certificate&lt;/span&gt;) and add it to the trusted CA list for your applications.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-771317229327496199?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/771317229327496199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/04/creating-ssl-certificates-with-multiple.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/771317229327496199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/771317229327496199'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/04/creating-ssl-certificates-with-multiple.html' title='Creating SSL Certificates with Multiple Host Names'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_QFTS-w4RNtM/SdZvstWjMBI/AAAAAAAAAEo/hJ-pUq4mBy8/s72-c/simpleauthority2.JPG' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2956616798377621787</id><published>2009-03-10T17:22:00.046-05:00</published><updated>2011-12-23T09:50:57.659-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='AD Integration'/><title type='text'>Active Directory (AD) Authentication on a Linux Server</title><content type='html'>&lt;h1&gt;
Domain Authentication for Linux&lt;/h1&gt;
I've updated the instructions &lt;a href="http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html"&gt;here to support RHEL 6&lt;/a&gt;.  I've streamlined things a bit, too, so I'd head &lt;a href="http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html"&gt;over to this page to get the latest on setting up AD authentication for a Linux server&lt;/a&gt;.  There are a lot of how-tos surrounding the integration of authentication and authorization in Linux through Active Directory domains.  I've found a variety of them helpful, and I've found more to be confusing, rather than helpful.  Here I'm hoping to put together a start-to-finish process for using your domain to authenticate and authorize users on your linux box.  These instructions are written for Red Hat Enterprise Linux v5 (RHEL from now on).  That means the file locations should be the same for &lt;a href="http://centos.org/"&gt;CENTOS &lt;/a&gt;distros (which I highly recommend as a server OS), but that they might move around a bit for others. &lt;br /&gt;
&lt;br /&gt;
A very small bit of background:   this system uses winbind and smb to connect to the domain to authenticate users.  Kerberos is used to join the system to the domain.  The benefit of this system is that it's secure and it's pretty easy to configure.  Coupled with &lt;a href="http://www.kernel.org/pub/linux/libs/pam/"&gt;PAM (Pluggable Authentication Modules)&lt;/a&gt;, it's quite flexible, and it's really pretty cool functionality.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;Likewise Open&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;If this looks too daunting (it's not so hard, I promise!), or if you don't want to mess with Samba, take a look at &lt;a href="http://www.likewise.com/products/likewise_open/" style="font-weight: bold;"&gt;Likewise Open Source&lt;/a&gt;. It's a utility that does just what we're doing in this article, but it does it apart from the OS tools we're using here. I've not used it, but I've heard good things about it. It also looks like it's got some neat admin features that could be really useful. If you've had experience with Likewise, I'd love to hear about it.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
And now back to the show&lt;/h3&gt;
To be clear:  this isn't utilizing kerberos except for joining the domain; it's using samba (smb) and &lt;a href="http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/winbind.html"&gt;winbind &lt;/a&gt;(which is a part of samba).  A note about a particular assumption here:  we're using DNS for name resolution.  A lot of instructions out there assume you're using a hosts file for name resolution.  That's certainly an option, if you're not in an environment where DNS is practical.  All that is to say:  we're assuming your computers can find each other without special changes to your hosts file.  So the first thing we want to do is edit the relevant configuration files.  &lt;h1&gt;
Edit the configuration Files&lt;/h1&gt;
Seems like the easiest thing is to include the two most important config files.  Critical changes are in blue, and my comments are in orange.  Lots of folks are using "example.com" for sample config files, so I'll go with that as well.  Substitute your domain name wherever you see example.com.  The short name of the domain, then, is "example".  &lt;h3&gt;
/etc/krb5.conf&lt;/h3&gt;
Make sure your file reads as follows.  Note the capitalization.&lt;br /&gt;
&lt;div class="codesnippet"&gt;
default_realm = &lt;span style="color: #33cccc;"&gt;EXAMPLE.COM&lt;/span&gt;&lt;br /&gt;
dns_lookup_realm = &lt;span style="color: #33cccc;"&gt;true&lt;/span&gt;&lt;br /&gt;
dns_lookup_kdc = &lt;span style="color: #33cccc;"&gt;true&lt;/span&gt;&lt;br /&gt;
ticket_lifetime = 24h&lt;br /&gt;
forwardable = yes&lt;br /&gt;
&amp;nbsp;[realms]&lt;br /&gt;
&lt;span style="color: #33cccc;"&gt;EXAMPLE.COM = {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #33cccc;"&gt;kdc = adserver.example.com:88&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #33cccc;"&gt;admin_server = adserver.example.com:749&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #33cccc;"&gt;default_domain = example.com }&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;[domain_realm]&lt;br /&gt;
&lt;span style="color: #33cccc;"&gt; .example.com = EXAMPLE.COM&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #33cccc;"&gt;example.com = EXAMPLE.COM&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
/etc/samba/smb.conf&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
#================== Global Settings =================== &lt;br /&gt;
[global]  &lt;br /&gt;
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH&lt;br /&gt;
&lt;span style="color: #00cccc;"&gt;workgroup = example&lt;/span&gt;  &lt;br /&gt;
# server string is the equivalent of the NT Description field &lt;br /&gt;
&lt;span style="color: #cc9933;"&gt;# Which is to say:  this can be whatever you want it to be.&lt;/span&gt;&lt;br /&gt;
server string = My Linux Box  &lt;br /&gt;
# Security mode. Defines in which mode Samba will operate. Possible &lt;br /&gt;
# values are share, user, server, domain and ads. Most people will want &lt;br /&gt;
# user level security. See the Samba-HOWTO-Collection for details.&lt;br /&gt;
&lt;span style="color: #00cccc;"&gt;security = ads&lt;/span&gt;  &lt;br /&gt;
# This option is important for security. It allows you to restrict &lt;br /&gt;
# connections to machines which are on your local network. The &lt;br /&gt;
# following example restricts access to two C class networks and &lt;br /&gt;
# the "loopback" interface. For more examples of the syntax see &lt;br /&gt;
# the smb.conf man page &lt;span style="color: #cc9933;"&gt;&lt;br /&gt;
# This can be quite useful, if you've got a limited number of users: &lt;br /&gt;
# it's difficult to hack in if there only are a couple of gates into the city.&lt;/span&gt;&lt;br /&gt;
;&amp;nbsp;hosts allow = 192.168.1. 192.168.2. 127.&lt;br /&gt;
&lt;span style="color: #cc9933;"&gt;
# The next two lines tell the OS what range of UID and GID (user and group ID numbers) &lt;br /&gt;
# to use when creating new accounts.  It doesn't really matter terribly what you use, but &lt;br /&gt;
# most folks keep it in the high range for clarity.&lt;/span&gt; &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
idmap uid = 10000-20000&lt;/span&gt; &lt;span style="color: #00cccc;"&gt; &lt;br /&gt;
idmap gid = &lt;/span&gt;&lt;span style="color: #00cccc;"&gt;10000-20000&lt;/span&gt; &lt;span style="color: #cc9933;"&gt;&lt;br /&gt;
# Don't forget to set this next line&lt;/span&gt; &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
template shell = /bin/bash&lt;/span&gt;&lt;span style="color: #00cccc; font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="color: #cc9933;"&gt;&lt;br /&gt;
#Telling &lt;/span&gt;&lt;span style="color: #cc9933;"&gt;winbind to use the default domain essentially means there are some situations (like logging in) &lt;br /&gt;
# in which you won't have to specify the domain name. &lt;br /&gt;
# We use it, but there is a pitfall:  domain users don't have to &lt;br /&gt;
# specify the domain name when logging in; if there are local &lt;br /&gt;
# accounts with the same name, serious confusion can ensue.&lt;/span&gt; &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
winbind use default domain = true&lt;/span&gt; &lt;span style="color: #cc9933; font-style: italic;"&gt;[SNIP]&lt;/span&gt;  &lt;br /&gt;
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names&lt;br /&gt;
# via DNS nslookups. The default is NO. &lt;span style="color: #cc9933;"&gt;&lt;br /&gt;
# HEADS-UP:  the following is case-sensitive:  it needs to be all upper-case&lt;/span&gt; &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
realm = EXAMPLE.COM&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #00cccc;"&gt;encrypt passwords = yes&lt;/span&gt; ; &lt;br /&gt;
guest ok = no ; &lt;br /&gt;
guest account = nobody  &lt;br /&gt;
&lt;br /&gt;
# These scripts are used on a domain controller or stand-alone &lt;br /&gt;
# machine to add or delete corresponding unix accounts ; &lt;br /&gt;
add user script = /usr/sbin/useradd %u ; &lt;br /&gt;
add group script = /usr/sbin/groupadd %g ; &lt;br /&gt;
add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u ;&lt;br /&gt;
delete user script = /usr/sbin/userdel %u ; &lt;br /&gt;
delete user from group script = /usr/sbin/deluser %u %g ; &lt;br /&gt;
delete group script = /usr/sbin/groupdel %g   &lt;br /&gt;
&lt;br /&gt;
#=================== Share Definitions ===================== &lt;/div&gt;
&lt;span style="font-family: georgia;"&gt;&lt;br /&gt;
Note that I've left the settings in the above file in the locations where you find them in a default smb.conf file.  Settings that aren't in there by default are grouped at the top.  All of these settings, though, are global, so they all can be clumped together, if you so choose&lt;/span&gt;.   &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
/etc/nsswitch.conf&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
# An example Name Service Switch config file. This file should be &lt;br /&gt;
# sorted with the most-used services at the beginning. &lt;br /&gt;
# &lt;br /&gt;
# The entry '[NOTFOUND=return]' means that the search for an &lt;br /&gt;
# entry should stop if the search in the previous entry turned &lt;br /&gt;
# up nothing. Note that if the search failed due to some other reason &lt;br /&gt;
# (like no NIS server responding) then the search continues with the &lt;br /&gt;
# next entry. &lt;br /&gt;
# &lt;br /&gt;
# Legal entries are: &lt;br /&gt;
# &lt;br /&gt;
#       nisplus or nis+         Use NIS+ (NIS version 3) &lt;br /&gt;
#       nis or yp               Use NIS (NIS version 2), also called YP &lt;br /&gt;
#       dns                     Use DNS (Domain Name Service) &lt;br /&gt;
#       files                   Use the local files &lt;br /&gt;
#       db                      Use the local database (.db) files &lt;br /&gt;
#       compat                  Use NIS on compat mode &lt;br /&gt;
#       hesiod                  Use Hesiod for user lookups &lt;br /&gt;
#       [NOTFOUND=return]       Stop searching if not found so far &lt;br /&gt;
#  &lt;br /&gt;
# To use db, put the "db" in front of "files" for entries you want to be &lt;br /&gt;
# looked up first in the databases &lt;br /&gt;
# &lt;br /&gt;
# Example: #passwd:    &lt;br /&gt;
db files nisplus nis &lt;br /&gt;
#shadow:    db files nisplus nis &lt;br /&gt;
#group:     db files nisplus nis  &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
passwd: files winbind&lt;/span&gt; &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
shadow: compat&lt;/span&gt; &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
group:  files winbind&lt;/span&gt;  &lt;br /&gt;
#hosts:     db files nisplus nis dns &lt;br /&gt;
hosts:      files dns &lt;br /&gt;
# Example - obey only what nisplus tells us... &lt;br /&gt;
#services:   nisplus [NOTFOUND=return] files &lt;br /&gt;
#networks:   nisplus [NOTFOUND=return] files &lt;br /&gt;
#protocols:  nisplus [NOTFOUND=return] files &lt;br /&gt;
#rpc:        nisplus [NOTFOUND=return] files &lt;br /&gt;
#ethers:     nisplus [NOTFOUND=return] files &lt;br /&gt;
#netmasks:   nisplus [NOTFOUND=return] files  &lt;br /&gt;
bootparams: nisplus [NOTFOUND=return] files  &lt;br /&gt;
ethers:     db files &lt;br /&gt;
netmasks:   files &lt;br /&gt;
networks:   files &lt;span style="color: #00cccc;"&gt;dns&lt;/span&gt;&lt;br /&gt;
protocols:  db files &lt;br /&gt;
rpc:        db files &lt;br /&gt;
services:   db files  &lt;br /&gt;
netgroup:   nisplus  &lt;br /&gt;
publickey:  nisplus  &lt;br /&gt;
automount:  files nisplus &lt;br /&gt;
aliases:    files nisplus &lt;/div&gt;
&lt;br /&gt;
&lt;h1&gt;
Join the domain&lt;/h1&gt;
Now we can restart samba to pick up the new settings and join the domain: &lt;br /&gt;
&lt;div class="codesnippet"&gt;
service smb restart net ads join -u username&lt;/div&gt;
&lt;span style="font-family: georgia;"&gt;where &lt;span style="font-style: italic;"&gt;username &lt;/span&gt;is a &lt;span style="font-family: georgia; font-style: italic; font-weight: bold;"&gt;domain &lt;/span&gt;&lt;span style="font-family: georgia;"&gt;user who has permissions to join a computer to the domain.&lt;/span&gt;  &lt;span style="font-family: georgia;"&gt;We should get a response about having joined the domain.  Don't worry about errors in updating the DNS; if your server cannot update the DNS, then we don't want it to. &lt;/span&gt;  Now start winbind: &lt;div class="codesnippet"&gt;
service winbind start&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-family: georgia;"&gt;Test out your settings to make sure you can enumerate the domain groups (I'd use groups instead of users; as a large domain can take a very long time to send over all the users).&lt;/span&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
wbinfo -g&lt;/div&gt;
&lt;span style="font-family: georgia;"&gt;Now we can edit our PAM configuration:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
/etc/pam.d/system-auth&lt;/h3&gt;
&lt;div class="codesnippet"&gt;
#%PAM-1.0 &lt;br /&gt;
# User changes will be destroyed the next time authconfig is run. &lt;span style="color: #cc9933;"&gt;&lt;br /&gt;
# Note the above statement. If you run authconfig after manually changing this, &lt;/span&gt; &lt;span style="color: #cc9933;"&gt;&lt;br /&gt;
# some of your changes may get dropped.&lt;/span&gt; &lt;br /&gt;
auth     required    pam_env.so &lt;br /&gt;
auth     sufficient  pam_unix.so nullok try_first_pass &lt;br /&gt;
auth     requisite   pam_succeed_if.so uid &amp;gt;= 500 quiet &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
auth     sufficient  pam_winbind.so use_first_pass&lt;/span&gt; &lt;br /&gt;
auth     required    pam_deny.so  &lt;br /&gt;
account  required    pam_unix.so &lt;br /&gt;
account  sufficient  pam_succeed_if.so uid &amp;lt; 500 quiet &lt;br /&gt;
account  required    pam_permit.so  &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
password  sufficient  pam_winbind.so use_authtok&lt;/span&gt; &lt;br /&gt;
password required    pam_deny.so  &lt;br /&gt;
session  optional    pam_keyinit.so revoke &lt;br /&gt;
session  required    pam_limits.so &lt;br /&gt;
session  [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid &lt;br /&gt;
session  required    pam_unix.so&lt;/div&gt;
&lt;br /&gt;
The above is called by most of the other PAM modules, so we should be able to do minimal modifications to other files after having changed this one.  We do want the system to create a home directory for people when they log in, so we'll add the following line both to the gdm and sshd files: &lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
session    required     pam_mkhomedir.so skel=/etc/skel umask=0077&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
The umask 0077 will give the users full control over their home directory, but no one else will have access.  Having added that, we should be able to log in using the username EXAMPLE\username That is, DOMAINNAME\username, to be clear.  &lt;br /&gt;
&lt;br /&gt;
Now, since we told winbind to use the default domain, people also should be able to log in using just their domain username.  It's probably a good idea, to avoid confusion, to have people use the domain name, too.  But there certainly will be situations in which that's not necessary.  If you're not able to log in, make sure that your sshd file has calls to system-auth, like in the following example: &lt;br /&gt;
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
#%PAM-1.0 &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
auth       include      system-auth&lt;/span&gt; &lt;br /&gt;
account    required     pam_nologin.so &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
account    include      system-auth&lt;/span&gt; &lt;br /&gt;
account    sufficient   pam_localuser.so &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
password   include      system-auth&lt;/span&gt; &lt;br /&gt;
session    optional     pam_keyinit.so force revoke &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
session    include      system-auth&lt;/span&gt; &lt;br /&gt;
session    required     pam_loginuid.so &lt;br /&gt;
session    required     pam_mkhomedir.so skel=/etc/skel umask=0077&lt;/div&gt;
&lt;br /&gt;
This is the case by default, so all should be fine.  Note that this works, too, with the gdm PAM file; that means you can &lt;a href="http://lanestechblog.blogspot.com/2009/02/setting-up-non-persistent-remote-gui.html"&gt;log in to a remote GUI (GDM in this case)&lt;/a&gt; on your Linux box with your domain name.  Pretty cool.   &lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
Restricting Login with Domain Groups&lt;/h1&gt;
Now that we've set this up, we want to be able to limit the users who can log in to this computer.  As it stands right now, any domain user can log in.  Usually not the best option (though it may be in your case).  &lt;br /&gt;
So we'll add a line to the ssh and gdm PAM module configuration files: &lt;br /&gt;
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
account    required     pam_succeed_if.so user ingroup EXAMPLE\groupname&lt;/div&gt;
&lt;br /&gt;
This line will be the last of the "account" lines.  You can stack these, as well as specify users instead of groups, which provides a lot of flexibility.  Let's say that we have three groups, linuxusers, webadmins, and domainadmins that we want to be able to log in to our linux server.  &lt;br /&gt;
&lt;br /&gt;
Let's say that our domain name is TEST, and let's say that we want, also to allow a user "frank" to be able to log in to our server.  We could have a sshd file like this that would allow just that: &lt;br /&gt;
&lt;div class="codesnippet"&gt;
#%PAM-1.0 &lt;br /&gt;
auth       include      system-auth &lt;br /&gt;
account    required     pam_nologin.so &lt;br /&gt;
account    include      system-auth &lt;br /&gt;
account    sufficient    pam_localuser.so &lt;span style="color: #00cccc;"&gt;&lt;br /&gt;
account    sufficient    pam_succeed_if.so user = TEST\frank&lt;/span&gt; &lt;br /&gt;
&lt;span style="color: #00cccc;"&gt;account    sufficient    pam_succeed_if.so user ingroup TEST\linuxusers&lt;/span&gt; &lt;br /&gt;
&lt;span style="color: #00cccc;"&gt;account    sufficient    pam_succeed_if.so user ingroup TEST\webadmins1&lt;/span&gt; &lt;br /&gt;
&lt;span style="color: #00cccc;"&gt;account    required     pam_succeed_if.so user ingroup TEST\domainadmins&lt;/span&gt; &lt;br /&gt;
password   include      system-auth &lt;br /&gt;
session    optional     pam_keyinit.so force revoke &lt;br /&gt;
session    include      system-auth &lt;br /&gt;
session    required     pam_loginuid.so &lt;br /&gt;
session    required     pam_mkhomedir.so skel=/etc/skel umask=0077&lt;/div&gt;
So we've got our user frank allowed (along with all local users on the line above it), and the groups below.  Note that the account is "sufficient" until the last group:  these are heirarchical, so if the "required" group is first, none of the other groups will be able to log in.   &lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
Troubleshooting&lt;/h1&gt;
One of the most common problems is previous domain joins on the system.  One way to take care of that problem is simply to delete the files that are created on the server when joining a domain.  Those are (again, on RHEL and CENTOS; other distros have the same files, but in different locations): &lt;pre&gt;/etc/samba/secrets.tdb
/var/cache/samba/*.tdb&lt;/pre&gt;
remove the above files (perhaps you might make a copy of the secrets.tdb file) and try to join the domain again.   &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2956616798377621787?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2956616798377621787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/03/active-directory-ad-authentication-on.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2956616798377621787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2956616798377621787'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/03/active-directory-ad-authentication-on.html' title='Active Directory (AD) Authentication on a Linux Server'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-505727882209755083</id><published>2009-03-05T17:24:00.002-06:00</published><updated>2009-03-05T17:40:58.839-06:00</updated><title type='text'>Singing the praises of DekiWiki</title><content type='html'>I've been a devotee of &lt;a href="http://www.mediawiki.org"&gt;MediaWiki &lt;/a&gt;for some time, now, and I still have a soft spot in my heart for it.  Having said that, however, I've become a real fan of &lt;a href="http://www.mindtouch.com/Products"&gt;DekiWiki&lt;/a&gt;.  It's a &lt;span style="font-weight: bold;"&gt;very&lt;/span&gt; full-featured wiki with a ton of extensibility.  And the best part:  it's released in a community-supported edition, so it's available to everyone without cost.
&lt;span id="fullpost"&gt;
There is a lot that can be said for DekiWiki, and the truth is that I'm too lazy to run through it all.  Suffice it to say that it has a ton of features, including extensions, a very flexible scripting language, and--for many the Holy Grail--a very robust ACL system, by which permissions can be set on the individual page level.

Here's another bonus:  they provide a feature by which MediaWiki installations can be converted to Deki.  And I can attest to this:  the conversion works well.  The commercially-licensed version, to which I suspect we'll move in the near future (I'll post our experience), has a suite of additional features, including a desktop-based toolset that allows for publishing from Outlook and Word, as well as drag-and-drop functionality for organizing the articles.

Installation instructions for the GPL'd edition can be found at the &lt;a href="http://wiki.developer.mindtouch.com/Official_Mindtouch_Deki_Community_Edition_Installation_Guides"&gt;MindTouch Deki site&lt;/a&gt;.

I'll leave it with this:  the developers are very active on the &lt;a href="http://wiki.developer.mindtouch.com/"&gt;MindTouch developer site&lt;/a&gt;, very quickly--and thoroughly--addressing problems you might run into.  They're a most helpful bunch.


&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-505727882209755083?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/505727882209755083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/03/singing-praises-of-dekiwiki.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/505727882209755083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/505727882209755083'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/03/singing-praises-of-dekiwiki.html' title='Singing the praises of DekiWiki'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-1665250649893830250</id><published>2009-02-13T09:26:00.023-06:00</published><updated>2011-12-23T10:09:57.627-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSolaris'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><category scheme='http://www.blogger.com/atom/ns#' term='Smart Array'/><title type='text'>Installing OpenSolaris on a server with a HP Smart Array Controller</title><content type='html'>I'm quite new to OpenSolaris; insofar as it's like Linux, I'm pretty comfortable, but there appear to be enough little gotchas to make the learning curve a little steeper than one might like.

Take, for instance, the fact that OpenSolaris doesn't ship with the drivers for the almost-ubiquitous HP Smart Array controller.  That makes for an installation hiccup that a quick Google search shows many people have found difficult.   It's too bad, too:  it appears that this has stymied a lot of folks in trying to install the OS.

Like most things, the solution is easy, once you know how to do it.

These instructions, originally, were for OpenSolaris 2008.11, but they've since been updated to work with 2009.06.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;

Boot to the Install CD&lt;/h3&gt;
&lt;span id="fullpost"&gt;The first task is to boot to the OpenSolaris Live CD, which is also the install CD.
If you haven't downloaded it, yet, you can get it at &lt;a href="http://www.opensolaris.org/"&gt;http://opensolaris.org&lt;/a&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;

&lt;span id="fullpost"&gt;Get the HP Smart Array Driver&lt;/span&gt;&lt;/h3&gt;
&lt;span id="fullpost"&gt;
Download the CPQary3 driver, which includes Solaris drivers for most of the recent (and not so recent) Smart Array controllers.  As of this writing, the latest version of these drivers is v2.2.0.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="color: #3366ff;"&gt;Update:  I've tried a few times to get the v2.0 drivers to work on the latest-generation HP servers, and I've had no luck.  The v2.2.0 drivers are out, and they &lt;/span&gt;&lt;span style="color: #330099;"&gt;&lt;span style="color: #3366ff;"&gt;support the latest that HP has to offer.  I've &lt;/span&gt;&lt;span style="color: #3366ff;"&gt;confirmed that the 2.1.0 drivers work on a BL460 G6&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
So stay away from the 2.0.0 drivers with new HP servers:  they can cause some serious heartburn.

The HP CPQary drivers can be found &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&amp;amp;cc=us&amp;amp;prodTypeId=15351&amp;amp;prodSeriesId=3884098&amp;amp;swItem=MTX-b1a47ff397fa4f33a44988f944"&gt;here&lt;/a&gt;.  The /tmp filesystem has a lot of space on the live CD, so it's probably best to save the file there.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-style: italic;"&gt;I saved off the 1.9.2 drivers &lt;a href="http://duncan.lane.googlepages.com/CPQary3-1.92-solaris10-i386.tar.gz"&gt;here&lt;/a&gt;, if that's helpful.  As always, it' a better idea to go to the source (HP in this case) for files than a second-hand location, but if you can't locate it at their site, it'll remain available here.&lt;/span&gt;

&lt;br /&gt;
&lt;h3&gt;

Install the Driver&lt;/h3&gt;
Now that we've got the drivers, we'll unpack them and go about installing them:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
jack@opensolaris:/tmp$ tar -zxf *.gz&lt;br /&gt;
jack@opensolaris:/tmp$ ls&lt;br /&gt;
CPQary3-2.0.0-solaris10-i386&lt;br /&gt;
dbus-D43WuQsGnK&lt;br /&gt;
iconf_entries.363&lt;br /&gt;
CPQary3-2.0.0-solaris10-i386.tar.gz&lt;br /&gt;
dbus-EmWPHCv5Ec&lt;br /&gt;
ogl_select471
&lt;/div&gt;
Just for simplicity's sake, I renamed the directory, so that it was a bit less unwieldy.
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
jack@opensolaris:/tmp$ mv CPQary3-2.0.0-solaris10-i386 cpqary&lt;br /&gt;
jack@opensolaris:/tmp$ cd cpqary&lt;br /&gt;
jack@opensolaris:/tmp/cpqary$ ls&lt;br /&gt;
CPQary3.144&lt;br /&gt;
&amp;nbsp;CPQary3.pkg&lt;br /&gt;
&amp;nbsp;LICENSE.CPQary3&lt;br /&gt;
&amp;nbsp;RELEASENOTES.CPQary3&lt;br /&gt;
CPQary3.iso&lt;br /&gt;
&amp;nbsp;DU&lt;br /&gt;
&amp;nbsp;README.CPQary3&lt;br /&gt;
&amp;nbsp;tools
&lt;/div&gt;
&lt;span style="font-style: italic;"&gt;Note that the OpenSolaris Live CD logs in with the username 'Jack,' which doesn't have much in the way of priviledges.  Instead of sudo, use the pfexec script to run the commands with elevated priviledges.&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Now here is where some persistent Googling paid off.  There's a bug report at the OpenSolaris site (&lt;a href="http://defect.opensolaris.org/bz/show_bug.cgi?id=5860"&gt;bug #5860&lt;/a&gt;) where a developer suggests a step (creating an empty file in the root dir) that makes things all OK.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Note that this step continues to be necessary with OpenSolaris 2009.06 and the v2.1.0 CPQary3 drivers.

So here are the rest of the steps:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Create a file on root:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
jack@opensolaris:/tmp/cpqary$ pfexec touch /ADD_DRV_IGNORE_ROOT_BASEDIR&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Once we've done that, we can install the driver we downloaded:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
jack@opensolaris:/tmp/cpqary$ pfexec pkgadd -d ./CPQary3.pkg&amp;nbsp;
&lt;br /&gt;
The following packages are available:&lt;br /&gt;
1  CPQary3     HP Smart Array Controller Driver
 (i386)&lt;br /&gt;
2.0.0,Rev=2008.12.05.01.09&lt;br /&gt;
&amp;nbsp;Select package(s) you wish to process (or 'all' to process
all packages).&lt;br /&gt;
(default: all) [?,??,q]:&lt;br /&gt;
&lt;br /&gt;
Processing package instance &lt;cpqary3&gt; from &lt;/cpqary3&gt;

HP Smart Array Controller Driver(i386) 2.0.0,Rev=2008.12.05.01.09&lt;br /&gt;
&lt;br /&gt;
Copyright 2008 Hewlett-Packard Development Company, L.P.&lt;br /&gt;
## Executing checkinstall script.
Using  as the package base directory.&lt;br /&gt;
## Processing package information.&lt;br /&gt;
## Processing system information.
11 package pathnames are already properly installed.&lt;br /&gt;
## Verifying package dependencies.&lt;br /&gt;
## Verifying disk space requirements.
WARNING:
The /usr filesystem has 0 free blocks.&lt;br /&gt;
The current installation requires 158 blocks, which includes a required 150 block buffer for open deleted files.&lt;br /&gt;
158 more blocks are needed.&lt;br /&gt;
WARNING:
The /usr filesystem has 0 free file nodes.&lt;br /&gt;
The current installation requires 26 file nodes, which includes a required 25 file node buffer for temporary files.&lt;br /&gt;
26 more file nodes are needed.&lt;br /&gt;
&amp;nbsp;Do you want to continue with the installation of &lt;cpqary3&gt; [y,n,?] y&amp;nbsp;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;## Checking for conflicts with packages already installed.&amp;nbsp;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;## Checking for setuid/setgid programs.&amp;nbsp;
&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;This package contains scripts which will be executed with super-user
permission during the process of installing this package.&amp;nbsp;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&amp;nbsp;Do you want to continue with the installation of &lt;cpqary3&gt; [y,n,?] y&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&amp;nbsp;Installing HP Smart Array Controller Driver as&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;cpqary3&gt;

## Installing part 1 of 1.&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;cpqary3&gt;/kernel/drv/amd64/cpqary3&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;cpqary3&gt;/kernel/drv/cpqary3&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;cpqary3&gt;/kernel/drv/cpqary3.conf&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;cpqary3&gt;/usr/share/man/man7d/cpqary3.7d&amp;nbsp;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;cpqary3&gt;ERROR: attribute verification of &lt;/cpqary3&gt; failed
pathname does not exist
[ verifying class &lt;none&gt; ]&amp;nbsp;&lt;/none&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;none&gt;ERROR: attribute verification of &lt;/none&gt; failed
pathname does not exist
[ verifying class &lt;master&gt; ]
[ verifying class &lt;devlink&gt; ]&amp;nbsp;&lt;/devlink&gt;&lt;/master&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;master&gt;&lt;devlink&gt;## Executing postinstall script.&amp;nbsp;&lt;/devlink&gt;&lt;/master&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;br /&gt;
&lt;cpqary3&gt;&lt;cpqary3&gt;&lt;master&gt;&lt;devlink&gt;Installation of &lt;cpqary3&gt; partially failed.
&lt;/cpqary3&gt;&lt;/devlink&gt;&lt;/master&gt;&lt;/cpqary3&gt;&lt;/cpqary3&gt;&lt;/div&gt;
Note a couple of things:  the defaults are sufficient, and there are errors in the install.

Happily, the errors are in copying the man pages, which we'll not need, at least for now (the /usr filesystem is read-only in the live CD).  The good news is that the driver now is installed for the Smart Array controller.

&lt;br /&gt;
&lt;h3&gt;

Install OpenSolaris&lt;/h3&gt;
Double-click on the "install OpenSolaris" icon, and you now should be able to see your drives for installation.

&lt;br /&gt;
&lt;h1&gt;

Troubleshooting&lt;/h1&gt;
&lt;h3&gt;

Reboot loop&lt;/h3&gt;
If, after installing OpenSolaris as above, you find yourself in a reboot loop, the best thing to do in troubleshooting it is to set a boot option such that OpenSolaris will display text as it's booting, rather than a graphical progress screen.

To enable this, type the letter e when presented with the GRUB boot loader menu.  This will allow you to edit the boot options.  You'll see a list of the steps that are used in booting OpenSolaris.

First we want to get rid of the splash screen.  Highlight the line that references "splashimage" and press the letter d. That will delete the image that otherwise will cover up the debugging text.

Now select the kernel line (it begins with 'kernel$') and type the letter e again.

If you're unfamilar with GRUB, you're getting a glimpse into how it works:  basically, it's a series of commands that sets up the system and then passes control over to the operating system.  It's a great system for dual booting (Windows, unbeknownst to most, &lt;a href="http://msdn.microsoft.com/en-us/library/aa468626.aspx"&gt;uses something similar&lt;/a&gt;, if more mysterious).

So now we've got a line that, by default, looks more or less like this:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics &lt;/div&gt;
We want to add verbosity and debugging to the boot options, so add -k -v to that line and remove the graphical console, such that it reads like this:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS -k -v&lt;/div&gt;
Hit ENTER, and you'll be returned to the GRUB menu, where you can hit the letter b to boot the system.

Now you can see the error that is causing the system not to boot (or to reboot).  In many cases, you'll see that the error is "cannot mount root" because there's something wrong with the SCSI controller driver.

In this case, try the installation again, using an older version of the CPQary3 drivers.

&lt;br /&gt;
&lt;h3&gt;

Enabling Event Logging&lt;/h3&gt;
HP, for some reason, turned off storage controller event logging in the latest version of the CPQary3 driver.  You can read the full HP Advisory &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&amp;amp;cc=us&amp;amp;objectID=c01828852"&gt;here&lt;/a&gt;, along with instructions on enabling the logging.

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-1665250649893830250?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/1665250649893830250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/02/installing-opensolaris-200811-on-server.html#comment-form' title='45 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1665250649893830250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1665250649893830250'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/02/installing-opensolaris-200811-on-server.html' title='Installing OpenSolaris on a server with a HP Smart Array Controller'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>45</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-7501851705188519424</id><published>2009-02-06T16:30:00.040-06:00</published><updated>2011-12-23T10:15:59.446-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RHEL6'/><category scheme='http://www.blogger.com/atom/ns#' term='VNC'/><category scheme='http://www.blogger.com/atom/ns#' term='RHEL5'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><title type='text'>Setting up a VNC remote desktop in Enterprise Linux 4, 5, and 6</title><content type='html'>This is something that is terribly useful, and there are lots of how-to articles running around.  Unfortunately, I've not found one that was quite complete, especially for someone who is only just getting familiar with Linux (which is precisely when you most need a GUI!).

So this is a step-by-step instruction list on getting a remote X Windows session set up on enterprise linux 4, 5, and 6 (RHEL and CENTOS) that can be accessed with VNC viewer software (do a quick search on VNC if you're not familiar with it).

In some set-ups, people create a VNCSERVER process that runs all the time.  This does allow for persistent sessions (sessions that survive a disconnect), but it's not really what most of us need most of the time.  What we're doing here is using xinetd, which will spin up Xvnc on an as-needed basis.  Much cooler.

Please note: &lt;i&gt; vnc is not a secure protocol&lt;/i&gt;.  What this means is that any traffic that VNC sends over the wire is *not* encrypted.  Do make sure that your use of this doesn't put you at risk for having sensitive data (passwords, for instance) compromised.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div id="fullpost"&gt;
&lt;h3&gt;


Change the RunLevel &lt;/h3&gt;
Change the runlevel to 3.  This will stop GDM (which is what we're using in this example), or whatever your GUI front-end is.


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
init 3&lt;/div&gt;
&lt;h3&gt;


Enable XDMCP &lt;/h3&gt;
Since we want to use Gnome, we'll make sure it's the default desktop manager. Edit &lt;code&gt;/etc/sysconfig/desktop&lt;/code&gt; and make sure it includes the following line:

&lt;br /&gt;
&lt;div class="codesnippet"&gt;
DESKTOP="GNOME"&lt;br /&gt;
DISPLAYMANAGER=GNOME &lt;/div&gt;
Now activate xdmcp:  edit the &lt;code&gt;/etc/gdm/custom.conf&lt;/code&gt; file and find the following lines (NOTE:  in RHEL 4 and CentOS 4, this is in &lt;code&gt;&lt;/code&gt;&lt;code&gt;/etc/X11/gdm/gdm.conf&lt;/code&gt;&lt;code&gt;&lt;/code&gt;).


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
[xdmcp]&lt;br /&gt;
# Distributions: Ship with this off. It is never a safe thing to leave&lt;br /&gt;
# out on the net. Alternatively you can set up /etc/hosts.allow and&lt;br /&gt;
# /etc/hosts.deny to only allow say local access.&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Enable=false&lt;/span&gt;&lt;br /&gt;
# Honour indirect queries, we run a chooser for these, and then redirect&lt;br /&gt;
# the user to the chosen host. Otherwise we just log the user in locally.&lt;/div&gt;
change it to&lt;code&gt;
Enable=true&lt;/code&gt;


&lt;br /&gt;
&lt;h3&gt;


Install VNC
&lt;/h3&gt;
If you're running a stock EL 5 system, you most likely already have vncserver installed.  If you are running EL6, however, you'll need to install it:
&lt;br /&gt;
&lt;div class="codesnippet"&gt;
yum install tigervnc-server&lt;/div&gt;
&lt;h3&gt;


Create Xinetd startup file &lt;/h3&gt;
Make sure xinetd is installed.  The easiest way is to install it:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
yum install xinetd&lt;/div&gt;
Create a file called vncserver in &lt;code&gt;/etc/xinetd.d/&lt;/code&gt; with the following content.  This will tell xinetd to listen on 5908 and 5910 for a desktop of 800x600 and 1024x768 respectively (I like to have the option of using a lower resolution if necessary).&lt;br /&gt;
Note that the service names aren't important; feel free to change them.  Likewise the resolution ("geometry") can be changed to fit your needs.
The server_args line is what gets passed to the Xvnc application.&lt;br /&gt;
&amp;nbsp;Change 'localhost' to the fully qualified domain name of your system.&lt;br /&gt;
&amp;nbsp;If you would like a descriptive title on the title bar of the viewer, put that text after the &lt;code&gt;-desktop=&lt;/code&gt; piece.

Heads-up:  the spaces around the equals signs are important.  Xinetd won't read this if you omit them.

&lt;br /&gt;
&lt;div class="codesnippet"&gt;
service vnc10
{&lt;br /&gt;
protocol = tcp&lt;br /&gt;
socket_type = stream&lt;br /&gt;
wait = no&lt;br /&gt;
user = nobody&lt;br /&gt;
server = usr/bin/Xvnc&lt;br /&gt;
server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16&amp;nbsp;SecurityTypes=None –desktop=&amp;lt;Window_Name_Here&amp;gt;&lt;br /&gt;
port = 5910&lt;br /&gt;
type = unlisted&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
service vnc8
{&lt;br /&gt;
protocol = tcp&lt;br /&gt;
socket_type = stream&lt;br /&gt;
wait = no&lt;br /&gt;
user = nobody&lt;br /&gt;
server = /usr/bin/Xvnc&lt;br /&gt;
server_args = -inetd -query localhost -once -geometry 800x600 -depth 16 SecurityTypes=None –desktop=&amp;lt;Window_Name_Here&amp;gt;&lt;br /&gt;
port =  5908&lt;br /&gt;
type = unlisted
}&lt;/div&gt;
Reload the xinetd settings with &lt;code&gt;service xinetd restart&lt;/code&gt;

&lt;br /&gt;
&lt;h3&gt;


Enable the service &lt;/h3&gt;
Set up the service to start on boot

Turn on xinetd


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
chkconfig xinetd on&lt;/div&gt;
&lt;h3&gt;


Set X Permissions &lt;/h3&gt;
You have to allow X to display for various users on the ports you've allowed.  The best way to do this is to use the Xn.hosts file, where n is the display number you're using.  In our case, we're using 8 and 10, so we'll create two files:  &lt;code&gt;/etc/X8.hosts&lt;/code&gt; and &lt;code&gt;/etc/X10.hosts&lt;/code&gt;.

They'll contain just one line, that is the fully qualified domain name of the server.

&lt;br /&gt;
&lt;h3&gt;


Go back to runlevel 5 &lt;/h3&gt;
&lt;div class="codesnippet"&gt;
init 5&lt;/div&gt;
&lt;h3&gt;


Configure your firewall &lt;/h3&gt;
&lt;code&gt;&lt;/code&gt;We have to allow traffic to come in to your computer on the two ports we configured in the vncserver xinetd file.  In our example, we're using TCP ports 5908 and 5910, so we'll add lines to our iptables file to allow that incoming traffic:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
vim /etc/sysconfig/iptables&lt;/div&gt;
Having opened the firewall file, we'll add the appropriate lines:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5908 -j ACCEPT&lt;br /&gt;
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5910 -j ACCEPT&lt;/div&gt;
These two lines tell the firewall to accept TCP traffic from any source to the ports 5908 and 5910.
Save your changes to the file, and then restart the firewall to pick up the additional ports:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
service iptables restart&lt;/div&gt;
We now should be able to connect to the server using 5908 and 5910.  Use the stand-alone vncviewer application to connect.  VNC works by specifying ports at the end of the computer domain name (e.g., hostname:10, to connect on port 5910).  Once you are connected you should have the usual graphical login screen from gnome.


&lt;br /&gt;
&lt;h3&gt;


Set up clipboard functionality &lt;/h3&gt;
Xvnc doesn’t do copy/paste to the client by default; it needs a helper app to do that. This is called &lt;code&gt;vncconfig&lt;/code&gt;.

&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt; To set it up so that it runs at login, first log in (this must be done for each user who would use the system). &lt;/li&gt;
&lt;li&gt; Click on &lt;b&gt;Applications&lt;/b&gt; &lt;i&gt;(SYSTEM in CentOS and RHEL v5)&lt;/i&gt; and select &lt;b&gt;Preferences -&amp;gt; More preferences -&amp;gt; Sessions&lt;/b&gt;. &lt;/li&gt;
&lt;li&gt; Click on the Startup Programs tab and click the Add button. &lt;/li&gt;
&lt;li&gt; Type &lt;code&gt;/usr/bin/vncconfig -nowin&lt;/code&gt; in the startup command field. &lt;/li&gt;
&lt;/ol&gt;
The next time that user logs in, copy and paste will be supported.


&lt;br /&gt;
&lt;h3&gt;


Troubleshooting &lt;/h3&gt;
&lt;h3&gt;


Connection Closed Unexpectedly or a Black Screen &lt;/h3&gt;
If, after doing the above, you get a “the connection closed unexpectedly” error when trying to connect, try changing the &lt;code&gt;-query localhost&lt;/code&gt; to &lt;code&gt;-query &lt;domain&gt;&lt;/domain&gt;&lt;/code&gt; in the file in the &lt;code&gt;/etc/xinetd.d&lt;/code&gt; dir.
The safest thing, if you run into this problem (or a black screen) is to replace ‘localhost’ with the output of &lt;code&gt;hostname –f&lt;/code&gt; on the server.
It could also indicate a typo in the vncserver file in /etc/xinetd.d, so check that file closely.



&lt;br /&gt;
&lt;h3&gt;


Client is not authorized to connect error
&lt;/h3&gt;
If you see something like the error below, it indicates that you need to create the Xn.hosts file as referenced above.  Create the file with the number indicated in the &lt;b&gt;display:&lt;/b&gt; piece of the error.  In the case below, it'd be X0.hosts file that needs to be created.

You'll have to log out and back in for this change to take place (or do an init 3, init 5).

&lt;br /&gt;
&lt;pre&gt;Xlib: connection to ":0.0" refused by serverXlib: server.example.com is not authorized to connect to serverError: can't open display: :0&lt;/pre&gt;
&lt;h3&gt;


Blank Screen after Login &lt;/h3&gt;
If you run into a blank (usually background-colored) screen after entering your username and password, this indicates some Gnome (XWindows) session data has gotten corrupted.  The easiest way to test this is to try logging in as another user.  If you can do so without getting this error, here's how to fix it:

&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt; Delete all files and directories beloning to the affected user in /tmp.
You can focus that a little more by first deleting any file/directories that appear with the name "gnome" or "X" in them.  After doing this, try logging in again.  It probably will work. &lt;/li&gt;
&lt;li&gt; If #1 doesn't get things going, you may also have to delete the following files and directories from the user's home directory (typically /home/username): &lt;/li&gt;
&lt;/ol&gt;
&lt;table border="1" cellpadding="1" cellspacing="1" style="width: 507px;"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;.esd_auth
&lt;/td&gt;&lt;td&gt;.gconfd
&lt;/td&gt;&lt;td&gt;.gnome2_private
&lt;/td&gt;&lt;td&gt;.nautilus
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;.dmrc
&lt;/td&gt;&lt;td&gt;.gconf
&lt;/td&gt;&lt;td&gt;.gnome-desktop
&lt;/td&gt;&lt;td&gt;.metacity
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;.fonts.cache*
&lt;/td&gt;&lt;td&gt;.gnome
&lt;/td&gt;&lt;td&gt;.gnome2
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;.ICEauthority
&lt;/td&gt;&lt;td&gt;.gtkrc*
&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;


Gray screen only &lt;/h3&gt;
A gray screen with no login prompt probably means you forgot to edit the desktop file at the top.
It also could be an error in the gdm.conf file.  Take a look at the gdm.conf (or custom.conf) file that you edited at the top and make sure the remote (or xdmcp) greeter in the [daemon] section is blank or commented out.
&lt;a href="http://www.blogger.com/post-edit.g?blogID=1714283384790610704&amp;amp;postID=7501851705188519424" name="DBus_Problems_-_DROM_Access_Denied"&gt;&lt;/a&gt;

&lt;br /&gt;
&lt;h3&gt;


DBus Problems - DROM Access Denied

&lt;/h3&gt;
If you receive a message stating something like this:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
A security policy in place prevents this sender from sending
this message to this recipient, see message bus configuration file
(rejected message had interface “org.freedesktop.Hal.Device.Volume”
member “Mount” error name “(unset)” destination “org.freedesktop.Hal”)
&lt;/div&gt;
Then you've run into this problem.  The problem is corrected by adding the following lines to the end of &lt;code&gt;/etc/dbus-1/system.d/hal.conf&lt;/code&gt;:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&amp;lt;policy group=" users="&amp;gt;&lt;br /&gt;
&amp;lt;allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement" /&amp;gt;&lt;br /&gt;
&amp;lt;allow send_interface="org.freedesktop.Hal.Device.VideoAdapterPM" /&amp;gt;&lt;br /&gt;
&amp;lt;allow send_interface="org.freedesktop.Hal.Device.LaptopPanel" /&amp;gt;&lt;br /&gt;
&amp;lt;allow send_interface="org.freedesktop.Hal.Device.Volume" /&amp;gt;&lt;br /&gt;
&amp;lt;allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto" /&amp;gt;&lt;br /&gt;
&amp;lt;/policy&amp;gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-7501851705188519424?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/7501851705188519424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2009/02/setting-up-non-persistent-remote-gui.html#comment-form' title='38 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7501851705188519424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7501851705188519424'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2009/02/setting-up-non-persistent-remote-gui.html' title='Setting up a VNC remote desktop in Enterprise Linux 4, 5, and 6'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>38</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4175153319009150965</id><published>2008-08-29T15:50:00.013-05:00</published><updated>2011-12-23T10:18:39.778-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Bulk Insert Using a Format File to Read Data that also Includes a Comma in the String</title><content type='html'>There are a lot of resources out there on the net about using SQL Server Bulk Insert, and there are a lot of technical discussions about the inner details of Format Files. The problem is that there aren't many concrete examples of a very common need: importing a CSV (comma-separated) file where a quoted string also includes a comma.
&lt;span id="fullpost"&gt;
Here's an example of what some data might look like:

&lt;/span&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;ID,Name,Phone&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
100983,"Jones, Frank",555-1212&lt;br /&gt;
118928,"Smith, Joe",555-1313&lt;br /&gt;
115454,"Franklin, Alibaster",555-1414
&lt;/div&gt;
&lt;span id="fullpost"&gt;
Using a bulk insert statment without a format file would give us data that would look like this:
&lt;table border="2"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;ID&lt;/span&gt;&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Phone&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100983&lt;/td&gt;&lt;td&gt;"Jones&lt;/td&gt;&lt;td&gt;Frank"&lt;/td&gt;&lt;td&gt;555-1212&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;118928&lt;/td&gt;&lt;td&gt;"Smith&lt;/td&gt;&lt;td&gt;Joe"&lt;/td&gt;&lt;td&gt;555-1313&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;115454&lt;/td&gt;&lt;td&gt;"Franklin&lt;/td&gt;&lt;td&gt;Alibaster"&lt;/td&gt;&lt;td&gt;555-1414&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/span&gt;&lt;div&gt;
When in reality, we want the data to look like this:
&lt;table border="2"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;100983&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;Jones, Frank&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;555-1212&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;118928&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;Smith, Joe&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;555-1313&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;115454&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;Franklin, Alibaster&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family: 'courier new';"&gt;555-1414&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a name='more'&gt;&lt;/a&gt;The format file is your friend! Basically, you'll create a format file that looks like this:
&lt;div class="codesnippet"&gt;
8.0&lt;br /&gt;
3&lt;br /&gt;
1 SQLCHAR 0 6 ",\"" 1 empid SQL_Latin1_General_Cp437_BIN
2 SQLCHAR 0 50 "\","&lt;br /&gt;
2 name SQL_Latin1_General_Cp437_BIN
3 SQLCHAR 0 10 "\n"&lt;br /&gt;
3 phone SQL_Latin1_General_Cp437_BIN&lt;/div&gt;
Here's how the above breaks down:
&lt;strong&gt;8.0 &lt;/strong&gt;is the version. That's constant. For SQL Server 2005, anyway. :)
&lt;strong&gt;3&lt;/strong&gt; tells the Bulk Insert statement how many fields there are in each row.

Then we have the three fields listed:
1, 2, and 3 are the field numbers.
6, 50, and 10 are the field sizes. You'll need these to match the data types that are defined in your table.

Now we get to our field delimiters. In a format file, delimiters are specified in double quotes. If a double quote is a part of a delimiter, then it needs to be escaped with a backslash:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;",\""&lt;/strong&gt; (&lt;em&gt;note the &lt;/em&gt;&lt;u&gt;double&lt;/u&gt; &lt;em&gt;double quotes&lt;/em&gt;) means, then, that there will be a comma followed by a double quote at the end of the first field. This is nice in that it does two things for us: first, it delimits the field, but it also will strip the first quote from the data as it's inserted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;"\"," &lt;/strong&gt;means that there will be a quote followed by a comma at the end of the second field. In this way, we've skipped the comma that is in the data, and we've stripped the second quote from the data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;"\n"&lt;/strong&gt; means that the last field will be delimited by an end-of-line character.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;SQL_Latin1_General_Cp437_BIN&lt;/strong&gt; has to do with the database collating setting, and many people simply leave that out of their format file without apparent ill effect.

Now you can use a bulk insert statment like this:
&lt;div class="codesnippet"&gt;
bulk INSERT temptable FROM 'csvfilename' WITH (FIRSTROW = 2, FORMATFILE='formatfilename')&lt;/div&gt;
This will insert the CSV file into table &lt;em&gt;&lt;span style="font-family: 'courier new'; font-size: 85%;"&gt;TEMPTABLE&lt;/span&gt;,&lt;/em&gt; starting at the second row (we don't want to import the headers), using your new format file.

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4175153319009150965?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4175153319009150965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/08/sql-server-bulk-insert-using-format.html#comment-form' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4175153319009150965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4175153319009150965'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/08/sql-server-bulk-insert-using-format.html' title='SQL Server Bulk Insert Using a Format File to Read Data that also Includes a Comma in the String'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-1505957302470078622</id><published>2008-07-10T14:37:00.005-05:00</published><updated>2010-12-25T12:07:11.572-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='PeopleSoft Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='PeopleSoft'/><title type='text'>WebLogic Case Sensitivity</title><content type='html'>Prior to v9.0, Weblogic was case-insensitive in Windows, but starting with v9, the default is, like Apache, to be case sensitive. A web search on changing that behavior isn't very helpful, and the setting is buried a bit, so I thought I'd post the instructions on changing that setting.
&lt;span id="fullpost"&gt;
The first step is to run the weblogic admin console. The default URL, once that has been started, is to browse to http://servername:9999/console.
You'll be prompted for the username/password that you configured when installing weblogic.

Once there, click on &lt;strong&gt;Domain&lt;/strong&gt;-&gt; &lt;strong&gt;Security&lt;/strong&gt;-&gt; &lt;strong&gt;Advanced&lt;/strong&gt;.

There you will see a "&lt;strong&gt;Web App Files Case Insensitive&lt;/strong&gt;:" setting. By default, this is set to "false". Change it to "os", click on save.

Once it's been saved, the changes have to be Activated. Click on the green &lt;strong&gt;Activate Changes&lt;/strong&gt; button on the left-hand side of the screen.
&lt;p&gt;You'll have to reboot the admin console, as well as your standard weblogic web services, for this change to take effect.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-1505957302470078622?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/1505957302470078622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/07/weblogic-case-sensitivity.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1505957302470078622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1505957302470078622'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/07/weblogic-case-sensitivity.html' title='WebLogic Case Sensitivity'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-579012898778924194</id><published>2008-06-17T16:45:00.003-05:00</published><updated>2008-06-17T16:51:16.121-05:00</updated><title type='text'>Persistent Problem with MS Update</title><content type='html'>Have you ever gotten a Windows system that simply won't update?  That is, it'll find all the updates it needs from Microsoft, but the updates won't do anything but fail.  It's a bummer, because the normal reboot simply won't fix the problem.
&lt;span id="fullpost"&gt;
It turns out there is a solution.  The problem appears to come from XP SP3, beauty, that.  In any case, this should fix the problem:

Run:

REGSVR32 WUAPI.DLL
REGSVR32 WUAUENG1.DLL
REGSVR32 ATL.DLL
REGSVR32 WUPS2.DLL
REGSVR32 WUCLTUI.DLL
REGSVR32 WUPS.DLL
REGSVR32 WUWEB.DLL
REGSVR32 WUAUENG.DLL

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-579012898778924194?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/579012898778924194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/06/persistent-problem-with-ms-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/579012898778924194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/579012898778924194'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/06/persistent-problem-with-ms-update.html' title='Persistent Problem with MS Update'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2471582917073169157</id><published>2008-06-17T16:14:00.002-05:00</published><updated>2008-06-17T16:34:00.545-05:00</updated><title type='text'>Windows Vista Look and Feel in XP</title><content type='html'>If you're interested in making your XP system look like Vista, there are a ton of resources out there.  Why another one?  Because I want to keep it simple.  I found two resources that gave me the whiz-bang look and functionality without fiddling too much with lots of other apps.
&lt;span id="fullpost"&gt;
In short, I used what must be the gold standard, &lt;a href="http://www.windowsxlive.net/vista-transformation-pack"&gt;Vista Transformation Pack&lt;/a&gt;, along with &lt;a href="http://www.crystalxp.net/galerie/en.id.5139-truetransparency-lefreut-explorer-tools.htm"&gt;TrueTransparency &lt;/a&gt;and the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=75078"&gt;Microsoft Zune XP theme&lt;/a&gt;.  With these three packages, I got more than I needed, and they're all free.

I ended up unselecting the toolbar and start button transformations from the vista transformation pack; I don't care for the tool bar, and the Start Button just wasn't quite where I think it should be:  you can't right-click on the icons, and there's just a bit missing.

Still, it makes for a great user experience, without a lot of the Vista negatives.


&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2471582917073169157?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2471582917073169157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/06/windows-vista-look-and-feel-in-xp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2471582917073169157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2471582917073169157'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/06/windows-vista-look-and-feel-in-xp.html' title='Windows Vista Look and Feel in XP'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6612680359272044226</id><published>2008-06-11T10:37:00.010-05:00</published><updated>2011-12-23T10:19:50.967-06:00</updated><title type='text'>Desktop Search for Windows x64</title><content type='html'>Windows released version 4 of its desktop search recently, and I must say that it (mostly) works well. With the Vista desktop, one simply can begin typing a search string at the start menu, and Windows will present the search results there as you type.&lt;br /&gt;
&lt;br /&gt;
The problem: UNC indexing isn't apparently supported in the 64 bit environments, at least not with Server 2008, and the network shares I want to index are stored on Windows Server 2000 boxes: those won't run the new indexing tool.&lt;br /&gt;
&lt;br /&gt;
So what to do?&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Of course: Google Desktop. It's fast, it supports network share indexing, and it's got a very intuitive interface.&lt;br /&gt;
&lt;br /&gt;
But here's the problem: &lt;a href="http://4.bp.blogspot.com/_QFTS-w4RNtM/SE_z6XsVJLI/AAAAAAAAACo/qXJMFPwbgB4/s1600-h/googledesktopinstall.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5210651478008865970" src="http://4.bp.blogspot.com/_QFTS-w4RNtM/SE_z6XsVJLI/AAAAAAAAACo/qXJMFPwbgB4/s320/googledesktopinstall.jpg" style="cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /&gt;&lt;/a&gt;That says: "Google Desktop is not currently compatible with your operating system. It requires a &lt;span style="font-weight: bold;"&gt;32-bit version of Windows&lt;/span&gt;..."&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;br /&gt;Ugh. Leaving out the rant, there's a happy solution. Before going to the solution that works in the corporate environment, &lt;a href="http://www.copernic.com/en/products/desktop-search/index.html"&gt;Copernic Desktop Search&lt;/a&gt; is worth looking at for those at home. Unfortunately, work is really where I need this, and Copernic requires a fee for corporate users.&lt;br /&gt;&lt;br /&gt;So we're back to Google. It turns out that Google Desktop version 5.1.706.29690 *does* in fact work with 64 bit versions of Windows. So all is happy in search land.&lt;br /&gt;&lt;br /&gt;Filehippo can get you that version (and others) of Google Desktop &lt;a href="http://www.filehippo.com/download_google_desktop/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Note that later versions (like 5.7.802.22438) also will install on Win x64, but I've not been able to get them to index files, especially network shares. So if you've installed a later version and constantly see "Crawl not yet started", try an earlier version.&lt;br /&gt;&lt;br /&gt;[Edit]&lt;br /&gt;Google has heard the call for 64-bit support, and responded with this post:&lt;a href="http://desktop.google.com/support/bin/answer.py?hl=en&amp;amp;answer=25631"&gt;http://desktop.google.com/support/bin/answer.py?hl=en&amp;amp;answer=25631&lt;/a&gt;&lt;br /&gt;to wit:&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;span id="fullpost"&gt;If you'd like to install and use Google Desktop on 64-bit Windows in an unsupported capacity, you can do so by using the&amp;nbsp;&lt;span class="code" style="font-family: 'Courier New', Courier;"&gt;/force&lt;/span&gt;&amp;nbsp;flag when using the command line to install Google Desktop. &lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Command line argument:  &lt;span class="code" style="font-family: 'Courier New', Courier;"&gt;googledesktopsetup.exe /force&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span id="fullpost"&gt;&lt;br /&gt;So, it's unsupported, and they note that certain features may not work.  So it might be worth a try.  For me, I'm content with the functionality I've got.  Anyone had any experience using this method?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6612680359272044226?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6612680359272044226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/06/desktop-search-for-windows-x64.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6612680359272044226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6612680359272044226'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/06/desktop-search-for-windows-x64.html' title='Desktop Search for Windows x64'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_QFTS-w4RNtM/SE_z6XsVJLI/AAAAAAAAACo/qXJMFPwbgB4/s72-c/googledesktopinstall.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5090268342207601565</id><published>2008-04-22T13:59:00.005-05:00</published><updated>2008-04-22T14:18:28.468-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PeopleSoft Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='PeopleSoft'/><title type='text'>PeopleSoft Upgrade Woes</title><content type='html'>When upgrading a PeopleSoft database from 8.47 to 8.49, we ran into a curious problem, receiving this error:

&lt;div class="codesnippet"&gt;SQL Error. Error Position: 14 Return: 6550 - ORA-06550: line 1, column 15: PLS-00103: Encountered the symbol "TABLE" when expecting one of the following: := . ( @ % ; &lt;/div&gt;
It turns out that it was a simple problem, but it wasn't at all obvious from the error: the DDLORA.DMS script that ran during the initial part of the upgrade was old; for whatever reason, it hadn't gotten updated by the install process.
&lt;span id="fullpost"&gt;
This is what was happening:
Datamover was importing the tables, and the first succeeded.  Then:  it went to compute statistics.  That's where things went wrong.  Here's why:  the ddlora.dms script defines not only default tablespace parameters, but also the method by which DataMover will compute statistics.  Pre-8.48 PeopleSoft did it using the 'analyze table' method, while 8.49 uses the dbms stats method.  With the old statistics parameters in the PSDDLMODEL table, the compute stats call failed, and so did the upgrade.
&lt;p&gt;To fix this problem, we installed PeopleTools 8.49 again on an empty PS Home, and then we copied the new script over.&lt;/p&gt;


&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5090268342207601565?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5090268342207601565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/04/peoplesoft-upgrade-woes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5090268342207601565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5090268342207601565'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/04/peoplesoft-upgrade-woes.html' title='PeopleSoft Upgrade Woes'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-1236236945092330092</id><published>2008-04-15T14:59:00.004-05:00</published><updated>2008-04-15T15:23:05.455-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Mysite problems'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Errors'/><title type='text'>404 (Not Found) Error When clicking on MySite "My Profile" tab in SharePoint</title><content type='html'>This error is vexing, though there's a simple solution documented in &lt;a href="http://support.microsoft.com/kb/924399"&gt;MS kb924399&lt;/a&gt;.
I've summarized the solution below with some assumptions about settings that folks normally use.
&lt;span id="fullpost"&gt;
In short, the problem is that there isn't a site collection set up using the appropriate template in the MySite web application. We'll correct that in a few steps.

&lt;em&gt;Note: it's entirely possible--even likely--that you've already got a site collection created at the root of the mysite web application. If this is a single personal site, that's part of your problem. This site will need to be backed up and deleted before you can go further, assuming that all of your other personal sites are using a different path.&lt;/em&gt;

First, we need to create the managed path that SharePoint will use for this site collection.
&lt;blockquote&gt;&lt;p&gt;This can be anything, but most people will have created their sites with the default root ( / ) site collection. So we'll go with that for our purposes. &lt;/p&gt;&lt;p&gt;To do this, click on &lt;strong&gt;Application Mangement -&gt; Define
Managed Paths&lt;/strong&gt;. Make sure, once the defined managed paths screen
comes up, that you've got the correct MySite web application selected in
the top-right.

Go ahead and create the managed path at the desired
location. &lt;/p&gt;&lt;/blockquote&gt;Next, we'll want to create the site collection using the correct template.
&lt;blockquote&gt;&lt;p&gt;Click on &lt;strong&gt;Application Management -&gt; Create Site
Collection&lt;/strong&gt; to bring up the site collection screen.
Make sure you've got the correct web application selected on the left, and
then select the managed path you created in the step above for the URL.&lt;/p&gt;&lt;p&gt;Give the site collection a title, like 'Personal Sites', and -- here's the money part -- select the "My Site Host" template from the &lt;strong&gt;Enterprise&lt;/strong&gt; template tab. &lt;/p&gt;&lt;p&gt;Fill in the site administrators fields appropriately and click on OK. &lt;/p&gt;&lt;/blockquote&gt;After doing these steps, the My Profile tab should work again.



&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-1236236945092330092?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/1236236945092330092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/04/404-not-found-error-when-clicking-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1236236945092330092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/1236236945092330092'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/04/404-not-found-error-when-clicking-on.html' title='404 (Not Found) Error When clicking on MySite &quot;My Profile&quot; tab in SharePoint'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-49857295493091191</id><published>2008-04-10T08:40:00.005-05:00</published><updated>2008-04-11T10:15:37.389-05:00</updated><title type='text'>Simplifying SharePoint Structure with Site Collections</title><content type='html'>Site Collections in SharePoint 2007 are the "pieces" of a web application.  Personal sites (my site), for instance, are each a site collection.  There are a couple of real benefits, too, for using many site collections--instead of multiple web applications--to form the bulk of your SharePoint implementation.
&lt;span id="fullpost"&gt;
&lt;span style="font-size:130%;"&gt;SharePoint Maintenance&lt;/span&gt;
On the whole, it's simpler to have few IIS web sites (and few web applications) and many site collections.  This provides for fewer urls (and thus fewer IIS sites) and fewer ACLs (permissions) to maintain.  The permissions piece, in particular, can become a real bear in a large SharePoint installation, as each piece of a web application and all of the pieces of all of its site collections can all have different permissions assigned to them.  Using site collections as the primary content-delivery piece can simplify the permissions considerably.

&lt;span style="font-size:130%;"&gt;Backups/Restore&lt;/span&gt;
Backups in SharePoint are a tricky business, partly because Microsoft gives you many ways to perform backups and recovery.  The simplest solution for backing up your SharePoint installation is to do a farm-level backup, which gives you the option of restoring individual web applications.

The downside to using lots of web applications, as most SharePoint administrators quickly discover, is that you end up with a multitude of IIS web sites.  To create subdirectories within these sites, administrators create site collections within them, giving a pretty complex structure.  Moreover, when you perform a web application backup, you have to restore the web application, which includes all of the site collections contained within it.  That complicates the restore process quite a bit.

Some implementations (particularly very large SharePoint sites) will benefit from the above scenario, but most people can get all the functionality and simpler administration by using site collections as the primary structural unit.
Because you can backup and restore individual site collections, it allows you a lot more flexibility and granularity in your backup and restore strategy.

Moreover, it happens from time to time that a web application configuration become corrupt, such that, for instance, the my sites functionality no longer works.  If you have backed up the individual site collections from that web application, it is a trivial task to create a new web application and import the component site collections into it.

Backing up site collections, however, does bring up a problem:  because stsadm (the admin tool used to backup site collections) requires a site collection url as a command line parameter, there's not an out-of-the-box way to backup all site collections in one fell swoop.

Happily, this problem has been recognized by many competent scripting folks.  The script we use is a modified version of the one posted by Mauro Cardarelli &lt;a href="http://blogs.officezealot.com/mauro/archive/2006/04/19/9683.aspx"&gt;on his blog&lt;/a&gt;.  It runs through all of the site collections in a given url and backs them all up individually.

&lt;span style="font-style: italic;"&gt;Note that, should you use this script, it was written for SharePoint 2003, and as a result, the path to the stsadm executable needs to be updated from &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;font-family:courier new;" &gt;60&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;\BIN\stsadm&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt; to &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;font-family:courier new;" &gt;12&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;\BIN\stsadm&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;.&lt;/span&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-49857295493091191?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/49857295493091191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/04/simplifying-sharepoint-structure-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/49857295493091191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/49857295493091191'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/04/simplifying-sharepoint-structure-with.html' title='Simplifying SharePoint Structure with Site Collections'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4591390498550668991</id><published>2008-03-28T08:43:00.008-05:00</published><updated>2009-04-04T21:07:10.736-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Mysite problems'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Errors'/><title type='text'>401 Error when trying to create MySite (personal site) in SharePoint 2007</title><content type='html'>It's a common enough problem that you can find untold numbers of questions posted to forums and blogs:  why am I getting a 401 denied error when trying to get to/create a mysite personal site in SharePoint?

The problem usually is manifest by first being presented with a username/password prompt three times, followed by a 401 error.  Interestingly, in Firefox, it appears that sometimes you just get unending username/password prompts.

Why this is happening:  who knows?  It's often possible to track down the problem, usually related to application pool permissions or some rogue setting in SharePoint.  Even if you do find the problem, though, enough settings in SharePoint are reasonably inaccessible after the initial setup that finding your way to correcting it can take a very, very long, frustrating time.

Our solution has been simply to create a new default shared services provider (SSP) and associate all of the web applications, including the existing mysites, to the new SSP.
&lt;span id="fullpost"&gt;
The Shared Services Provider in SharePoint is the glue that holds everything together.  It manages, in particular, what happens when you click on the "mysite" link.  So when that link no longer functions properly, one way to fix it is to set up a new SSP using a new content database and new IIS web site.  In this way, we can eliminate a lot of errors without having to do a lot of painful troubleshooting.  We'll go through those steps now.

Note that these steps are for SharePoint 2007; they may work on 2003 as well, but I've no experience with it, so I make no promises as to its applicability.

&lt;span style="font-size:130%;"&gt;Create the New Shared Services Provider&lt;/span&gt;&lt;span style="font-size:100%;"&gt;
Open SharePoint Central Administration and click on the &lt;span style="font-weight: bold;"&gt;Shared Services Administration&lt;/span&gt; link on the left-hand side of the screen.&lt;/span&gt;
&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;
You should see something like the screen shot below.&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_QFTS-w4RNtM/R-0CQYZhzrI/AAAAAAAAACY/fJik8sZhAD4/s1600-h/SSPAdmin.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_QFTS-w4RNtM/R-0CQYZhzrI/AAAAAAAAACY/fJik8sZhAD4/s320/SSPAdmin.JPG" alt="" id="BLOGGER_PHOTO_ID_5182801226623995570" border="0" /&gt;&lt;/a&gt;
&lt;span style="font-size:100%;"&gt;
To create a new Shared Services Provider, click on the &lt;span style="font-weight: bold;"&gt;New SSP&lt;/span&gt; link.  You'll want to create a new web application to host this, on a new port.  Also, specify a new SSP Database, ensuring that any erroneous settings don't get migrated.

Make sure &lt;/span&gt;&lt;span style="font-size:100%;"&gt;that you use your existing MySite web application (in this example, named "Sharepoint - Personal") for the &lt;span style="font-weight: bold;"&gt;My Site Location&lt;/span&gt; in setting up this new SSP.

Once you've created your new SSP, you can set it as the default (using the &lt;span style="font-weight: bold;"&gt;Change Default SSP&lt;/span&gt; link).  Once you've done that, use the &lt;span style="font-weight: bold;"&gt;Change Associations&lt;/span&gt; link to associate all of your existing web applications to the new SSP.

Having done that, you're probably good to go.  You might, just to be safe, double-check your My Site settings in the new Shared Services site.&lt;/span&gt;
&lt;span idstyle="font-size:100%;"&gt;

&lt;span style="font-size:130%;"&gt;Check your My Site Settings&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;/span&gt;On the left-hand menu, under Shared Services Administration, click on the title of your new SSP.  This will open the SSP home page, like below.
&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_QFTS-w4RNtM/R-0HzoZhzsI/AAAAAAAAACg/Dtmk814_Rrw/s1600-h/SSPAdmin2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_QFTS-w4RNtM/R-0HzoZhzsI/AAAAAAAAACg/Dtmk814_Rrw/s400/SSPAdmin2.jpg" alt="" id="BLOGGER_PHOTO_ID_5182807329772523202" border="0" /&gt;&lt;/a&gt;
&lt;span id="fullpost"  style="font-size:100%;"&gt;Click on the &lt;span style="font-weight: bold;"&gt;My Site Settings&lt;/span&gt; link and make sure that the &lt;span style="font-weight: bold;"&gt;Personal Site Location&lt;/span&gt; field matches what you had set up previously.  Having done that, you're done!


&lt;span style="font-size:130%;"&gt;Delete any erroneously-created My Sites&lt;/span&gt;

Unless you're not:  if you discover later that the personal site location field is incorrect, you may end up with users creating new sites when they already had one.  This is disconcerting, but it's easily fixed.

To delete a user's My Site, simply click on the &lt;span style="font-weight: bold;"&gt;Delete Site Collection&lt;/span&gt; link in the &lt;span style="font-weight: bold;"&gt;Application Tab&lt;/span&gt; of the &lt;span style="font-weight: bold;"&gt;Central Administration&lt;/span&gt; page.  There you can select the offending site collection from the My Site web application.  This will delete the My Site without problem.  However, you still need to change the My Site settings in the SSP, as above.

And:  having done so, issue a iisreset /noforce on the front-end web servers.  Unless you do this, the user runs the risk of being directed, even still, to the now-nonexistent My Site.  This gives them a 404 (not found) error.  After the iisreset, they should be directed, again, to their original my site.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4591390498550668991?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4591390498550668991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/401-error-when-trying-to-create-mysite.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4591390498550668991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4591390498550668991'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/401-error-when-trying-to-create-mysite.html' title='401 Error when trying to create MySite (personal site) in SharePoint 2007'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_QFTS-w4RNtM/R-0CQYZhzrI/AAAAAAAAACY/fJik8sZhAD4/s72-c/SSPAdmin.JPG' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2117938876752855167</id><published>2008-03-26T14:15:00.006-05:00</published><updated>2008-03-26T15:00:15.849-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Backup and Restore'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Errors'/><title type='text'>Value cannot be null error When Trying to View a SharePoint Site</title><content type='html'>We ran into a problem after restoring a SharePoint 2007 farm that stumped us for awhile.  Namely, the MySites web application wouldn't come up; it had restored successfully, but we'd get a generic error message when we'd try to browse to it.  Once we had &lt;a href="http://lanestechblog.blogspot.com/2008/03/configuring-sharepoint-2007-to-display.html"&gt;turned on detailed error reporting&lt;/a&gt;, we saw the following error code:

&lt;div class="codesnippet"&gt;Value cannot be null.
Parameter name: serverContext 
   at Microsoft.Office.Server.UserProfiles.UserProfileManager..ctor(ServerContext serverContext, Boolean IgnoreUserPrivacy, Boolean backwardCompatible)
   at Microsoft.Office.Server.UserProfiles.UserProfileManager..ctor(ServerContext serverContext, Boolean IgnoreUserPrivacy)
   at Microsoft.Office.Server.UserProfiles.ProfileLoader.EnsureUserProfile()
   at Microsoft.Office.Server.UserProfiles.ProfileLoader.GetUserProfile()
   at Microsoft.SharePoint.Portal.WebControls.CreatePersonalSpace.Page_Load(Object sender, EventArgs args)
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at Microsoft.SharePoint.Portal.PageBase.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)   &lt;/div&gt;

&lt;span id="fullpost"&gt;
Now this made no sense whatsoever; what's null?  The application looked like it was set up correctly, and it had been working before we did the backup and restore (it was a test run of our DR process).

Unfortunately, too, all I could find on the web that referenced the error was information about coding tasks, which isn't what I'm doing at all.

Finally, we fixed it:  &lt;span style="font-weight: bold;"&gt;Alternate Access Mappings&lt;/span&gt;.  We were using SSL to access the site (through a netscaler load balancer), but post-restore, SharePoint only had http:// in its configuration.  After re-adding https:// as a public URL for the web application, the error goes away.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2117938876752855167?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2117938876752855167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/value-cannot-be-null-error-when-trying.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2117938876752855167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2117938876752855167'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/value-cannot-be-null-error-when-trying.html' title='Value cannot be null error When Trying to View a SharePoint Site'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-3822580659467765889</id><published>2008-03-26T11:00:00.008-05:00</published><updated>2008-03-26T13:21:02.413-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Errors'/><title type='text'>Configuring SharePoint 2007 to Display Errors</title><content type='html'>By default (and this is a good thing), SharePoint displays a simple generic "an error has occurred" message when a problem arises.  In troubleshooting these problems, it's useful to turn on more descriptive error messages.
&lt;span id="fullpost"&gt;
The first thing to realize in any discussion of detailed error messages on the web is that it's generally not a good thing to keep your site configured to display details of the errors that are generated; it can reveal much about your infrastructure and security that is best kept secret.
So:  when you make these changes, be sure to unmake them later.

&lt;span style="font-size:130%;"&gt;Locating Web.config&lt;/span&gt;
Configuring SharePoint to display a details (including a stack trace) of its errors involves two simple changes to the web.config file that is stored in the root of the affected web site.  &lt;/span&gt;&lt;span id="fullpost"&gt;Hopefully, in setting SharePoint up, you opted to use meaningful names for the web sites.  If, however, that didn't happen, call up the &lt;span style="font-weight: bold;"&gt;Web Application List&lt;/span&gt; in SharePoint's application management tab.  You'll see a list of the sites (name) and their respective URLs.  Those names correspond to the site names in IIS.
&lt;/span&gt;&lt;span id="fullpost"&gt;Of course, SharePoint doesn't care where that document root is, so if you don't already know where the document root is, open up IIS manager and view the web site's properties.  Click on the &lt;span style="font-weight: bold;"&gt;Home Directory&lt;/span&gt; tab, and you'll see the path to use.  web.config will be in that directory.
&lt;span style="font-size:130%;"&gt;
Modifying Web.config&lt;/span&gt;
Having located web.config, open it in a text editor, and find the following line:
&lt;div class="codesnippet"&gt;&amp;lt;customerrors mode="on" /&amp;gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;
&lt;/span&gt;Change the above setting to &lt;span style="font-weight: bold;"&gt;Off&lt;/span&gt;.
This tells the web app server to display errors as they occur, instead of the generic SharePoint-defined custom error of "An Error occurred."

Likewise, find
&lt;div class="codesnippet"&gt;&amp;lt;SafeMode MaxControls="200" Callstack="false"&lt;/div&gt;
Change the false above to &lt;span style="font-weight: bold;"&gt;true&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;
This tells the web app server to display the error stack when an error occurs.

When you save your changes, you should be set, and your SharePoint errors now will display as they occur.


&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-3822580659467765889?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/3822580659467765889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/configuring-sharepoint-2007-to-display.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3822580659467765889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/3822580659467765889'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/configuring-sharepoint-2007-to-display.html' title='Configuring SharePoint 2007 to Display Errors'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-2615565255675884997</id><published>2008-03-25T20:36:00.010-05:00</published><updated>2008-12-08T23:46:41.219-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Backup and Restore'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Errors'/><title type='text'>Backing up and Restoring SharePoint 2007 Sites and Site Collections</title><content type='html'>Restoring SharePoint 2007 sites and web applications from a backup can be quite a headache; SharePoint is famously tight-lipped when it comes to error messages. This is a rundown of some of the issues we've run into in restoring from backups.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Restore Errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;DCOM Permissions &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If your restore fails with a log referencing "UnauthorizedAccessException" referencing a COM class with a long CLSID and error number 80070005, you've got a COM Config permissions problem. This error is accompanied by a system event log like the one below.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="codesnippet"&gt;The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID&lt;br /&gt;{3D42CCB1-4665-4620-92A3-478F47389230}&lt;br /&gt;to the user domain\databaseconnectuser SID (S-1-5-21-2142909598-1293495619-134157935-85307). This security permission can be modified using the Component Services administrative tool.&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As the event log error indicates, the fix for this is to use the Component Services tool (dcomcnfg.exe) to give Local Activation permissions to the user listed. Here's the rub: you don't at this time know which COM class to modify. To figure that out, search in the registry for the CLSID as referenced in the event log and restore log. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The registry search will give you the name of the com class. Unless it doesn't: a common class to have this problem is OSearch. If, when you search the registry, you see "Microsoft Office SharePoint Server Search Gathering Manger", the name you'll look for in the component services tool is &lt;strong&gt;OSearch&lt;/strong&gt;. &lt;/p&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_QFTS-w4RNtM/R-mwUIZhzqI/AAAAAAAAACQ/Ad546iM1nys/s1600-h/dcomcnfg.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5181866706164895394" style="margin: 0px 10px 10px 0px; float: left; width: 300px; height: 237px;" alt="" src="http://1.bp.blogspot.com/_QFTS-w4RNtM/R-mwUIZhzqI/AAAAAAAAACQ/Ad546iM1nys/s320/dcomcnfg.JPG" border="0" height="232" width="379" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;By the way, you're looking in the DCOM Config tree in Component Services, as in this screen shot.&lt;/p&gt;&lt;p&gt;Right-click on the appropriate class and select &lt;strong&gt;Properties&lt;/strong&gt;. Then click on the &lt;strong&gt;Security&lt;/strong&gt; tab and edit the &lt;em&gt;Launch and Activation Permissions&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Add the user that is mentioned in the event log, and give that user &lt;strong&gt;local launch &lt;/strong&gt;and &lt;strong&gt;local activation&lt;/strong&gt; permissions. &lt;/p&gt;&lt;p&gt;Finally, restart IIS with a iisreset /noforce. That should take care of this error.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Web Site Is In Use Restore Error&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Especially if you've set up multiple SharePoint sites using host headers and SSL, you'll likely end up with the following error when trying to restore the web application:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="codesnippet"&gt;ArgumentException: The IIS Web Site you have selected is in use by SharePoint.&lt;br /&gt;You must select another port or hostname.&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;The issue is that SharePoint, in restoring the IIS sites, doesn't restore the host headers, as well. Hard to figure out why, but there you have it. Moreover, this error isn't a IIS error, which is to say that, even if you fix the alleged conflict, SharePoint still will error out on the restore, because it still thinks there's a problem.&lt;/p&gt;&lt;p&gt;So you have to do one of two things: customize the settings when you restore the web applications (to use different port numbers), or restore them one at a time, configuring each after the individual restore to use host headers. In either case, to end up with the original URLs, you'll have to do some fiddling after the restore is complete.&lt;/p&gt;&lt;p&gt;In short: you want to restore the web applications, such that you've got the content back. Having done that, you can re-create the web sites, using the &lt;em&gt;Extend an existing Web application &lt;/em&gt;component of SharePoint's Application Management.&lt;/p&gt;&lt;p&gt;Extend the newly-restored web application to a new IIS web site, using the appropriate port number and URL. Once you've extended it, you can go back and "Remove SharePoint from IIS Web site." Using the remove function, you can delete the unwanted site, leaving only the desired URL.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-2615565255675884997?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/2615565255675884997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/backing-up-and-restoring-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2615565255675884997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/2615565255675884997'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/backing-up-and-restoring-sharepoint.html' title='Backing up and Restoring SharePoint 2007 Sites and Site Collections'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_QFTS-w4RNtM/R-mwUIZhzqI/AAAAAAAAACQ/Ad546iM1nys/s72-c/dcomcnfg.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-7370190762616222990</id><published>2008-03-16T15:29:00.004-05:00</published><updated>2008-03-23T22:25:51.754-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='RPM'/><category scheme='http://www.blogger.com/atom/ns#' term='package building'/><category scheme='http://www.blogger.com/atom/ns#' term='AMANDA'/><category scheme='http://www.blogger.com/atom/ns#' term='Backup'/><title type='text'>Rebuilding RPMs in RHEL</title><content type='html'>&lt;span style="font-size:180%;"&gt;How to rebuild a RPM from source&lt;/span&gt;

Reconfiguring and rebuilding RPMs can be immensely useful, particularly when, as in the case of AMANDA backup software, you need to make a change that is used over and over again on a lot of clients.

The steps are pretty straightforward. In short:


&lt;span style="font-size:130%;"&gt;To tweak an existing package&lt;/span&gt;

&lt;div class="codesippet"&gt;rpm -i &lt;src-name&gt;.src.rpm&lt;/src-name&gt;&lt;/div&gt;

This puts all sources into /usr/src/redhat/SOURCES/ and the .spec file into /usr/src/redhat/SPECS/ which you can change as required

&lt;span id="fullpost"&gt;
&lt;span style="font-size:130%;"&gt;To change the compile settings&lt;/span&gt;

Edit the /usr/src/redhat/SPECS/&lt;spec-name&gt;.spec file to meet your needs


&lt;span style="font-size:130%;"&gt;To build the binary&lt;/span&gt;

Then run the following command to build the RPM:

&lt;/spec-name&gt;&lt;div class="codesnippet"&gt;rpm -bs /usr/src/redhat/SPECS/&lt;pkg-name&gt;.spec&lt;/pkg-name&gt;&lt;/div&gt;

rebuilds the RPM from the modified source.

--

&lt;span style="font-size:180%;"&gt; How to rebuild the AMANDA source to create new install RPMs&lt;/span&gt;

This is an important thing to do: AMANDA by default picks random high tcp ports on which to communicate with the clients. This is a problem when we cross subnets, in particular, since the firewall needs to know which ports are needed.

So we recompile the source to include the &lt;span style="font-family:courier new;"&gt;--withtcpportrange&lt;/span&gt;= and &lt;span style="font-family:courier new;"&gt;--withudpportrange=&lt;/span&gt; switches. This will limit AMANDA to the appropriate port ranges.

&lt;span style="font-size:85%;"&gt;This is from &lt;a href="http://wiki.centos.org/HowTos/AmandaBackups"&gt;http://wiki.centos.org/HowTos/AmandaBackups&lt;/a&gt;&lt;/span&gt;

 1.  Download the amanda-xxxxx.src.rpm file.

 2.  Install the source rpm: rpm -i amanda-2xxxxx.src.rpm. This will extract the contents into your rpm directory (if you're doing it as root, it'll be /usr/src/redhat/.)

 3.  Edit the SPECS/amanda.spec file to reflect the appropriate changes.
It's a good idea to changed the Release:  tag to indicate you've made changes.  In addition to just helping you keep track of what you've changed from the default, this will help keep the package from being updated automatically when you patch the system.

To set up AMANDA to use specific ports that we can open up on the firewall, we want to add the following to the ./configure command.
&lt;span style="font-style: italic;"&gt;    Don't forget to put the trailing back-slashes at the end of the lines.&lt;/span&gt;

&lt;div class="codesnippet"&gt;--with-tcpportrange=50000,50100 \
 --with-udpportrange=700,710&lt;/div&gt;

 4.  Rebuild the rpms:

&lt;/span&gt;&lt;span id="fullpost"&gt;&lt;div class="codesnippet"&gt;&lt;src-name&gt;&lt;span id="fullpost"&gt;&lt;spec-name&gt;&lt;pkg-name&gt;    rpmbuild -bb --define "build_rhel5 1" &lt;path to="" spec=""&gt;/amanda.spec&lt;/path&gt;&lt;/pkg-name&gt;&lt;/spec-name&gt;&lt;/span&gt;&lt;/src-name&gt;&lt;/div&gt;

 or for RHEL4,

&lt;/span&gt;&lt;span id="fullpost"&gt;&lt;div class="codesnippet"&gt;&lt;src-name&gt;&lt;span id="fullpost"&gt;&lt;spec-name&gt;&lt;pkg-name&gt;&lt;path to="" spec=""&gt;    rpmbuild -bb --define "build_rhel4 1" &lt;path to="" spec=""&gt;/amanda.spec&lt;/path&gt;&lt;/path&gt;&lt;/pkg-name&gt;&lt;/spec-name&gt;&lt;/span&gt;&lt;/src-name&gt;&lt;/div&gt;




&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-7370190762616222990?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/7370190762616222990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/rebuilding-rpms-in-rhel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7370190762616222990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/7370190762616222990'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/rebuilding-rpms-in-rhel.html' title='Rebuilding RPMs in RHEL'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4689047859234808863</id><published>2008-03-15T12:35:00.024-05:00</published><updated>2011-12-23T10:22:08.771-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alternatives'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Sun Java'/><title type='text'>Using 'Alternatives' in Linux to use a different Java package</title><content type='html'>Installing Sun Java alongside the default GNU java using the 'alternatives' system.&lt;br /&gt;
This post shows how to install Sun's java implementation alongside the Linux default GNU java.&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;span style="font-size: 180%;"&gt;Installing Sun Java alongside the default GNU java&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Sun's java isn't installed by default on RedHat systems.  This is because Sun hasn't licensed it for RedHat's distribution.  Instead, Linux ships with an open source alternative, GNU Java.  It's based on Sun's Java implementation, and--in part because of that--it's always a version or two behind Sun.  In all, it's a very good implementation, but sometimes--as in the case with DSpace--it's necessary to use Sun's Java, instead.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;We don't want to remove the Gnu Java; we'll install Sun's alongside it.&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;script type="text/javascript"&gt;
if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } 
&lt;/script&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;a href="" name="Download_the_files"&gt;&lt;/a&gt;&lt;span style="font-size: large;"&gt; Download the files&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;
The first file we need is Sun's java implementation. In this example, we'll be referencing JDK 1.6.0 release 4, but the steps are the same for all versions.&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote&gt;
  Links to Sun's most recent download packages can be found &lt;a href="http://java.sun.com/javase/downloads/index.jsp" title="Sun Java"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
The second file is a compatibility package from www.jpackage.org.  This simply creates a bunch of symbolic links to bring Sun's directory locations into compliance with the GNU system.&lt;br /&gt;
We'll be referencing &lt;span style="font-style: italic;"&gt;java-1.6.0-sun-compat-1.6.0.04-1jpp.i586.rpm&lt;/span&gt;, which works with the version of Sun's Java discussed above (1.6.0_4).   Whichever version you're using, you'll need to visit the &lt;a class="external text" href="http://www.jpackage.org/" rel="nofollow" title="http://www.jpackage.org"&gt;jpackage web site&lt;/a&gt; to download it.&lt;br /&gt;
JPackage has managed, somehow to make their downloads almost as inscrutable as Sun's.  Their &lt;a href="http://www.jpackage.org/installation.php"&gt;instructions page&lt;/a&gt;, though, has good pointers to all the correct downloads.&lt;br /&gt;
If you run into problems either finding the correct sun-compat package, or if you're running a distro (such as 64-bit RHEL) for which JPackage hasn't created a sun-compat package, you're not out of luck.  We'll also look at how to configure alternatives manually, at least for basic java usage.&lt;/blockquote&gt;
&lt;br /&gt;
Install the Packages&lt;br /&gt;&lt;a href="" name="Install_Sun_Java"&gt;&lt;/a&gt;&lt;h3&gt;
&lt;span class="mw-headline"&gt; Install Sun Java&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote&gt;
Sun packages its distributions in a self-extracting binary file.  Simply execute the .bin file from the command line:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
./jdk-6u4-linux-i586-rpm.bin&lt;/div&gt;
&lt;br /&gt;
This will take awhile.  When it's finished, Sun's Java will be installed.&lt;br /&gt;
You can see, however, that the GNU java still is active by typing the following command&lt;br /&gt;
&lt;div class="codesnippet"&gt;
java -version&lt;/div&gt;
&lt;a href="" name="Install_Sun_Campatibility"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;
&lt;br /&gt;&lt;h3&gt;
&lt;span class="mw-headline"&gt; Install Sun Campatibility&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote&gt;
java-1.6.0-sun-compat-1.6.0.04-1jpp.i586.rpm is signed by jpackage.org, so the easiest way to install the package is to import the jpackage.org key:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
rpm --import http://jpackage.org/jpackage.asc&lt;/div&gt;
&lt;br /&gt;
If you don't want to do this (and thus trust all Jpackage.org rpm packages), you'll need to use RPM instead of yum to install it.&lt;br /&gt;
Then, simply install the package:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
yum install java-1.6.0-sun-compat-1.6.0.04-1jpp.i586.rpm&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;

&lt;h1&gt;
Configure Alternatives manually&lt;/h1&gt;
If you've not found the correct JPackage sun-compat package, or if one isn't available, it's still quite possible to use the alternatives system to manage your java versions.&lt;br /&gt;
Alternatives is configured at the command line:&lt;br /&gt;
alternatives --install &lt;symlink&gt; &lt;name&gt; &lt;path-to-application&gt; &lt;priority&gt;&lt;br /&gt;alternatives --config &lt;name&gt;&lt;br /&gt;alternatives --remove &lt;name&gt; &lt;path-to-application&gt;&lt;br /&gt;&lt;/path-to-application&gt;&lt;/name&gt;&lt;/name&gt;&lt;/priority&gt;&lt;/path-to-application&gt;&lt;/name&gt;&lt;/symlink&gt;&lt;br /&gt;
So, to get straight to the meat of the matter:&lt;br /&gt;
&lt;div class="codesnippet"&gt;
alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_11/bin/java 120 \&lt;br /&gt;--slave /usr/bin/keytool keytool /usr/java/jdk1.6.0_11/bin/keytool \&lt;br /&gt;--slave /usr/bin/rmiregistry rmiregistry /usr/java/jdk1.6.0_11/bin/rmiregistry&lt;br /&gt;
alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_11/bin/javac 120 \&lt;br /&gt;   --slave /usr/bin/jar  jar  /usr/java/jdk1.6.0_11/bin/jar \&lt;br /&gt;   --slave /usr/bin/rmic rmic /usr/java/jdk1.6.0_11/bin/rmic&lt;/div&gt;
&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;/span&gt;The above will create two entries in the alternatives symlink config system, one for java (with some "slave" symlinks for dependent apps), and one for javac (likewise with slave symlinks).&lt;br /&gt;By and large, the above should be what's necessary to run java.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;a href="" name="Check_the_active_Java_Version"&gt;&lt;/a&gt;Check the active Java Version &lt;blockquote&gt;
Now we need to verify that Sun's java is the default (using the java -version command):&lt;br /&gt;
&lt;div class="codesnippet"&gt;
$ java -version&lt;br /&gt;
java version "1.6.0_04"&lt;br /&gt;
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)&lt;br /&gt;
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)&lt;/div&gt;
&lt;br /&gt;
Above, we see that Sun's Java v 1.6.0 r4 is the default java.  If, however, we see something like the following, &lt;br /&gt;
&lt;div class="codesnippet"&gt;
# java -version&lt;br /&gt;
java version "1.4.2"&lt;br /&gt;
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-13)&lt;br /&gt;
&lt;br /&gt;
Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
This is free software; see the source for copying conditions.  There is NO&lt;br /&gt;
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/div&gt;
&lt;br /&gt;
Then we have to use the alternatives program to set the correct default.  Alternatives simply is a system that manages standard symbolic links, allowing you to select one or another alternative program to run for any given command.  In our case, that's java.&lt;br /&gt;
As root, simply run the following command &lt;br /&gt;
&lt;div class="codesnippet"&gt;
alternatives --config java&lt;/div&gt;
&lt;br /&gt;
you'll see something like the following: &lt;br /&gt;
&lt;div class="codesnippet"&gt;
# alternatives --config java&lt;br /&gt;
&lt;br /&gt;
There are 2 programs which provide 'java'.&lt;br /&gt;
&lt;br /&gt;
Selection    Command&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
+ 1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java&lt;br /&gt;
*  2           /usr/lib/jvm/jre-1.6.0-sun/bin/java&lt;br /&gt;
&lt;br /&gt;
Enter to keep the current selection[+], or type selection number:&lt;/div&gt;
&lt;br /&gt;
The + sign next to the first line indicates that the GNU Compiler for Java (GCJ) is the default.  Simply type the number 2 and press enter to make the Sun Java distro be the default.&lt;/blockquote&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4689047859234808863?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4689047859234808863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/using-alternatives-in-linux-to-use.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4689047859234808863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4689047859234808863'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/using-alternatives-in-linux-to-use.html' title='Using &apos;Alternatives&apos; in Linux to use a different Java package'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-5918902825589582325</id><published>2008-03-13T21:04:00.011-05:00</published><updated>2011-12-23T10:23:36.039-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl certs'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Certificates'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><category scheme='http://www.blogger.com/atom/ns#' term='host headers'/><title type='text'>Using SSL with a Wildcard Certificate on Multiple Apache Sites</title><content type='html'>It is possible to set up multiple virtual SSL-encrypted hosts (sites) in apache, but did you know it's possible for them all to use port 443 and the same IP address? Wildcard certificates help make it happen. &lt;span id="fullpost"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Setting up SSL virtual hosts in linux (specifically RHEL and CentOS, but the steps are similar in other distros) isn't hard, and--to correct a common misperception--&lt;span style="font-style: italic;"&gt;it is possible to have multiple SSL virtual hosts running under apache using host headers.&lt;/span&gt; To be clear: you don't have to use separate IP addresses or different port numbers in order to have multiple SSL sites under apache.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;In short, the process involves creating multiple SSL virtual hosts, each with its own host header (ServerName in apache parlance), and adding the same wildcard SSL certificate to each of the sites.  There are a variety of ways to create a certificate, and you can see many of them discussed with a simple Google search. In our case, we'll use genkey from crypto-utils. Feel free to use any utility you'd like &lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span id="fullpost"&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="Install_Crypto-Utils"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;&lt;span class="mw-headline"&gt;Install Crypto-Utils &lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;span id="fullpost"&gt;Crypto-utils is a package that contains a lot of programs for dealing with certificates and keys; it makes things a lot easier. &lt;/span&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;yum install crypto-utils&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="Generate_the_new_key"&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span id="fullpost"&gt;&lt;span class="mw-headline"&gt;Generate the new key &lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;span id="fullpost"&gt;Then simply run the genkey application: &lt;/span&gt;&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;genkey --days 3650 *.servername.com&lt;/span&gt;&lt;/div&gt;
&lt;span id="fullpost"&gt;You'll notice in the above example we set it to last for 10 years (why should it expire?) and contain the server name servername.com. Of course, you'd want to put the correct server name there. &lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;The program will prompt you for some details; note that you'll &lt;b&gt;&lt;u&gt;not&lt;/u&gt;&lt;/b&gt; want to have the private key encrypted; that requires a password when you start apache, which isn't terribly convenient. &lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;Genkey will create a file called *.&lt;i&gt;servername&lt;/i&gt;.cert and &lt;i&gt;*.servername&lt;/i&gt;.key in /etc/pki/tls/certs and /etc/pki/tls/private, respectively. These directories, I believe, are specific to RHEL (and CENTOS) 5; EL 4 and other distros use different directories. You'll want to rename these files when the process is complete: genkey creates the cert and key with the name you typed in, which means it'll be a filename with a * in it. That's no good, so when it's done, go to those directories and change the filename to wildcard.servername.cert and wildcard.servername.key.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;When you've done that, your certificate is complete, and you're ready to set up your sites.&lt;/span&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;As an aside: it's not necessary that you use self-signed certificates. In fact, if you're setting this up for a production environment, you will want to use a commercially-provided certificate from a company such as GeoTrust, Verisign, or any of the myriad of certificate companies out there. &lt;/span&gt;&lt;/blockquote&gt;
&lt;span id="fullpost"&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="Edit_ssl.conf"&gt;&lt;/a&gt;&lt;h3&gt;
&lt;span class="mw-headline"&gt;Edit ssl.conf &lt;/span&gt;&lt;/h3&gt;
&lt;blockquote&gt;
Now we add our virtual hosts (sites). Again, this directory location may be different for your distro. &lt;br /&gt;
&lt;div class="codesnippet"&gt;
vim /etc/httpd/conf.d/ssl.conf &lt;/div&gt;
If we were just installing this certificate for the default site, we'd just change the SSLCertificateFile and SSLCertificateKeyFile to point to the new files created in /etc/pki/tls/certs and /etc/pki/tls/private respectively. &lt;br /&gt;
But because we're creating (or adding certificates to) two new sites we'll have to change the SSLCertificateFile and SSLCertificateKeyFile not only in the default site, but add our additional sites as well. The following will create two additional sites called "testssl1" and "testssl2." They'll go right after the default &amp;lt;VirtualHost&amp;gt; &amp;lt;/VirtualHost&amp;gt; section &lt;br /&gt;
&lt;div class="codesnippet"&gt;
NameVirtualHost *&lt;br /&gt;
&amp;lt;VirtualHost * &amp;gt; &lt;br /&gt;
SSLEngine on SSLProtocol all -SSLv2 &lt;br /&gt;
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW &lt;br /&gt;
ServerAdmin webmaster@example.com &lt;br /&gt;
DocumentRoot /var/www/html/testssl1 &lt;br /&gt;
ServerName testssl1.example.com &lt;br /&gt;
ErrorLog /var/log/httpd/testssl_error_log &lt;br /&gt;
CustomLog /var/log/httpd/testssl_access_log common &lt;br /&gt;
SSLCertificateFile /etc/pki/tls/certs/wildcard.example.com.cert &lt;br /&gt;
SSLCertificateKeyFile /etc/pki/tls/private/wildcard.example.com.key &lt;br /&gt;
&amp;lt;/virtualhost&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;virtualhost *&amp;gt; &lt;br /&gt;
SSLEngine on SSLProtocol all -SSLv2 &lt;br /&gt;
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW &lt;br /&gt;
ServerAdmin webmaster@example.com &lt;br /&gt;
DocumentRoot /var/www/html/testssl2 &lt;br /&gt;
ServerName testssl2.example.com &lt;br /&gt;
&lt;br /&gt;
ErrorLog /var/log/httpd/testssl_error_log &lt;br /&gt;
CustomLog /var/log/httpd/testssl_access_log common &lt;br /&gt;
SSLCertificateFile /etc/pki/tls/certs/wildcard.example.com.cert &lt;br /&gt;
SSLCertificateKeyFile /etc/pki/tls/private/wildcard.example.com.key &lt;br /&gt;
&amp;lt;/virtualhost&amp;gt; &lt;/div&gt;
&lt;br /&gt;
If you'd prefer simply to replace the default :443 site, simply comment out the entire section between the first &amp;lt;VirtualHost&amp;gt; &amp;lt;/VirtualHost&amp;gt; section. &lt;br /&gt;
Note that there's a lot that can go wrong with the settings in this file, but, unlike using wildcard certificates, there is--happily--a lot of information on the web about troubleshooting this file. &lt;/blockquote&gt;
&lt;a href="http://www.blogger.com/blogger.g?blogID=1714283384790610704" name="Restart_Apache"&gt;&lt;/a&gt;&lt;h3&gt;
&lt;span class="mw-headline"&gt;Restart Apache &lt;/span&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;div class="codesnippet"&gt;
service httpd restart &lt;/div&gt;
&lt;/blockquote&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-5918902825589582325?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/5918902825589582325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl_13.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5918902825589582325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/5918902825589582325'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl_13.html' title='Using SSL with a Wildcard Certificate on Multiple Apache Sites'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4627964696285915635</id><published>2008-03-12T22:07:00.025-05:00</published><updated>2011-12-23T10:31:42.489-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl certs'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Certificates'/><category scheme='http://www.blogger.com/atom/ns#' term='host headers'/><title type='text'>Multiple SSL Sites on a Single IIS Server Using Host Headers</title><content type='html'>Wildcard SSL certificates can allow you to publish multiple IIS web sites--all using SSL on port 443--that are accessible by host headers. That is, if you're running on IIS 6 or above.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;
So you read about these things, wildcard certificates, but mostly you read about how to buy them. It is possible (and easy) to create one for yourself, however, so long as you don't mind it not being trusted by folks' browsers.

There are some really good uses for these, not least in a test environment in which you don't care about the trust.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
Production environments need them, too, sometimes, such as when you're using a network appliance like a Netscaler or F5 load balancer. Those devices allow you to point multiple URLs (cnames, really) to a single (or multiple) server(s). Very handy.&lt;br /&gt;
In our case, we have several web sites that we'd like to secure using SSL. Problem is: they're all on a single server.

There are several options for dealing with such a case: assign multiple IP addresses to the server, use different SSL ports for each IIS site, or (definitely the coolest option) use a wildcard certificate on the server to allow IIS to decipher the http host header. This option, by the way, is a new feature with IIS 6, so if there's anyone out there still using IIS v5, this is another reason to upgrade.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;Background&lt;/span&gt;&lt;br /&gt;
A little background on the problem might be in order: a SSL certificate is used to encrypt the http data. Normally, in setting up a IIS web site, we differentiate that site from all the others by assigning unique host headers to each site. IIS can use those host headers to determine to which site to route any given http request.&lt;br /&gt;
When the site is using ssl, however, the host header is encrypted, which introduces something of a chicken-and-egg thing: since the host header (along with all the rest of the data) is encrypted, IIS can't use that to determine which site to send the request to. And, since a SSL certificate is site-specific, IIS can't use a certificate to decrypt the data until it knows which site the request belongs to.&lt;br /&gt;
Thus, it widely is reported that it isn't possible to have multiple SSL sites on a single server, all sharing the same port.

Enter wildcard SSL certificates and secure server bindings.&lt;br /&gt;
The wildcard certificate allows IIS to use the same certificate for all of the sites on a particular port. That takes away the requirement that IIS know which site's certificate to use in decrypting the data.&lt;br /&gt;
Secure server bindings help IIS in securing the wildcard certificate, a requirement for setting this up.&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;Note that a similar solution is available to apache. You can read about it &lt;a href="http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl_13.html"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
Thus, it is very possible to have multiple SSL sites on a single server, all sharing the same port.&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;Configure your sites to use host headers&lt;/span&gt;
&lt;br /&gt;
&lt;span id="fullpost"&gt;Host headers are the backbone of this.  Open the properties window for each site in IIS and click the &lt;strong&gt;advanced&lt;/strong&gt; button.  There, you can add the appropriate host header on port 80.  &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;span style="font-size: 130%;"&gt;Creating a self-signed wildcard SSL certificate&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
The next step in this process is to make sure that all of the relevant sites have the same SSL port assigned to them.&lt;br /&gt;
In IIS, go to each site's properties and enter the appropriate port number (the same one for each site) in the SSL Port field. 443 is the default SSL port.&lt;br /&gt;
&lt;span style="font-size: 100%;"&gt;
Note that once you do this, all but one of the affected sites will stop. That is because, at this point, IIS isn't configured to allow multiple sites to share the same SSL port.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: 100%;"&gt;That's OK; we'll take care of that in a moment.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;

Now, to generate the certificate: using SelfSSL, generate the certificate for one existing IIS site.&lt;br /&gt;
SelfSSL is a tool that's a part of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499&amp;amp;displaylang=en"&gt;Microsoft IIS Resource kit&lt;/a&gt;.&lt;br /&gt;
If you haven't downloaded and installed it, you'll need to do that first.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
Here's the syntax:


&lt;br /&gt;
&lt;div class="codesnippet"&gt;
&lt;span id="fullpost"&gt;selfssl /n:cn=*.server.edu /s:1 /P:443 /v:3650
&lt;/span&gt;&lt;/div&gt;
&lt;span id="fullpost"&gt;
Where &lt;span style="font-style: italic;"&gt;*.server.edu&lt;/span&gt; would be your own URL. So if you had these sites:&amp;nbsp;&lt;/span&gt;&lt;div&gt;
mysite.sharepoint.com&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
portal.sharepoint.com&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
auth.sharepoint.com&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
you'd use this code:



&lt;div class="codesnippet"&gt;
selfssl /n:cn=*.sharepoint.com /s:1 /P:443 /v:3650
&lt;/div&gt;
It's the * that makes it a wildcard certificate.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
The /s:1 is the site identification. There are a variety of ways to view a site's identifier, but the easiest simply is to open the IIS manager and click on the "web sites" tree on the left. The right-hand pane will show the description and identifier. The default site has an identifier of 1; the other sites have very long identifiers.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
/P: is the SSL port you're using, and /V: is the number of days for which this cert is valid. Why would you want it to expire, anyway?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Now you've generated a wildcard certificate.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: 130%;"&gt;Assign the Certificate to your sites&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;The easiest way to assign a certificate to a site, having already created it, is to view the site properties in IIS Manager.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Click on &lt;span style="font-weight: bold;"&gt;Directory Security&lt;/span&gt;, and then on the &lt;span style="font-weight: bold;"&gt;Server Certificate&lt;/span&gt; button. This will start the wonderful wizard of IIS.

You already have created a certificate, so when the wizard prompts you, choose "Assign an existing certificate." When you click next, you'll see a list of available certs, including the wildcard certificate you created.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Select this certificate, click next, and make sure you assign it the same port that was assigned to the first site.
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
That's it: once the wizard has finished its magic, you've assigned the cert to your site. Repeat this for all of the sites you want to secure on this port with SSL.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: 130%;"&gt;Configure Secure Server Bindings&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;This is the final step. It involves running a vbs script to set up secure bindings, which allows IIS to use host headers with SSL and secure the new wildcard certificate you created and installed.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;The syntax is like this:



&lt;div class="codesnippet"&gt;
cscript adsutil.vbs set /w3svc/844934796/SecureBindings ":443:mysite.sharepoint.com"
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
The adsutil.vbs script, at least on my systems, is at C:\Inetpub\AdminScripts. You'll need to run the script command from that location.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;The syntax breaks down like this:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
844934796 is the site ID. Substitute your own site identifier there.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
443, again, is the port&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
mysite.sharepoint.com is the host header for the site.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Make sure that you have this host header configured in the site properties in IIS, as well.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Run this script for each of your IIS sites.

That should be all you need to do.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Start up the stopped sites after you've run cscript, and you should be good to go.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Microsoft has a few documents that run through this, but they don't really put the pieces together for you. Here they are:

&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/596b9108-b1a7-494d-885d-f8941b07554c.mspx?mfr=true"&gt;Configure SSL Host Headers (IIS 6.0)&lt;/a&gt;
&lt;a href="http://http//www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/8d9f2a8f-cd23-448c-b2c7-f4e87b9e2d2c.mspx?mfr=true"&gt;Configuring Server Bindings for SSL Host Headers (IIS 6.0)&lt;/a&gt;
&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5d0fb4c2-3333-4fec-82fc-6e15d3733937.mspx?mfr=true"&gt;Obtaining and Installing a Wildcard Server Certificate&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;By the way: if you've done a lot of testing, and you've generated a bunch of certificates you're no longer using, you can delete them. Run mmc.exe and add the &lt;span style="font-weight: bold;"&gt;certificates &lt;/span&gt;snap-in. You'll want to choose the "local computer" version. Using that, you can manage all of your local certificates, including deleting the ones you no longer need.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4627964696285915635?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4627964696285915635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl.html#comment-form' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4627964696285915635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4627964696285915635'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/creating-self-signed-wildcard-ssl.html' title='Multiple SSL Sites on a Single IIS Server Using Host Headers'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-4606735958888478771</id><published>2008-03-11T21:07:00.009-05:00</published><updated>2010-06-02T08:00:42.339-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='LDAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Mediawiki'/><title type='text'>LDAP Authentication in Mediawiki</title><content type='html'>LDAP Authentication in Mediawiki isn't terribly hard, and it's so very worth it.  This post shows how one implementation succeeded, and hopefully it'll help with yours.
&lt;span id="fullpost"&gt;
I have to say that I'm a little hesitant to post this entry, as many people have done so, and inevitably, the post becomes dated, full of deprecated and even downright wrong information.  So one runs the risk in the end of being more of a hindrance than a help.

So:  &lt;span style="font-style: italic;"&gt;caveat emptor&lt;/span&gt;.  I decided in the end to write this because it took a very long time to implement this &lt;span style="font-style: italic;"&gt;very&lt;/span&gt; useful extension to MediaWiki, and I hope my process will help others in their own implementation.

Having said that, one really should check out all of the work Ryan Lane has done and continues to do in writing and supporting this excellent extension.  The main page for the extension can be found &lt;a href="http://www.mediawiki.org/wiki/Extension:LDAP_Authentication"&gt;here&lt;/a&gt;.

These instructions were written as we implemented version 1.1g, which is one release behind the (as of this writing) current version of 1.2a.

Having got that behind us, I hope this is helpful to you:
&lt;h3&gt;&lt;span class="mw-headline"&gt; LDAP Authentication
&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;This is a big one.  It can be got from the &lt;a href="http://www.mediawiki.org/wiki/Extension:LDAP_Authentication" class="external text" title="http://www.mediawiki.org/wiki/Extension:LDAP_Authentication" rel="nofollow"&gt;MediaWiki Extensions Site&lt;/a&gt;.  The instructions are pretty tough to follow, but it does work.
&lt;/p&gt;&lt;p&gt;Here are our settings in LocalSettings.php, in which the user is authenticated against the domain, and all users except those in a select group are disallowed from logging in.
&lt;/p&gt; &lt;a name="A_note_about_SSL_encryption"&gt;&lt;/a&gt;&lt;h4&gt;&lt;span class="editsection"&gt;&lt;/span&gt;&lt;span class="mw-headline"&gt; A note about SSL encryption &lt;/span&gt;&lt;/h4&gt; &lt;blockquote&gt; SSL encryption is necessary to ensure this is a secure process. Especially given that we're talking about domain usernames and passwords.  So first, &lt;u&gt;&lt;b&gt;make sure that the apache server is requiring https when accessing the wiki&lt;/b&gt;&lt;/u&gt;&lt;b&gt;.&lt;/b&gt;  Second, for the SSL piece of the LDAP authentication to work, &lt;u&gt;&lt;b&gt;the wiki server has to recognize and trust the root CA of the LDAP server&lt;/b&gt;&lt;/u&gt; (or, in our case, the LDAP virtual IP fronted by a netscaler device).   I hope to have instructions on doing this piece posted soon.  In any case, please do this before going further. &lt;/blockquote&gt;  &lt;a name="LocalSettings.php_Contents"&gt;&lt;/a&gt;&lt;h4&gt;&lt;span class="editsection"&gt;&lt;/span&gt; &lt;span class="mw-headline"&gt;LocalSettings.php Contents
&lt;/span&gt;&lt;/h4&gt;
&lt;div class="codesnippet"&gt;#LDAP authentication
require_once( "$IP/extensions/LdapAuthentication.php" );
#$wgLDAPDebug = 6;
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( "DOMAINNAME");
$wgLDAPServerNames = array( "DOMAINNAME"=&gt;"ldapserver.FQDN" );
$wgLDAPSearchStrings = array( "domainname"=&gt;"DOMAINNAME\\USER-NAME" );
$wgLDAPEncryptionType = array( "domainname"=&gt;"ssl" );
$wgLDAPUseLocal = false;
$wgMinimalPasswordLength = 1;
$wgLDAPBaseDNs = array( "domainname"=&gt;"dc=tcu,dc=edu" );
$wgLDAPSearchAttributes = array( "domainname"=&gt;"sAMAccountName" );

#Everything above is for simple LDAP authentication; the stuff below is for group syncronization
#DNs in $wgLDAPRequiredGroups must be lowercase, as search result attribute values are...
$wgLDAPRequiredGroups = array( "domainname"=&gt;array("Fully qualified LDAP cn structure goes here") );
$wgLDAPGroupUseFullDN = array( "domainname"=&gt;true );
$wgLDAPLowerCaseUsername = array( "domainname"=&gt;true, );
$wgLDAPGroupObjectclass = array( "domainname"=&gt;"group" );
$wgLDAPGroupAttribute = array( "domainname"=&gt;"member" );
$wgLDAPGroupSearchNestedGroups = array( "domainname"=&gt;true );
$wgLDAPUseLDAPGroups = array( "domainname"=&gt;"true" );
$wgLDAPGroupNameAttribute = array( "domainname"=&gt;"cn" );

#Adding new groups to the list of possible groups. This value (the group name)
#also needs to be added to the user_groups table in the database. That happens manually.
$wgGroupPermissions['groupname']['edit']= true;
&lt;/div&gt;
&lt;p&gt;The first bit should be pretty self-explanatory:  load the extension, then set the basic variables as specific to your environment.  In the examples here, I have used "domainname" and "DOMAINNAME" instead of our true domain name.  Case matters here, so stay sharp!
Note that the &lt;b&gt;$wgLDAPBaseDNs&lt;/b&gt; variable is important; it must be correct.  In most cases, this is the final bit of your domain name.  For instance, if my domain is example.com, my base DN is also example.com.
&lt;/p&gt;&lt;p&gt;Likewise, &lt;b&gt;$wgLDAPRequiredGroups&lt;/b&gt; is very specific, and if it's not just right, the whole thing will break.  Note that &lt;span style="font-family:courier new;"&gt;ldapsearch&lt;/span&gt;--a piece of openssl--can be an extremely useful tool in determining the correct settings for all of this.  If you're using linux, you very likely already will have this tool.  If you're using Windows, &lt;span style="font-family:courier new;"&gt;dsget &lt;/span&gt;is an equivalent (as a part of Windows Server) that can really help you out of a jam.  Many will recommend a web-base ldap browser, but, honestly, I think the command-line tools like ldapsearch and dsget are much easier to use and set up.
&lt;/p&gt;&lt;p&gt;If you're having difficulty, uncomment the &lt;b&gt;$wgLDAPDebug&lt;/b&gt; line, and it'll provide a lot of useful debugging information within the browser session.
&lt;/p&gt; &lt;a name="User_Rights_Management"&gt;&lt;/a&gt;&lt;h4&gt;&lt;span class="editsection"&gt;&lt;/span&gt; &lt;span class="mw-headline"&gt;User Rights Management
&lt;/span&gt;&lt;/h4&gt; &lt;p&gt;User rights management is done through groups.  We use the domain groups for this purpose, but it's also necessary to tell MediaWiki about the groups, and how we'll use them.  This is done in a single step:
&lt;/p&gt; &lt;a name="Defining_group_rights"&gt;&lt;/a&gt;&lt;h5&gt;&lt;span class="editsection"&gt;&lt;/span&gt; &lt;span class="mw-headline"&gt;Defining group rights
&lt;/span&gt;&lt;/h5&gt; &lt;p&gt;Edit the LocalSettings.php file and add lines as below:
&lt;/p&gt; &lt;div class="codesnippet"&gt;## The following three lines disable anonymous access
$wgGroupPermissions['*' ]['createaccount'] = false;
$wgGroupPermissions['*' ]['read'] = false;
$wgGroupPermissions['*' ]['edit'] = false;
$wgGroupPermissions['tcudba']['edit'] = true;
$wgGroupPermissions['user' ]['move'] = false;
$wgGroupPermissions['user' ]['read'] = true;
$wgGroupPermissions['user' ]['edit'] = false;
$wgGroupPermissions['user' ]['upload'] = false;

&lt;/div&gt;&lt;p&gt;In the above example, the default group (user) only can read articles.  Those who have not authenticated (*) cannot do anything in the wiki.  Those in TCUDBA can edit documents.
&lt;/p&gt;&lt;p&gt;There are a variety of possible permissions, which are detailed &lt;a href="http://www.mediawiki.org/wiki/Help:User_rights" class="external text" title="http://www.mediawiki.org/wiki/Help:User_rights" rel="nofollow"&gt;here&lt;/a&gt;.  The table below shows a few of the more relevant permissions:
&lt;/p&gt; &lt;table width="75%" border="1" cellpadding="1" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt; &lt;td&gt; Permission &lt;/td&gt;&lt;td&gt; Description &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; read
&lt;/td&gt;&lt;td&gt; allows viewing pages not defined in &lt;a href="http://www.mediawiki.org/wiki/Manual%3A%24wgWhitelistRead" class="external text" title="http://www.mediawiki.org/wiki/Manual%3A%24wgWhitelistRead" rel="nofollow"&gt;$wgWhitelistRead&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; edit
&lt;/td&gt;&lt;td&gt; allows &lt;a href="http://www.mediawiki.org/wiki/Help:Editing" class="external text" title="http://www.mediawiki.org/wiki/Help:Editing" rel="nofollow"&gt;editing&lt;/a&gt; unprotected pages. &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; createpage
&lt;/td&gt;&lt;td&gt; allows the creation of new pages (requires the &lt;i&gt;edit&lt;/i&gt; right). &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; move
&lt;/td&gt;&lt;td&gt; allows renaming page titles. &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; upload
&lt;/td&gt;&lt;td&gt; allows the creation of new images and files. &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; createaccount
&lt;/td&gt;&lt;td&gt; allows the creation of new user accounts. &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; delete
&lt;/td&gt;&lt;td&gt; allows the deletion of edits and pages. &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;a name="Modifying_User_Groups"&gt;&lt;/a&gt;&lt;/p&gt;&lt;h4&gt;&lt;span class="editsection"&gt;&lt;/span&gt; &lt;span class="mw-headline"&gt;Modifying User Groups &lt;/span&gt;&lt;/h4&gt; &lt;p&gt;An easy way to modify the Mediawiki database is to use PHPmyAdmin.  Of course, whether you use a GUI or the command line, the data to modify is the same.
&lt;/p&gt;&lt;p&gt;After logging in to phpmyadmin, select the WIKIDB database on the left.  Then select the user_groups table and click on the browse button.  You'll see the userid and group name of all the users.  Note that the userid is a number; you have to use the users table to find out which userid corresponds to which username.  Use this method to get back as a sysop in the wiki if you've accidentally removed yourself from that group.  If you're still a sysop, you simply can use the special:userrights page. &lt;/p&gt;&lt;p&gt;
&lt;/p&gt; &lt;a name="Troubleshooting"&gt;&lt;/a&gt;&lt;h4&gt;&lt;span class="editsection"&gt;&lt;/span&gt; &lt;span class="mw-headline"&gt;Troubleshooting &lt;/span&gt;&lt;/h4&gt; &lt;p&gt;If you receive the error &lt;b&gt;basedn is not set for this type of entry, trying to get the default basedn&lt;/b&gt;, that means that the $wgLDAPBaseDNs variable isn't set correctly.  At the time of this writing, the correct value for that is &lt;/p&gt;&lt;p&gt;&lt;code&gt;$wgLDAPBaseDNs = array( "tcu"=&gt;"dc=tcu,dc=edu" );&lt;/code&gt; &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;The following commands also can be helpful in determining if your system is set up correctly: &lt;/p&gt; &lt;div class="codesnippet"&gt;ldapsearch -x -D &lt;username&gt;@TCU -W -b "dc=tcu,dc=edu" "sAMAccountName=&lt;username&gt;" -H ldaps://ldap.example.com
&lt;/username&gt;&lt;/username&gt;&lt;/div&gt; &lt;div class="codesnippet"&gt;openssl s_client -connect ldap.example.com:636
&lt;/div&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-4606735958888478771?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/4606735958888478771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/ldap-authentication-in-mediawiki.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4606735958888478771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/4606735958888478771'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/ldap-authentication-in-mediawiki.html' title='LDAP Authentication in Mediawiki'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-8212416384786724974</id><published>2008-03-11T20:57:00.005-05:00</published><updated>2008-03-15T20:45:58.132-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mediawiki'/><title type='text'>Manually Adding a User to a Group in Mediawiki</title><content type='html'>If you've locked yourself out of MediaWiki administration, say, by implementing LDAP authentication, this shows you how to add a user to MediaWiki groups by editing the security tables in the database.
&lt;span id="fullpost"&gt;
User rights are stored in a MySQL table called user_groups.  Usually you'll find it's got the wiki prefix so to give a user with the user_id of 1 bureaucrat privileges in the system wiki, use the command:  &lt;div class="codesnippet"&gt;insert into user_groups values(1,'bureaucrat');&lt;/div&gt;
&lt;p&gt;The other 'power' group is sysop: &lt;/p&gt; &lt;div class="codesnippet"&gt;insert into user_groups values(1,'sysop');&lt;/div&gt;
&lt;p&gt;To find out which user_id you want to use, execute the following: &lt;/p&gt;
&lt;div class="codesnippet"&gt;select * from user&lt;/div&gt;
Note that you'll need to prefix the table names with a prefix, if you set up your wiki to use one.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-8212416384786724974?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/8212416384786724974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/manually-adding-user-to-group-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/8212416384786724974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/8212416384786724974'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/manually-adding-user-to-group-in.html' title='Manually Adding a User to a Group in Mediawiki'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-6634341866288610595</id><published>2008-03-11T13:27:00.022-05:00</published><updated>2008-03-27T08:58:03.843-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Copying SQL Server 2005 logins from one instance to another</title><content type='html'>Copying SQL Server 2005 logins from one instance to another can be scripted pretty easily with these stored procedures from Microsoft.
&lt;span id="fullpost"&gt;
&lt;span style="font-family:lucida grande;"&gt;This is a reasonably easy task, and it's outlined in &lt;/span&gt;&lt;a style="font-family: lucida grande;" href="http://support.microsoft.com/kb/918992"&gt;Microsoft KB article 918992&lt;/a&gt;&lt;span style="font-family:lucida grande;"&gt;.  Here's the gist, if you want to get down to brass tacks quickly.&lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt;Create the stored procedures &lt;/span&gt;&lt;b style="font-family: lucida grande;"&gt;sp_hexadecimal &lt;/b&gt;&lt;span style="font-family:lucida grande;"&gt;and &lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;s&lt;/span&gt;&lt;b style="font-family: lucida grande;"&gt;p_help_revlogin:&lt;/b&gt;

&lt;div class="codesnippet"&gt;
USE master
GO
IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
 DROP PROCEDURE sp_hexadecimal
GO
CREATE PROCEDURE sp_hexadecimal
   @binvalue varbinary(256),
   @hexvalue varchar (514) OUTPUT
AS
DECLARE @charvalue varchar (514)
DECLARE @i int
DECLARE @length int
DECLARE @hexstring char(16)
SELECT @charvalue = '0x'
SELECT @i = 1
SELECT @length = DATALENGTH (@binvalue)
SELECT @hexstring = '0123456789ABCDEF'
WHILE (@i &lt;= @length) BEGIN   DECLARE @tempint int   DECLARE @firstint int   DECLARE @secondint int   SELECT @tempint = CONVERT(int, SUBSTRING(@binvalue,@i,1))   SELECT @firstint = FLOOR(@tempint/16)   SELECT @secondint = @tempint - (@firstint*16)   SELECT @charvalue = @charvalue +     SUBSTRING(@hexstring, @firstint+1, 1) +     SUBSTRING(@hexstring, @secondint+1, 1)   SELECT @i = @i + 1 END  SELECT @hexvalue = @charvalue GO   IF OBJECT_ID ('sp_help_revlogin') IS NOT NULL   DROP PROCEDURE sp_help_revlogin GO CREATE PROCEDURE sp_help_revlogin @login_name sysname = NULL AS DECLARE @name sysname DECLARE @type varchar (1) DECLARE @hasaccess int DECLARE @denylogin int DECLARE @is_disabled int DECLARE @PWD_varbinary  varbinary (256) DECLARE @PWD_string  varchar (514) DECLARE @SID_varbinary varbinary (85) DECLARE @SID_string varchar (514) DECLARE @tmpstr  varchar (1024) DECLARE @is_policy_checked varchar (3) DECLARE @is_expiration_checked varchar (3)  DECLARE @defaultdb sysname   IF (@login_name IS NULL)   DECLARE login_curs CURSOR FOR        SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM  sys.server_principals p LEFT JOIN sys.syslogins l       ON ( l.name = p.name ) WHERE p.type IN ( 'S', 'G', 'U' ) AND p.name &lt;&gt; 'sa'
ELSE
 DECLARE login_curs CURSOR FOR
     SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM
sys.server_principals p LEFT JOIN sys.syslogins l
     ON ( l.name = p.name ) WHERE p.type IN ( 'S', 'G', 'U' ) AND p.name = @login_name
OPEN login_curs

FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin
IF (@@fetch_status = -1)
BEGIN
 PRINT 'No login(s) found.'
 CLOSE login_curs
 DEALLOCATE login_curs
 RETURN -1
END
SET @tmpstr = '/* sp_help_revlogin script '
PRINT @tmpstr
SET @tmpstr = '** Generated ' + CONVERT (varchar, GETDATE()) + ' on ' + @@SERVERNAME + ' */'
PRINT @tmpstr
PRINT ''
WHILE (@@fetch_status &lt;&gt; -1)
BEGIN
 IF (@@fetch_status &lt;&gt; -2)
 BEGIN
   PRINT ''
   SET @tmpstr = '-- Login: ' + @name
   PRINT @tmpstr
   IF (@type IN ( 'G', 'U'))
   BEGIN -- NT authenticated account/group

     SET @tmpstr = 'CREATE LOGIN ' + QUOTENAME( @name ) + ' FROM WINDOWS WITH DEFAULT_DATABASE = [' + @defaultdb + ']'
   END
   ELSE BEGIN -- SQL Server authentication
       -- obtain password and sid
           SET @PWD_varbinary = CAST( LOGINPROPERTY( @name, 'PasswordHash' ) AS varbinary (256) )
       EXEC sp_hexadecimal @PWD_varbinary, @PWD_string OUT
       EXEC sp_hexadecimal @SID_varbinary,@SID_string OUT

       -- obtain password policy state
       SELECT @is_policy_checked = CASE is_policy_checked WHEN 1 THEN 'ON' WHEN 0 THEN 'OFF' ELSE NULL END FROM sys.sql_logins WHERE name = @name
       SELECT @is_expiration_checked = CASE is_expiration_checked WHEN 1 THEN 'ON' WHEN 0 THEN 'OFF' ELSE NULL END FROM sys.sql_logins WHERE name = @name

           SET @tmpstr = 'CREATE LOGIN ' + QUOTENAME( @name ) + ' WITH PASSWORD = ' + @PWD_string + ' HASHED, SID = ' + @SID_string + ', DEFAULT_DATABASE = [' + @defaultdb + ']'

       IF ( @is_policy_checked IS NOT NULL )
       BEGIN
         SET @tmpstr = @tmpstr + ', CHECK_POLICY = ' + @is_policy_checked
       END
       IF ( @is_expiration_checked IS NOT NULL )
       BEGIN
         SET @tmpstr = @tmpstr + ', CHECK_EXPIRATION = ' + @is_expiration_checked
       END
   END
   IF (@denylogin = 1)
   BEGIN -- login is denied access
     SET @tmpstr = @tmpstr + '; DENY CONNECT SQL TO ' + QUOTENAME( @name )
   END
   ELSE IF (@hasaccess = 0)
   BEGIN -- login exists but does not have access
     SET @tmpstr = @tmpstr + '; REVOKE CONNECT SQL TO ' + QUOTENAME( @name )
   END
   IF (@is_disabled = 1)
   BEGIN -- login is disabled
     SET @tmpstr = @tmpstr + '; ALTER LOGIN ' + QUOTENAME( @name ) + ' DISABLE'
   END
   PRINT @tmpstr
 END

 FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin
  END
CLOSE login_curs
DEALLOCATE login_curs
RETURN 0
GO
&lt;/div&gt;
Having executed this script on the primary DB instance (in the master DB), you'll have two stored procedures, one named sp_hexadecimal, and the other named sp_help_revlogin.  Execute sp_help_revlogin there in the master DB, and you'll get results like those below:&lt;/span&gt;
&lt;div class="codesnippet"&gt;exec sp_help_revlogin;


/* sp_help_revlogin script
** Generated Nov 26 2007 11:29AM on PROGGY1 */


DECLARE @pwd sysname


-- Login: adm
SET @pwd = CONVERT (varbinary(256), 0x0100232E814889F09515E0F88CE4DD9)
EXEC master..sp_addlogin 'adm', @pwd, @sid = 0x3FF76B5AC6E7E5, @encryptopt = 'skip_encryption'


-- Login: Athletics
SET @pwd = CONVERT (varbinary(256), 0x010068191842A1D43B7313EEC14579B)
EXEC master..sp_addlogin 'Athletics', @pwd, @sid = 0x6C5671BA, @encryptopt = 'skip_encryption'


-- Login: bart
SET @pwd = CONVERT (varbinary(256), 0x0100252DE7AB024B287010BD25A4AB9)
EXEC master..sp_addlogin 'bart', @pwd, @sid = 0x7BEA9B86F686F, @encryptopt = 'skip_encryption'


-- Login: brs
SET @pwd = CONVERT (varbinary(256), 0x01007037A96AEE4A1695455AD0E9126)
EXEC master..sp_addlogin 'brs', @pwd, @sid = 0x344998CB53E408, @encryptopt = 'skip_encryption'&lt;/div&gt;


&lt;span style="font-family:lucida grande;"&gt;Note that the hashed values there will be considerably longer; I've truncated them for your viewing pleasure.  The output above is the script you'll run on the mirror instance to create the appropriate logins.  Simply copy the whole output to your mirror instance and delete the logins from the script that you do not wish to copy.  This will create the logins on your mirror instance with the same passwords (if you're using SQL authentication) as on your primary instance.

You'll still have to set up the server permissions on the mirror instance as they were set up on the primary, but this makes the process a whole lot easier.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-6634341866288610595?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/6634341866288610595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/copying-sql-server-2005-logins-from-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6634341866288610595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/6634341866288610595'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/copying-sql-server-2005-logins-from-one.html' title='Copying SQL Server 2005 logins from one instance to another'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1714283384790610704.post-8498256070925872708</id><published>2008-03-11T12:23:00.012-05:00</published><updated>2008-03-21T22:58:46.689-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database Mirroring'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SharePoint with SQL Server Mirroring</title><content type='html'>While most documentation for implementing Microsoft SharePoint suggests using SQL Server clustering for high availability and failover, database mirroring might be as good or even a better option.  If, for instance, you don't have a SAN, you might really appreciate the ability to use database mirroring instead.  This post runs through using DB mirroring with SharePoint 2007.
&lt;span id="fullpost"&gt;
&lt;span style="font-family:lucida grande;"&gt;There is a ton of information out there about implementing Microsoft Office SharePoint Server 2007 (MOSS), but my experience is that the bulk of them fall into two basic categories:  very basic step-by-step instructions that don't go into much detail on the &lt;/span&gt;&lt;span style="font-style: italic;font-family:lucida grande;" &gt;why &lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;of it all, and those that focus entirely on the &lt;/span&gt;&lt;span style="font-style: italic;font-family:lucida grande;" &gt;why&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; without talking much, if at all, about the how.  &lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt;So you either end up with a theoretical understanding of the underpinnings of SharePoint (assuming you are familiar with the term&lt;span style="font-family:lucida grande;"&gt;inology), or you are able to set a basic MOSS site without knowing if you're following best-practices, or if what you're doing will even give you what you want.  It's my hope--as we go through our implementation--to find and p&lt;/span&gt;ost a middle road through all this.&lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt;By way of starting out, here are a few documents that have been helpful in implementing SharePoint.&lt;/span&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc262686.aspx"&gt;Microsoft SQL Server Mirroring with SharePoint&lt;/a&gt;&lt;/span&gt;
Unfortunately, this document is almost entirely instructions on how to set up database mirroring in SQL Server.   If you're a DBA, this is not useful information to you, and if you're not a DBA, you're likely going to use the SQL Server GUI to implement database mirroring, anyway (the white paper gives instructions on mirroring through T-SQL commands).
Happily, though, there is a bit on configuring SharePoint to use the mirror database in the event of a failover.  In short:  you use the SQL Alias feature (through cliconfg.exe) on the front-end web server(s).
This is the method we ended up using.  &lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:180%;"  &gt;Implementing DB Mirroring with SharePoint&lt;/span&gt;
&lt;/div&gt;
Here's where the rubber hits the road.  To be clear:  we're talking SQL Server 2005, here.  In short, this is what we're doing:
&lt;ul&gt;&lt;li&gt;Mirror the SQL Server databases&lt;/li&gt;&lt;li&gt;Ensure the SharePoint login accounts can access the mirror DB server&lt;/li&gt;&lt;li&gt;Configure the SharePoint front-end web server(s) to allow for failover&lt;/li&gt;&lt;/ul&gt;At the moment, we're not going to go into much detail on setting up the mirroring; that may be added at another time.  It's a good idea to set up a witness server (instance, really); that makes testing the failover much easier, and the witness instance can be a SQL Server Express instance, so it won't cost you any more.
Do make sure your logins from the primary database instance are copied to the mirror instance.  &lt;a href="http://support.microsoft.com/kb/918992"&gt;This KB article from Microsoft&lt;/a&gt; talks about doing so.  Or you can see my summary &lt;a href="http://lanestechblog.blogspot.com/2008/03/copying-sql-server-2005-logins-from-one.html"&gt;in this post&lt;/a&gt;.


&lt;div style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:180%;"  &gt;Setting up the Server Alias
&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:100%;"&gt;Here's the money piece.  SQL Server includes a "alias" feature that allows you to create a synonym, stored in the registry, for a SQL Server.  This is important, because, for some reason, MOSS 2007 developers decided not to include SQL Server mirror failover capability in the product.

&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:trebuchet ms;" &gt;&amp;lt;Actually, this decision probably is a function of the way SharePoint handles the database; it really does treat the SQL Server instance as a whole, rather than as several databases.  Given that, it does follow that--since mirroring is a database-level (rather than instance-level) high-availability technology--SharePoint mightn't work quite right with mirroring.  Still, it'd have been nice for them to have worked out a way for this &lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-style: italic;"&gt;to function.&amp;gt;&lt;/span&gt;
&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style=";font-family:lucida grande;font-size:130%;"  &gt;To create an alias, run the application &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:130%;"  &gt;cliconfg.exe&lt;/span&gt;&lt;span style=";font-family:lucida grande;font-size:130%;"  &gt;.  This allows you to create an alias for a SQL Server machine, stored in the registry.  It should be noted here that there may be two versions of this application  if you're running this on a 64-bit server.  They are identical except that the 32-bit version stores the alias in the 32-bit compatibility registry key.  We've had instances in which we've had to set the alias up in both the standard (64-bit) and compatible (32-bit) keys in order to get SharePoint to use the alias fully.

Note that when you create a TCP alias, the port matters.  If you're not pointing the alias to a named instance, the port by default is 1433.  Additional instances will always have a different port.  You can find the port number either in the current SQL Server startup logs or by using the SQL Server configuration utility.

&lt;/span&gt;&lt;span style=";font-family:lucida grande;font-size:130%;"  &gt;The registry key in which the alias is stored is at &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;p class="MsoNormal"  style="margin-left: 0.5in;font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;\\HKLM\Softare\Microsoft\MSSQLServer\Client\ConnectTo\&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-family:lucida grande;"&gt;While the 32-bit compatible key is at &lt;/span&gt;
&lt;p class="MsoNormal"  style="margin-left: 0.5in;font-family:lucida grande;"&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;\\HKLM\Software\Wow6432Node\Microsoft\MSSQLServer\Client\ConnectTo\&lt;/span&gt;
&lt;/p&gt; &lt;span style="font-family:lucida grande;"&gt;A TCP Alias breaks down something like this:&lt;/span&gt;
&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;DBMSSOCN,servername,4984&lt;/span&gt;&lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt;Where &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;DBMSSOCN&lt;span style="font-family:lucida grande;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;refers to TCP, &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;servername&lt;span style="font-family:lucida grande;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;is the server name, and &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;4984&lt;span style="font-family:lucida grande;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;is the port number.&lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt;A Named Pipes Alias, on the other hand:&lt;/span&gt;
&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;DBNMPNTW,\\servername\PIPE\MSSQL$spstg\sql\query

&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;Where DBNMPNTW refers to Named Pipes,&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;servername &lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;is the server name, and&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;$spstg&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; is the instance name.

&lt;span style="font-family:lucida grande;"&gt;Once you've got these registry keys set, it's a simple matter of changing the server name (and port, if necessary) in the alias after a failover.  This will point SharePoint to the mirror DB server instead of to the primary.  If you're comfortable doing this, changing the registry directly is quite sufficient.  If not, you can edit the alias with the &lt;span style="font-family:courier new;"&gt;cliconfg.exe&lt;/span&gt; application.&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;After changing the alias, it's prudent to go ahead and reset IIS.  You can simply run the &lt;span style="font-family:courier new;"&gt;IISRESET&lt;/span&gt; command from the command line to do this.
&lt;/span&gt;
It should be pointed out again that, while SQL Server DB mirroring is on a database-level (that is, a single database within an instance can fail over to the mirror), SharePoint, for the most part, treats the SQL Server instance as a unit.  While it's possible to use &lt;span style="font-family:courier new;"&gt;STSADM &lt;/span&gt;to rename a server for a particular database, this seems like more work than is necessary.

To do this failover automatically requires another step, and it's one that we're still working on.  I'll post that as we move closer to that goal.

&lt;/span&gt;

&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1714283384790610704-8498256070925872708?l=lanestechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lanestechblog.blogspot.com/feeds/8498256070925872708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/sharepoint-with-sql-server-mirroring.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/8498256070925872708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1714283384790610704/posts/default/8498256070925872708'/><link rel='alternate' type='text/html' href='http://lanestechblog.blogspot.com/2008/03/sharepoint-with-sql-server-mirroring.html' title='SharePoint with SQL Server Mirroring'/><author><name>Lane Duncan</name><uri>https://profiles.google.com/109576495494222218525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-n9mKPRWAUz8/AAAAAAAAAAI/AAAAAAAAASY/43kdgEDtA_g/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry></feed>
