Archive for September, 2006

Transferring files to a box with McAfee VirusScan

If you have McAfee VirusScan on your server, most likely the On-Access Scan feature is enabled. This is good but can cause you problems when you transfer files to the server.

For example, say you want to copy some install media to \\MyServer\C$, most likely it contains files like autorun.exe, autorun.inf, and/or autorun.ini. When you do a copy and paste of the whole install media folder, you will get the message below:

Cannot copy autorun: Access is denied.

Make sure the disk is not full or write-protected and that the file is not currently in use.
—————————
OK
—————————

To get around this, you can right click on VirusScan icon in the system tray at the lower right hand corner and pick “Disable On-Access Scan”. This will disable that feature temporarily. Proceed with copying. When it is finished, be sure to re-enable On-Access Scan.

Comments

Quick guide to Database Mail in Sql Server 2005

All right dear reader, I am sure you’ve waited long and hard for this moment. So let’s cut to the chase. Here is the gist of Database Mail in Sql Server 2005:

1. Say goodbye to the silly and cumbersome Sql Mail of Sql Server 2000;
2. Database Mail uses SMTP service. You can use Exchange as your SMTP server, if your company uses Exchange;
3. Database Mail needs to be enabled before you can use it. Dah! As part of secure computing, Database Mail is off by default;
4. At a high level, Database Mail needs at least one profile. Each profile needs at least one account. Account is the core of the whole thing, where you define From Address, Reply To address, Account Name, and most importantly, SMTP server name. If your SMTP server does not support anonymous authentication, you will need to supply login and password;
5. Each profile can have more than one account. The idea is that each account is associated with different SMTP servers. If one SMTP server is down, the second account will be used to send mail;
6. You can create more than one profile for different purposes. I think one profile will be enough for a lot of shops;
7. You probably want to create a default public profile, so it can be used by a lot of users;
8. The script below does the following:
a. Enable Database Mail;
b. Create mail accounts. Account name always starts with the server name, so you know where the message is from when you receive it. This script creates 2 accounts. If primary account fails, secondary account will handle the task. For a lot of shops, one account is probably enough. Remove the second account creation if you do not need it;
c. Create a profile;
d. Add the 2 accounts created earlier to the profile;
e. Make the profile a default public profile, so it can be used for general administrative purposes. Having a default public profile also facilitates your migration from xp_sendmail to sp_send_dbmail, because their interfaces are similar.

To verify your script ran successfully, do this:

EXEC msdb.dbo.sp_send_dbmail
    @recipients = 'Me@MyCompany.com',
    @body = 'Cool Beans',
    @subject = 'Sweet success' ;

This is actually a lot of stuff. I think I will write an article on it.

Scripts below:

use master
go
sp_configure 'show advanced options',1
go
reconfigure with override
go
sp_configure 'Database Mail XPs',1
go
reconfigure
go
sp_configure 'show advanced options',0
go
reconfigure
go

-- Declare variables for account_name, email_address, domain name, and profile name
declare @PrimaryAccountName varchar(50)
declare @SecondaryAccountName varchar(50)
declare @DomainName varchar(50)
declare @Email varchar(50)
declare @DisplayName varchar(50)
declare @ProfileName varchar(50)

select @PrimaryAccountName = @@servername + ' Public Primary Account'
select @SecondaryAccountName = @@servername + ' Public Secondary Account'
select @DomainName = 'MyCompany.com'
select @Email = @@servername + '@' + @DomainName
select @DisplayName = @@servername + ' Automated Mailer'
select @ProfileName = @@servername + ' Public Profile'
-- Create a Database Mail account

EXECUTE msdb.dbo.sysmail_add_account_sp
    @account_name = @PrimaryAccountName,
    @description = 'Mail account for use by all database users.',
    @email_address = @Email,
    @display_name = @DisplayName,
    @mailserver_name = 'MyPrimarySMTPServer' ;

EXECUTE msdb.dbo.sysmail_add_account_sp
    @account_name = @SecondaryAccountName,
    @description = 'Mail account for use by all database users.',
    @email_address = @Email,
    @display_name = @DisplayName,
    @mailserver_name = 'MySecondarySMTPServer' ;

-- Create a Database Mail profile

EXECUTE msdb.dbo.sysmail_add_profile_sp
    @profile_name = @ProfileName,
    @description = 'Profile used for general public administrative mail.' ;

-- Add the account to the profile

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
    @profile_name = @ProfileName,
    @account_name = @PrimaryAccountName,
    @sequence_number =1 ;

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
    @profile_name = @ProfileName,
    @account_name = @SecondaryAccountName,
    @sequence_number =2 ;

-- Grant access to the profile to all users in the msdb database

EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
    @profile_name = @ProfileName,
    @principal_name = 'public',
    @is_default = 1 ;

Comments (1)

No remote connection to the other node(s) during Sql server cluster install

