基隆汽車換輪胎 四輪定位

今天去了基隆 七堵 車豐 自帶胎換輪 每顆200 *4 含輪胎平衡 就是把原廠貼的平衡鐵片刮下 然後輪胎放上去在哪轉一轉 結果他的平衡貼片又貼在原廠位置 然侯他的平衡貼片感覺上沒有原廠質感那麼好
早知道就在基金一路郵局旁這間換了 不過這間看起比較老舊沒什電子化儀器 這間每顆150

另外四輪定位更冤 網路上跟拍賣明明寫450過去卻說600 然後我的車又跟我說只能定前輪又不減價…………………. 結果我說一起做殺到500 他花了不到十分鐘 鑽到車下把原本+1.3 -0.5 調成+2.0 +2.0就好了 我的500元也就飛了

張貼在 Uncategorized | 發表留言

make 微軟winpe 3.0光碟 & 範例 emulex firmware

ref http://ngs6428.pixnet.net/blog/post/6076343
http://technet.microsoft.com/zh-tw/library/dd125468.aspx#EHAA
http://technet.microsoft.com/en-us/library/cc709665%28WS.10%29.aspx
http://itsjustanotherlayer.com/

Vista 下的 Windows PE 2.0 光碟的製作,而現在 Windows 7 上市,相對應地也推出了 Windows PE 3.0 版本。

首先,我們必須下載安裝新版本的 Windows Automated Installation Kit (Windows AIK)。

Microsoft 下載中心 – Windows 7 的 Windows 自動化安裝套件 (AIK)

新的 Windows 7 的 Windows 自動化安裝套件 (AIK) 才能安裝、自訂以及部署 Microsoft Windows 7 和 Windows Server 2008 R2 系列的作業系統。

此外,也可以使用 Windows AIK 來自動化 Windows 安裝、使用 ImageX 擷取 Windows 影像、使用部署映像服務與管理 (DISM) 設定和修改影像、建立 Windows PE 影像,以及利用使用者狀態移轉工具 (USMT) 移轉使用者設定檔和資料。Windows AIK 還包括磁碟區啟用管理工具 (VAMT),讓 IT 專業人員可以使用多重啟用金鑰 (MAK) 自動化並集中管理磁碟區啟用程序。

支援的作業系統

* Windows 7
* Windows Server 2008
* Windows Server 2008 R2
* Windows Vista SP1
* Windows Server 2003 with Service Pack 2

請注意,此版本已不再支援 Windows XP 了!代表接下來的幾年,我可能同時要存在二套工具,一份處理 Windows XP,一份處理 Windows 7。

再安裝完 Windows AIK 後,接下來就直接實做,做一張 Windows PE 的開機光碟:

1. 依序點按「開始」→「所有程式」→「Microsoft Windows AIK」,再「部署工具命令提示字元」上按滑鼠右鍵,選擇「以系統管理員身分執行」。
2. 首先,建立支援建置 Windows PE 映像的必要目錄結構,輸入:copype.cmd x86 d:\winpe_x86

copype.cmd
可以是 x86、amd64 或 a64
是計劃使用的工具資料夾位置
3. 將基礎映像複製到工作資料夾的 ISO \ sources 子資料下,並重新命名為 Boot.wim。輸入:copy c:\winpe_x86\winpe.wim d:\winpe_x86\ISO\sources\boot.wim
4. 將 ImageX 新增至 Windows PE 映像中;輸入 copy “C:\program files\Windows AIK\Tools\x86\imagex.exe" d:\winpe_x86\iso\

copy “C:\program files\\Tools\\imagex.exe" C:\winpe_x86\iso\
可以是 Windows OPK 或 Windows AIK
可以是 x86、amd64 或 a64。
而 ImageX 是在部署案例過程中,用來擷取和套用映像的工具。
5. 建立可開機光碟,輸入 oscdimg -n -bD:\winpe_x86\etfsboot.com d:\winpe_x86\ISO d:\winpe_x86\winpe_x86.iso
6. 將映像 (.iso) 燒錄到 CD-ROM 或 DVD-ROM。

接下來我們可以使用它來開機,擷取和部署 Windows 7 了。
可是只有cmd console

Step 1: Set up a Windows PE Build Environment

In this step, you create a required directory structure that supports building a Windows PE image.

1. On your technician computer, click Start, point to All Programs, point to Windows OPK or Windows AIK, and then click Windows PE Tools Command Prompt.
The menu shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools. By default, all tools are installed at C:\Program Files\version\Tools, where version can be Windows OPK or Windows AIK.
2. At the command prompt, run the Copype.cmd script. The script requires two arguments: hardware architecture and destination location. For example,

copype.cmd

where can be x86, amd64, or ia64 and is a path to the local directory. For example,

copype.cmd x86 c:\winpe_x86

The script creates the following directory structure and copies all the necessary files for that architecture. For example,

\winpe_x86
\winpe_x86\ISO
\winpe_x86\mount

Step 2: Mount the Base Windows PE Image

In this step, you mount the base image to a local directory so that you can add or remove packages.

* At the command prompt, mount the base Windows PE image (Winpe.wim) to the \Mount directory by using ImageX. For example,

imagex /mountrw c:\winpe_x86\winpe.wim 1 c:\winpe_x86\mount

Step 3: Add Additional Packages

By using the Peimg tool, you install Windows features by using the /install option. Windows features are included with the base image (Winpe.wim) but are not installed. You can also import packages and add drivers and language packs. For more information, see Windows PE Customization How-To Topics.

1. Add a Windows feature to the base image by using the peimg /install command. For example,

peimg /install= c:\winpe_x86\mount\Windows

where denotes the package name. A list of available packages and their names can be obtained by using the /list command. You can use wildcards to specify a package name. Any packages with matching names will be installed. For example,

peimg /install=WinPE-HTA-Package c:\winpe_x86\mount\Windows

-or-

peimg /install=*HTA* c:\winpe_x86\mount\Windows

where wildcards denote any package with HTA in the package name.
Windows PE 2.0 provides the following Windows features referred to as packages.

Package Name Description

WinPE-FONTSupport–Packages

Additional font support for ja-jp, ko-kr, zh-cn, zh-hk, and zh-tw.

WinPE-HTA-Package

HTML application support

WinPE-MDAC-Package

Microsoft Data Access Component support

WinPE-Scripting-Package

Windows Script Host support

WinPE-SRT-Package

Windows Recovery Environment component (available only on the Windows OPK)

WinPE-WMI-Packages

Windows Management Instrumentation (WMI) support

WinPE-XML-Package

Microsoft XML (MSXML) parser support
2. Repeat Step 1 for each package.
3. Verify that the packages were installed by using the peimg /list command to view all packages in the current image. For example,

peimg /list c:\winpe_x86\mount\Windows

In the INS column, (+) denotes installed packages and (-) denotes not installed.

Step 4: (Optional) Add Additional Customizations

This step is optional but recommended. You can add applications and scripts to your Windows PE image that you might need while working in Windows PE. The following is a list of common tools to include in your Windows PE image.

* ImageX
A command-line tool for capturing and applying images during deployment scenarios. For example, at a command prompt,

copy “c:\program files\\Tools\x86\imagex.exe” c:\winpe_x86\iso\

* Package Manager (Pkgmgr.exe)
A tool for servicing Windows image (.wim) files offline. You must copy the entire \Servicing folder and MSXML6 binaries. Offline servicing requires ImageX. For example,

xcopy “c:\program files\\Tools\\Servicing” c:\winpe_x86\iso\Servicing /s

copy %windir%\system32\msxml6*.dll c:\winpe_x86\iso\Servicing
where can be Windows OPK or Windows AIK and can be x86, amd64 or ia64. In both previous examples, the tools are not loaded into memory during a Windows PE RAM boot. The media must be available to access the tools.
To load the tools into memory along with Windows PE, copy the source files into the mounted \Windows directory. For example,

