2009年9月24日 星期四

ASP connect to SQL Server using Windows Authentication(ASP使用Windows認證連線到SQL Server)

ASP connect to SQL Server using Windows Authentication(ASP使用Windows認證連線到SQL Server)

1.Using Computer Management,Create a new Local Windows Account name myAppUser

2.Internet Service Manager, open the Properties Sheet of the virtual directory for the Web application,
select the Directory Security tab,
click on the Edit button for Anonymous Access and Authentication Control to display the Authentication Methods.
Click the Edit button for Allow Anonymous Access to edit the NT account used for anonymous access (MyAppUser)

3.select the Basic authentication (password is sent in clear text) option(基本驗證).

[Reference]
PRB: "Client Unable to Establish Connection" Error Message When Connecting from ASP to SQL Server
http://support.microsoft.com/?scid=kb%3Ben-us%3B253500&x=6&y=10

Authentication methods for connections to SQL Server in Active Server Pages
http://support.microsoft.com/?scid=kb%3Ben-us%3B247931&x=7&y=11

How to use Kerberos authentication in SQL Server
http://support.microsoft.com/kb/319723/en-us

ASP connect to SQL Server using Windows Authentication(ASP使用Windows認證連線到SQL Server)

ASP connect to SQL Server using Windows Authentication(ASP使用Windows認證連線到SQL Server)

1.Using Computer Management,Create a new Local Windows Account name myAppUser

2.Internet Service Manager, open the Properties Sheet of the virtual directory for the Web application,
select the Directory Security tab,
click on the Edit button for Anonymous Access and Authentication Control to display the Authentication Methods.
Click the Edit button for Allow Anonymous Access to edit the NT account used for anonymous access (MyAppUser)

3.select the Basic authentication (password is sent in clear text) option(基本驗證).

[Reference]
PRB: "Client Unable to Establish Connection" Error Message When Connecting from ASP to SQL Server
http://support.microsoft.com/?scid=kb%3Ben-us%3B253500&x=6&y=10

Authentication methods for connections to SQL Server in Active Server Pages
http://support.microsoft.com/?scid=kb%3Ben-us%3B247931&x=7&y=11

How to use Kerberos authentication in SQL Server
http://support.microsoft.com/kb/319723/en-us

T-SQL WHILE Loop and CAST

-- DEMO WHILE Loop and CAST
DECLARE @ip1 varchar(15), @ip1start int
SET @ip1 = '10.3.21.'
SET @ip1start = 131

WHILE (@ip1start<255)
BEGIN
--PRINT 'test'
PRINT @ip1 + CAST(@ip1start as varchar(3))

SET @ip1start = @ip1start + 1
END

GO

2009年9月22日 星期二

利用Windows 2003的DNS 應用程式目錄磁碟分割,只複寫指定的DC

利用Windows 2003的DNS 應用程式目錄磁碟分割,指複寫指定的DC
找了幾天的solution,雖然用不到了,但是記錄一下也好,
參考reference的最後一份微軟doc文件

1.建立目錄磁碟分割
2.編列目錄磁碟分割
3.DNS mmc管理工具,指定分割區

[Reference]
建立 DNS 應用程式目錄磁碟分割
http://technet.microsoft.com/zh-tw/library/cc736585%28WS.10%29.aspx

編列 DNS 應用程式目錄磁碟分割中的一部 DNS 伺服器
http://technet.microsoft.com/zh-tw/library/cc756813%28WS.10%29.aspx

使用DNS應用程式目錄磁碟分割
http://download.microsoft.com/download/a/e/6/ae63ca55-7fc4-4190-8400-a17d2096c277/dns_adp.doc

2009年9月20日 星期日

How to connect Windows Server 2008 and Windows Vista to an iSCSI Server

若想測試一下iSCSI可用此方法建置

[iSCSI Server]
1.可下載使用OpenFiler這個軟體建置iSCSI Server
下載為ISO檔,燒錄光碟後為可開機進行系統安裝
http://www.openfiler.com/community/download/

圖形介面安裝說明,安裝過程就像Linux的安裝
http://www.openfiler.com/learn/how-to/graphical-installation
PS.安裝在第一顆硬碟,保留第二顆不使用,之後可做為shared disk Volumn用

2.可使用Web管理介面設定IP與通訊埠
https://安裝時設定的iSCSI Server IP:446/

