ITPub博客

首页 > 数据库 > Oracle > Oracle Application Express 4.2.1 安装指南

Oracle Application Express 4.2.1 安装指南

Oracle 作者:yxt566162 时间:2014-03-09 17:13:31 0 删除 编辑
   
--------------------〉注:oracle 11g R2自带有apex 安装文件 位于 

¥ORACLE_HOME/

一、安装需求
  浏览器要求支持 JavaScript 、HTML4.0、 CSS 1.0。一般的IE 6.0、

Firefox 1.0都支持。

  HTTP服务器需求:
      Pl/SQL gateway 启用
      Oracle HTTP Server and mod_plsql
Oracle XML DB HTTP Server with the embedded PL/SQL gateway installs 

with Oracle Database 11g. It provides the database with a Web server 

and also the necessary infrastructure to create dynamic 

applications.

Oracle Application Express requires the shared_pool_size of the 

target database to be at least 100 MB.

  磁盘空间需求:
       安装APEX 软件需要              450MB
       安装apex 的表空间需要          100MB
       SYSTEM表空间需要                85MB
       对于一种语言支持,表空间还需要  30MB

二、开始安装apex

我们可以打开 apexins.sql文件查看里边的内容:
例如我的 apex_4.2.1 / apexins.sql 文件里边的注释部分就将的很清楚,应

该怎么安装apex
-------------------------------
[oracle@node20 apex]$ cat apexins.sql 
Rem  Copyright (c) Oracle Corporation 1999 - 2012. All Rights 

Reserved.
Rem
Rem    NAME
Rem      apexins.sql
Rem
Rem    DESCRIPTION
Rem
Rem    NOTES
Rem      Assumes the SYS user is connected.            -----〉要求以

Sys用户连接数据库 并且打开数据库实例
Rem
Rem    REQUIREMENTS                                    ------〉要安

装这个版本apex,对数据最低要求
Rem      - Oracle Database 10.2.0.3 or later
Rem
Rem    Arguments:     ------〉(下

边:example)执行apexins.sql 文件是参数描述
Rem     Position 1: Name of tablespace for Application Express 

application user     -----〉第一个 SYSAUX
Rem     Position 2: Name of tablespace for Application Express files 

user           -----〉第二个 SYSAUX
Rem     Position 3: Name of temporary tablespace or tablespace group 

               -----〉指定临时表空间或临时表空间组TEMP
Rem     Position 4: Virtual directory for APEX images

   -----〉开发用到图片的虚拟目录位置
Rem
Rem    Example:
Rem
Rem    1)Local
Rem      sqlplus "sys/syspass as sysdba" @apexins SYSAUX SYSAUX TEMP 

/i/
Rem
Rem    2)With connect string
Rem      sqlplus "sys/syspass@10g as sysdba" @apexins SYSAUX SYSAUX 

TEMP /i/
Rem
Rem    MODIFIED   (MM/DD/YYYY)
Rem      jkallman  09/10/2004 - Created
Rem      jstraub   10/25/2004 - Changed the name of the log file to 

end in .log and include date/time
Rem      jkallman  01/04/2005 - Adjusted APPUN to FLOWS_020000
Rem      jduan     07/07/2005 - Modify for upgrade to 2.0
Rem      jkallman  09/14/2005 - Adjusted APPUN to FLOWS_020100
Rem      jkallman  09/22/2005 - Add substitution variable XE
Rem      jkallman  01/23/2006 - Adjusted APPUN to FLOWS_020200
Rem      jkallman  02/28/2006 - Copied from original htmldbins.sql
Rem      jstraub   06/27/2006 - Added exit logic if XE
Rem      jstraub   08/11/2006 - Changed calling coreins with new 

prefix parameter
Rem      jkallman  09/29/2006 - Adjusted APPUN to FLOWS_030000
Rem      jkallman  02/15/2007 - Remove XE check
Rem      jstraub   02/21/2007 - Removed 6th positional connect 