c:\winpe_x86\mount\Windows

ImportantImportant
Adding files to the \Windows directory will increase the size of your Windows PE RAM image. Ensure that your computer has sufficient memory to boot Windows PE and to run various applications.

Step 5: Prepare the Image

In this step, you prepare the image by using the peimg /prep command. This operation removes any non-installed packages from the final image. This operation reduces the overall image size. For example,

peimg /prep c:\winpe_x86\mount\Windows

The /prep option cannot be reverted, and after the /prep option is run, the /install, /uninstall, /import, and /list options will not function, while the /lang and /inf options will continue to function. The Peimg tool prompts you to confirm the command. To suppress this prompt for scripting, add the /f option.
Step 6: Commit Changes to the Image

In this step, you commit the changes to the original image file (Winpe.wim) by using the ImageX /unmount option with the /commit option. For example,

imagex /unmount c:\winpe_x86\mount /commit

Step 7: Replace the Default Boot.wim File

In this step, you replace the default Boot.wim in the \ISO directory with your new customized image. The image must be called Boot.wim. For example,

copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

Next Step

You now have a customized Windows PE RAM disk image that you can place on bootable media, like a CD-ROM or a UFD.
To create a bootable CD-ROM

1. On your technician computer, at a command prompt, create an .iso file by using Oscdimg. For example,

oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso

For IA-64 architecture, replace Etfsboot.com with Efisys.bin.
2. Burn the image (Winpe_x86.iso) to a CD-ROM.

To create a bootable UFD

1. During a running Windows Vista operation system or a Windows PE session, insert your UFD device.
2. At a command prompt, use Diskpart to format the device as FAT32 spanning the entire device, setting the partition to active. For example,

diskpart
select disk 1
clean
create partition primary size=
select partition 1
active
format fs=fat32
assign
exit

where the value of disk 1 is equal to UFD.
3. On your technician computer, copy all the content in the \ISO directory to your UFD device. You can manually create the directory structure or use the xcopy command to automatically build and copy the appropriate files from your technician computer to your UFD device. For example,

xcopy c:\winpe_x86\iso\*.* /s /e /f f:\

where c is the letter of your technician computer hard disk and f is the letter of your UFD device.

You can further customize your Windows PE image by adding language packs, customized scripts, and drivers. For more information, see Windows PE Customization How-To Topics.

CustomEmulexWinPE.cmd – Run this to create a bootable ISO that will install the Emulex WinPE utilities & drivers and then attempt to upgrade the 10G CNA & LPe12000 cards in the system.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
call "C:\Program Files\Windows AIK\Tools\PETools\pesetenv.cmd"

call copype x86 EmulexWinPE

imagex /mountrw Winpe.wim 1 mount

mkdir mount\Emulex
xcopy "setupElxAll-x86.exe" mount\Emulex\
xcopy /s "Firmware" mount\Emulex\
del mount\Windows\System32\startnet.cmd
xcopy "startnet.cmd" mount\Windows\System32\startnet.cmd

peimg /prep mount\Windows
imagex /unmount mount /commit
copy winpe.wim ISO\sources\boot.wim

oscdimg -n -betfsboot.com ISO EmulexWinPE.iso

startnet.cmd – This runs on boot and will attempt to update the 10G CNA & the Emulex LPe12000 cards in the system.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
wpeinit

\Emulex\setupElxAll-x86.exe /q
cd "\Program Files\Emulex\Util\elxApp"

winlpcfg download a=lpe12000-m8 i=\emulex\lpe12000\ud111a5.all
winlpcfg download a=lpe12000-m8 i=\emulex\lpe12000\ub202a2.prg

winlpcfg download n=1 i=\emulex\oce10102\s1462001.ufi
winlpcfg download n=2 i=\emulex\oce10102\s1462001.ufi
winlpcfg download n=3 i=\emulex\oce10102\s1462001.ufi
winlpcfg download n=4 i=\emulex\oce10102\s1462001.ufi

winlpcfg listhba
winlpcfg listbios n=1

Once this script is done running you’ll have a EmulexWinPE.iso that you can mount and boot off of. It will automatically run and upgrade the firmware of the Emulex devices.

This basic setup should allow you to do anything scripting wise you need to do in a Windows environment to update the hardware configuration or run various diagnostics tests outside of ESXi.

Download Locations:
setupElxAll-x86.exe
Windows AIK
Emulex Firmware – Download as needed and update the location you copy it to your WinPE ISO file in the Startnet.cmd and in the CustomEmulexWinPE.cmd.

若用新版windows 7 xpe windows AIK

DISM replaces several Windows AIK tools including PEImg, Intlcfg, and Package Manager.
PEimg is not supported in Windows 7 WAIK.

run as administrator call "C:\Program Files\Windows AIK\Tools\PETools\pesetenv.cmd" call copype x86 EmulexWinPE copy winpe.wim ISO\sources\boot.wim Dism /Mount-Wim /WimFile:ISO\sources\boot.wim /index:1 /MountDir:mount mkdir mount\Emulex xcopy "setupElxAll-x86.exe" mount\Emulex\ xcopy /s "Firmware" mount\Emulex\ dism /unmount-Wim /mountDir:mount /Commit oscdimg -n -betfsboot.com ISO EmulexWinPE.iso
張貼在 Uncategorized | 發表留言

acronis for windows 7 MBR 處理

XP, and many years, the first partition on a disk started at sector 63 and all partition boundaries were multiples of 63 sectors

Windows 7 and Vista’s partitioning tools (the installer, Disk Managment console, and the command-line diskpart tool) start the first partition at sector 2048

Vista and Win7 can happily exist on a disk with the old layout standards. However, due to the way that Vista/7 boot, the boot manager entries in the BCD (Boot Configuration Database) must be modified so that the boot manager is aware of the new location of the partition(s).

TrueImage still uses the older standard with 63-sector offset,TI has the ability to automatically correct the BCD entries for a single boot installation

請注意acronis true image restore 會有更動partition table的機會導致MBR 全錯

張貼在 電腦和網際網路 | 發表留言

Use Windows 2008 NFS for ESX

NO AD
ref http://ross-family.org/blog/2009/07/08/how-to-use-windows-2008-to-host-storage-for-esx/

with AD

按一下以存取 XD10254%20NFS%20Storage%20Configuration%20for%20vSphere%20using%20Windows%202008.pdf

1.added the File Server role with the Services for Network File System (NFS)
2.folder to allow the ANONYMOUS LOGON group Full Control.
and NFS Sharing Allow anonymous access box.
3.set  the nfs share permissions to Read/Write and select the Allow root access for esx ip
4.set local security policy: local policy/
Network Access: Let Everyone permissions apply to anonymous users policy and make sure it is set to Enabled.
5.reboot

B
1.same
2.add AD role with Identity Management for UNIX all services
3.user OU add “Unixgroup" with global&security, set unix attr’s
NIS domain &GID=0
4. add administrator to this grp and set unix attr’s NIS domain &UID=0, unixgroup
5.set Services for NFS  Properties to AD domain
6.conf NFS folder Allow anonymous access UGID=-2 and  RW,root permission

張貼在 電腦和網際網路 | 發表留言

check oracle cpu 使用過度

影响CPU的因素
1,高的无必要的解析会代价昂贵。
发现那些SQL运行了大量的PARSE
select sql_text, parse_calls, executions from v$sqlarea order by parse_calls desc;
SYS的总的PARSE情况
select name, value from v$sysstat where name = ’parse count%’;
只有硬解析才能减少,可以绑定变量,或增加每一个SESSION的CACHED CURSORS。
2,导致大量I/O的SQL也会明显占用CPU,如没有INDEX。BUFFER GETS一般会同CPU一块增长。可以通过v$sqlarea发现buffer_gets
3,其他等待时间,可以通过v$sesstat,v$sysstat查看

