2012年12月15日 星期六

How to Rename SQL Server Cluster Virtual Server Name (Network name)

How to Rename SQL Server Cluster Virtual Server Name(Network name)
from my MSDN Blog December 15, 2012

Rename a SQL Server Failover Cluster Instance
http://msdn.microsoft.com/en-us/library/ms178083.aspx

The name of the virtual server is always the same as the name of the SQL Network Name (the SQL Virtual Server Network Name). Although you can change the name of the virtual server, you cannot change the instance name. For example, you can change a virtual server named VS1\instance1 to some other name, such as SQL35\instance1, but the instance portion of the name, instance1, will remain unchanged.

Before you begin the renaming process, review the items below.


  • SQL Server does not support renaming servers involved in replication, except in the case of using log shipping with replication. The secondary server in log shipping can be renamed if the primary server is permanently lost. For more information, see Replication and Log Shipping.
  • When renaming a virtual server that is configured to use database mirroring, you must turn off database mirroring before the renaming operation, and then re-establish database mirroring with the new virtual server name. Metadata for database mirroring will not be updated automatically to reflect the new virtual server name.


To rename a virtual server


  1. Using Cluster Administrator, change the SQL Network Name to the new name.
  2. Take the network name resource offline. This takes the SQL Server resource and other dependent resources offline as well.
  3. Bring the SQL Server resource back online.
  4. 確認DNS Server上的A Record是否已經改成新的Network Name
  5. 查詢SQL Server系統資料表是否已正確修改成新的Network Name,SELECT @@SERVERNAME; SELECT * FROM sys.sysservers;
  6. Failover Test





前端程式可能需要幾秒鐘或3到5分鐘或更久(depending on network configuration)才能成功連線到SQL
Server。

For connections from any node in the cluster, the new name can be used almost immediately. However, for connections using the new name from a client computer, the new name cannot be used to connect to the server until the new name is visible to that client computer. The length of time required for the new name to be propagated across a network can be a few seconds, or as long as 3 to 5 minutes, depending on the network configuration; additional time may be required before the old virtual server name is no longer visible on the network.

在前端應用程式伺服器(例如Web Server),執行以下命令來減少這個延遲的時間。

To minimize network propagation delay of a virtual server renaming operation, use the following steps:

ipconfig /flushdns

ipconfig /registerdns

nbtstat –RR







Awesome SQL Server blogs

SQL Release Services Blog
http://blogs.msdn.com/b/sqlreleaseservices/

CSS SQL Server Engineers
http://blogs.msdn.com/b/psssql/

SQL Server Engine Tips
http://blogs.msdn.com/b/sqltips/

Microsoft SQL Server Development Customer Advisory Team
http://blogs.msdn.com/b/sqlcat/

SQL CAT(Customer Advisory Team)
http://sqlcat.com/

SQL Server Storage Engine Blog
http://blogs.msdn.com/sqlserverstorageengine/

Tips, Tricks, and Advice from the SQL Server Query Processing Team
http://blogs.msdn.com/b/sqlqueryprocessing/

SQL Server Performance
http://blogs.msdn.com/b/sqlperf/

SQL Programmability & API Development Team Blog
http://blogs.msdn.com/b/sqlprogrammability/

Euan Garden's BLOG
http://blogs.msdn.com/b/euanga/


SQL Server - Blogs
http://technet.microsoft.com/en-us/sqlserver/bb671052.aspx

Karthick PK 's Blog
http://blogs.msdn.com/b/karthick_pk/

Karthick P.K SQL Server Blogs
http://mssqlwiki.com/sqlblogs/

MSSQL tips
http://www.mssqltips.com/

2012年12月6日 星期四

Oracle 8i R2 8.1.6 Install on Windows 2003 R2 sp2

1.Oracle 8i安裝在Windows 2003 R2上沒有問題
2.安裝之後必須使用Configuration Assistant設定一個repository user
3.啟動OracleOraHome81ManagmentServer服務
4.啟動OracleOraHome81Agnet服務
5.使用sysman/oem_temp登入Oracle Enterprise Manager Console,步驟4啟動後,discovery才不會失敗
6.之後就可以使用system/manger登入Enterprise manager console來管理Oracle

後記
Oracle 11g R2 Client無法連線到Oracle 8i 8.1.6

ORA-03134: Connections to this server version are no longer supported.
Cause: An attempt was made to connect to an Oracle server of older version.
Action: Please refer to documentation for more details.



select * from v$version;



research之後,發現需要上patch 8.1.7.4
select * from v$version;
Oracle 8i 8.1.7.4

Oracle 10g client not connecting to Oracle 8i server
https://community.oracle.com/thread/245332?start=0&tstart=0

再research發現p2376472_8174_WINNT.zip Oracle 8.1.7.4 is a patchset for 8.1.7.0
並且Oracle也不提供沒有support帳戶可以下載patch file,所以暫時只能找其他方法了

2012年12月5日 星期三

SSIS Oracle Source and Destination