I have done a number of Sql Server cluster installs on a variety of platforms: 32-bit Sql Server 2000 on Windows 2000 and Windows 2003, 32-bit and 64-bit Sql Server 2005 on Windows 2003, both on AMD and Intel hardware. So I feel I am pretty experienced.

Recently I did an install of Sql Server 2005 64-bit cluster on Windows 2003. After picking the right components, entering public IP address for database cluster, filling in service account and a domain group, all that stuff, I commanded the installer to do its magic and expected everything to go smoothly.

And I got this message:

Setup failed to start on the remote machine. Check the Task scheduler event log on the remote machine.

OK Button

Hmmm, I never saw this before. And the install proceeded to fail.

It turned out that I had a remote desktop connection to the other node. Some research revealed that during install, there can be no remote desktop connection to other nodes. Once that connection was cut, I restarted the install, and all was well.

Hope this will be helpful to somebody.

Comments (6)

在书原买中文书和其它文化用品

20080320 Update: Unfortunately, this shop was closed.

记不得是什么时候知道书原的,但我很喜欢这家书店。它以书和音像为主,兼卖杂志和笔墨纸砚等其它文化用品。我感觉这儿的价格和国内差不多。

以下是我上次买的部分清单,现在记不很全了:

1 童安格的歌曲精选;
2 刀朗的2003年的第一场雪;
3 一些儿童学拼音和汉字的书;
4 时事出版社2005年出版的《一生要会背诵的唐诗宋词》,有注译;
5 岳麓书社的国学基本丛书之《论语》,有注译;
6 2006年5月的《中国国家地理》杂志。这期有关于大运河的文章。大运河应当走过台儿庄,那儿离我家不远。但我从没去过;
7 2005年7月4日的《三联生活周刊》;
8 电影《铁道游击队》。我们家乡枣庄的抗日历史。说来好笑,每次当别人听说我从山东枣庄来,十有八九的人会说:哟,铁道游击队的故乡。其实很惭愧,本人爬火车的本领没有,但挤火车的经验倒有一些;
9 电影《冰山上的来客》;
10 电影《手机》。

我也看到周国平的新书。名字忘了,可能下次买来看看。

书原的芝加哥地区分店地址是:
St. James Crossing Shopping Center
Bldg # 212, Unit 14 & 15
832-34 Ogden Ave.
Westmont, IL 60559

在它的北面有一家中国菜店,还不错。所以这儿物质和精神食粮兼备。

书原网址:
www.soyodo.com

Comments (1)

怎样在Windows XP上安装新版紫光拼音输入法/Install Ziguang V5 on Windows XP English

几个月前我在这儿介绍了安装紫光的方法。2005年6月紫光发表了新的输入法第5版。以下是我的安装过程,一点儿都不复杂:

1 在这儿下载软件
2 Control Panel -> Regional and Language Options -> Language Tab, 在Install files for East Asian languages打钩;
3 点击Apply。这时机器需要操作系统的安装软盘。东亚语言支持安装后机器要重新启动。见下图

RegionalLanguageSetting

4 死里回生之后,再向虎山行:Control Panel -> Regional and Language Options -> Advanced Tab. 在下落单子里选择Chinese (PRC)。见下图

RegionalLanguageSettingAdvanced

5 点击Apply。你会看到以下信息:

The required files are already installed on your hard disk. Setup can use these existing files, or Setup can recopy them from your original Windows CD-ROM or from a network share.

Would you like to skip file copying and use the existing files? (If you click No, you will be prompted to insert your Windows CD-ROM or to supply an alternate location where the needed files may be found.)

点击Yes。之后机器需重新启动;

6 死去活来,你会在屏幕的上方看到Language Bar。这是正常的。双击刚才下载的安装软件。按照说明安装;

7 安装结束。如要输入中文,需按左边的Alt和Shift,才可切换到中文。第一次用时,你要点击Language Bar后选择“紫光华宇拼音输入法V5”。按一下Shift, 你就可以输入英文。 再按一下, 就可输入中文。如觉得Language Bar碍眼,相信聪明的你可以自己摸索调整 :)

Comments (3)

Busy, 200609

Let’s see: kid’s school, family stuff, work, volunteering, planning, adding them all up, it can be fun but very busy. So much so that I have neglected my blog for a while. You do take second place, dear reader :) My better half would disagree, though…

Anyway, here are a few pictures.

My son took this picture of me close to Lake Shore Drive on Chicago Avenue, Chicago

Benjamin's shot of Daddy

Little rapper:

Benjamin the rapper

China and Hamburg in Chicago, sign at a bus stop close to Northwestern’s Chicago campus:

Bus stop shelter

Modern art, in front of Museum of Contemporary Art in Chicago. To me, this is pure garbage. Am I the person who dares to say the emperor has no clothes on? Or am I not sophisticated enough to appreciate its beauty? Or somewhere in the middle?

Chicago Museum of Contemporary Art

Comments (5)