ref http://www.ciw.com.cn/News/coveragepage/2006-07-24/6909.shtml
1.使用vmstat检查系统当前情况
首先登陆数据库主机,检查当前系统状况。
使用vmstat检查,发现CPU资源已经耗尽,大量任务位于运行队列:

bash-2.03$ vmstat 3
procs     memory            page            disk          faults      cpu
r b w   swap  free  re  mf pi po fr de sr s6 s9 s1 sd   in   sy   cs us sy id
0 0 0 5504232 1464112 0  0  0  0  0  0  0  0  1  1  0 4294967196 0 0 -84 -5 -145
131 0 0 5368072 1518360 56 691 0 2 2 0  0  0  1  0  0 3011 7918 2795 97  3  0
131 0 0 5377328 1522464 81 719 0 2 2 0  0  0  1  0  0 2766 8019 2577 96  4  0
130 0 0 5382400 1524776 67 682 0 0 0 0  0  0  0  0  0 3570 8534 3316 97  3  0
134 0 0 5373616 1520512 127 1078 0 2 2 0 0 0  1  0  0 3838 9584 3623 96  4  0
136 0 0 5369392 1518496 107 924 0 5 5 0 0  0  0  0  0 2920 8573 2639 97  3  0
132 0 0 5364912 1516224 63 578 0 0 0 0  0  0  0  0  0 3358 7944 3119 97  3  0
129 0 0 5358648 1511712 189 1236 0 0 0 0 0 0  0  0  0 3366 10365 3135 95 5  0
129 0 0 5354528 1511304 120 1194 0 0 0 0 0 0  0  4  0 3235 8864 2911 96  4  0

本案例当时,系统CPU资源已经耗尽,Idle为0,并且运行队列大量进程排队等待。

2.使用Top工具辅助诊断
通过Top工具,我们可以查看进程CPU耗用情况,如果存在进程异常,可以通过Top定位,为进一步诊断提供依据。
对于本案例,观察进程CPU耗用,发现没有明显过高CPU使用的进程。

$ top

last pid: 28313;  load averages: 99.90, 117.54, 125.71            23:28:38
296 processes: 186 sleeping, 99 running, 2 zombie, 9 on cpu
CPU states:  0.0% idle, 96.5% user,  3.5% kernel,  0.0% iowait,  0.0% swap
Memory: 4096M real, 1404M free, 2185M swap in use, 5114M swap free

PID USERNAME THR PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
27082 oracle8i   1  33    0 1328M 1309M run      0:17  1.29% oracle
26719 oracle8i   1  55    0 1327M 1306M sleep    0:29  1.11% oracle
28103 oracle8i   1  35    0 1327M 1304M run      0:06  1.10% oracle
28161 oracle8i   1  25    0 1327M 1305M run      0:04  1.10% oracle
26199 oracle8i   1  45    0 1328M 1309M run      0:42  1.10% oracle
26892 oracle8i   1  33    0 1328M 1310M run      0:24  1.09% oracle
27805 oracle8i   1  45    0 1327M 1306M cpu/1    0:10  1.04% oracle
23800 oracle8i   1  23    0 1327M 1306M run      1:28  1.03% oracle
25197 oracle8i   1  34    0 1328M 1309M run      0:57  1.03% oracle
21593 oracle8i   1  33    0 1327M 1306M run      2:12  1.01% oracle

从Top的输出中我们发现有大量进程处于running的运行状态,CPU消耗很平均,单进程消耗大约在1%左右,我们基本可以排除个别进程异常导致CPU问题的可能。

3、检查进程数量
对于一个生产数据库系统,稳定运行的进程数量通常是可知的。
提示:对于稳定运行的生产系统,数据库的运行状况通常是稳定的,如果你绘制出性能曲线,你会发现每个星期的曲线几乎是可以重合的,对数据库系统的运行状况及性能指标具有充分认识和了解是必须的。

我们看一下当前系统的进程数量,从而进行比较判断:

bash-2.03$ ps -ef|grep ora|wc -l
258
bash-2.03$ ps -ef|grep ora|wc -l
275
bash-2.03$ ps -ef|grep ora|wc -l
274
bash-2.03$ ps -ef|grep ora|wc -l
278
bash-2.03$ ps -ef|grep ora|wc -l
277
bash-2.03$ ps -ef|grep ora|wc -l
366

发现此时系统存在大量Oracle进程,大约在300左右,大量进程消耗了几乎所有CPU资源,而正常情况下Oracle连接数应该在100左右。

由此,我们可以基本判断,是数据库或应用出现问题,导致进程任务无法完成,不断累积,从而出现大量队列等待。

这些等待在数据库中应该有具体的体现,接下来需要登陆数据库进行检查了。
4、登陆数据库
我们判断数据库可能经历了等待,那么Oracle数据库提供了相关视图供我们查询和发现问题,v$session_wait是首先值得我们关注的。

查询v$session_wait获取各进程等待事件:

SQL> select sid,event,p1,p1text from v$session_wait;

SID EVENT                                  P1 P1TEXT
———- —————————— ———- —————————————————————-
124 latch free                     1.6144E+10 address
1 pmon timer                            300 duration
2 rdbms ipc message                     300 timeout
。。。。。。
140 buffer busy waits                      17 file#
66 buffer busy waits                      17 file#
10 db file sequential read                17 file#
18 db file sequential read                17 file#
54 db file sequential read                17 file#
49 db file sequential read                17 file#
48 db file sequential read                17 file#
46 db file sequential read                17 file#
45 db file sequential read                17 file#
。。。。。。
234 db file sequential read                17 file#
233 db file sequential read                17 file#
230 db file sequential read                17 file#
333 db file sequential read                17 file#
330 db file scattered read                 17 file#
310 db file scattered read                 17 file#
。。。。。。。

244 rows selected.

对于本案例,我们发现存在大量db file scattered read及db file sequential read等待。显然全表扫描等操作成为系统最严重的性能影响因素。

5、捕获相关SQL

确定这些进程因为数据访问产生了等待,我们考虑捕获这些SQL以发现问题。
这里用到了我的以下脚本getsqlbysid.sql,该脚本通过已知session的sid,联合v$session、v$sqltext视图,获得相关session正在执行的完整的SQL语句。

SELECT   sql_text
FROM v$sqltext a
WHERE a.hash_value = (SELECT sql_hash_value
FROM v$session b
WHERE b.SID = ‘&sid’)
ORDER BY piece ASC
/

使用该脚本,通过从v$session_wait中获得的等待全表或索引扫描的进程SID,可以捕获可能存在问题的sql语句:
SQL> @getsqlbysid
Enter value for sid: 18
old   5: where b.sid=’&sid’
new   5: where b.sid=’18’

SQL_TEXT
—————————————————————-
select i.vc2title,i.numinfoguid  from  hs_info i where i.intenab
ledflag = 1  and i.intpublishstate = 1  and i.datpublishdate <=
sysdate  and i.numcatalogguid = 2047 order by i.datpublishdate d
esc, i.numorder desc

SQL> /
Enter value for sid: 54
old   5: where b.sid=’&sid’
new   5: where b.sid=’54’

SQL_TEXT
—————————————————————-
select i.vc2title,i.numinfoguid  from  hs_info i where i.intenab
ledflag = 1  and i.intpublishstate = 1  and i.datpublishdate <=
sysdate  and i.numcatalogguid = 33 order by i.datpublishdate des
c, i.numorder desc
。。。。。。。。
对几个进程进行跟踪,分别得到以上SQL语句,这些SQL可能就是问题产生的根源。

