Sunday, August 23, 2009

Secure Installation of Microsoft SQL Server 2000

Concept คร่าว

1. Drive ที่เก็บ database เอาไว้ห้ามทำ Compression เอาไว้เพราะจะทำให้ sql ทำงานช้าลงมาก

2. run sql service โดยใช้ account ที่สร้างขึ้นมาใหม่โดยเฉพาะ โดยให้เป็น user ธรรมดา แล้ว SQL Server จะ assign permission ต่างๆที่จำเป็นให้เองตอน Install อย่า run sql server โดยใช้ Local System Account เด็ดขาด

3. Authentication Mode ให้ใช้ Windows Authentication Mode เพราะเป็นการบังคับให้ user ที่จะใช้งาน sql นั้นจะต้อง login เข้า domain ก่อน อย่าเลือก Mixed Mode โดยเด็ดขาด

4. ลง SQL SP4

5. ลง Post SP4 hotfix ล่าสุดคือ build 2282 download ได้จาก http://www.microsoft.com/downloads/details.aspx?familyid=a93f3cfe-18c9-4218-a551-13bf415e418a&displaylang=en

สำหรับ Post SP4 Analysis Service build 2174 download ได้จาก
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=9c9ab140-bdee-44df-b7a3-e6849297754a

สามารถ check build ของ sql server ล่าสุดได้จากเวป
http://www.bigdatabaselist.com/wiki/SQL_Server_Version_Builds

Note

- ถ้ามีปัญหาเกี่ยวกับ replicate olap ให้ add user account ที่ run sql ให้อยู่ใน olap administrator

วิธี Check version ของ SQL Server

สำหรับ SQL 2000 เปิด Query Analyzer แล้วใช้คำสั่ง 
SELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

หรือ

Select @@version

 
The following table lists the Sqlservr.exe version number. 

ReleaseSqlservr.exe
RTM2000.80.194.0
SQL Server 2000 SP12000.80.384.0
SQL Server 2000 SP22000.80.534.0
SQL Server 2000 SP32000.80.760.0
SQL Server 2000 SP3a2000.80.760.0
SQL Server 2000 SP42000.8.00.2039
 

http://sqlserverbuilds.blogspot.com/


http://www.sqlteam.com/article/sql-server-versions


Saturday, August 15, 2009

Download Dell Utility DVD

Dell Systems Management Tools and Documentation (SMTD)
ใช้สำหรับ Install OS และโดยเตรียม partition ให้มองเห็น harddisk และลง Driver ล่าสุดให้
ข้อมูลของทั้ง Virtual Disk 0 จะหายไปให้ Backup เอาไว้ก่อน
ถ้ามีการใช้ Virtual Disk 1 ให้ดึงออกมาก่อนเผื่อข้อมูลหาย

Dell Systems Build and Update Utility (SUU)
เป็นแผ่นรวม BIOS และ Firmware รวมถึง Driver ด้วย ทั้งของ server เองและอุปกรณ์ต่อพ่องของ dell ที่ต่ออยู่กับ server นั้น
มันจะ scan หา BIOS, firmware, driver ของเครื่องทั้งหมด และเปรียบเทียบกับที่มีอยู่ในแผ่น
สามารถสั่ง update ได้พร้อมกันทีเดียว
ข้อควรระวังคือไม่ควร update firmware ของ harddisk อาจจะทำให้ข้อมูลหายหมด
http://ftp.us.dell.com/sysman แล้วค้นหาคำว่า SUU


Dell USB Key F6
http://ftp.us.dell.com/utility/USBKeyPrepA07.exe
- เอาไว้ใช้กับเครื่องที่ไม่มี Drive A: แล้วต้องมีการให้อ่านค่า Driver ของ PERC Raid Controller โดยการกด F6 ในระหว่างการ Install
- copy file driver ทั้งหมดใส่ลงใน folder FILE แล้ว run program

Dell CD ISO - Dell Systems Build and Update Utility
ใช้สำหรับ Install Windows 2000 Server

Dell Direct Download Link
http://ftp.us.dell.com/sysman/

Dell Online Diagnostics
http://ftp.us.dell.com/diags/dell-onlinediags-win32-2.15.0.169.exe

Note
- ไฟล์ ISO Image ของแต่ละ ISO ที่ download มาจะมีอยู่ 2 ไฟล์ จะต้องเอามารวมเข้าด้วยกันด้วยคำสั่ง

