2017年8月23日 星期三

開啟 Visual Studio 2010, 出現 " 的類型初始值設定項引發異常"

Problem


開啟 Visual Studio 2010, 出現 "<Moudle> 的類型初始值設定項引發異常" 錯誤訊息

Solution


重灌 Visual Studio


2017年3月16日 星期四

下一波的IT革命

標題以”下一波的IT革命“看起來很聳動,非要語不驚人死不休。但,IT走向下一波的趨勢已經越來越明朗。什麼會帶來 IT 巨大的變革呢?那就是非 cloud computing 雲端計算不可。
雲端產業已不是新鮮玩意,而自從Amazon從網路書店發跡,建構強大 cloud platform 雲端平台後,Microsoft 也隨之跟進,有專屬的 azure 平台,而 Oracle 夾其在Data Base 資料庫的優勢,同樣有 Oracle Cloud 平台。一般企業在 cloud 運用的接受度大都還逗留在 backup / storage 階段,即購買雲端的儲存容量,作為異地備份。至於 Cloud Computing是否採用, 企業大都採取觀望的態度。
沒錯,Cloud Computing 雲端計算將引領 IT 走向下一波革命,這點可以從近日Google推出的 Google Cloud Platform 即可看出。未來開發人員可向 Cloud Computing 業者租用雲端的 CPU 及Storage 硬碟空間,建構專屬的開發環境。相同,企業可將 ERP 或 Email 等應用軟體放在雲端上,提供企業內部可靠的服務。屆時 MIS 機房將省下硬體投資與每年的維修保固,MIS 人員也可將心力放在企業問題的解決上,而不是軟硬體的管理。Cloud Computing 平台終年無休可信賴的服務,讓MIS人員至少不擔心伺服器會當機。
我曾將異地備份採用 Oracle Cloud 的平台,租用其 storage 儲存空間 ,每晚定期備份。Oracle 本身 RMAN 資料備份與復原的技術相當成熟,所以在 Cloud 平台上,雲端資料備份的建構相當簡單。至於災難復原方面,Oracle Cloud 也在異常事件發生後,展現其資料由雲端還原至本地伺服器端,而沒有資料遺失 Data Loss 現象。我曾將 Oracle ERP 以 Rapid Clone 的方式,將公司的 Oracle ERP 建構在 Oralce Cloud 及 Ravello (Oracle 2016.8 月併購)平台上。在解壓縮檔案及建置過程當中,CPU 的執行效率都比本地伺服器優。
Google 推出 Google Cloud Platform後,這一波IT的變革我們不得不關注。IT已經歷經多次變革,每次變革都會帶來新的硬體與新的軟體設計工具。IT 的應用也不斷創新,屆時對生活層面也有可觀的影響。有誰料到 iPhone 或 Android 手機已變成生活的必需品,而其網路應用也愈來多采多姿。當 Cloud Computing 來臨時,會不會我們不必從網路下載應用軟體到手機,而直接連上網路即可使用?那時手機的內存大小似乎不是很重要了。

2016年11月30日 星期三

新增Oracle DB 的 Control File

以下列方式檢測 DB 開啟是否以 SPFILE 方式:

SQL> show parameter spfile

NAME TYPE VALUE
--------- ----------- ------------------------------
spfile string /orahome/app/oracle/product/12
.1.0.1/db_1/dbs/spfileO12C.ora

若是,以 SPFILE 方法新增 Control File

若檢查 spfile 沒有設定,則以 init.ora 方法新增 Control File

SQL> show parameter spfile
NAME TYPE VALUE
---------- ----------- ------------------------------
spfile string

以 SPFILE 方法

1. 找出 Control File 存檔的路徑

SQL> show parameter control_files
NAME TYPE VALUE
----------------- ----------- ------------------------------
control_files string /u01/dbfile/O12C/control01.ctl

2. 在設定上新增 Control File (control02.ctl)