使用该应用用户连接,通过autotrace功能检查以上SQL的执行计划:
SQL> set autotrace trace explain
SQL> select i.vc2title,i.numinfoguid
2  from  hs_info i where i.intenabledflag = 1
3  and i.intpublishstate = 1  and i.datpublishdate <=sysdate
4  and i.numcatalogguid = 3475
5  order by i.datpublishdate desc, i.numorder desc  ;

Execution Plan
———————————————————-
0      SELECT STATEMENT Optimizer=CHOOSE (Cost=228 Card=1 Bytes=106)
1    0   SORT (ORDER BY) (Cost=228 Card=1 Bytes=106)
2    1     TABLE ACCESS (FULL) OF ‘HS_INFO’ (Cost=218 Card=1 Bytes=106)

SQL> select count(*) from hs_info;

COUNT(*)
———-
227404

通过执行计划,我们看到以上查询使用了全表扫描,而该表这里有22万记录,全表扫描已经不再适合。

我们检查全表扫描的数据表,发现存在以下索引:
SQL> select index_name,index_type  from user_indexes where table_name=’HS_INFO’;

INDEX_NAME                     INDEX_TYPE
—————————— —————————
HSIDX_INFO1                    FUNCTION-BASED NORMAL
HSIDX_INFO_SEARCHKEY        DOMAIN
PK_HS_INFO                     NORMAL

检查索引键值:

SQL> select index_name,column_name
2 from user_ind_columns  where table_name =’HS_INFO’;

INDEX_NAME                     COLUMN_NAME
—————————— ——————–
HSIDX_INFO1                    NUMORDER
HSIDX_INFO1                    SYS_NC00024$
HSIDX_INFO_SEARCHKEY        VC2INDEXWORDS
PK_HS_INFO                     NUMINFOGUID

SQL> desc hs_info
Name                              Null?    Type
——————————— ——– ——————————————–
NUMINFOGUID                       NOT NULL NUMBER(15)
NUMCATALOGGUID                    NOT NULL NUMBER(15)
INTTEXTTYPE                       NOT NULL NUMBER(38)
VC2TITLE                          NOT NULL VARCHAR2(60)
VC2AUTHOR                    VARCHAR2(100)
NUMPREVINFOGUID                            NUMBER(15)
NUMNEXTINFOGUID                            NUMBER(15)
NUMORDER                          NOT NULL NUMBER(15)
。。。。。

6、创建新的索引以消除全表扫描

检查发现在numcatalogguid字段上并没有索引,该字段具有很好的区分度,考虑在该字段创建索引以消除全表扫描。

SQL> create index hs_info_NUMCATALOGGUID on hs_info(NUMCATALOGGUID);

Index created.

SQL> set autotrace trace explain
SQL> select i.vc2title,i.numinfoguid
2  from  hs_info i where i.intenabledflag = 1
3  and i.intpublishstate = 1  and i.datpublishdate <=sysdate
4  and i.numcatalogguid = 3475
5  order by i.datpublishdate desc, i.numorder desc ;

Execution Plan
———————————————————-
0      SELECT STATEMENT Optimizer=CHOOSE (Cost=12 Card=1 Bytes=106)
1    0   SORT (ORDER BY) (Cost=12 Card=1 Bytes=106)
2    1     TABLE ACCESS (BY INDEX ROWID) OF ‘HS_INFO’ (Cost=2 Card=1 Bytes=106)
3    2       INDEX (RANGE SCAN) OF ‘HS_INFO_NUMCATALOGGUID’ (NON-UNIQUE) (Cost=1 Card=1)

7、观察系统状况
原大量等待消失

SQL> select sid,event,p1,p1text from v$session_wait where event not like ‘SQL%’;

SID EVENT                                  P1 P1TEXT
———- —————————— ———- —————————————————————-
1 pmon timer                            300 duration
2 rdbms ipc message                     300 timeout
3 rdbms ipc message                     300 timeout
6 rdbms ipc message                  180000 timeout
59 rdbms ipc message                    6000 timeout
118 rdbms ipc message                    6000 timeout
275 rdbms ipc message                   30000 timeout
147 rdbms ipc message                    6000 timeout
62 rdbms ipc message                    6000 timeout
11 rdbms ipc message                   30000 timeout
4 rdbms ipc message                     300 timeout
305 db file sequential read                17 file#
356 db file sequential read                17 file#
19 db file scattered read                 17 file#
5 smon timer                            300 sleep time

15 rows selected.

在另外的session里,持续观察的CPU使用情况:

bash-2.03$ vmstat 3
procs     memory            page            disk          faults      cpu
r b w   swap  free  re  mf pi po fr de sr s6 s9 s1 sd   in   sy   cs us sy id
34 0 0 5343016 1465416 44 386 77 0 0 0  0  0  0  0  0 3197 8486 2902 92  8  0
31 0 0 5331568 1459696 178 1491 122 0 0 0 0 0 0  3  0 3237 9461 3005 89 11  0
31 0 0 5317792 1453008 76 719 80 0 0 0  0  0  0  0  0 3292 8736 3025 93  7  0
31 2 0 5311144 1449552 235 1263 69 2 2 0 0 0  1  0  0 3473 9535 3357 88 12  0
25 0 0 5300240 1443920 108 757 18 2 2 0 0  0  1  1  0 2377 7876 2274 95  5  0
19 0 0 5295904 1441840 50 377 0 0 0  0  0  0  0  1  0 1915 6598 1599 98  1  0
—-以上为创建索引之前部分
—-以下为创建索引之后部分,CPU使用率恢复正常
procs     memory            page            disk          faults      cpu
r b w   swap  free  re  mf pi po fr de sr s6 s9 s1 sd   in   sy   cs us sy id
0 0 0 4955872 1287136 737 6258 16 0 0 0 0  0  0  3  0 2890 11777 4432 44 12 44
1 0 0 4887888 1256464 809 6234 8 2 2 0  0  0  0  2  0 2809 12066 4247 45 12 43
0 0 0 4828912 1228200 312 2364 13 5 5 0 0  0  2  1  0 2410 6816 3492 38  6 57
0 0 0 4856816 1240168 8 138 0  0  0  0  0  0  1  0  0 2314 4026 3232 34  4 62
0 0 0 4874176 1247712 0 86  0  0  0  0  0  0  0  0  0 2298 3930 3324 35  2 63
2 0 0 4926088 1270824 34 560 0 0  0  0  0  0  0  0  0 2192 4694 2612 29 16 55
0 0 0 5427320 1512952 53 694 0 0  0  0  0  0  3  2  0 2443 5085 3340 33 12 55
0 0 0 5509120 1553136 0 37  0  0  0  0  0  0  0  0  0 2309 3908 3321 35  1 64

至此,此问题得以解决。

8、性能何以提高
回答这个问题似乎是多余的,我只想重申一点:

有效的降低SQL的逻辑读是SQL优化的基本原则之一。

我们来比较一下前后两种执行方式的逻辑读取及性能差异。

a. 全表扫描的性能
SQL> select i.vc2title,i.numinfoguid
2  from  hs_info i where i.intenabledflag = 1
3  and i.intpublishstate = 1  and i.datpublishdate <=sysdate
4  and i.numcatalogguid = 3475
5  order by i.datpublishdate desc, i.numorder desc  ;

352 rows selected.

Execution Plan
———————————————————-
0      SELECT STATEMENT Optimizer=CHOOSE (Cost=541 Card=1 Bytes=106)
1    0   SORT (ORDER BY) (Cost=541 Card=1 Bytes=106)
2    1     TABLE ACCESS (FULL) OF ‘HS_INFO’ (Cost=531 Card=1 Bytes=106)