SQL Server Integration Service可以透過內建的OLE DB Source連線到Oracle匯出資料,但無法寫入資料到Oracle,Attunity公司針對這個功能提供了SSIS的連結Source,並且聽說資料傳送效率非常好,本人沒有測試過效能,有興趣的朋友可以試試。

Microsoft® Connectors v1.2 for Oracle and Teradata
for SQL Server 2008 Integration Service

Microsoft Connectors v2.0 for Oracle and Teradata
For SQL Server 2012 Integration Service

Installation
In summary, if you want both to develop and to run SSIS packages on a 64-bit computer:
1.Install the Attunity Oracle 64 bit connector.(the 64 bit connector installs both 32-bit and 64-bit versions)
2.Install the Oracle 11G 64 Bit client.
3.Install the Oracle 11G 32 Bit client.
4.Restart the computer after the Oracle installations are complete.
5.You should be able to develop and run SSIS packages.


Install Microsoft® Connectors v1.2 for Oracle with Error message cannot retistry AttunitySSISOraAdapters.dll and the AttunitySSISOraConnections.dll
http://www.attunity.com/forums/microsoft-ssis-connectors-attunity/installation-issues-1735.html

[solution]
Download: Visual C++ 2008 SP1 Redistributable Package (x64) - Microsoft Download Center - Confirmation
或是直接安裝Visual Studio 2008 SP1
http://www.microsoft.com/en-us/download/details.aspx?id=13276


========================================================================
Microsoft® Connectors v1.2 for Oracle and Teradata
http://www.microsoft.com/en-us/download/details.aspx?id=29284

Download the SSIS Connectors Version 1.2 for Oracle and Teradata that provide additional value for SQL Server Integration Services (SSIS).

Quick details

Version:1.2Date published:7/9/2012
Language:English

Files in this download

The links in this section correspond to files available for this download. Download the files appropriate for you.
File nameSize
AttunitySSISOraAdaptersSetup.msi2.1 MBDownload
AttunitySSISOraAdaptersSetupX64.msi3.8 MBDownload
AttunitySSISTeraAdaptersSetup.msi2.7 MBDownload
AttunitySSISTeraAdaptersSetupX64.msi4.9 MBDownload


========================================================================
Microsoft Connectors v2.0 for Oracle and Teradata
http://www.microsoft.com/en-us/download/details.aspx?id=29283

Download the SSIS Connectors v2.0 for Oracle and Teradata that provide additional value for SQL Server Integration Services (SSIS) 2012.

Quick details

Version:2.0Date published:4/3/2012
Language:English

Files in this download

The links in this section correspond to files available for this download. Download the files appropriate for you.
File nameSize
AttunitySSISOraAdaptersSetup.msi2.3 MBDownload
AttunitySSISOraAdaptersSetupX64.msi3.9 MBDownload
AttunitySSISTeraAdaptersSetup.msi2.8 MBDownload
AttunitySSISTeraAdaptersSetupX64.msi5.0 MBDownload
參考
Microsoft Connectors v2.0 for Oracle and Teradata – Now Available
http://blogs.msdn.com/b/mattm/archive/2012/04/04/microsoft-connectors-v2-0-for-oracle-and-teradata-now-available.aspx


Using the Microsoft Connector for Oracle by Attunity with SQL Server 2008 Integration Services

2012年12月3日 星期一

Oracle 11g R2 installation Warning "Enterprise manager configuration succeeded with the following warning"


[symptom]
1.安裝Oracle 11g R2到最後倒數第二個步驟18/19,出現一個警告
資料庫組態輔助程式
Enterprise manager configuration succeeded with the following warning -
 Error starting database control. Please execute the following command(s)
 1) Set the environment variable ORACLE_UNQNAME to database unique name
 2) c:\app\Administrator\product\11.2.0\dbhome_1\bin\emctl start dbconsole

[解決方法]
1.不用解決
 因為安裝還是會完成

 服務還是可以正常啟動,使用[服務]管理員也是可以正常停止啟動DB control服務,並且DB control URL網站還是可以正常使用

 但是如果想用Oracle的啟動命令啟動db control則會失敗

2.解決這個問題
 依照警告訊息的畫面所說明的方法,增加一個環境變數ORACLE_UNQNAME
 先用命令列測試SET ORACLE_UNQNAME=orcl,再用Oracle的啟動db control,果然成功了

 接下來就直接在Windows系統環境變數加上這個變數ORACLE_UNQNAME=orcl,以後再用Oracle的啟動命令來啟動db control就不會有問題了

Oracle 10g R2中文字亂碼

最近安裝的Oracle 10g R2卻會出現輸入或查詢中文字會有亂碼的問題(例如使用sqlplus在直接執行INSERT中文字,再用SELECT查詢中文字會出現亂碼),以下提供的解決方法不一定能所有的中文字亂碼問題,但在我的環境是可以解決的。

[我的環境]
Windows 2003 R2 Enterprise Edition with SP2 Traditional Chinese繁體中文版
Oracle 10g R2 10.2.0.4
Oracle安裝時選擇預設的字元集AL32UTF8

[解決方法]
1.開始>執行>regedit
2.在以下機碼設定這個值
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb01g_home1
將此機碼NLS_LANG的值改成TRADITIONAL CHINESE_TAIWAN.ZHT16MSWIN950

