Oracle APEX 3.2 安装

前几时帮朋友安装了一个APEX 3.2环境,参照网上的文档和官方文档进行安装,顺利完成。

APEX安装前的准备

登录系统:sqlplus system/0621
1.  
从数据字典v$instance中获取数据库的实例名和版本号:

SQL> conn system/oracle

Connected.

SQL> show user;

USER is "SYSTEM"

SQL> select instance_name,version from v$instance;

 

INSTANCE_NAME    VERSION

---------------- -----------------

ORCL             11.1.0.6.0

 

2.        从数据字典v$version中获取版本的详细信息:

SQL> select * from v$version;

 

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

PL/SQL Release 11.1.0.6.0 - Production

CORE    11.1.0.6.0      Production

TNS for Linux: Version 11.1.0.6.0 - Production

NLSRTL Version 11.1.0.6.0 – Production

 

3.确认oracle所使用的参数文件是否为二进制的参数文件(spfile表明为二进制文件):

SQL> show parameter pfile

 

NAME                           TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                              string      /u01/oracle/dbs/spfileORCL.ora        


4.
确认oracle是否使用的是自动内存管理:

SQL> show parameter memory_target

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

memory_target                        big integer 396M


5.
查看表空间是否为自动扩展:

SQL> select tablespace_name, autoextensible from dba_data_files;

 

TABLESPACE_NAME                AUT

------------------------------ ---

USERS                          YES

UNDOTBS1                       YES

SYSAUX                         YES

SYSTEM                         YES

EXAMPLE                        YES

PEIHU                          NO

PEIHU                          YES

 

7 rows selected.

 

嵌入式PL/SQL网关配置

使用嵌入式PL/SQL网关(也称连接器,Gateway)安装和配置Oracle Application Express的具体步骤如下:
1.      
安装Oracle Application Express.

1.1先进入到APEX的解压根目录

我的目录是/u01/apex(这个一定要做,否则等下无法正确安装)

[oracle@oracle11g ~]$ cd /u01/apex

[oracle@oracle11g apex]$ ls

apex_epg_config_core.sql  apxe111.sql   core

apex_epg_config.sql       apxldimg.sql  coreins.sql

apexins.sql               apxpatch.sql  devins.sql

apexvalidate.sql          apxrelod.sql  doc

apxchpwd.sql              apxremov.sql  endins.sql

apxconf.sql               apxrtins.sql  images

apxdbmig.sql              apxsqler.sql  install2011-03-14_01-45-58.log

apxdevrm.sql              apxxemig.sql  load_trans.sql

apxdvins.sql              apxxepwd.sql  owa

apxe101.sql               builder       utilities

apxe102.sql               catapx.sql

 

1.2然后用SYS身份登陆

SQL> conn / as sysdba

Connected.

SQL> show user

USER is "SYS"

 

1.3安装脚本

SQL> @apexins SYSAUX SYSAUX TEMP /i/

 

其中:apexins为安装脚本文件名称

SYSAUX SYSAUX 第一个SYSAUX为数据存放的表空间,第二个为用户信息存放表空间

TEMP为排序所用的表空间

/i/表示EXPRESS中存放的虚拟目录

 

1.4检查是否安装完毕

SQL> select username,created from dba_users     

  2  where username like 'APEX%';

 

USERNAME                       CREATED

------------------------------ ---------

APEX_030200                    14-MAR-11

APEX_PUBLIC_USER               03-AUG-07

 

SQL> select username,created from dba_users  where username like 'FLOW%';

 

USERNAME                       CREATED

------------------------------ ---------

FLOWS_FILES                    03-AUG-07

FLOWS_030000                   03-AUG-07


2.      
修改Admin帐户密码

SQL> @apxchpwd

Enter a value below for the password for the Application Express ADMIN user.

 

Enter a password for the ADMIN user              []

输入你的密码:oracle

Session altered.

...changing password for ADMIN

 

PL/SQL procedure successfully completed.

Commit complete.

 


3.      
配置嵌入式PL/SQL网关。