Statistics
———————————————————-
0  recursive calls
25  db block gets
3499  consistent gets
258  physical reads
0  redo size
…..
2  sorts (memory)
0  sorts (disk)
352  rows processed

b. 使用索引的性能
SQL> select i.vc2title,i.numinfoguid
2  from  hs_info i where i.intenabledflag = 1
3  and i.intpublishstate = 1  and i.datpublishdate <=sysdate
4  and i.numcatalogguid = 3475
5  order by i.datpublishdate desc, i.numorder desc;

352 rows selected.

Execution Plan
———————————————————-
0      SELECT STATEMENT Optimizer=CHOOSE (Cost=12 Card=1 Bytes=106)
1    0   SORT (ORDER BY) (Cost=12 Card=1 Bytes=106)
2    1     TABLE ACCESS (BY INDEX ROWID) OF ‘HS_INFO’ (Cost=2 Card=1 Bytes=106)
3    2       INDEX (RANGE SCAN) OF ‘HS_INFO_NUMCATALOGGUID’ (NON-UNIQUE) (Cost=1 Card=1)

Statistics
———————————————————-
0  recursive calls
0  db block gets
89  consistent gets
0  physical reads
0  redo size
….
1  sorts (memory)
0  sorts (disk)
352  rows processed

consistent gets从3499 到89,我们看到性能得到了巨大的提高.

结语

通常,开发人员很少注意SQL代码的效率,他们更着眼于功能的实现。
至于性能问题通常被认为是次要的,而且在应用系统开发初期,由于数据库数据量较少,对于查询SQL语句等,不容易体会出各种SQL句法的性能差异。

但是一旦这些应用作为生产系统上线运行,随着数据库中数据量的增加,大量并发访问,系统的响应速度可能就会成为系统需要解决的最主要的问题之一。

在少量用户下性能可以接受的SQL,可能在大量用户并发的条件下就会成为性能瓶颈。

在我这个案例中,开发人员很难相信仅只一条SQL语句就导致了整个数据库的性能下降。然而事实就是如此,一条低效的SQL语句就可能毁掉你的数据库,所以在系统设计及开发过程中,你必须考虑到诸多细节,严格的测试也是提早发现问题的有效方法。
如果不幸以上环节都被忽略,那么,DBA(也许就是你)就是最后的一环,你必须能够快速的诊断并解决各种复杂问题。

張貼在 oracle | 標記 | 發表留言

綠峰度假山莊 泡湯


水質感覺  蠻好的  設備乾淨  普普  感覺品質中等  超值

消費滿三百送一張大眾池泡湯卷(200元)  分室內男女裸湯藥草池  跟室外泡湯  (記得是google地圖中的餐飲才有喔去旅館區可能要400元才送)
2張卷+100可換成湯屋
以前是休閒農場改裝  所以可以看到魚池  涼亭  兒童遊樂器材  不過都已荒廢
餐飲有分上下  上面是旅館泡湯兼餐飲  我家都去下面那間吃合菜 自己點菜吃  有時我們人比較多  老闆都會多送個幾張  很阿莎力  且炒的菜也不難吃
人數少的話可考慮他們的咖啡簡餐
http://greenpeak.yah.tw/

要更便宜的還有50元及免錢的  可是覺得這個有些品質又不貴因此推薦之

張貼在 電腦和網際網路 | 發表留言

linux PXE 網卡 install and etcs

ref http://benjr.tw/?q=node/507

Red Hat Linux 下建立 PXE Server
Step 1 : 前言
Step 2 : 環境需求
Step 3 : tftp server 的設定
Step 4 : 安裝媒體(FTP,NFS,HTTP)
Step 5 : PXE 設定檔
Step 6 : DHCP Server
Step 7 : The PXE clients
Step 8 : 其他 Linux Distribution

Step 1 : 前言

在安裝作業系統時最常見的方式就是透過 CD/DVD 為安裝媒體來安裝作業系統,而這邊所說的 PXE (Preboot eXecution Environment) 則是透過網路的方式進行安裝作業系統.一開始可能會覺得怎麼有可能透過這樣的方式來進行安裝作業系統,他是怎麼做到的.先說說 PXE 的歷史,他是由 Intel 所提出,最主要的目的就是希望網卡能像是 其他裝置如:硬碟,光碟,磁碟機一樣可以擔任開機的動作.所以一開始我們主機的 BIOS 必須要支援從網卡開機.
在網卡上有一塊 ROM(firmware) 裡面存放了一些基本的網路協定如:Internet Protocol (IP), User Datagram Protocol (UDP), Dynamic Host Configuration Protocol (DHCP) 以及 Trivial File Transfer Protocol (TFTP) 透過這一些協定使得 PXE 可以進行網路的存取進一步取得網路上的資源.
圖片出自於 :http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf而 PXE 是指在作業系統前的一個作業環境,所以他最主要的工作就是將任何的作業系統載入的動作.目前多是數的網卡都支援 PXE 功能,有些甚至還支援到 iSCSI Boot 的功能.目前 PXE 已經是一個成熟的標準協定,詳細的技術可以參考 Intel 網站的 PXE 規格書. http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf

Step 2 : 環境需求

PXE 最主要透過兩個 Protocol 來進行網路資源的存取,DHCP 和 TFTP, 透過 DHCP 讓 PXE 得知網路啟動的服務位於何處,而 TFTP 則是讓 PXE 可以下載適當的啟動程式 (bootstrap program) 以及其他服務.所以這邊我們一樣需要這兩項服務.

1.一台具有 DHCP 與 tftp server (eg: IP 192.10.0.1)
2.一台具有 PXE(Preboot eXecution Environment) 網路開機功能的機台.

作業系統我選擇的是 Red Hat Enterprise Linux 3 版本,基本上具有 DHCP 和 tftp 服務的 Linux 皆可以擔任此項工作.

Step 3 : tftp server 的設定
1. 編輯 “/etc/xinetd.d/tftp” 並將 server 開啟

[root@benjr ~]# vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
CPUS = 100 2
flags = IPv4
}

將 disable 設定成為 no 即可.或者你可以用下面的指令將 tftp 功能開啟

[root@benjr ~]# chkconfig tftp on

2.啟動 tftp servicee

[root@benjr ~]# service xinetd restart


Step 4 : 安裝媒體(FTP,NFS,HTTP)
RedHat Linux 透過 PXE 來安裝作業系統時可以透過 3 種網路媒體 FTP, NFS , HTTP 來做安裝的來源.這邊簡單較紹一下怎麼針對這 3 種安裝媒體來做設定.

複製 RedHat 光碟所有的內容 (這邊我是用 RedHat Enterprise Linux Advanced server 3.0 Update 2 為範例)
[root@benjr ~]# mkdir /var/ftp/as3u2
[root@benjr ~]# cp -rf /mnt/cdrom/* /var/ftp/as3u2/ ( 1CD )
[root@benjr ~]# cp -rf /mnt/cdrom/* /var/ftp/as3u2/ ( 2CD )
[root@benjr ~]# cp -rf /mnt/cdrom/* /var/ftp/as3u2/ ( 3CD )
[root@benjr ~]# cp -rf /mnt/cdrom/* /var/ftp/as3u2/ ( 4CD )