SQL> alter system set control_files='/u01/dbfile/O12C/control01.ctl',
'/u01/dbfile/O12C/control02.ctl' scope=spfile;

3. 關掉 DB

SQL> shutdown immediate;

4. 將既有的 control file 檔 copy 至新的目錄下

$ cp /u01/dbfile/O12C/control01.ctl /u01/dbfile/O12C/control02.ctl

5. 啟動 DB

SQL> startup;

6. 驗證

SQL> show parameter control_files

NAME TYPE VALUE
--------------- ----------- ------------------------------
control_files string /u01/dbfile/O12C/control01.ctl
,/u01/dbfile/O12C/control02.ctl

以 init.or 方法

1. 關掉 DB

SQL> shutdown immediate;

2. 以 vi 編輯 initO12C.ora,在 contorl_files 參數,新增一個 Control File (control02.ctl)

$ vi $ORACLE_HOME/dbs/initO12C.ora
control_files='/u01/dbfile/O12C/control01.ctl',
'/u01/dbfile/O12C/control02.ctl'

3. 將既有的 control file 檔 copy 至新的目錄下

$ cp /u01/dbfile/O12C/control01.ctl /u01/dbfile/O12C/control02.ctl

4.  啟動 DB

SQL> startup;

5. 驗證

SQL> show parameter control_files
NAME TYPE VALUE
---------------- ----------- ------------------------------
control_files string /u01/dbfile/O12C/control01.ctl
,/u01/dbfile/O12C/control02.ctl

/end

2016年11月20日 星期日

已安裝 Java ,但無法啟動 Applet

Prolem

已安裝 Java ,但無法啟動 Applet

Solution

1. 開啟 Java 控制面板

2. 檢查 允許使用者對已簽署的內容授予許可權允許使用者對來自不可信的授權單位的內容授予許可權 是否已經勾選




Reference

1. How do I enable Java through the Control Panel?, https://java.com/en/download/help/enable_panel.xml


/end

限制 User 自動更新 Java,使用固定版本

Problem

限制 User 自動更新 Java,使用固定版本

此設定尤其在 Oracle ERP 格外重要。在 12.1.3 版本,若Windows版本為 XP,其Oracle ERP的Java 只支援 1.6.0_45 (輸入 java -version 可知)


Solution

1. 啟動 Java 控制面板 (Java Control Panel)

2. 在 更新 頁次,將 自動檢查更新 的 Check Box 不勾選


3. 在 Java 控制面板,頁次 進階 中,點選 JRE 自動下載 ,然後點選 永不自動下載




Remark

檢查 Java 版本:




/end

2016年11月1日 星期二

Error: /u01/proddb/proddb/11.2.2/bin/sqlplus: Permission denied

Problem:

執行每月 WIP 報表,出現下列錯誤訊息:

[@ wip_rpt]$ gen_wip_prod_def.sh 2016 OCT 1 31
APPS Password:
WIP Defect Analysis Daily Report Generate: 01-OCT-2016
./gen_wip_prod_def.sh: line 23: /u01/proddb/proddb/11.2.2/bin/sqlplus: Permission denied
cat: ./output/ddata/dtemp-01-OCT-2016.txt: No such file or directory

Solution:

更改 sqlplus 權限:

[root@erp ~]# cd /u01/proddb/proddb/11.2.2/bin/
[root@erp bin]# ls -l sqlplus
-rwxr-x--- 1 proddba proddba 9181 Apr  4  2013 sqlplus
[root@erp bin]# chmod 755 sqlplus

2016年10月31日 星期一

【Oracle 筆記 】查看 Oracle ERP 線上 User 登入狀況:


查看 Oracle ERP 線上 User 登入狀況:


SELECT fsav.user_name
      ,d.description
      ,fsav.responsibility_name
      ,fsav.user_form_name
      ,TIME
      ,s.SID
      ,s.SERIAL#
      ,s.LOGON_TIME
      ,s.PROGRAM
      ,s.MODULE
      ,s.BLOCKING_SESSION_STATUS