parameter
Rem      jstraub   04/10/2007 - Added INSTALL_TYPE parameter for use 

with dynamically setting WHENEVER SQLERROR exit in coreins
Rem      jkallman  08/02/2007 - Change FLOWS_030000 references to 

FLOWS_030100
Rem      jstraub   08/16/2007 - Removed password as positional 

parameter and made random
Rem      jstraub   09/14/2007 - Updated comments to reflect correct 

number of arguments and updated examples
Rem      jstraub   12/19/2007 - Added logic to exit if not connected 

as SYSDBA
Rem      jstraub   01/10/2008 - Added prerequisite checks for XDB 

and CONTEXT
Rem      jstraub   02/08/2008 - Added alter session set 

nls_length_semantics = byte
Rem      jkallman  07/08/2008 - Change FLOWS_030100 references to 

FLOWS_040000
Rem      jkallman  10/02/2008 - Change FLOWS_040000 references to 

APEX_040000
Rem      mhichwa   10/15/2008 - Changed comments, no functional 

changes
Rem      jstraub   02/18/2009 - Added version already installed to 

prerequisite checks
Rem      jstraub   03/24/2009 - Added spool off, removed from 

coreins.sql for catupgrd
Rem      jkallman  06/01/2009 - Added DB version check
Rem      jkallman  06/08/2009 - Removed DB version check
Rem      jstraub   07/14/2010 - Added DB version check
Rem      jkallman  11/22/2010 - Change APEX_040000 references to 

APEX_040100
Rem      jkallman  05/23/2011 - Removed prerequisite check for 

Oracle Text
Rem      jstraub   12/05/2011 - Added checks for tablespace 

arguments
Rem      pawolf    02/21/2012 - Changed APEX_040100 references to 

APEX_040200
Rem      jstraub   04/16/2012 - Changed temporary tablespace check 

to include tablespace groups (bug 13857152)
Rem      jkallman  06/08/2012 - Change NLS_LENGTH_SEMANTICS = CHAR 

(Feature 770)
Rem      vuvarov   06/26/2012 - Call apxprereq.sql to check 

installation prerequisites (bug 14211939)
Rem      jstraub   08/09/2012 - Changed length of rnd_pwd to 60, 

causing buffer to small in some instances
Rem      jstraub   08/14/2012 - Removed exit
Rem      jstraub   08/16/2012 - Made exit conditional
Rem      jkallman  08/16/2012 - Reverted NLS_LENGTH_SEMANTICS = CHAR 

modifications
Rem      jkallman  11/08/2012 - Avoid multiple bind variables in 

same block (Bug 12381658)
-------------------------------

首先创建一个数据库(如果没有实例,但是这个实例不需要任何sample数据,

还需要监听器)
++++++
unzip apex_4.2.1.zip  -----> 这个文件夹待会儿有用处,所有应该把这个

文件夹规划好位置;我把这个解压出来的文件直接Mv到了安装oracle的BASE 

目录下去了。
++++++
进入解压好的apex目录  cd apex
++++++
链接到数据库实例    sqlplus / as sysdba
++++++
启动数据库:startup 
++++++
执行脚本程序安装apex :SQL〉@apexins SYSAUX SYSAUX TEMP /i/
    ---- 注:SYSAUX 为使用的表空间的名字
               TEMP  为使用的临时表空间或者临时表空间组的名字
                /i/ 参数
该脚本估计会有半个小时的运行时间,更具你机器配置而定。

PL/SQL procedure successfully completed.

timing for: Validate Installation
Elapsed: 00:00:01.02
old   1: alter session set current_schema = ^APPUN
new   1: alter session set current_schema = APEX_040200

Session altered.

timing for: Complete Installation
Elapsed: 00:25:19.84

PL/SQL procedure successfully completed.

