顯示具有 Oracle 標籤的文章。 顯示所有文章
顯示具有 Oracle 標籤的文章。 顯示所有文章

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.

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月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)

2016年7月14日 星期四

【Oracle ERP Note 】Oracle EBS 測試區刪除無用的 Archive Log

Oracle EBS 測試區儲存 Size 近況如下:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       38G   12G   25G  32% /
/dev/sda1              99M   16M   79M  17% /boot
tmpfs                 4.0G  3.2M  3.9G   1% /dev/shm
/dev/mapper/VolGroup00-LogVol02
                       40G   23G   15G  62% /ora01
/dev/mapper/VolGroup00-LogVol03
                      5.0G  631M  4.1G  14% /misap
/dev/mapper/VolGroup00-LogVol05
                      9.9G  1.5G  8.0G  16% /var
/dev/mapper/VolGroup01-LogVol05
                      352G  200G  138G  60% /ora03
/dev/mapper/VolGroup01-LogVol05
                      352G  200G  138G  60% /u01

如用 rman 清除 archive log:

$ rman
RMAN > connect target /
RMAN> delete noprompt archivelog all;

刪除 archive log 後,測試區儲存 Size 如下:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       38G   12G   25G  32% /
/dev/sda1              99M   16M   79M  17% /boot
tmpfs                 4.0G  3.2M  3.9G   1% /dev/shm
/dev/mapper/VolGroup00-LogVol02
                       40G   23G   15G  62% /ora01
/dev/mapper/VolGroup00-LogVol03
                      5.0G  631M  4.1G  14% /misap
/dev/mapper/VolGroup00-LogVol05
                      9.9G  1.5G  8.0G  16% /var
/dev/mapper/VolGroup01-LogVol05
                      352G  177G  161G  53% /ora03
/dev/mapper/VolGroup01-LogVol05
                      352G  177G  161G  53% /u01



2016年6月12日 星期日

【Oracle ERP Note 】 FRM-41830: List of Values contains no entries

Problem:

User 申請使用 Data Collection 某項功能,權限已給予,但是點選詢問時,無法列出日報表供選取,而系統有錯誤訊息如下:

 FRM-41830: List of Values contains no entries

Solution:

1. 以  super user 登入,點選 System Administration > Concurrent > Requests
2. sync 這些 local table. 在 Submit Request 視窗之欄位 Name中,選取 Synchronize WF LOCAL tables
3. 注意: 在 Parameters 之視窗中,欄位  Orig System 選取 HZ Group (TCA Groups)

2016年6月3日 星期五

【Oracle Discoverer 】點選 Discoverer,出現錯誤訊息 “Discoverer 無法更新系統登入,請嘗試使用 REGEDIT”

Problem:

點選 Discoverer,出現錯誤訊息 “Discoverer 無法更新系統登入,請嘗試使用 REGEDIT”

Solution:

解除舊 Discoverer  安裝,重新安裝 Oracle Discoverer client


2016年6月2日 星期四

【Oracle ERP Note 】PL/SQL 連接時,報錯 SQL*Net not properly installed OracleHomeKey:

Problem:

安裝 PL/SQL 欲連接 DB時,出現錯誤訊息 : SQL* Net not properly installed
OracleHomeKey: SOFTWARE\ORACLE
OracleHomeDir:

Study:

1. 點選 PL/SQL 後,Oracle Logon 視窗中的欄位 Database 是空的,沒有點選的項目 (SID),且 Connect as 這欄位沒有出現。判斷 PL/SQL 啟動時,沒有讀取 tnsname.ora 設定檔

2. 在 PL/SQL 的 tool > Preference 中察看,Oracle Home [empty is auto detect] 與 OCI library [empty is auto detect] 都是空白

3. PL/SQL 這工具需要安裝 Oracle Client,若是安裝 Oracle Server 在 PC 端,雖然以 sqlplus 連接 DB Tier 沒問題,而誤以為  Oracle Home [empty is auto detect]  填入 C:\app\Administrator\product\11.2.0\dbhome_1,以及 OCI library [empty is auto detect] 填入 C:\app\Administrator\product\11.2.0\dbhome_1\bin\oci.dll 也是沒用。

Solution:

1. 安裝 Oracle Client 工具
2. 修改 C:\oracle\product\11.1.1\as_1\network\admin 目錄下的 tnsname.ora
3. 點選 PL/SQL,此時 Oracle Login 已讀取此 tnsname.ora,而在 Database 時可點選,且 Connect as 可點選 Logon 的角色是 Normal, SYSDBA, SYSOPER

2016年4月6日 星期三

【Oracle ERP Note 】連結至 ERP時候,出現下列錯誤訊息 Internal Server Error

Problem:

連結至 ERP時候,出現下列錯誤訊息

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, ohs_admin@xxx.com.tw and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Solution:

清除硬碟空間
prettyPrint();