2014年10月31日 星期五

【Oracle 筆記 】Oracle EBS: 你的 Instance 是用那一個 ORACLE_HOME?


乍看這標題會很納悶。的確,尤其以 adpatch 指令做 AutoPatch 時,被問到下列 prompt 出來的問題,還會猶豫一下:

You are about to use or modify Oracle Applications product tables
in your ORACLE database 'PROD'
using ORACLE executables in '/u01/apps/PROD/apps/tech_st/10.1.2'.

Is this the correct database [Yes] ?

對於剛開始懵懂無知的人或許只要按下 return 鍵,心理就暗自祈禱。但,事實上比較仔細的人在以 adstpall.sh 指令 shutdown EBS AP 時,在起始要關閉 Forms server 當下有段 log 顯示:

****************************************************

You are running adformsrvctl.sh  version 120.15.12010000.3

Stopping FORMS Server (Socket Mode)  ...
Forms Server stopped...

adformsrvctl.sh: exiting with status 0

adformsrvctl.sh: check the logfile /u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms/socket.log for more information ...


.end std out.

.end err out.

****************************************************
看到這行 /u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms/socket.log ,我們更加篤定我們的 Instance 使用的是 10.1.2 這 ORACLE_HOME,而非 10.1.3 的 ORACLE_HOME。 事實上在更稍早時,我們應該很確定此 Instance 使用 ORACLE_HOME 的版本。例如: 我們規劃 client 端的 Form 以 socket 方式與 Forms Server 連結,這就注定 Instance 的 ORACLE_HOME 的版本。 若 Client 端以 servlet 方式,則 ORACLE_HOME 使用 10.1.3 版本。這 2 個版本之間的差異,先窺其目錄結構大致上可知道:

[mgr@tw-srv 10.1.2]$ pwd
/u01/apps/PROD/inst/apps/PROD_tw-srv/ora/10.1.2
[mgr@tw-srv 10.1.2]$ ls -l
total 20
drwxr-xr-x 2 mgr mgr 4096 Apr  4  2014 bin
drwxr-xr-x 3 mgr mgr 4096 Apr  4  2014 forms
drwxr-xr-x 3 mgr mgr 4096 Apr  4  2014 network
-rw-r--r-- 1 mgr mgr 3140 Oct 24 00:11 PROD_tw-srv.env
drwxr-xr-x 3 mgr mgr 4096 Apr  4  2014 reports


[mgr@tw-srv 10.1.3]$ pwd
/u01/apps/PROD/inst/apps/PROD_tw-srv/ora/10.1.3
[mgr@tw-srv 10.1.3]$ ls -l
total 36
drwxr-xr-x 3 mgr mgr 4096 Apr  4  2014 Apache
drwxr-xr-x 2 mgr mgr 4096 Apr  4  2014 cfgtoollogs
drwxr-xr-x 2 mgr mgr 4096 Apr  4  2014 config
drwxr-xr-x 2 mgr mgr 4096 Apr  4  2014 deconfig
drwxr-xr-x 6 mgr mgr 4096 Apr  5  2014 j2ee
drwxr-xr-x 3 mgr mgr 4096 Apr  4  2014 javacache
drwxr-xr-x 3 mgr mgr 4096 Apr  4  2014 network
drwxr-xr-x 5 mgr mgr 4096 Apr  4  2014 opmn
-rw-r--r-- 1 mgr mgr 3240 Oct 24 00:11 PROD_tw-srv.env
若 Instance 的 ORACLE_HOME 採用 10.1.2 (Oracle Tools Home),這是早期 client / server 彼此做 communication 的版本,屬於舊的版本,而 10.1.3 (Oracle OC4J Home) 則採用 Apache / J2EE 等技術,屬於後期開發,而被採用作為 Oracle Fusion 的 Middleware 技術。前者老而穩定,而後者新,需上 patch。Instance 選用不同的 ORACLE_HOME 版本,對後續 Oracle EBS 的管理維護影響很大! 參考: 1. http://blog.csdn.net/cai_xingyun/article/details/40394497

2014年10月30日 星期四

【Oracle 筆記 】Oracle Forms Server 與 Forms Client 的連結