++++++
执行脚本修改密码:给ADMIN(用于登陆APEX)用户的密码
    @apxchpwd    
               Wellcome_2      //----登陆以后密码会强制要求更改
*************
SQL> @apxchpwd             
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.
++++++
启用Pl/SQL gateway 
   我的APEX 是解压在/oapex/apex   的所以我的输入就是:

   @apex_epg_config /oapex    
****************
SQL> @apex_epg_config /oapex

PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Directory created.
PL/SQL procedure successfully completed.
Commit complete.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
timing for: Load Images
Elapsed: 00:02:28.09
Session altered.
PL/SQL procedure successfully completed.
Commit complete.
Session altered.
Directory dropped.
++++++
解锁用户
     ALTER USER ANONYMOUS ACCOUNT UNLOCK;
*************
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;
User altered.
++++++
设置 Oracle XML DB HTTP ServerPort

      SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

      EXEC DBMS_XDB.SETHTTPPORT(8888);
*********
SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;
GETHTTPPORT
-----------
 0
SQL> EXEC DBMS_XDB.SETHTTPPORT(8888);
     PL/SQL procedure successfully completed.
SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

GETHTTPPORT
-----------
       8888
++++++
赋予用户相应的权限:
     
--------------
DECLARE  
  ACL_PATH  VARCHAR2(4000);  
  ACL_ID    RAW(16);  
BEGIN  
  -- Look for the ACL currently assigned to '*' and give APEX_030200 

 
  -- the "connect" privilege if APEX_030200 does not have the 

privilege yet.  
   
  SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS  
   WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;  
   
  -- Before checking the privilege, ensure that the ACL is valid  
  -- (for example, does not contain stale references to dropped 

users).  
  -- If it does, the following exception will be raised:  
  --  
  -- ORA-20000ORA-29855ORA-44416ORA-06512ORA-44416ORA-06512ORA-

44416ORA-20000ORA-29855ORA-44416ORA-06512ORA-44416ORA-06512ORA-

44416: Invalid ACL: Unresolved principal 'APEX_030200'  
  -- : at "XDB.DBMS_XDBZ", line ...  
  --  
  SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO 

ACL_ID  
    FROM XDB.XDB$ACL A, PATH_VIEW P  
   WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND  
         EQUALS_PATH(P.RES, ACL_PATH) = 1;  
   
  DBMS_XDBZ.ValidateACL(ACL_ID);  
   IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 

'APEX_030200',   
     'connect') IS NULL THEN   
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,   
     'APEX_030200', TRUE, 'connect');   
  END IF;  
   
EXCEPTION  
  -- When no ACL has been assigned to '*'.  
  WHEN NO_DATA_FOUND THEN  
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',  
    'ACL that lets power users to connect to everywhere',  
    'APEX_030200', TRUE, 'connect');  
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');  
END;  
/  
COMMIT; 
--------------
**************************************************
*                                        *********
**     注意一定到等到  Commit complete.     ******
****这几个字出现,才算真的完成,不要急于验证。****
******                                         ***
**************************************************
………………………
好了做到这一步如果没有报任何错误的话,apex就算安装好了,接下来我们就

验证一下吧:

三、验证安装是否成功

    安装完之后:

    (1)shutdown Oracle DB: SQL>shutdown immediate 

    (2)重新启动Oracle database listener:

        cd $ORACLE_HOME

        ./lsnrctl start

    (3)启动Oracle DB SQL>startup

    1.管理界面

    http://localhost:8888/apex/apex_admin 
等近取之后呢, 会要求修改密码。


    admin/Welcome_2    -----> Oracle_11g

密码修改了以后这里有个workspace:INTERNAL
     输入你刚才的密码,就可以进去管理员界面了。 

    2.开发界面

    http://localhost:8888/apex

——————————————————————
    Ok,就到这了,尽情的享受Apex 带来开发web 应用的快感吧。
<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23062054/viewspace-1114772/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-12-22