2016年8月29日 星期一

【Oracle 筆記 】Database character set (UTF8) and Client character set ZHT16MWIN950) are different

由於 DB Server 的參數

NLS_CHARACTERSET = TRANDITIONAL TAIWAN_TAIWAN.AL16UTF8

NLS_NCHAR_CHARACTERSET = TRANDITIONAL_TAIWAN_TAIWAN.AL16UTF16

在 Client 端開啟 regedit ,尋找 ZHT16MSWIN950 關鍵字,將 NLS_LANG 的值 TRANDITIONAL CHINESE_TAINWAN.ZHT16MSWIN950 改為TRANDITIONAL CHINESE_TAINWAN.UTF8 即可

2016年8月12日 星期五

【Oracle 筆記 】Run the Patch Application Assistant by entering "admsi.pl"

Steps:

1. 上傳 patch file xxx.zip (以 root 登入)
2. 解開 xxx.zip 檔,會產生 xxx 目錄
3. 更改目錄權限: chmod 777 xxx
4. cd 到 xxx 目錄下,執行 admsi.pl 命令

Example:

[prodmgr@srv 21261629]$ perl /u01/apps/PROD/apps/apps_st/appl/ad/12.0.0/bin/admsi.pl -patch_top=/u01/patch/21261629 -appspass=elvismeng -log=elvis_admsi.log

2016年8月11日 星期四

【Oracle 筆記 】也談 Oracle 上 Patch 的工具 admsi.pl

一般 Oracle Metalink 提供的 Patch 包會內含 Readme 檔案,指示該如何正確上此 patch,而 Oracle 也提供另一個工具 admsi.pl ,解析操作環境,而產生一個 install instruction 的檔案做為上 Patch 的參考。藉由以下 try and error 的方式,進行對此工具初步的了解。

執行下列指令:


[test@dev patch]$  perl /u01/apps/TEST/apps/apps_st/appl/ad/12.0.0/bin/admsi.pl  -patch_top=/u01/patch/10148526 -appspass=apps

Gathering Information..
Error:

ERROR: can't open log file: admsi.log: Permission denied


See admsi.log for more details.

這錯誤原因是 admsi.log 的 default 目錄是在 patch number 目錄下產生,所以我們需在Patch 的目錄下,執行 admsi.pl 指令。


[test@dev patch]$ cd /u01/patch/10148526
[test@dev 10148526]$  perl /u01/apps/TEST/apps/apps_st/appl/ad/12.0.0/bin/admsi.pl  -patch_top=/u01/patch/10148526 -appspass=apps

此外,在 /u01/apps/TEST/apps/apps_st/appl/ad/12.0.0/bin 目錄下的 admsi_main.pl 也有說明:


     : Name of the log file (optional),
                    By default, the file admsi.log in
                    the current directory is created and used.
                    (optional)

執行 admsi.pl 後,檢視此檔案 admsi.log,發現還有另外的錯誤:


[test@dev 10148526]$ vi admsi.log
Log for admsi_main.pl, started at 2014-10-30 09:32:22
************************************************
Establishing connection to the database with the following parameters:
SID      : TEST
User     : APPS

Error:

Unable to connect to TEST database.

 ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin)

最後將 apps 的密碼更正後, 執行結果如下:


[mgr@dev 10148526]$ perl /u01/apps/TEST/apps/apps_st/appl/ad/12.0.0/bin/admsi.pl  -patch_top=/u01/patch/10148526 -appspass=elvismeng

Gathering Information..
Logfile for this session is located at admsi.log
Generating installation instructions for patch 10148526..
Updating database....
install_10148526.html generated successfully
install_10148526.txt generated successfully

再次檢查 admsi.log 檔案內容:


[test@dev 10148526]$ vi admsi.log
Log for admsi_main.pl, started at 2014-10-30 09:48:00
************************************************
Establishing connection to the database with the following parameters:
SID      : TEST
User     : APPS

Parsing metadata file /u01/patch/10148526/patch_metadata.xml..
Loading data from Manual Step Files..


/u01/patch/10148526/ad/patch/115/manualsteps/ad_apply_patch.xml:
Parsing..
Validating..
Checking whether this step is applicable to this instance..
Yes, This step is applicable for this instance.

Executing begin  :value := ad_manual_step_object.is_step_already_done