==============================================================
update:
Oracle 11g R2安裝時預設的字元集就是ZHT16MSWIN950,所以不會出現亂碼

安裝Oracle 10g R2最後Database Control(Web EM)配置失敗的解決方式2

因為客戶的資料庫通常也有Oracle,當我們在support SQL Server的問題就需要有Oracle的LAB來進行測試,最近重新安裝了一台Oracle 10g R2發生了一些問題是安裝Oracle 11g沒有出現的,所以只要想辦法解決,以下是問題說明與解決方法,希望能幫助到遇到相同問題的朋友。

官方網站的解釋是憑證到期,導致EM(Enterprise Manager Database Control)配置失敗且無法啟動

In Enterprise Manager Database Control with Oracle Database 10.2.0.4 and 10.2.0.5, the root certificate used to secure communications via the Secure Socket Layer (SSL) protocol will expire on 31-Dec-2010 00:00:00. The certificate expiration will cause errors if you attempt to configure Database Control on or after 31-Dec-2010. Existing Database Control configurations are not affected by this issue.

If you plan to configure Database Control with either of these Oracle Database releases, Oracle strongly recommends that you apply Patch 8350262 to your Oracle Home installations before you configure Database Control. Configuration of Database Control is typically done when you create or upgrade Oracle Database, or if you run Enterprise Manager Configuration Assistant (EMCA) in standalone mode.


[解決方法]
1.下載p8350262_10204_Generic.zip

2.使用Opatch安裝Patch 8350262
  (1)Set the ORACLE_HOME and ORACLE_SID environment variables.
      預設

      ORACLE_HOME=c:\oracle\product\10.2.0\db_1
      ORACLE_SID=orcl

  (2)將p8350262_10204_Generic.zip解壓縮到目錄,執行opatch apply
       例如
       c:\Temp\p8350262\opatch apply
       PS.c:\oracle\product\10.2.0\db_1\OPatch必須在path的環境變數裡
       或

       c:\Temp\p8350262\>c:\oracle\product\10.2.0\db_1\OPatch\opatch apply


      PS.如果遇到Java could not be located. OPatch cannot proceed錯誤,則加上這個參數
       c:\Temp\p8350262\opatch apply -jre c:\oracle\product\10.2.0\db_1\jdk
   

3. Re-secure Database Control with the following command:
      /bin/emctl secure dbconsole -reset

4. Re-start Database Control with the following command:
      /bin/emctl start dbconsole

[由於我是安裝一台新的Oracle所以我的作法是]
1.將Windows系統時間調整到31-Dec-2010之前,例如2009-10-10
2.安裝Oracle 10g R2 10.2.0.4,就可以順利安裝
3.安裝完成後確認Oracle Enterprise Manager database control服務已經正常啟動且使用瀏覽器可以連線到Enterprise Manager Database Control
 https://hostname:1158/em
4.將Oracle Enterprise Manager database control服務停止,依照上面的[解決方法]開始套用patch 8350262

5.再將Oracle Enterprise Manager database control服務啟動,確認可以正常啟動
6.將Windows系統時間調整回正常時間,並重新開機
7.此時Oracle Enterprise Manager database control服務已經可以正常啟動了
8.如果此時Oracle Enterprise Manager database control服務還是無法正常啟動,則使用命令將DB control移除重建
emca -deconfig dbcontrol db -repos drop
emca -config dbcontrol db -repos create

可以參考這篇
http://www.aixchina.net/home/space.php?uid=20260&do=blog&id=28358

2012年12月1日 星期六

SQL Server 2012 Installation fail "Managed SQL Server Installer has stopped working"

SQL Server 2012 Installation fail "Managed SQL Server Installer has stopped working"


因為一年多前換了新公司,很久沒有更新文章了,最近在Windows 8上安裝了SQL Server 2012 Developer Edition RTM出現一個錯誤"Managed SQL Server Installer has stopped working",搜尋網路上的資源都指向是.net framework的問題,試了很多方法,最後的解決方法是將Windows 8 內建的.Net Framework 3.5與4.5所有子功能都一併安裝起來才解決的。

我的狀況如下
1.當我先安裝了SQL Server 2008, Visual Studio 2008, SQL Server 2008 R2, Visual Studio 2010。
2.接著安裝SQL Server 2012 RTM,當我啟動Setup.exe沒有問題,正常出現SQL Server Installation Center,接下來點選Installation裡面的New SQL Server stand-alone installation or add features to an existing installation.



3.馬上就會出現跳出以下錯誤訊息視窗,此時只能按close program了,檢查C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log也查不出甚麼東西。

視窗title: Managed SQL Server Installer
內容:Managed SQL Server Installer has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a  solution is available.
 4.解決方法是將Windows 8 內建的.Net Framework 3.5與4.5所有子功能都一併安裝,然後再重新開始安裝就不會發生錯誤了。



如果遇到相同問題的朋友希望能幫到你。

SQL Server Database Mirroring 資料庫鏡像

SQL Server Database Mirroring 資料庫鏡像