PS: When the system asks for “replace file? " please answers “No"

  • 由 FTP 來安裝
  • 請確定 ftp 的服務已經開啟,ftp 預設路徑為 /var/ftp ,所以沒有其他設定.

    [root@benjr ~]# chkconfig vsftpd on
    [root@benjr ~]# service vsftpd restart
  • 由 NFS 來安裝
  • 編輯 “/etc/exports" 並將 “/var/ftp/as3u2″ 目錄分享(因為我們將把光碟內的檔案放在此目錄下,此為FTP預設的分享目錄)

    [root@benjr ~]# vi /etc/exports
    /var/ftp/ 192.10.0.*(ro,all_squash)

    並確定 NFS 的服務已經開啟

    [root@benjr ~]# chkconfig nfs on
    [root@benjr ~]# service nfs start
  • 由 HTTP 來安裝
  • 編輯 “/etc/httpd/conf/httpd.conf" 並將 Document 設為 /var/ftp(因為我們將把光碟內的檔案放在此目錄下,此為FTP預設的分享目錄)

    [root@benjr ~]# vi /etc/httpd/conf/httpd.conf
    Document Root “/var/ftp"

    並確定 HTTP 的服務已經開啟

    [root@benjr ~]# chkconfig httpd on
    [root@benjr ~]# service httpd restart


Step 5 : PXE 設定檔
1.將開機所需的 kernel 和 initrd 檔案複製到 “/tftpboot/linux-install/as3u2 目錄下

[root@benjr ~]# mkdir /tftpboot/linux-install/as3u2
[root@benjr ~]# cp /var/ftp/as3u2/image/pxeboot/vmlinuz /tftpboot/linux-install/as3u2
[root@benjr ~]# cp /var/ftp/as3u2/image/pxeboot/initrd.img /tftpboot/linux-install/as3u2

2.編輯 /tftpboot/linux-install/pxelinux.cfg/default (這個檔案定義了與PXE的Clients可以經由按鍵來選擇安裝的系統)

[root@benjr ~]# vi /tftpboot/linux-install/pxelinux.cfg/default
default 0
timeout 2000
F1 msgs/boot.msg
F2 msgs/expert.msg
prompt 1
display msgs/boot.msg
label 0
localboot 1
label 1
kernel as3u2/vmlinuz
append initrd=as3u2/initrd.img ramdisk_size=65536

設定檔說明:
default 0
如果使用者不選擇安裝哪一種OS這邊就可以設定預設安裝哪一個OS,default 0的意是就是使用label 0的設定.
timeout 2000
預設安裝生效時間為2000ms(200秒).
F1 msgs/boot.msg
F2 msgs/expert.msg
這邊是用來定義F1至F12功能鍵所要顯示的內容.
prompt 1
效果不明????
display msgs/boot.msg
一開機進入PXE所顯示的第一個提示訊息.
label 0
localboot 1
這裡定義了使用機器系統上的硬碟來直接開機.
label 1
kernel as3u2/vmlinuz
append initrd=as3u2/initrd.img ramdisk_size=65536
這就是要安裝OS的定義.

3.編輯 /tftpboot/linux-install/msgs/boot.msg (這個檔案就是Clients經由PXE開機時所看到的提示訊息)

[root@benjr ~]# vi /tftpboot/linux-install/msgs/boot.msg
1. Install RHAS3-QU2

4.編輯 /etc/rc.d/rc.local 必須加入下面這一行

[root@benjr ~]# vi /etc/rc.d/rc.local
route add -host 255.255.255.255 eth0

Step 6 : DHCP Server
編輯 /etc/dhcpd.conf

[root@benjr ~]# vi /etc/dhcpd.conf
# ddns-update-style interim;
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;
class “pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = “PXEClient";
next-server 192.10.0.1;
filename “linux-install/pxelinux.0″;
}
subnet 192.10.0.0 netmask 255.255.255.0 {
range 192.10.0.150 192.10.0.180;
option broadcast-address 192.10.0.255;
option routers 192.10.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.10.0.1;
}

這個項目 option domain-name-servers 192.10.0.1 為非必要選項,如果你有設定就不用再指定 DNS 位址.但是相對應的 DNS(Bind Server)也要設定.
match if substring(option vendor-class-identifier, 0, 9) = “PXEClient"; 這一個選項會檢查是否為實體的網路卡,如果你是準備給 virtual machine 時可以移除這一個選項, DHCP 設定檔案範例如下.

[root@benjr ~]# vi /etc/dhcpd.conf
# ddns-update-style interim;
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;subnet 192.10.0.0 netmask 255.255.255.0 {
range 192.10.0.150 192.10.0.180;
option broadcast-address 192.10.0.255;
option routers 192.10.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.10.0.1;
next-server 192.10.0.1;
filename “linux-install/pxelinux.0″;
}

並確定 DHCP 的服務已經開啟

[root@benjr ~]# chkconfig dhcpd on
[root@benjr ~]# service dhcpd start

其中的 next-server 就是你的tftp server所在的位置.我這邊的例子使用192.10.0.1至於其他有關於DHCP的設定說明起自行參考DHCP的官方網站http://www.isc.org.

在整個 DHCP 設定檔中,最重要的就是 filename “linux-install/pxelinux.0″ 整個網路開機顯示畫面,流程控制都由 pxelinux.0 來管理,關於更多有關於 pxelinux.0 ,請參考 PXELinux 的官方網頁 http://syslinux.zytor.com/wiki/index.php/PXELINUX

Step 7 : The PXE clients
1. 將具有 PXE 功能網路卡的 client 開機.

2.請先確定 PXE 功能已經在 BIOS 下開啟,並設為第一開機順位,並從 PXE 開機

3. 選擇你想要安裝的作業系統,如果你有參數可以在這邊加入.

Begin Downloading linux kernel image and initrd image ……..

此時就開始安裝作業係統

4. 你可以選擇 FTP , NFS 或 HTTP 等方式來安裝

5. 至於 server IP 就是 192.10.0.1,我將光碟內容都放在 192.10.0.1:/var/ftp/ 目錄下
至於目錄根據不同的方式有所不同
使用 FTP 方式的目錄:/as3u2
使用 NFS 方式的目錄:/var/ftp/as3u2 (只有透過NFS才會有圖形界面的安裝)
使用 HTTP 方式的目錄 : /as3u2

6. 接下來的安裝過程就和一般光碟安裝一樣.