* The default username is openfiler, password password
* Go to services & enable the iSCSI Target service.
* Go to Volumes, then Physical Storage Management,
and click on the name of the disk where you want to create a new volume (I do this by having a second disk in the server besides the boot disk). In my case, I clicked on /dev/sdb
* Create a partition on that disk.
* Now go to Volume Group Management,
give the new VG a name, click the Select checkbox,
and click Add volume group.
* Now click on Create new Volume.
Create an iSCSI file system volume in the VG,
of whatever size you want.
* Now, go to the General tab and add your local network to the networks tab.
This should be the same network that the Win 2008 Server or Vista hosts are located on.
* Go back to the Volume properties, edit the volume,
and change that local network to Allow instead of the default of block.
Click Update.
* Now disable and enable the iSCSI service.

PS.版本不同設定位置會不一樣,
例如: Local network設定需在System->Network Access Configuration
先新增完成,然後設定Volumne完成時,點右邊的iSCSI Targets,
進行Target IQN新增與mapping,再設定Network ACL時指定Local Network

[iSCSI Client]
1.Windows Server 2008, Windows Vista內建Initiator
2.Windows Server 2003, Windows XP需額外下載安裝
Microsoft iSCSI Software Initiator Version 2.08
http://www.microsoft.com/downloads/details.aspx?familyid=12cb3c1a-15d6-4585-b385-befd1319f825&displaylang=en#filelist
3.設定連線到iSCSI Server
(1)控制台->iSCSI Initiator(iSCSI啟動器)
(2)電腦管理->存放->磁碟管理->會偵測到新磁碟->進行設定
依照下面的reference設定即可完成

[reference]
How to connect Windows Server 2008 and Windows Vista to an iSCSI Server
http://www.windowsnetworking.com/articles_tutorials/Connect-Windows-Server-2008-Windows-Vista-iSCSI-Server.html

2009年9月11日 星期五

SQL Server Linked Server To Oracle

SQL Server Linked Server To Oracle

1.Install Oracle 10g Release 2 Client
and Oracle 10g Release 2 ODAC 10.2.0.2.21
on the server that is running Microsoft SQL Server

2.Create an alias name on the server
that is running SQL Server that points to an Oracle database instance.
(tnsname.ora)

3.Enable Allow inprocess on Oracle Provider for OLE DB
SQL Server Instance
->Server Objects -> Linked Servers
->Providers->OraOLEDB.Oracle->Properties
checked Allow inprocess

4.Execute sp_addlinkedserver to create the linked server,
specifying OraOLEDB.Oracle as provider_name,
and the alias for the Oracle database as data_source.
The following example assumes that the alias has been defined as DQORA8:
exec sp_addlinkedserver @server='OrclDB',
@srvproduct='Oracle',
@provider='OraOLEDB.Oracle',
@datasrc='DQORA8'

5.Use sp_addlinkedsrvlogin to create login mappings
from SQL Server logins to Oracle logins.

EXEC sp_addlinkedsrvlogin @rmtsrvname = 'OrclDB',
@useself = 'false',
@locallogin = 'Joe',
@rmtuser = 'OrclUsr',
@rmtpassword = 'OrclPwd'

6.若要寫入資料則要而外設定RPC,RPC OUT
USE master;
EXEC sp_serveroption 'OrclDB', 'rpc out', 'True';

7.限制
Table Name 使用大寫或小寫
每個欄位值都必須提供無論是否可NULL或有預設值
日期型別需使用變數來寫入