FROM   fnd_signon_audit_view fsav
      ,fnd_user              d
      ,v$process  p
      ,v$session  s
WHERE  d.user_name = fsav.user_name
       AND d.user_name LIKE '01%'
       AND fsav.PROCESS_SPID = p.SPID
       AND fsav.PID = p.PID
       AND p.ADDR = s.PADDR
ORDER BY fsav.user_name

結果:

USER_NAME 0338
DESCRIPTION 堂月立
RESPONSIBILITY_NAME  UP_CO_B
USER_FORM_NAME  Item Costs
TIME 0:0:07
SID 117
SERIAL# 40025
LOGON_TIME 2016/11/1 上午 09:39:41
PROGRAM frmweb@erp.up.com.tw (TNS V1-V3)
MODULE e:BOM:frm:CSTFITCT
BLOCKING_SESSION_STATUS NO HOLDER

2016年9月1日 星期四

【Oracle 筆記 】找出 Oracle 的 .pls 檔案 version

找出 Oracle 的 .pls 檔案 version

Syntax

Usage: /u01/apps/PROD/apps/apps_st/appl/ad/12.0.0/bin/adident id_pattern file1 [file2 file3 ...]


Example

以 prodmgr 登入

[prodmgr@srv]$ /u01/apps/PROD/apps/apps_st/appl/ad/12.0.0/bin/adident Header apacrndb.pls
apacrndb.pls:
$Header apacrndb.pls 120.22.12010000.27 2010/05/24 11:23:27 amitmukh ship $

[prodmgr@srv]$ /u01/apps/PROD/apps/apps_st/appl/ad/12.0.0/bin/adident Header apacpayb.pls
apacpayb.pls:
$Header apacpayb.pls 120.12.12010000.20 2010/05/24 11:22:15 amitmukh ship $

[prodmgr@srv]$ /u01/apps/PROD/apps/apps_st/appl/ad/12.0.0/bin/adident Header appredis.pls
appredis.pls:
$Header appredis.pls 120.11.12010000.11 2010/10/14 04:22:35 rseeta ship $


 $

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

2016年7月28日 星期四

【Oracle ERP Note 】Request a concurrent job and display "No Manager" error

Problem:

Request 一個 current job,回覆 No Manager

Solution:

[prodmgr@srv]$ adcmctl.sh start

You are running adcmctl.sh version 120.17.12010000.5


Enter the APPS username : apps

Enter the APPS password :
Starting concurrent manager for FUN ...
Starting FUN_0888@FUN Internal Concurrent Manager
Default printer is noprint

adcmctl.sh: exiting with status 0


adcmctl.sh: check the logfile /u01/apps/PROD/inst/apps/PROD_twhc-srv-erp/apps/FUN_srv/logs/appl/admin/log/adcmctl.txt for more information ...

Reference:

1. Concurrent Processing - Command-Line Utility OR Recovery Wizard (Doc ID 134007.1)

【Oracle ERP Note 】Orace EBS 登入後出現 There are no active responsibilities available for this user. 錯誤訊息

Problem:

Orace EBS 登入後出現 There are no active responsibilities available for this user. 錯誤訊息

Solution:

要執行這支程式 : Workflow Directory Services User/Role Validation
Super User裡面注意要執行兩次
第一次參數下100000, Yes, No, No
第二次參數下100000, No, Yes, No

可參考這個Metalink文件 : How To Fix Missing Responsibilities For A User (Doc ID 429852.1)


/end

【Oracle ERP Note 】Warning: The system has not been taken off maintenance mode completely

Problem:

登入 Oracle EBS 時,無法登入,出現下列錯誤訊息:

Warning: The system has not been taken off maintenance mode completely


Solution:

1. 以 adadmin 工具檢查 maintence mode,確認其為 disable
2. bounce HTTP (在 $INST_TOP/admin/scripts)
   $(prodmgr) adapcctl.sh stop
   wait 30 seconds
   $(prodmgr) adapcctl.sh start