('ad_apply_patch','120.4'); end;
Generating installation instructions for patch 10148526..
Updating database....
install_10148526.html generated successfully
install_10148526.txt generated successfully
Performing final cleanup..

若要指定 admsi.pl 的 log 檔案,則須註明 -log 如下:


[test@dev 10148526]$ perl /u01/apps/TEST/apps/apps_st/appl/ad/12.0.0/bin/admsi.pl  -patch_top=/u01/patch/10148526 -appspass=apps4 -log=elvis_admsi.log

Gathering Information..
Logfile for this session is located at elvis_admsi.log
Generating installation instructions for patch 10148526..
Updating database....
install_10148526.html generated successfully
install_10148526.txt generated successfully

最後別忘了,在執行 admsi.pl 指令後,在 patch number 的目錄下產生了兩個 install instruction 指示檔案: install_10148526.html 與 install_10148526。

附註:

[test@dev]$ admsi.pl -help

         USAGE: admsi.pl [-[-]patch_top=<patch_directory>]
                         [-[-]appsschema=<apps schema name>]
                         [-[-]appspass=<apps password>]
                         [-[-]log=<logfilename>]
                         [-[-]help] [-[-]debug] [-[-]all]
                         [-[-]force][-[-]done]
          WHERE:
           <patch_directory> : Patch top directory location (optional)
                               Prompts if not passed.
           <appsschema>      : Name of the APPS schema (optional)
                               Defaults to "APPS" if not passed.
           <appspass>        : Password for the apps user(optional),
                               Prompts if not passed.
           <logfilename>     : Name of the log file (optional),
                               By default, the file admsi.log in
                               the current directory is created and used.
                               (optional)
            -debug           : Runs admsi.pl in debug mode.(optional)
            -cli             : Runs admsi.pl to generate an installation
                               instructions for a patch using command line
                               interface.
            -gui             : Invokes the oracle installation instructions
                               generator (default).
            -all             : Shows all steps even if it is not applicable to
                               this instance.(optional)
            -force           : Shows all the applicable steps even if it is
                               already done.(optional)
            [-]-done         : Updates the manual steps as completed(optional).
         admsi.pl [-]-help provides usage information.

Windows XP 新增遠端桌面連線


Steps:

1. 點選 控制台 > 新增移除程式

2. 點選 新增/移除Windows元件 > 點選 Internet Information System (IIS),點選詳細資料



3. 點選 World Wide Web Service > 點選詳細資料




4. 點選 遠端桌面網站連線 , 點選 確定




確定後,會要求放入 Windows XP SP3 的光碟。

Reference

1. 在 Windows XP 中安裝遠端桌面網路連線, https://support.microsoft.com/zh-tw/kb/284931

2016年8月9日 星期二

【VMware 】VMware Server 不正常關機,無法啟動,出現 "This virtual machine appears to be in use. ..." 錯誤訊息


Problem:

VMware Server 不正常關機,無法啟動,出現下列錯誤訊息:

"This virtual machine appears to be in use. If this virtual machine is already in use, press the "cancel" button to avoid damaging it. If this virtual machine is not in use , press the "Take Ownership" button to obtain ownership of it"
configuration file D:\Virtual Machines\Windows XP Professional\windows XP Professional.vmx

Study:

此解決方式參照(1)網路。

到 D:\Virtual Machines\Windows XP Professional\Windows XP Professional (2).vmdk.lck 目錄下,有M09192.lck ( 8/9 日) 與 M39944.lck (8/10 日) 兩個檔案。事實上,只要刪除最近的 *.lck 即可

M39944.lck (8/10 日)

uuid=35-af-a4-35-1c-c9-e5-11-77-00-00-15-00-00-00-c5 1044-121151620316737386(vmplayer.exe) 1 X 121151620316737386 lc=1812402890


Solution

1. 關掉 VMware
2. 到 D:\Virtual Machines\Windows XP Professional\Windows XP Professional (2).vmdk.lck 目錄下,刪除 M39944.lck
3. 重新開啟 VMware



Reference:

1. [筆記] VMware 出現 This virtual machine appears to be in use. 的解決方法,
http://goodjack.blogspot.tw/2015/05/vmware-this-virtual-machine-appears-to-be-in-use.html

prettyPrint();