Oracle EBS 的 AP Sever 包含 Forms server,而啟動此 server 時, 會產生 frmsrv 這 process。既然為 server process,就會定義所謂的 port number,提供 connection 的 service 以及其他相關的設定。

各 client 連線到此 AP server 時,此 server 也會為各自的 client 產生對應的 process,作為資料傳輸的 interface。

Forms (Socket) 的 server 是以 adformsrvctl.sh 指令來 startup / stop Forms Server in Socket Mode,此指令在 /u01/apps/PROD/apps/tech_st/10.1.2/bin 的目錄下。

Forms (Socket) 產生 server process 時,其環境設定值可參考由 AutoConfig 所產生的檔案 appsweb.cfg ( 在 $INST_TOP/ora/10.1.2/forms/server 目錄下 ),而若要自行定義 Forms 的參數,可參考 Metalink 的文件 387859.1

在此以簡單的實例來說明 Forms server / client 的關係:

Forms Server Process:

mgr  23268     1  0 Oct30 ?        00:00:00 frmsrv host tw-srv port 9000 pool 1 exe frmweb log /u01/apps/PROD/inst/apps/PROD_tw-srv /logs/ora/10.1.2/forms/socket.log em 1


Forms Client Process:

mgr    327 23268  0 08:04 ?        00:00:02 frmweb webfile=5,20,twhc-srv-erp_9000,/u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms/socket.log
mgr   1430 23268  0 11:17 ?        00:00:01 frmweb webfile=5,51,twhc-srv-erp_9000,/u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms/socket.log
mgr   2465 23268  0 08:07 ?        00:01:08 frmweb webfile=5,22,twhc-srv-erp_9000,/u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms/socket.log
我們來解析 Forms server process 這 startup 指令:

frmsrv host tw-srv port 9000 pool 1 exe frmweb log /u01/apps/PROD/inst/apps/PROD_tw-srv
frmsrv => 以 mgr 帳號,切換到 $ORACLE_HOME/bin ( /u01/apps/PROD/apps/tech_st/10.1.2 )之下,可找到此執行檔 frmweb host tw-srv => 以 $ hostname -a 指定找出,亦可參考 /etc/hosts 檔案 port 9000 => 這 frmweb 使用的 port number 被定義在 $INST_TOP ( /u01/apps/PROD/inst/apps/PROD_tw-srv ) 目錄下的 conf_PROD.txt 檔案中,而以 s_formsport = 9000 此參數定義。 pool 1 => exe frmweb => log /u01/apps/PROD/inst/apps/PROD_tw-srv => frmweb 的 server proces 定義了 Log 的目錄,這目錄為 $INST_TOP/logs/ora/10.1.2/forms,也就是說所有的 client process 都寫在 $INST_TOP/logs的目錄下。例如: client process pid = 327 時,將來有關此 client 的 connection 的 log 會寫入 /u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms 目錄下。 參考: 1. http://blog.csdn.net/cai_xingyun/article/details/40394497

【Oracle 筆記 】Oracle EBS AP shutdown / startup 時,查看連結紀錄


Oracle EBS R12 的 Form Client 標準透過 Servelet 與 Form Server 溝通,但也允許以 WinSocket 方式 (比較不建議,需上 Patch)。

連上 Form Server時,可看到 frmweb 這些 process 等待處理回應。 當我們下 adstpall.sh 停掉 AP server 時,可到 /u01/apps/PROD/inst/apps/PROD_tw-srv/logs/oar/10.1.2/forms/socket.log 查看 Client 連結紀錄。這  log 紀錄 Oracle EBS AP server 在 10/30/14-19:04:26 被 shutdown, 而於 10/30/14-19:18:16 被 startup。



[Thu Oct 30 17:18:46 2014 CST]::LISTN: Connection Request [ConnId=482, Addr=xx.xx.xx.103:5128]
[Thu Oct 30 17:23:28 2014 CST]::LISTN: Connection Request [ConnId=483, Addr=xx.xx.xx.140:7952]
[Thu Oct 30 17:48:05 2014 CST]::LISTN: Connection Request [ConnId=484, Addr=xx.xx.xx.123:7698]
[Thu Oct 30 17:56:17 2014 CST]::LISTN: Connection Request [ConnId=485, Addr=xx.xx.xx.103:14089]