copy /b source1.iso + source2.iso out.iso

- บางทีต้องทำการ update ซ้ำหลายครั้งกว่าจะสมบูรณ์
- ไม่สามารถใช้ SUU update Windows XP ได้
- Install Windows Server 2000 จะต้อง download แผ่น version 5.3 มาใช้ และเป็นแผ่น CD เวลา install ให้ตอบว่า ไม่ต้องลง Dell Open Manage เพื่อที่จะได้ไม่ต้อง download แผ่น Open Manage 5.3 อีกแผ่น เพราะเสียเวลามาก
- Install Windows 2000 โดยให้อ่าน driver PERC5/i จาก usb โดยการกด F6 ไม่ได้ผล ต้องใช้แผ่น 5.3 ถึงจะ install ได้
- ใน bios ให้ set usb emulate type ไว้เป็น Floppy Disk
- Dell Open Manage สำหรับ Windows 2000 Server ที่จะใช้ได้คือ Version 5.5
- ไฟล์ของ Open Manage ที่จะเอามาลงจะเรียกว่า Mannode


Tuesday, August 11, 2009

Copy a Folder to Another Folder and Retain its Permissions

วิธีง่ายๆมี 2 วิธี ที่ฟรี

1. ใช้ xcopy
http://support.microsoft.com/kb/323007
เช่น
xcopy c:\olddocs c:\newdocs /O /X /E /H /K

2. robocopy จาก resource kit ของ Windows 2003
http://www.enterprisenetworkingplanet.com/netos/article.php/3719606
- ถ้าไฟล์ถูก lock เพราะว่ากำลังถูกใช้งานอยู่มันจะ สามารถทำงานต่อไปได้

copy folder ไปยังอีก server นึง สามารถใช้ \\ ร่วมด้วยได้
robocopy d:\userdata\bob e:\userdata_backup\bob /copyall /e

mirror ข้อมูล (สามารถ copy เฉพาะไฟล์ที่เปลี่ยนแปลงได้ด้วย) จะลบข้อมูลปลายทางด้วยถ้าต้นทางโดนลบไปแล้ว
robocopy d:\userdata\bob e:\userdata_backup\bob /copyall /mir

/R:0 ให้ข้ามไฟล์ที่ถูก lock ไป
/W:0 รอนานเท่าไหร่ถึงจะ retire

3. robocopy GUI 3.1.2
http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-25c359cc0842/UtilitySpotlight2006_11.exe

Note
- อย่าลืมเปิด CMD ด้วย run as administrator ไม่งั้นจะ copy ไม่ได้

Thursday, August 06, 2009

Remote Control to Console Session

บางครั้งเราต้องการที่จะ Remote ไปควบคุม Console Session แต่จะเจอ error ว่า

"Can't remote control Session (ID 0) because Remote Control is disabled
on that session"

แก้โดยการใช้ command line mstsc.exe /console แล้วให้ connect กลับมาที่ server ใหม่จะสามารถ control console session ได้



mstsc.exe - when connecting to Server 2003-based system will begin a new interactive session independant of the console session

mstsc.exe - when connecting to XP or Vista will connect to the console session as virtual interactive sessions are not supported

mstsc.exe /console - connecting to a Server 2003-based system will enable you to connect to the 0 console session


Once connected to your server, whether console or other interactive session, you can launch the task manager > click on the Users tab > view interactive sessions 0, 1, 2 etcetera.


If you right-click on any of the listed sessions that are not your current session, the options you receive are:

- Connect
- Disconnect
- Log off
- Remote Control

By this method you can log off or connect to any existing session.

Example:

The user is logged on to the home server via mstsc.exe /console from their home computer (session ID 0). The user closes the mstsc window and leaves their session active with tasks running. The user then connects to the home server via mstsc.exe without the /console switch and is then given a new interactive session with ID 1.


Wishing to reconnect to her 0 session and logoff session 1, she:

1. Launches the task manager
2.Navigates to the Users tab
3.Right-clicks the ID 0 session
4.Clicks Connect > the view then changes to session 0 with full interactive capability.
- Session 1 still remains logged in but will show as Disconnected.
5.From session 0 she launches the task manager
6.Navigates to the Users tab
7.Right-clicks session 1 and clicks Logoff
- Session 1 is now gone and the only active session is the 0 console session which she is currently connected to.