Step 8 : 其他 Linux Distribution

  1. SuSE powered by UnitedLinux
  2. 步驟同 RedHat Linux 但 kernel 和 initrd.img 的位址在 SuSE 的第一片 CDROM /boot/loader/ 目錄中
    /boot/loader/linux 是 kernel
    /boot/loader/initrd 是 initrd.img
    SuSE 有一點要注意的是要加 vga 的參數

    [root@benjr ~]# vi /tftpboot/linux-install/pxelinux.cfg/default
    default 0
    timeout 2000
    F1 msgs/boot.msg
    F2 msgs/expert.msg
    prompt 1
    display msgs/boot.msg
    label 0
    localboot 1
    label 1
    kernel as3u2/vmlinuz
    append initrd=as3u2/initrd.img ramdisk_size=65536
    label 2
    kernel sles9/linux
    append initrd=sles9/initrd ramdisk_size=65536 vga=0x317 splash=silent showpts

    這樣安裝時才有 GUI 的模式,下面是常用的 VGA 顯示模式
    1024x768x8bpp -> vga=773 1024x768x16bpp -> vga=791
    1280x1024x8bpp -> vga=775 1280x1024x16bpp -> vga=794

    note:如果你使用的是 SuSE Linux Enterprise Server 9 CDs 時還要修改一個檔 “var/ftp/sles9/media.1/media" 才能使用網路安裝.

    [root@benjr ~]# vi /var/ftp/sles9/media.1/media
    SuSE Linux AG
    20040702201519
    1
    MEDIA1 SUSE LINUX ENTERPRISE Server 9 CD1
  3. Turbo Linux
  4. 步驟同 RedHat Linux 但 kernel 和 initrd.img 的位址在 /images/network.img 檔案中,因為 network.img 是 image 檔所以必須用 mount -o loop 才能看到 kernel 和 initrd.img 檔案

    [root@benjr ~]# mount -o loop /images/network.img /mnt

    在 /mnt 目錄下可以看到 vmlinuz(Linux kernel) 和 initrd.img(initrd image).Turbo 有一點要注意的是要加 ramdisk_size 的參數.因為你在安裝時如果採用 FTP, turbo linux 會因為 ramdisk size 大小問題而無法載入.
    Turbo 7 Linux 的 ramdisk_size 要定設為 16384
    Turbo 8 Linux 的 ramdisk_size 要定設為 21000

    [root@benjr ~]# vi /tftpboot/linux-install/pxelinux.cfg/default
    default 0
    timeout 2000
    F1 msgs/boot.msg
    F2 msgs/expert.msg
    prompt 1
    display msgs/boot.msg
    label 0
    localboot 1
    label 1
    kernel as3u2/vmlinuz
    append initrd=as3u2/initrd.img ramdisk_size=65536
    label 2
    kernel sles9/linux
    append initrd=sles9/initrd ramdisk_size=65536 vga=0x317 splash=silent showpts
    label 3
    kernel turbo7/vmlinuz
    append initrd=turbo7/initrd.img ramdisk_size=16384
    label 4
    kernel turbo8/vmlinuz
    append initrd=turbo8/initrd.img ramdisk_size=21000

    加入下面的訊息來讓使用者(PXE的Clients)知道有什麼作業系統可以安裝

    [root@benjr ~]# vi /tftpboot/linux-install/msgs/boot.msg
    1. Install RHAS3-QU2
    2. Install SLES 9
    3. Install Turbo 7
    4. Install Turbo 8
  5. ubuntu
  6. 步驟同 RedHat Linux 但 kernel 和 initrd.img 的位址在 ubuntu CDROM 目錄 /install/netboot/ubuntu-installer/i386 中
    linux 是 kernel
    initrd.gz 是 initrd.img

    1. enter information manually:
    2. 即可指定你的 http 服務器.

    3. ubuntu archive mirror hostname:
    4. 這邊可以指定你的 http 服務器的 IP 或是 hostname

    5. ubuntu archive mirror directory:
    6. 這邊可以指定你的 http 服務器的 Root directory + unbuntu 光碟內容

  1. [root@benjr ~]# vi /tftpboot/linux-install/pxelinux.cfg/default
    default 0
    timeout 2000
    F1 msgs/boot.msg
    F2 msgs/expert.msg
    prompt 1
    display msgs/boot.msg
    label 0
    localboot 1
    label 1
    kernel as3u2/vmlinuz
    append initrd=as3u2/initrd.img ramdisk_size=65536
    label 2
    kernel sles9/linux
    append initrd=sles9/initrd ramdisk_size=65536 vga=0x317 splash=silent showpts
    label 3
    kernel turbo7/vmlinuz
    append initrd=turbo7/initrd.img ramdisk_size=16384
    label 4
    kernel turbo8/vmlinuz
    append initrd=turbo8/initrd.img ramdisk_size=21000
    label 5
    kernel ubuntu10/linux
    append vga=normal initrd=/ubuntu10/initrd.gz ramdisk_size=16432 —

    加入下面的訊息來讓使用者 (PXE的Clients) 知道有什麼作業系統可以安裝

    [root@benjr ~]# vi /tftpboot/linux-install/msgs/boot.msg
    1. Install RHAS3-QU2
    2. Install SLES 9
    3. Install Turbo 7
    4. Install Turbo 8
    5. Install ubuntu 10

    使用 PXE 安裝時 ubuntu 系統預設使用的是 http 的傳輸方式,如果你有連上 Internet 時直接使用他指定的 http 服務器即可,不過我們還是透過內部網路會快一些,此時選擇

張貼在 電腦和網際網路 | 發表留言

OPEN FCoE initator target 看起來不錯用喔

ref http://benjr.tw/?q=node/474

 

Cisco Nexus 5000 系列的 10Gb switch.

  • High-performance 10 Gigabit Ethernet
  • 當然了他是一台 10G 的 switch ,但是有什麼特異功能之處呢!!

  • Data Center Ethernet (I/O Consolidation)
  • 他同時是網路 switch 同時也是一台 Fiber SAN 的 switch.

  • Fibre Channel over Ethernet(FCoE)
  • Fiber Channel 的資料可以透過 Ethernet 的封包來傳送.

  • Virtual-machine-optimized networking
  • 主要功能是可以讓多台 VMware 的 virtual switch 可以透過虛擬的網路裝置整合為單一的虛擬交換器(Virtual Switch).

High-performance 10 Gigabit Ethernet
目前 Cisco Nexus 5000 系列主要有兩個產品 1-RU Nexus 5010 和 2-RU Nexus 5020 ,Nexus 5020 幾乎是 Nexus 5010 的一倍大小.可以使用的埠也是2倍之多,Nexus 5020 預設的埠高達 40 個, Expansion Module 有 2 個,其支援的 Expansion Module 有三種.

  • An Ethernet module that provides 6 ports of 10 Gigabit Ethernet.
  • A Fibre Channel plus Ethernet module that provides 4 ports of 10 Gigabit Ethernet, and 4 ports of 1/2/4 Gbps native Fibre Channel.
  • A Fibre Channel module that provides 8 ports of 1/2/4 Gbps native Fibre Channel.

後面 2 種有支援 Native Fiber Channel 最主要就是為了支援 1/2/4 Gbps native Fibre Channel 的 SAN 裝置.傳統的 SAN Fibre 的裝置都可以直接接在這 Expansion Module.

Data Center Ethernet (I/O Consolidation) 但是一開始就遇到難題了!就是如何將舊有的 Fiber Channel Storage(SAN) 整合到這一台.在官方說明文件的確有提到 “Cisco Nexus 5000 " 系列支援  FCoE 和 Fibre Channel Switching 的功能.

FCoE and Fibre Channel Switching
Cisco Nexus 5000 Series switches support data center I/O consolidation (IOC) by providing FCoE
interfaces (to the servers) and native Fibre Channel interfaces (to the SAN).

上面提到 “Cisco Nexus 5000″ 系列的確是支援  FCoE 和 Fibre Channel Switching 不過請看接下來的這一句話!!

Physical Fibre Channel Interfaces
Cisco Nexus 5000 Series switches provide up to eight physical Fibre Channel uplinks. The Fibre
Channel interfaces are supported on optional expansion modules. The Fibre Channel plus Ethernet
expansion module contains four Fibre Channel interfaces.

我們買的是標準配備並不包含 “physical Fibre Channel",如需此項功能請再買 “expansion modules".是哪一個 expansion modules 呢!!請看下面的說明.

The Nexus 5020 switch has two slots for optional expansion modules. The following expansion modules
are available:
• N5K-M1404 provides four 10-Gigabit Ethernet ports, and four 1/2/4 Gb Fibre Channel ports.
• N5K-M1600 provides six 10-Gigabit Ethernet ports.

也就是需要再購買 " N5K-M1404″ ,就可以在 Cisco Nexus 5020″ 上使用 Fibre Channel Switching 功能.至於 Fibre Channel over Ethernet (FCoE).

Fibre Channel over Ethernet
Fibre Channel over Ethernet (FCoE) provides a method of encapsulating Fibre Channel traffic over a
physical Ethernet link. Cisco Nexus 5000 Series switches use FCoE to carry Fibre Channel and Ethernet traffic on the same
physical Ethernet connection between the switch and the server.

“Cisco Nexus 5000″ 系列上所有的 10Gb Ethernet Ports 經過設定皆可當成 FCoE,系統預設為 “auto".