10/30/14-19:04:26 :: adformsrvctl.sh version 120.15.12010000.3
10/30/14-19:04:26 :: adformsrvctl.sh: Stopping  FORMS Server (Socket Mode)


10/30/14-19:04:26 :: adformsrvctl.sh: exiting with status 0

================================================================================


10/30/14-19:18:14 :: adformsrvctl.sh version 120.15.12010000.3
10/30/14-19:18:16 :: adformsrvctl.sh: Starting FORMS Server (Socket Mode)


10/30/14-19:18:16 :: adformsrvctl.sh: exiting with status 0


================================================================================


FORMS CONNECTION ACTIVITY LOG FILE
Developer:Forms/LogRecord

[Thu Oct 30 19:18:16 2014 CST]::Server Start-up Data:
        Server Log Filename: /u01/apps/PROD/inst/apps/PROD_tw-srv/logs/ora/10.1.2/forms/socket.log
        Server Hostname: tw-srv.elvismeng.com.tw
        Server Port: 9000
        Server Pool: 1
        Server Process Id: 23268

[Thu Oct 30 20:11:26 2014 CST]::LISTN: Connection Request [ConnId=0, Addr=xx.xx.xx.131:27909]
[Thu Oct 30 20:23:16 2014 CST]::LISTN: Connection Request [ConnId=1, Addr=xx.xx.xx.132:12552]
[Thu Oct 30 20:31:19 2014 CST]::LISTN: Connection Request [ConnId=2, Addr=xx.xx.xx:25599]
在 /u01/apps/PROD/inst/apps/PROD_tw-srv/logs/oar/10.1.2/forms 目錄下存放 3 種檔案: *.rti 檔案, frmweb_dump_(pid) 檔案與 .log 檔案。 前面提到,每個 Form Client 登入後,在 AP Server 端都會各自有唯一的 process 作為窗口,與之對應,提供服務。這 process 就是 frmweb 程序。 frmweb process 生成後, 會將登入檔案以 em_(pid).rti 的檔名紀錄,而所有關於 forms 的 frmweb 活動只記錄在 socket.log (若以 socket 溝通) 裡。 例如: 查看一個 frmweb 這 process:

[root@tw-srv ~]# ps -ef | grep 14675
dmgr  14675 23268  0 10:50 ?        00:00:01 frmweb webfile=5,49,tw-srv_9000,/u01/apps/PROD/inst/apps/PROD_twhc-srv-erp/logs/ora/10.1.2/forms/socket.log 
在這 log 目錄下,找到與之對應的 .rti 登入檔:

[root@tw-srv forms]# vi em_14675.rti
listener = tw-srv-_9011
pid = 14675
connect = Fri Oct 31 10:50:16 2014 CST
ip = 92.68.1.11
user = APPLSYSPUB
db_string = PROD
~
至於 frmweb_dump_(pid) 這些檔案紀載 client / server 的 connection 有問題的紀錄,可作為 debug 除錯 Oracle EBS 的參考。例如:

[root@tw-srv forms]# vi frmweb_dump_15207
[Tue Jun 24 15:52:18 2014 CST]::Client Status [ConnId=1007, PID=15207]
        >> ERROR: Abnormal termination of connection, Error Code: 6

FORM/BLOCK/FIELD: APXINWKB:BAT_SUM_FOLDER.DISTRIBUTION_LINE_NUMBER
Last Trigger: KEY-COMMIT - (Execution Suspended)
Msg: 
Last Builtin: COMMIT - (Successfully Completed)
------------- Call Stack Trace [ConnId = 1007, ProcId = 15207] -------------

calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
siehjmpterm()+755    CALL                          2 ? A591ED ? FFC2F8 ? 0 ?
                                                   0 ? 0 ?
                     CALL
                     CALL

(N/A)

------------- End of Call Stack Trace -------------
~
~
~
~
~
~
"frmweb_dump_15207" 46L, 2713C

【Oracle 筆記 】 Apply Oracle Patch Guideline for 10148526


上 Oracle Patch 之前,是否該事先寫下執行計畫? 答案是肯定的。這計畫一方面組織執行的過程,另一方面避免錯誤重複發生,同時也可作為上 Production 環境前,給自己一個萬全的準備。