3. shut down AP Tier (在 $INST_TOP/admin/scripts)
   $(prodmgr) adstpall.sh
4. start up AP Tier
   $(prodmgr) adstrtal.sh

Reference:

1. https://community.oracle.com/thread/599372

2016年7月26日 星期二

【Oracle ERP Note 】RSA host key has just been changed

Problem:

以 scp 將檔案 copy 至遠端時,系統抱怨 "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! " (因系統重灌 OS,但仍沿用之前 IP)

# scp app-.tar.gz  root@10.20.1.45:/               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
38:49:5d:16:58:36:c5:10:6c:53:36:b2:52:0e:c3:18.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:4
RSA host key for 10.20.1.45 has changed and you have requested strict checking.
Host key verification failed.
lost connection

Solution:

以 vi 刪除 /root/.ssh/known_hosts 的 IP 10.20.1.45 (含 key)

# scp app-.tar.gz root@10.20.1.45:/
The authenticity of host '10.20.1.45 (10.20.1.45)' can't be established.
RSA key fingerprint is 38:49:5d:16:58:36:c5:10:6c:53:36:b2:52:0e:c3:18..
Are you sure you want to continue connecting (yes/no)? yes

此時新的一筆 IP 加入 /root/.ssh/known_hosts

Reference:

1. How To Fix Offending key in ~/.ssh/known_hosts file, http://www.thegeekstuff.com/2010/04/how-to-fix-offending-key-in-sshknown_hosts-file

2016年7月22日 星期五

【Oracle ERP Note 】Oracle EBS 已新增 User 某 data collection plan 使用權限,但點選此 plan program 的選項時,沒有列出任何 collection plan

Problem:

Oracle EBS 已新增 User 某 data collection plan 使用權限,但點選此 plan program 的選項時,沒有列出任何 collection plan

Solution:

1. 以 Super User 身分,點選  System Administration > Concurrent > Request
2. 點選 Submit a new Request,選擇 Single Request
3. 在 Submit Request 視窗,選擇 Synchronize WF LOCAL tables.

注意: 在 Parameters 的 Orig System 要選 All (此為 Default 值)

2016年7月21日 星期四

【Oracle ERP Note 】Oracle ERP 印表機無法列印 ?

Problem:

Oracle ERP 印表機無法列印

Solution:

# service cups restart
Stopping cups:                                             [  OK  ]
Starting cups:                                               [  OK  ]
# cupsenable P_6_2_P2

Test:

# ls
 src   test.file
# lp -c -d P_6_2_P2 test.file
request id is P_6_2_P2-501506 (1 file(s))

【Oracle ERP Note 】Oracle ERP 的 Log 存放路徑 ?


 adpreclone.pl =>
(db tier) RDBMS $ORACLE_HOME/appsutil/log/<context>/StageDBTier_<timestamp>.log 
(ap tier) $INST_TOP/admin/log/StageAppsTier_<timestamp>.log 

admkappsutil.pl =>
(ap tier) $INST_TOP/admin/log/MakeAppsUtil_<timestamp>.log 

adcfgclone.pl =>
(db tier) RDBMS $ORACLE_HOME/appsutil/log/<context>/ApplyDBTier_<timestamp>.log 
(ap tier) $INST_TOP/admin/log/ApplyAppsTier_<timestamp>.log 

adconfig =>
(db tier) RDBMS $ORACLE_HOME/appsutil/log/<context>/<timestamp>/adconfig.log 
(db tier) RDBMS $ORACLE_HOME/appsutil/log/<context>/<timestamp>/NetServiceHandler.log 
(ap tier) $INST_TOP/admin/log/<timestamp>/adconfig.log 
(ap tier) $INST_TOP/admin/log/<timestamp>/NetServiceHandler.log

 Refererence :

1. How to find Clone and AutoConfig log files in E-Business Suite R12 (Doc ID 467095.1)
prettyPrint();