結論:: 要將其他 SAN Storage 運行在這一台  “Cisco Nexus 5020″ 目前是辦不到的.除非再添購 N5K-M1404 expansion modules.

傳統的企業環境是 SAN + Network 不管是 SAN 還是 Network 裝置都需要格外添購這兩者無法共用,所有的裝置都需要兩套不管是 Server 上(Fiber Channel HBA + NIC)連 Switch 也必須 2 套,怎麼都無法整合在一起,如下圖所示

但是 Cisco Nexus 提供了一項技術 DCE(Data Center Ethernet,除了 Cisco 把這項技術命名為 DCE 其他廠商把類似的技術稱為 CEE(Convergence Enhanced Ethernet),所以當提到 DCE / CEE 都是相同的東西),也就是說不管是 SAN 的裝置還是網路的裝置只要透過 FCoE 這項技術就可以通通整合在一起,聽起來有點怪怪的他是怎麼做到的.
1.首先我們先來看看原先的 SAN 設備端裝置,它可以透過 Cisco Nexus 5000 系列的 Expansion Module 上的 Native Fiber Channel 連接在一台 Nexus 5000 上面.
2.再來看看傳統的 FC HBA(如:Qlogic , Emulex) 也可以透過 Cisco Nexus 5000 系列的 Expansion Module 上的 Native Fiber Channel 連接在一台 Nexus 5000 上面.就可以直接和 SAN 的裝置溝通了.但是這跟一般的 F.C Switch 有什麼不同呢!!
3.接下來我們看一般 Server 上的 10G NIC 要和 NIC 的裝置溝通是沒有什麼問題的,但是他怎麼有辦法和 SAN 設備端裝置溝通呢!!他是透過 FCoE 這一個協定去和 SAN 的裝置溝通,但是一般的網卡怎麼有辦法懂得 FC 的協定這有兩種解決方式 1.是硬體的 CNA(Converged Network Adapter) 2.軟體的 Linux 下的 open-FCoE ,就可以讓系統產生 FC Frame 然後讓 NIC 將這 Frame 封裝在傳統的 Enternet Frame 內,再透過 Cisco Nexus 5000 去傳送.

Fibre Channel over Ethernet(FCoE)

FCoE 照字面的意思就是將傳統的 Fiber Channel 指令封裝在 Enternet 的訊框(frames).

不同於 iSCSI 之處是 iSCSI 透過 TCP / IP 去傳送,FCoE 則是直接透過 Enternet 的訊框(frames)去傳送,所以資料是無法 Routing 的.

當然還要 switch 的支援才能使用.主要是 fiber channel 為了拉攏傳統以 IP 的網路環境 (我想是 iSCSI 拉走了不少 Fiber Channel 的客戶,像是 Dell EqualLogic 就只出純 iSCSI 的設備 ).主要 FCoE 是將 Fiber Channel 封裝在 Enternet 的 frame 上,但和 iSCSI 不同的是他不再使用 TCP / IP  的封裝.所以他不能在透過 IP routed 到達遠端網路.
傳統的 FC Switch 是應用在高端的 SAN 儲存系統上,當然費用貴很多不只要添購 Fiber Storage(SAN),而且要連接的 Server 時還需要透過 FC HBA 去連接,如果多台同時連接到 SAN 時還需要一台 SAN Switch.這樣添購下來成本只有大企業能負擔的起.
但是 Fiber Channel 的優點就是快 1G/2G/4G ,跟傳統 10/100/1Gbit Ethernet 相比,但是目前 eherent 網路頻寬已經到達 10Gbits,所以一般的網路也可以擔任起高速傳輸環境.而 FCoE 也就針對 10Gbit 的環境將傳統的 switch 去整合 Fiber  SAN 環境整合在一起,使用者不要再添購多台 Switch(Ethernet,Fiber) 就能將兩種環境結合在同一台 Siwtch 上面.
那一般連接端就像是 iSCSI ,FCoE 解決方案有硬體有軟體下面的網站是軟體方式,主要在推行的 Intel,因為到目前為止 Intel 還是主要以製造 Ethernet 網卡為主.

FCoE SW Target
http://www.open-fcoe.org/openfc/wiki/index.php/FCoE_SW_Target_Quickstart

FCoE Initiator
http://www.open-fcoe.org/openfc/wiki/index.php/FCoE_Initiator_Quickstart

而硬體的方式以 CNA – converged network adapter 為主.你可以簡單把它想像成 Enthernet + Fiber Channel 同時做在同一張卡上.

所以整合SAN + Network 環境就簡單多了.

Virtual-machine-optimized networking
這跟 VMware 比較有關似乎 VMware 上的 Virtual Switch 可以和 Cisco Nexus 可以有一個程度上的整合.

張貼在 電腦和網際網路 | 發表留言

vmware ESX 4 install on ESX

ref http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/ VMware ESX 4 can even virtualize itself
http://www.vcritical.com/2009/05/vmotion-from-physical-esx-4-to-virtual-esx-4/ VMotion from physical ESX 4 to virtual ESX 4
http://communities.vmware.com/docs/DOC-8970/

GA build of ESX 4 allows installing ESX 4 as a virtual machine as well as powering on nested virtual machines — VMs running on the virtual ESX host. You can even VMotion a running virtual machine from the physical ESX to a virtual ESX — on the same physical server!

VMware vSphere 4.1 UPDATE: VMware ESXi 4.1 has a keyboard issue when virtualized on an ESX 4.0 host. In order to virtualize ESXi 4.1, the underlying host must be 4.1. However, ESX 4.1 classic will work on ESX 4.0.

After installing ESX 4 onto your real hardware, configure as desired and enable promiscuous mode on a vSwitch:

vswitch0 promisc

Create a new VM with the following guidance (choose “Custom”):

* Virtual Machine Version 7
* Guest OS: Linux / Red Hat Enterprise Linux 5 (64-bit)
* 2 VCPUs, 2GB RAM
* 2 NICs – e1000
* LSI Logic Parallel
* New disk – reasonable size greater than 10GB for ESX classic

After you have the VM ready, simply attach a VMware ESX 4 ISO image, power on, and install ESX as a guest OS.

Virtual ESX 4

After installation, add the new virtual ESX to vCenter 4 and create a new VM.

vSphere Client with virtual ESX

If you do not need to run VMs on your virtual ESX, you can stop there. However, if you try to power on that nested VM, you will see the following error:

You maynot power on a virtual machine inside a VM.

To prevent this, just one tweak is needed:

* Shut down the virtual ESX VM
* Click Edit Settings
* Click the Options tab
* Click Advanced / General / Configuration Parameters…
* Click Add Row
* For the Name/Value enter: monitor_control.restrict_backdoor / TRUE

Editing VM configuration.

The above procedure is just an alternative to hand-editing the .vmx file — if you prefer to do it that way, feel free.

Now you are ready to power your virtual ESX VM back on, as well as the nested VMs. This capability should come in handy as you start investigating the new features of vSphere 4.

ESXi4.1 nested ESXi 4.1 nested 32bit guest os OK

張貼在 電腦和網際網路 | 發表留言

Facebook與WordPress融為一體的應用與外掛

ref http://www.hksilicon.com/kb/articles/1663/8FacebookWordPress

1.wordbooker (wordpress.com不適用)

wordpress 中的plugin 須為自架的wordpress blog server 才可用

http://wordpress.org/extend/plugins/wordbooker/

http://www.facebook.com/?sk=apps&ap=1#!/Wordbooker

2.另外wordpress中管理文章–>設定–>sharing setings

可加入facebook icon如此可輕易引用wordpress到任何人的facebook

3.youtube video box

http://apps.facebook.com/youtubebox/

facebook中一個程式可將喜歡的影片 add 到my profile

張貼在 電腦和網際網路 | 發表留言