Oracle 的 Patch 上的手法,只能堪稱手工業的精華。怎麼說? 上 Patch 之前要詳細研讀每個 Readme  檔案,避免粗心大意,造成後續累死人的修復工作。Oracle 已由 Database 供應商,提供為整合 Solution 的廠商,而流通於全球。每個新的 Release 後,使用者得不間斷地藉由 MA 維護,獲得最新 Bug 的修復的 Patch。有些惱人,有些竊喜,而喜的是 Oracle 愈複雜,工作愈有 Security。很諷刺吧 ? 這與 Apple 的 Steve Jobs 行事觀念大異其趣,同時也違背當前 IT 的符合人性的簡化原則,但,這恐龍畢竟是 Oracle 啊,奈何!

以下拿一個上 Patch 的過程為範例,可參考。

Prepare:

- download patch 1014526
- study Readme file
- Plan:
  1. shutdown AP
  2. Enable maintenance mode
  3. Apply patch tool: adpatch
  4. Disable maintenance mode
  5. startup AP
  6. verify: 
     (1) OS / DB Level: use command 'string'
     (2) EBS Level

Execution:


Step  1. shutdown AP

# su testmgr
[test@dev] cd $APPL_TOP
[test@dev] . ./APPSTEST_twhc-srv-oradev
[test@dev] cd $INST_TOP/admin/scripts
[test@dev] adstpall.sh ( AP account / password required )

Step  2. Enable maintenance mode

# su testmgr
[test@dev] . ./APPSTEST_twhc-srv-oradev
[test@dev] adadmin

choose '5 Change Maintenance Mode' and enable it


Step  3. Apply patch tool: adpatch

# su testmgr
[test@dev] . ./APPSTEST_twhc-srv-oradev
[test@dev] cd /u01/patch/10148526
[test@dev] adpatch ( SYSTEM & APPS password required ) 

Step  4. Disable maintenance mode

# su testmgr
[test@dev] . ./APPSTEST_twhc-srv-oradev
[test@dev] adadmin

choose '5 Change Maintenance Mode' and disable it

Step  5. startup AP

[test@dev] adstrtal ( AP account / password required eg. APPS/APPS)

Step  6. verify: 


     (1) OS / DB Level: use command 'string'

         strings -a $AP_TOP/patch/115/import/US/ap12amg.ldt | grep '$Header' 
         strings -a $AP_TOP/forms/US/APXPAWKB.fmx | grep '$Header'

 this patch will upgrade the related two files to the higher version : 
        
           APXPAWKB.fmb 120.223.12010000.188 
           ap12amg.ldt 120.49.12010000.52  

     (2) EBS Level

  Duplicate the case and verify if it works

2014年10月29日 星期三

【Oracle 筆記 】上 Oracle Patch 成功嗎?

要驗證 Oracle Patch 安裝是否成功有許多途徑,其中之一是使用 

[test@dev 10148526]$ strings -a $AP_TOP/patch/115/import/US/ap12amg.ldt | grep '$Header'
# $Header: ap12amg.ldt 120.49.12010000.42 2010/06/14 14:03:41 ppodhiya ship $
[test@dev 10148526]$ strings -a $AP_TOP/forms/US/APXPAWKB.fmx | grep '$Header'
$Header: APPSTAND.fmb 120.6.12010000.6 2010/03/10 12:58  dbowles ship                                                                                                                                                                                                                                                         $
$Header: APXPAWKB.fmb 120.223.12010000.174 2010/06/22 10:05  dawasthi ship                                                                                                                                                                  

檢查 Patch 的 readme 檔案,發現需上的版本為  120.223.12010000.188, 所以之前上的 Patch 並沒有成功。

Successful patch installation checks:
    Confirm APXPAWKB.fmb version 120.223.12010000.188

2014年10月22日 星期三

【Linux 筆記 】下載 Oracle Patch 前,確認 Linux 32 或 64 版本

有 3 種方法可確認 Linux 是 32 位元,或是64位元的版本:

1. 使用 uname 指令
2. 使用 file 指令
3. 使用 getconf 指令

例如,參考下面範例:

1. 使用 uname 指令

[test@tw-srv-erp bin]$ uname -a
Linux tw-srv-erp.elvismeng.com.tw 2.6.18-53.el5 #1 SMP Sat Nov 10 19:37:22 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