SQL> @apex_epg_config  /u01/apex

 

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

 

Directory created.

 

declare

*

ERROR at line 1:

ORA-22288: file or LOB operation FILEOPEN failed

No such file or directory

ORA-06512: at "SYS.XMLTYPE", line 296

ORA-06512: at line 18

 

Commit complete.

 

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

 

timing for: Load Images

Elapsed: 00:00:03.68

Session altered.

 

PL/SQL procedure successfully completed.

Commit complete.

Session altered.

Directory dropped.

 

错误原因是目录不对。解决办法:
/tmp 为你解压apex后所在的目录,例如我的是:/u01/apex,那么/tmp/u01

文档做了注释,但地方不对,在@apxldimg.sql是有如下说明:

引用

Tip:
The above examples assume that you unzipped Oracle Application Express in a directory called TEMP on Windows and tmp on UNIX or Linux.

 

纠正后如下:

SQL> @apex_epg_config  /u01

 

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:01:45.40

Session altered.

 

PL/SQL procedure successfully completed.

Commit complete.

Session altered.

Directory dropped.

 

4.   核实和开启Oracle XML DB HTTP服务器的端口。

4.1查看端口是否开启,为0未开启,大于0表示开启

SQL> select DBMS_XDB.GETHTTPPORT FROM DUAL;

 

GETHTTPPORT

-----------

          0

42开启制定端口

SQL> exec DBMS_XDB.SETHTTPPORT(8080);

PL/SQL procedure successfully completed.

 

4.3 再次查询

SQL>  select DBMS_XDB.GETHTTPPORT FROM DUAL;

GETHTTPPORT

-----------

       8080


5.  
开启Oracle 11g数据库中的网络服务

SQL中运行开启网络服务语句如下:

SQL>

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-44416: Invalid ACL: Unresolved principal 'APEX_030200'

  -- ORA-06512: 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;

/

 

PL/SQL procedure successfully completed.

 

6.将用户解锁

SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;

 

User altered.

 

7.               安装中文语言。

[oracle@oracle11g ~]$ set NLS_LANG=American_America.AL32UTF8

[oracle@oracle11g ~]$ sqlplus / as sysdba

SQL> ALTER SESSION SET CURRENT_SCHEMA = APEX_030200;

 

Session altered

SQL> @/u01/oracle/apex/builder/zh-cn/load_zh-cn.sql


8.      
设置JOB_QUERY_PROCESS参数。

    查看参数值:
    
SQL> SELECT VALUE FROM v$parameter WHERE NAME ='job_queue_processes';
VALUE
---------------------------------------------------
1000

 

得到的值如果为20以上,则无需更改,否则更改命令如下

    SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 100

 


9.      
配置SHARED_SERVER参数。

SQL> ALTER SYSTEM SET SHARED_SERVERS = 5 SCOPE=BOTH;

SQL> show parameter shared_servers;

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

max_shared_servers                   integer

shared_servers                       integer     5

 

开启数据库监听和数据库EM

[oracle@oracle11g ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 14-MAR-2011 05:04:28

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Starting /u01/oracle/bin/tnslsnr: please wait...

 

TNSLSNR for Linux: Version 11.1.0.6.0 - Production

System parameter file is /u01/oracle/network/admin/listener.ora

Log messages written to /u01/diag/tnslsnr/oracle11g/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g)(PORT=1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle11g)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.1.0.6.0 - Production

Listener Parameter File   /u01/oracle/network/admin/listener.ora

Listener Log File         /u01/diag/tnslsnr/oracle11g/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

The listener supports no services

The command completed successfully

 

[oracle@oracle11g ~]$ emctl start dbconsole

Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0

Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.

https://oracle11g:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ............. started.

------------------------------------------------------------------

Logs are generated in directory /u01/oracle/oracle11g_ORCL/sysman/log

 

设置本地环境

1.       登陆APEX管理服务

 

 输入网址登陆

附件为:官方下载文档和网上参考文档

你可能感兴趣的:(Oracle,DBA)