หลังจากการ "Request Workspace" เรียบร้อยแล้ว เราจะ Login ด้วย OTN user.
จากนั้นเลือก Workspace ที่เราสร้างไว้
Oracle Application Express 5.0 Early Adopter 1 Feature Descriptions
login as: oracleหลังจากนั้นเปิด Browser เพื่อติดต่อ APEX
oracle@192.168.111.15's password:
Last login: Wed Oct 2 19:34:34 2013 from 192.168.111.14
All passwords are oracle or noted if otherwise.
The SQL Developer and Data Modeler scripts are in the directory:
/home/oracle/Desktop/SQLDev_Tutorials/sqldev
To Reset the labs:
SQL Developer: /home/oracle/reset_sqldev
Application Express: /home/oracle/reset_apex
In-Memory Database Cache: /home/oracle/reset_imdbcache
XML Database: /home/oracle/reset_xmldb
Oracle Enterprise Manager
Start: emctl start dbconsole
Stop : emctl stop dbconsole
URL : https://127.0.0.1:1158/em
*** Please note that this appliance is for testing purposes only,
as such it is unsupported and should not be used as a production environment.
inet addr:192.168.111.15 Bcast:192.168.111.255 Mask:255.255.255.0
inet addr:127.0.0.1 Mask:255.0.0.0
LD_LIBRARY_PATH set to /home/oracle/app/oracle/product/TimesTen/tt1122/lib:/home/oracle/app/oracle/product/TimesTen/tt1122/ttoracle_home/instantclient_11_2:/home/oracle/app/oracle/product/11.2.0/dbhome_2/lib
ANT_HOME set to /home/oracle/app/oracle/product/TimesTen/tt1122/3rdparty/ant
PATH set to /home/oracle/app/oracle/product/TimesTen/tt1122/bin:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/oci:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/odbc:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/odbc/xla:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/jdbc:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/odbc_drivermgr:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/proc:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/ttclasses:/home/oracle/app/oracle/product/TimesTen/tt1122/quickstart/sample_code/ttclasses/xla:/home/oracle/app/oracle/product/TimesTen/tt1122/ttoracle_home/instantclient_11_2:/home/oracle/app/oracle/product/TimesTen/tt1122/ttoracle_home/instantclient_11_2/sdk:/home/oracle/app/oracle/product/TimesTen/tt1122/3rdparty/ant/bin:/usr/java/latest/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/app/oracle/product/11.2.0/dbhome_2/bin:/home/oracle/bin
CLASSPATH set to /home/oracle/app/oracle/product/TimesTen/tt1122/lib/ttjdbc6.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/orai18n.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/timestenjmsxla.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/3rdparty/jms1.1/lib/jms.jar:.:/home/oracle/app/oracle/product/11.2.0/dbhome_2/ucp/lib/ucp.jar:/home/oracle/app/oracle/product/11.2.0/dbhome_2/jdbc/lib/ojdbc6.jar
TNS_ADMIN set to /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin
IP Address is:
inet addr:192.168.111.15 Bcast:192.168.111.255 Mask:255.255.255.0
inet addr:127.0.0.1 Mask:255.0.0.0
[oracle@localhost ~]$
[oracle@localhost ~]$
[oracle@localhost ~]$ ./apexlistener.sh status
+ . /etc/rc.d/init.d/functions
++ TEXTDOMAIN=initscripts
++ umask 022
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin
++ export PATH
++ '[' -z '' ']'
++ COLUMNS=80
++ '[' -z '' ']'
+++ /sbin/consoletype
++ CONSOLETYPE=pty
++ '[' -f /etc/sysconfig/i18n -a -z '' ']'
++ . /etc/profile.d/lang.sh
+++ sourced=0
+++ for langfile in /etc/sysconfig/i18n '$HOME/.i18n'
+++ '[' -f /etc/sysconfig/i18n ']'
+++ . /etc/sysconfig/i18n
++++ LANG=en_US.UTF-8
++++ SYSFONT=latarcyrheb-sun16
+++ sourced=1
+++ for langfile in /etc/sysconfig/i18n '$HOME/.i18n'
+++ '[' -f /home/oracle/.i18n ']'
+++ '[' -n '' ']'
+++ '[' 1 = 1 ']'
+++ '[' -n en_US.UTF-8 ']'
+++ export LANG
+++ '[' -n '' ']'
+++ unset LC_ADDRESS
+++ '[' -n '' ']'
+++ unset LC_CTYPE
+++ '[' -n '' ']'
+++ unset LC_COLLATE
+++ '[' -n '' ']'
+++ unset LC_IDENTIFICATION
+++ '[' -n '' ']'
+++ unset LC_MEASUREMENT
+++ '[' -n '' ']'
+++ unset LC_MESSAGES
+++ '[' -n '' ']'
+++ unset LC_MONETARY
+++ '[' -n '' ']'
+++ unset LC_NAME
+++ '[' -n '' ']'
+++ unset LC_NUMERIC
+++ '[' -n '' ']'
+++ unset LC_PAPER
+++ '[' -n '' ']'
+++ unset LC_TELEPHONE
+++ '[' -n '' ']'
+++ unset LC_TIME
+++ '[' -n '' ']'
+++ unset LC_ALL
+++ '[' -n '' ']'
+++ unset LANGUAGE
+++ '[' -n '' ']'
+++ unset LINGUAS
+++ '[' -n '' ']'
+++ unset _XKB_CHARSET
+++ consoletype=pty
+++ '[' -z pty ']'
+++ '[' -n '' ']'
+++ '[' -n '' ']'
+++ '[' -n en_US.UTF-8 ']'
+++ case $LANG in
+++ '[' xterm = linux ']'
+++ unset SYSFONTACM SYSFONT
+++ unset sourced
+++ unset langfile
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/init ']'
++ . /etc/sysconfig/init
+++ BOOTUP=color
+++ GRAPHICAL=yes
+++ RES_COL=60
+++ MOVE_TO_COL='echo -en \033[60G'
+++ SETCOLOR_SUCCESS='echo -en \033[0;32m'
+++ SETCOLOR_FAILURE='echo -en \033[0;31m'
+++ SETCOLOR_WARNING='echo -en \033[0;33m'
+++ SETCOLOR_NORMAL='echo -en \033[0;39m'
+++ LOGLEVEL=3
+++ PROMPT=yes
+++ AUTOSWAP=no
++ '[' pty = serial ']'
++ '[' color '!=' verbose ']'
++ INITLOG_ARGS=-q
++ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
+ NAME='Oracle Application Express Listener'
+ JAVA_HOME=/usr/java/latest
+ JAVA=/usr/java/latest/bin/java
+ APEXWAR=/home/oracle/listener/apex.war
+ ORACLE_SID=orcl
+ ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
+ OPTIONS=' -Xmx1024m -Xms256m -jar /home/oracle/listener/apex.war standalone >/tmp/apexListener.log '
+ LOGFILE=/tmp/apex_listener.log
++ ps -ef
++ grep apex
++ grep -v apexlistener
++ grep -v grep
++ cut -c9-15
+ PID=' 2569 '
++ ps -ef
++ grep apex
++ grep -v apexlistener
++ grep -v grep
++ cut -c9-15
++ wc -l
+ RUNNING=1
+ case "$1" in
+ status
+ echo -n 'Status Oracle Application Express Listener: '
Status Oracle Application Express Listener: + '[' 1 -eq 1 ']'
+ echo APEX Listener running: 2569
APEX Listener running: 2569
+ ps -ef
+ grep 2569
oracle 2569 1 0 19:24 ? 00:00:04 /usr/java/latest/bin/java -Xmx1024m -Xms256m -jar /home/oracle/listener/apex.war standalone >/tmp/apexListener.log
oracle 3690 3673 0 19:43 pts/3 00:00:00 grep 2569
+ exit 0
[oracle@localhost ~]$ netstat -anp | grep 2569
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 :::8888 :::* LISTEN 2569/java
tcp 0 0 ::ffff:127.0.0.1:46995 ::ffff:127.0.0.1:1521 ESTABLISHED 2569/java
tcp 0 0 ::ffff:127.0.0.1:46994 ::ffff:127.0.0.1:1521 ESTABLISHED 2569/java
tcp 0 0 ::ffff:127.0.0.1:46993 ::ffff:127.0.0.1:1521 ESTABLISHED 2569/java
unix 2 [ ] STREAM CONNECTED 7717 2569/java
SQL> select CON_ID, NAME, OPEN_MODE from v$pdbs;เนื่องจากต้องการใช้ Embedded PL/SQL Gateway เลยเซต HTTP port บน PDB (PDB_OPUN) และเปลี่ยน Password + unlock ให้กับ ANONYMOUS
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
2 PDB$SEED READ ONLY
3 PDB_OPUN READ WRITE
SQL> select COMP_ID, VERSION, CON_ID from cdb_registry where COMP_ID='APEX';
no rows selected
SQL>
[oracle@test12c ~]$ unzip -l apex_4.2.3.zip|tail
2256 08-22-2012 10:46 apex/apxconf.sql
4301 08-15-2013 04:08 apex/apxdvins.sql
1150 08-22-2012 10:46 apex/apxchpwd.sql
5 08-22-2012 10:46 apex/apxexit.sql
4706 03-02-2013 22:19 apex/catapx.sql
538 03-07-2008 21:20 apex/apxe102.sql
3271 03-02-2013 22:19 apex/apxxepwd.sql
13889 06-18-2011 00:08 apex/apexvalidate.sql
--------- -------
989017663 12307 files
[oracle@test12c ~]$ ls -la apex_4.2.3.zip
-rw-r--r--. 1 oracle oinstall 162660590 Sep 18 13:15 apex_4.2.3.zip
[oracle@test12c ~]$ cd /tmp/
[oracle@test12c tmp]$ man unzip
[oracle@test12c tmp]$ unzip /home/oracle/apex_4.2.3.zip ^C
[oracle@test12c tmp]$ pwd
/tmp
[oracle@test12c tmp]$ cd apex/
[oracle@test12c apex]$ ls
apex_epg_config_con.sql apex_rest_config.sql apxdevrm.sql apxexit.sql apxremov2.sql apxxepwd.sql images
apex_epg_config_core.sql apexvalidate.sql apxdvins_con.sql apxldimg_con.sql apxremov_con.sql builder load_trans.sql
apex_epg_config.sql appins.sql apxdvins.sql apxldimg.sql apxremov.sql catapx.sql owa
apexins_con.sql apxchpwd.sql apxe101.sql apxpatch.sql apxrtins_con.sql core utilities
apexins.sql apxconf.sql apxe102.sql apxprereq.sql apxrtins.sql coreins.sql
apex_rest_config_con.sql apxdbmig.sql apxe111.sql apxrelod.sql apxsqler.sql devins.sql
apex_rest_config_core.sql apxdevrm_con.sql apxe112.sql apxremov1.sql apxxemig.sql endins.sql
[oracle@test12c apex]$
[oracle@test12c apex]$ ls -l apexins_con.sql
-rw-r--r--. 1 oracle oinstall 2042 Aug 31 13:38 apexins_con.sql
[oracle@test12c apex]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Wed Sep 18 14:12:33 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> @apexins_con.sql SYSAUX SYSAUX TEMP /i/
PL/SQL procedure successfully completed.
Performing installation in multitenant container database in the background.
The installation progress is spooled into apexins_con*.log files.
Please wait...
Installation completed. Log files for each container can be found in:
apexins_con*.log
You can quickly scan for ORA errors or compilation errors by using a utility
like grep:
grep ORA- *.log
grep PLS- *.log
SQL> select CON_ID, NAME, OPEN_MODE from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
2 PDB$SEED READ ONLY
3 PDB_OPUN READ WRITE
SQL> select COMP_ID, VERSION, CON_ID from cdb_registry where COMP_ID='APEX';
COMP_ID VERSION CON_ID
------------------------------ ------------------------------ ----------
APEX 4.2.3.00.08 1
APEX 4.2.3.00.08 2
APEX 4.2.3.00.08 3
SQL> alter session set container = PDB_OPUN;จากนั้นก็ได้เวลาติดตั้ง Embedded PL/SQL Gateway
Session altered.
SQL> @apxconf
PORT
----------
8080
Enter values below for the XDB HTTP listener port and the password for the Application Express ADMIN user.
Default values are in brackets [ ].
Press Enter to accept the default value.
Enter a value below for the password for the Application Express ADMIN user.
Enter a password for the ADMIN user []
Session altered.
...changing password for ADMIN
PL/SQL procedure successfully completed.
Enter a port for the XDB HTTP listener [ 8080] 8000
...changing HTTP Port
PL/SQL procedure successfully completed.
SQL>
SQL> ALTER SESSION SET CONTAINER = CDB$ROOT;
Session altered.
SQL> ALTER USER ANONYMOUS IDENTIFIED BY PASSWORD ACCOUNT UNLOCK;
User altered.
SQL> select con_id, account_status from cdb_users where username='ANONYMOUS';
CON_ID ACCOUNT_STATUS
---------- --------------------------------
3 OPEN
2 EXPIRED & LOCKED
1 OPEN
SQL>
SQL> !lsnrctl status |grep 8000
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test12c)(PORT=8000))(Presentation=HTTP)(Session=RAW))
SQL>
[oracle@test12c apex]$ ls -l apex_epg_config_con.sqlหลังจากนั้นทดสอบเรียกจาก Browser ...
-rw-r--r--. 1 oracle oinstall 2130 Aug 31 13:38 apex_epg_config_con.sql
[oracle@test12c apex]$ ls -l apex_epg_config.sql
-rw-r--r--. 1 oracle oinstall 831 Apr 6 13:09 apex_epg_config.sql
[oracle@test12c apex]$
[oracle@test12c apex]$
[oracle@test12c apex]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Wed Sep 18 18:21:05 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> alter session set container = PDB_OPUN;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PDB_OPUN
SQL> @apex_epg_config /tmp
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
. Loading images directory: /tmp/apex/images
Directory created.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Commit complete.
Directory dropped.
timing for: Load Images
Elapsed: 00:02:13.11
PL/SQL procedure successfully completed.
Commit complete.
SQL>
SQL> conn / as sysdbaอ่านเพิ่มเติม http://docs.oracle.com/cd/E16655_01/install.121/e17958/toc.htm
Connected.
SQL> alter session set container=pdb_opun;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PDB_OPUN
SQL> DECLARE
2 ACL_PATH VARCHAR2(4000);
3 BEGIN
4 -- Look for the ACL currently assigned to '*' and give APEX_040200
5 -- the "connect" privilege if APEX_040200 does not have the privilege yet.
6
7 SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
8 WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
9
10 IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200',
11 'connect') IS NULL THEN
12 DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
13 'APEX_040200', TRUE, 'connect');
14 END IF;
15
16 EXCEPTION
17 -- When no ACL has been assigned to '*'.
18 WHEN NO_DATA_FOUND THEN
19 DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
20 'ACL that lets power users to connect to everywhere',
21 'APEX_040200', TRUE, 'connect');
22 DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
23 END;
24 /
COMMIT;
PL/SQL procedure successfully completed.
SQL>
Commit complete.
SQL>
SQL> select CON_ID, NAME, OPEN_MODE from v$pdbs;หลังจากนั้นอัพเดทรูปใน CDB ถ้าใช้ Embedded PL/SQL Gateway.
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
2 PDB$SEED READ ONLY
3 TESTPDB01 READ WRITE
SQL> select COMP_ID, VERSION, CON_ID from cdb_registry where COMP_ID='APEX';
COMP_ID VERSION CON_ID
------------------------------ ------------------------------ ----------
APEX 4.2.0.00.27 1
APEX 4.2.0.00.27 2
APEX 4.2.0.00.27 3
[oracle@test12c ~]$ ls -l p17347169_423_Generic.zip
-rw-r--r--. 1 oracle oinstall 77044627 Sep 17 17:25 p17347169_423_Generic.zip
[oracle@test12c ~]$ unzip -l p17347169_423_Generic.zip |tail
1197 09-11-2013 02:16 patch/patches/4_2_3/prereq.sql
1812 07-13-2013 01:55 patch/patches/4_2_3/syspatch.sql
144074 09-17-2013 00:45 patch/readme.htm
220231 09-17-2013 00:45 patch/readme.pdf
0 09-11-2013 04:59 patch/utilities/
1621 08-31-2013 13:38 patch/utilities/reset_image_prefix.sql
2804 08-31-2013 13:38 patch/utilities/reset_image_prefix_con.sql
2575 08-31-2013 13:38 patch/utilities/reset_image_prefix_core.sql
--------- -------
184039056 11743 files
[oracle@test12c ~]$ unzip -l p17347169_423_Generic.zip
[oracle@test12c ~]$ ls patch/
apex_rest_config_con.sql apex_rest_config.sql apxldimg.sql apxpatch.sql images readme.htm utilities
apex_rest_config_core.sql apxldimg_con.sql apxpatch_con.sql core patches readme.pdf
[oracle@test12c ~]$ cd patch/
[oracle@test12c patch]$
[oracle@test12c patch]$ ls -l apxpatch_con.sql
-rw-r--r--. 1 oracle oinstall 2496 Aug 31 13:38 apxpatch_con.sql
[oracle@test12c patch]$ pwd
/home/oracle/patch
[oracle@test12c patch]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Tue Sep 17 22:32:46 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> @apxpatch_con.sql
PL/SQL procedure successfully completed.
Performing installation in multitenant container database in the background.
The installation progress is spooled into *patch_con*.log files.
Please wait...
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
timing for: Complete Patch
Elapsed: 01:29:21.57
Installation completed. Log files for each container can be found in:
syspatch_con*.log
ddlpatch_con*.log
deppatch_con*.log
corepatch_con*.log
You can quickly scan for ORA errors or compilation errors by using a utility
like grep:
grep ORA- *.log
grep PLS- *.log
SQL>
SQL> !grep ORA- *.log
SQL> !grep PLS- *.log
SQL> select COMP_ID, VERSION, CON_ID from cdb_registry where COMP_ID='APEX';
COMP_ID VERSION CON_ID
------------------------------ ------------------------------ ----------
APEX 4.2.3.00.08 1
APEX 4.2.3.00.08 3
APEX 4.2.3.00.08 2
SQL> @apxldimg_con.sql /home/oracle/patch
PL/SQL procedure successfully completed.
Performing installation in multitenant container database in the background.
The installation progress is spooled into apxldimg_con*.log files.
Please wait...
/bin/bash: -c: line 0: syntax error near unexpected token `&'
/bin/bash: -c: line 0: `&OH_HOME/perl/bin/perl -I &OH_HOME/rdbms/admin &OH_HOME/rdbms/admin/catcon.pl -b apxldimg_con apxldimg.sql --p&1'
Installation completed. Log files for each container can be found in:
apxldimg_con*.log
You can quickly scan for ORA errors or compilation errors by using a utility
like grep:
grep ORA- *.log
grep PLS- *.log
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@test12c patch]$ less apxldimg_con.sql
[oracle@test12c patch]$ less apxpatch_con.sql
[oracle@test12c patch]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Wed Sep 18 00:08:06 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> @apxldimg_con.sql /home/oracle/patch
PL/SQL procedure successfully completed.
Performing installation in multitenant container database in the background.
The installation progress is spooled into apxldimg_con*.log files.
Please wait...
Installation completed. Log files for each container can be found in:
apxldimg_con*.log
You can quickly scan for ORA errors or compilation errors by using a utility
like grep:
grep ORA- *.log
grep PLS- *.log
SQL>
SQL> ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK- จากนั้น ก๊อปปี้ images โฟล์เดอรไปที่ในที่ต้องการ (จากครั้งที่แล้ว Oracle HTTP server ผมอยู่ที่ /u01/app/oracle/Middleware/Oracle_WT1/instances/instance1/config ... งั้นผมขอที่นี่ละกัน แต่จริงๆไม่ใช่ปัญหา เพราะอย่างไรเราก็ต้องเซต Alias อยู่ดี)
2 ;
User altered.
SQL> alter user APEX_PUBLIC_USER identified by password;
User altered.
SQL> CREATE PROFILE APEX_PROFILE LIMIT PASSWORD_LIFE_TIME UNLIMITED ;
Profile created.
SQL> select * from dba_profiles where profile='APEX_PROFILE';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
APEX_PROFILE COMPOSITE_LIMIT KERNEL DEFAULT
APEX_PROFILE SESSIONS_PER_USER KERNEL DEFAULT
APEX_PROFILE CPU_PER_SESSION KERNEL DEFAULT
APEX_PROFILE CPU_PER_CALL KERNEL DEFAULT
APEX_PROFILE LOGICAL_READS_PER_SESSION KERNEL DEFAULT
APEX_PROFILE LOGICAL_READS_PER_CALL KERNEL DEFAULT
APEX_PROFILE IDLE_TIME KERNEL DEFAULT
APEX_PROFILE CONNECT_TIME KERNEL DEFAULT
APEX_PROFILE PRIVATE_SGA KERNEL DEFAULT
APEX_PROFILE FAILED_LOGIN_ATTEMPTS PASSWORD DEFAULT
APEX_PROFILE PASSWORD_LIFE_TIME PASSWORD UNLIMITED
APEX_PROFILE PASSWORD_REUSE_TIME PASSWORD DEFAULT
APEX_PROFILE PASSWORD_REUSE_MAX PASSWORD DEFAULT
APEX_PROFILE PASSWORD_VERIFY_FUNCTION PASSWORD DEFAULT
APEX_PROFILE PASSWORD_LOCK_TIME PASSWORD DEFAULT
APEX_PROFILE PASSWORD_GRACE_TIME PASSWORD DEFAULT
16 rows selected.
SQL> select * from dba_profiles where profile='DEFAULT';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED
DEFAULT CPU_PER_CALL KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED
DEFAULT IDLE_TIME KERNEL UNLIMITED
DEFAULT CONNECT_TIME KERNEL UNLIMITED
DEFAULT PRIVATE_SGA KERNEL UNLIMITED
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7
16 rows selected.
SQL> alter user APEX_PUBLIC_USER profile APEX_PROFILE;
User altered.
SQL>
SQL> conn APEX_PUBLIC_USER
Enter password:
Connected.
SQL>
$ cp -rf images /u01/app/oracle/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1- ตามด้วยการแก้ไข dads.conf ไฟล์ แล้ว restart Oracle HTTP server
$ vi /u01/app/oracle/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1/mod_plsql/dads.conf
$ cat /u01/app/oracle/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1/mod_plsql/dads.conf
# ============================================================================
# mod_plsql DAD Configuration File
# ============================================================================
# 1. Please refer to dads.README for a description of this file
# ============================================================================
# Note: This file should typically be included in your plsql.conf file with
# the "include" directive.
# Hint: You can look at some sample DADs in the dads.README file
# ============================================================================
Alias /i/ "/u01/app/oracle/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1/images/"
<Location /pls/apex>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString localhost:1521:orcl
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword password
PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
Allow from all
</Location>
$ export ORACLE_HOME=/u01/app/oracle/Middleware/Oracle_WT1- หลังจากนั้นลองเรียกการใช้งานด้วย http://IP:7777/pls/apex มันควรที่จะต้องโชว์ผลลัพธ์ดังรูปข้างล่าง
$ export ORACLE_INSTANCE=/u01/app/oracle/Middleware/Oracle_WT1/instances/instance1
$ /u01/app/oracle/Middleware/Oracle_WT1/opmn/bin/opmnctl status
Processes in Instance: instance1
---------------------------------+--------------------+---------+---------
ias-component | process-type | pid | status
---------------------------------+--------------------+---------+---------
ohs1 | OHS | 5611 | Alive
$ /u01/app/oracle/Middleware/Oracle_WT1/opmn/bin/opmnctl stopproc ias-component=ohs1
opmnctl stopproc: stopping opmn managed processes...
$ /u01/app/oracle/Middleware/Oracle_WT1/opmn/bin/opmnctl startproc ias-component=ohs1
opmnctl startproc: starting opmn managed processes...
$ /u01/app/oracle/Middleware/Oracle_WT1/opmn/bin/opmnctl status
Processes in Instance: instance1
---------------------------------+--------------------+---------+---------
ias-component | process-type | pid | status
---------------------------------+--------------------+---------+---------
ohs1 | OHS | 5841 | Alive
$
- ถ้าใช้ APEX 4.2 หรือ 4.2.1 สามารถใช้ patch number 16277995 จาก support.oracle.com (ถ้าไม่มี user บน My Oracle Support ก็จบกัน... download APEX 4.2.2 เลยละกัน)
- ถ้าใช้ APEX 4.1.1 หรือ ต่ำกว่านั้น (including Oracle HTML DB release 1.5) ก็ต้อง download APEX 4.2.2แต่ในบนความนี้ผมขอใช้ Patch: 16277995 ...Read!
- ถ้าไม่เคยติดติดตั้งเลย ก็ download APEX 4.2.2
SQL> select comp_id, version from dba_registry where comp_id='APEX';ผมใช้ Embed Gateway เลย stop มันสักหน่อย ต่อด้วยแบคอัพ APEX_040200 และ FLOWS_FILES
COMP_ID VERSION
------------------------------ ------------------------------
APEX 4.2.0.00.27
$ ls -la p16277995_422_Generic.zipเราสามารถตรวจสอบ error ได้ที่ไฟล์ apxpatch.log ต่อจากนั้นอัพเดท Images... เนื่องจากผมใช้ Embed Gateway เลยต้องใช้ apxldimg.sql script.
-rw-r--r-- 1 oracle oinstall 73892800 Apr 29 17:43 p16277995_422_Generic.zip
$ unzip p16277995_422_Generic.zip
$ cd patch/
$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 29 18:00:21 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> !ls -la apxpatch.sql
-rw-r--r-- 1 oracle oinstall 398 Feb 24 04:08 apxpatch.sql
SQL> @apxpatch.sql
.
.
.
...Database user "SYS", database schema "APEX_040200", user# "66" 18:38:49
...Compiled 0 out of 3001 objects considered, 0 failed compilation 18:38:51
...266 packages
...258 package bodies
...452 tables
...11 functions
...16 procedures
...3 sequences
...457 triggers
...1320 indexes
...208 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 18:38:51
...Completed key object existence check 18:38:51
...Setting DBMS Registry 18:38:51
...Setting DBMS Registry Complete 18:38:51
...Exiting validate 18:38:51
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
timing for: Complete Patch
Elapsed: 00:38:16.10
$ ls -l apxpatch.log
-rw-r--r-- 1 oracle oinstall 350361 Apr 29 18:39 apxpatch.log
SQL> !ls apxldimg.sql
apxldimg.sql
SQL> @apxldimg.sql /tmp/patch
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
. Loading images directory: /tmp/patch/images
Directory created.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Commit complete.
Directory dropped.
timing for: Load Images
Elapsed: 00:05:25.74
SQL> select comp_id, version from dba_registry where comp_id='APEX';เรียบร้อยครับ...
COMP_ID VERSION
------------------------------ ------------------------------
APEX 4.2.2.00.11
SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;
GETHTTPPORT
-----------
0
SQL> exec DBMS_XDB.SETHTTPPORT(8080);
PL/SQL procedure successfully completed.
SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;
GETHTTPPORT
-----------
8080
sqlplus / as sysdba SQL> select dbms_xdb.gethttpport , dbms_xdb.getftpport from dual;
GETHTTPPORT GETFTPPORT
----------- ----------
8080 0
SQL> begin
2 dbms_xdb.sethttpport('8081');
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> select dbms_xdb.gethttpport , dbms_xdb.getftpport from dual;
GETHTTPPORT GETFTPPORT
----------- ----------
8081 0