2. 使用 file 指令

[test@tw-srv-erp bin]$ file /bin/bash
/bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

3. 使用 getconf 指令

[test@tw-srv-erp bin]$ getconf LONG_BIT #64bits
64
[test@tw-srv-erp bin]$ getconf LONG_BIT #32bits
64

【Oracle 筆記 】Clone Oracle EBS- 第一階段:Source 系統預備

什麼情況下需 clone 一個 Oracle EBS ?

1. 標準 Clone,為了測試
2. 增加伺服器時 
3. 系統轉換時
4. 上 Patch 與版本升級時

為何使用 Rapid Clone 工具?

clone 容易, clone 整個系統與資料,而非只是檔案結構 topology,所以啟動後馬上可用。

那該如何進行 Oracle EBS 的 clone ? 

這 clone 作業分 3 個階段:

第一階段:Source 系統預備 (Prepare Source System)
第二階段:clone 系統 (Copy Bits)
第三階段:Target 系統配置(Configure Target System)

第一階段:Source 系統預備

1. Verify OS requirements on target system

Oracle 建議使用 Rapid Clone 這工具時, Source / Target System 安裝的 OS 要一致,否則需要採取其他相關措施。有關這工具所支援的 OS,請參考 Doc ID 405565.1

2.Verify source and target system software components and versions

檢查 Source / Target System 是否已經安裝壓縮 / 解壓縮等下列工具: zip/unzip/(make, ld, ar)/perl

參考【Oracle 筆記: Clone Oracle EBS 】檢查 Source / Target System 是否已經安裝壓縮 / 解壓縮等工具

接下來,clone 有 4 種類型的 Patch 要上: AD patch,  AutoConfig patch, Rapid Clone patch, 與 other patches

3. Apply the latest AD patch

首先,檢查 Source System 是否已安裝 Patch:

select bug_number from ad_bugs where bug_number='XXXXXX' 

例如: 針對 Oracle EBS 12.1.x 版本,需上 AD Patch 9239089

select bug_number from ad_bugs where bug_number = '9239089'


4. Apply the latest AutoConfig template patch

例如: 需上 AD Patch 387859.1

select bug_number from ad_bugs where bug_number = '387859.1'

5. Apply the latest Rapid Clone patches

例如: 針對 Oracle EBS 12.1.x 版本, 需上以下的AD Patch 
Patch '9171651','9833058','12404574','12598630','15969020','16958896','13942692','18991480','17889841','18835102'

select bug_number from ad_bugs where bug_number in ('9171651','9833058','12404574','12598630','15969020','16958896','13942692','18991480','17889841','18835102')

另外,還有一個適用於Microsoft Windows 所有 Oracle EBS 版本的 Patch 要上:

select bug_number from ad_bugs where bug_number = '8246709'

6. Run AutoConfig on the application tiers

參考 Doc ID 387859.1 的 "Run AutoConfig on the Application Tiers" 章節。

7. Synchronize appsutil on the database tier nodes

參考 Doc ID 387859.1 的 "Copy AutoConfig to the RDBMS ORACLE_HOME" 章節。

8. Run AutoConfig on the database tier

參考 Doc ID 387859.1 的 "Run AutoConfig on the Database Tiers" 章節。

9. Maintain Snapshot Information
 
snapshot 是整個系統目前的 View,可分為 APPL_TOP snapshots 與 global snapshots。

要查詢 globla snapshots,可下此指令:

select * from all_snapshots;



參考 

1. Cloning Oracle Application Release 12 with Rapid Clone (Doc ID 406982.1, Standard Clone),若為 RAC Clone則需參考 Doc ID 559518.1
2. Patch 下載網站: http://support.oracle.com
3. R12.2 Cloning Steps, http://balaoracledba.com/2013/10/23/
4. Oracle E-Business Suite Release 12 Installation Guidelines (Doc ID 405565.1), https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=342123966819007&id=405565.1&_afrWindowMode=0&_adf.ctrl-state=aieagcvzv_178
5. Using AutoConfig to Manage System Configurations in Oracle E-Business Suite Release 12 , https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=353025954864484&id=387859.1&_adf.ctrl-state=197rdbqksz_169
6. [Tips]如何建立Oracle Materialized View (snapshot) 
,http://auneths.blogspot.tw/2013/11/tipsoracle-materialized-view-snapshot.html