例如:
DECLARE @v1 datetime SET @v1 = CONVERT(datetime,'14-sep-94')
EXEC('INSERT INTO
DYNORCL.SALES(ID, ORD_NO, ORD_DATE, QTY)
VALUES (?, ?, ?, ?)', '6380', '6871', @v1, 5) AT OrclDB

一些舊版的Oracle Provider可能不支援AVG()函數(Oracle 10g已直接支援AVG),
若發生錯誤可使用OPENQUERY來達成同樣效果
例如:
SELECT AVG(QTY) FROM ORA..RPUBS.SALES;
發生錯誤則改用
SELECT * FROM OPENQUERY
(
ORA
,'SELECT CAST (AVG(QTY) AS numeric) FROM ORA..RPUBS.SALES'
);


[Reference]
SQL Server 2008 Books Online (August 2009)
Oracle Provider for OLE DB
http://msdn.microsoft.com/en-us/library/ms190618.aspx

2009年9月8日 星期二

How to Speedup Download and Browsing in Vista

Windows Vista you have noticed the slow internet speed. The web browsing and downloading speed is very slow as compare to previous versions of windows. You can open the same sites in Windows XP and Server 2003 with the normal speed.

Follow the steps to speedup the Vista browsing speed:

First go to Advance tab in Internet Explorer and turn off the TLS (Transport Layer Security) encryption option. Here to fix problem with some secure pages turn on the SSL 2.0 (Secure Sockets Layer) feature and click Ok button to close it.

Speedup Vista download:

In windows Vista, the TCP autotuning feature is enabled by default. Some web servers do not respond properly to this feature, so it appears that some sites open with very slow speed.

To use this feature, you will need to be logged into your computer with administrative rights.

First click on Start button and type CMD in Run option then press Enter.

At Command Prompt, type the following command and press Enter :

netsh interface tcp set global autotuninglevel= disabled

This command will disable the TCP autotuning feature. Now close the command Prompt and restart your computer after any changes to go into effect.

You can easily restore these setting by typing the following command at Command Prompt :

netsh interface tcp set global autotuninglevel= normal

Now close the Command Prompt and again restart your computer after any changes to go into effect.

引用

http://www.windowsreference.com/windows-vista/how-to-speedup-download-and-browsing-in-vista/

How to Disable/Enable Aero Glass UI in Vista 如何關閉Aero Glass

To disable Windows Aero Glass UI follow these steps

Right-click on any blank spot on desktop area and On the pop up right click contextual menu, and select “Personalize”.

Select “Windows Color and Appearance” option.

Disable Transparency, simply uncheck the “Enable Transparency” option.

To disable the Windows Aero theme click on the “Open classic apperance properties for more color options” link located at the bottom of Window Color and Apperance window.

In the Appearance Setting dialog box, select Windows Classic listed in the “Color Scheme” except Windows Aero and click ok

If you want to enable aero glass UI reverse these changes and select windows aero option in the last step.

Using Registry Key

Go to Start—>Run type regedit click ok

Expand and navigate to the following registry key
HKEY_CURRENT_USER\Software\Microsoft\Windows\DWN

On the right pane, locate ColorizationColor with type as DWORD. Right click on ColorizationColor, and select Delete on the right click menu. Click on OK to confirm the deletion.

Then right click on registry value titled Composition (type DWORD) and select Modify. Change the value to 0 (by default is 1).

Restart the computer.

引用

http://www.windowsreference.com/windows-vista/how-to-disableenable-aero-glass-ui-in-vista/

2009年9月7日 星期一

Audit Active Directory Objects in Windows Server 2003 (設定稽核Windows 2003 Active Directory物件)

若存取AD物件發生此錯誤"Access Denied" error code 0x80007005
可設定稽核來找到未授權存取的LDAP屬性


To configure an audit policy setting for a domain controller:
  1. Click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.
  2. On the View menu, click Advanced Features.
  3. Right-click Domain Controllers, and then click Properties.
  4. Click the Group Policy tab, click Default Domain Controller Policy, and then click Edit.
  5. Click Computer Configuration, double-click Windows Settings, double-click Security Settings, double-click Local Policies, and then double-click Audit Policy.
  6. In the right pane, right-click Audit Directory Services Access, and then click Properties.
  7. Click Define These Policy Settings, and then click to select one or both of the following check boxes:
    • Success: Click to select this check box to audit successful attempts for the event category.
    • Failure: Click to select this check box to audit failed attempts for the event category.
  8. Right-click any other event category that you want to audit, and then click Properties.
  9. Click OK.
  10. Because the changes that you make to your computer's audit policy setting take effect only when the policy setting is propagated or applied to your computer, complete either of the following steps to initiate policy propagation:
    • Type gpupdate /Target:computer at the command prompt, and then press ENTER.
    • Wait for automatic policy propagation that occurs at regular intervals that you can configure. By default, policy propagation occurs every five minutes.
  11. Open the Security log to view logged events.

    Note If you are either a domain or an enterprise administrator, you can enable security auditing for workstations, member servers, and domain controllers remotely.

Configure Auditing for Specific Active Directory Objects

After you configure an audit policy setting, you can configure auditing for specific objects, such as users, computers, organizational units, or groups, by specifying both the types of access and the users whose access that you want to audit. To configure auditing for specific Active Directory objects:
  1. Click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.
  2. Make sure that Advanced Features is selected on the View menu by making sure that the command has a check mark next to it.
  3. Right-click the Active Directory object that you want to audit, and then click Properties.
  4. Click the Security tab, and then click Advanced.
  5. Click the Auditing tab, and then click Add.
  6. Complete one of the following:

    • Type the name of either the user or the group whose access you want to audit in the Enter the object name to select box, and then click OK.
    • In the list of names, double-click either the user or the group whose access you want to audit.
  7. Click to select either the Successful check box or the Failed check box for the actions that you want to audit, and then click OK.
  8. Click OK, and then click OK.
[Reference]
How to troubleshoot access denied in a split permission model or minimum permissions mode

HOW TO: Audit Active Directory Objects in Windows Server 2003

SQL Server Database Mirroring 資料庫鏡像

SQL Server Database Mirroring 資料庫鏡像