2014年10月21日 星期二

【Oracle 筆記: Clone Oracle EBS 】檢查 Source / Target System 是否已經安裝壓縮 / 解壓縮等工具

在 clone 一個 Oracle EBS 生產作業環境中,初步會檢驗 Source / Target System 是否
檢查 Source / Target System 是否已經安裝壓縮 / 解壓縮等下列工具:

例如: 檢查 Source / Target System:


[root@erp sysconfig]# which zip
/usr/bin/zip
[root@erp sysconfig]# which unzip
/usr/bin/unzip
[root@erp sysconfig]# which make
/usr/bin/make
[root@erp sysconfig]# which ld
/usr/bin/ld
[root@erp sysconfig]# which ar
/usr/bin/ar
[root@erp sysconfig]# which perl
/usr/bin/perl
Zip 版本要求 2.3 以上或更高,Unzip 版本要求 5.52 以上或更高,而 Perl 版本要求 5.x 以上。版本資訊可依下列方式查詢: 1. 檢查 zip 版本

[root@erp sysconfig]# zip -v

Copyright (C) 1990-2005 Info-ZIP
Type 'zip "-L"' for software license.
This is Zip 2.31 (March 8th 2005), by Info-ZIP.
Currently maintained by Onno van der Linden. Please send bug reports to
the authors using http://www.info-zip.org/zip-bug.html; see README for details.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip, as of
above date; see http://www.info-zip.org for other sites.

Compiled with gcc 4.1.1 20070105 (Red Hat 4.1.1-52) for Unix (Linux ELF) on Jun  7 2007.

Zip special compilation options:
        USE_EF_UT_TIME
        [encryption, version 2.9 of 22 April 2000]
Encryption notice:
        The encryption code of this program is not copyrighted and is
        put in the public domain.  It was originally written in Europe
        and, to the best of our knowledge, can be freely distributed
        in both source and object forms from any country, including
        the USA under License Exception TSU of the U.S. Export
        Administration Regulations (section 740.13(e)) of 6 June 2002.

Zip environment options:
             ZIP:  [none]
          ZIPOPT:  [none]
2. 檢查 unzip 版本

[root@erp sysconfig]# unzip -v

UnZip 5.52 of 28 February 2005, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;
see ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.

Compiled with gcc 4.1.1 20070105 (Red Hat 4.1.1-52) for Unix (Linux ELF) on Jun  6 2007.

UnZip special compilation options:
        COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)
        SET_DIR_ATTRIB
        TIMESTAMP
        USE_EF_UT_TIME
        USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)
        USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
        VMS_TEXT_CONV
        [decryption, version 2.9 of 05 May 2000]

UnZip and ZipInfo environment options:
           UNZIP:  [none]
        UNZIPOPT:  [none]
         ZIPINFO:  [none]
      ZIPINFOOPT:  [none]
3. 檢查 Perl 版本

[root@erp sysconfig]# perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Cloning Oracle Applications Release 12 with Rapid Clone (Doc ID 406982.1)
檢查後,發現無此工具,或是版本過時,則可到下列網站下載更新:

zip / unzip : http://www.info-zip.org/
perl : http://www.perl.org/get.html
參考 1. Cloning Oracle Applications Release 12 with Rapid Clone (Doc ID 406982.1)

【Linux 筆記 】root 密碼修改


考慮資安,定期更改伺服器 / 個人 帳號是必須的,而在 Linux 更改 root 的密碼,與更改一般 user 的密碼方式相同,即是下 passwd accountName 來更改。例如:

[root@localhost etc]# passwd root
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost etc]#
一般公司擁有多伺服器,所以不同主機會設定不同的密碼,此時密碼的安全控管很重要。在密碼管理上已有相當多的工具可選用,例如 KeyPass 等工具也相當好用。

【Linux 筆記 】如何更改 Linux 的 hostname 設定


Red Hat Linux 安裝完後,下指令 # hostname 時,會顯示:


[root@localhost ~]# hostname
localhost.localdomain
而查看 /etc/hostname 時,系統顯示:

[root@localhost ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1      localhost.localdomain localhost
::1            localhost6.localdomain6 localhost6
我們將 /etc/hosts 這檔案修改為:

[root@localhost etc]# vi hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1      localhost.localdomain localhost
#::1            localhost6.localdomain6 localhost6

127.0.0.1       tw-srv-erp.elvismeng.com.tw tw-srv-erp
172.20.1.100    tw-srv-erp.elvismeng.com.tw tw-srv-erp
127.0.0.1       localhost
另外,我們還需修改/etc/sysconfig 目錄下的 network 檔案。查看此目錄,顯示目前network 檔案的內容為:
 
[root@localhost sysconfig]# cat network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
現在讓我們修改 /etc/sysconfig/network 這檔案,在修改前,有些設定要先規劃確定: 1. localhost 命名 (例如: tw-srv-erp ) 2. localdomain 命名 (例如: elvismeng.com.tw) 3. GATEWAY 的 ip 配置 GATEWAY 的設定一般先查看伺服器的 ip 位置,例如: 新增 Linux 伺服器的 ip 為 12.2.1.100,那 GATEWAY 設定為 12.2.1.254

[root@localhost sysconfig]# vi network
NETWORKING=yes
NETWORKING_IPV6=no
#HOSTNAME=localhost.localdomain
HOSTNAME=tw-srv-erp.elvismeng.com.tw
GATEWAY=12.2.1.254
雖然 hostname 的設定完成,但還沒有生效,所以須下 hostname 此指令:

[root@localhost sysconfig]# hostname tw-srv-erp
最後,我們驗證看 hostname 是否已經被修改成功:

[root@localhost sysconfig]# hostname
tw-srv-erp
另外,我們也可用 ping hostname 的方式來驗證:

[root@localhost sysconfig]# ping tw-srv-erp
PING tw-srv-erp.elvismeng.com.tw (127.0.0.1) 56(84) bytes of data.
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=1 ttl=64 time=0.815 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=2 ttl=64 time=0.067 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=3 ttl=64 time=0.066 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=4 ttl=64 time=0.060 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=5 ttl=64 time=0.067 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=6 ttl=64 time=0.068 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=7 ttl=64 time=0.058 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=8 ttl=64 time=0.068 ms
^C64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=9 ttl=64 time=0.065 ms
64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=10 ttl=64 time=0.069 ms

--- tw-srv-erp.elvismeng.com.tw ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9000ms
rtt min/avg/max/mdev = 0.058/0.140/0.815/0.225 ms
[root@localhost sysconfig]#
參考 1. How to Change the Hostname of a Linux System http://www.ducea.com/2006/08/07/how-to-change-the-hostname-of-a-linux-system/ 2. 蔡宗融個人網站,http://www.ichiayi.com/wiki/tech/linux_hostname

【Oracle 筆記 】忘記 Oracle sys 與 system 密碼怎麼辦 ?

1. 首先以 root 系統管理員帳號登入:


login as: root
root@10.10.1.82's password:
Last login: Tue Sep  9 08:14:56 2014 from elvismeng-g10-1042-2
2. 再來切換到 Oracle DBA 帳號:

[root@elvismeng-srv-r ~]# su devdba
3. 查看 Oracle DB 的 SID 是否被定義在 devdba 的登入的 profile (若使用 bash shell):

[devdba@elvismeng-srv-r root]$ echo ORACLE_SID
ORACLE_SID
4. 如無 (依照上例),定義此 Oracle Instance 的識別名稱:

[devdba@elvismeng-srv-r root]$ ORACLE_SID=DEV5
5. 定義完後,export 此識別名稱,如此 Unix 環境即可識別:

[devdba@elvismeng-srv-r root]$ export ORACLE_SID
[devdba@elvismeng-srv-r root]$ echo $ORACLE_SID
DEV5
6. 更改 sys 與 system 密碼:

[devdba@elvismeng-srv-r root]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Tue Sep 9 16:01:06 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

SQL> connect / as sysdba
Connected.

SQL> alter user sys identified by sys
  2  ;

User altered.

SQL> alter user system identified by system;

User altered.

SQL>
參考: http://www.itkee.com/database/detail-1dc1.html
prettyPrint();