我采用的是開發環境的安裝, 當然,在產品環境,可以選擇Runtime environment 模式安裝, sql 腳本換成 @apxrtins.sql
之前創建的兩個表空間將tablespace_apex, tablespace_files 替換如下:
@apexins.sqlAPEX APEX_FILES TEMP /i/
這一步會花一段時間安裝完如果一切安裝順利的話, 就會出現和截圖一樣
當安裝完後, 一下三個schema 會被創建,有空的話,可以查看驗證下
■ APEX_050000 - The account that owns the Oracle Application Express schema and
metadata.
■ FLOWS_FILES - The account that owns the Oracle Application Express uploaded
files.
■ APEX_PUBLIC_USER - The minimally privileged account is used for Oracle
Application Express configuration with Oracle REST Data Services or Oracle
HTTP Server and mod_plsql.
5, 運行apxchpwd.sql, 它的作用如下, 就是設置APEX的超級管理員。 運行完後, 重啟數據庫。
Running the apxchpwd.sql script enables your to create or update your Instance
Administrator account. You must run the apxchpwd.sql script in the following
scenarios:
■ New Oracle Application Express installations - Run apxchpwd.sql to create an
Instance Administrator account and password.
■ Converting of a runtime environment to a development environment - Run
apxchpwd.sql to change the Instance Administrator account password.
■ Changing Your Instance Administrator Password -Run apxchpwd.sql to change
the password for an existing Instance Administrator account.
■ Unlocking Your Instance Administrator Account - Run apxchpwd.sql to unlock
an existing Instance Administrator account.
6, 設置APEX_PUBLIC_USER, 為了下面配置ORDS 用
解鎖
SQL>ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK
重置密碼
SQL>alter user apex_public_user identified by apex_public_user
7, 安裝配置Oracle Rest Data Services(ORDS)
下載地址:http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/
index.html
下載完後, 解壓指定好的安裝目錄。 解壓完後, 你可以發現ORDS這個就是個war包
7.1 Disabling Oracle XML DB Protocol Server
SQL>EXEC DBMS_XDB.SETHTTPPORT(0);
SQL>
7.2 configure RESTful Services in Oracle Application ExpressSQL>@apex_rest_config.sql
When configuring RESTful Services in OracleApplication Express, it creates two
new database accounts.
■ APEX_LISTENER - The account used to query RESTfulServices definitions
stored in Oracle Application Express.
■ APEX_REST_PUBLIC_USER - The account used whencalling RESTful Services
definitions stored in Oracle Application Express.
SQL>@apex_rest_config.sql
Entera password for the APEX_LISTENER user []
Entera password for the APEX_REST_PUBLIC_USER user []
...createAPEX_LISTENER user
...createAPEX_REST_PUBLIC_USER user
SQL>
SQL>
7.3 Granting Connect Privileges, 這一步是賦連接的權限給web 主機, 使它能能夠與ORDS進行連接
SQL>
SQL>DECLARE
2 ACL_PATH VARCHAR2(4000);
3 BEGIN
4 --Look for the ACL currently assigned to '*' and give APEX_050000
5 --the "connect" privilege if APEX_050000 does not have the privilegeyet.
6 SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
7 WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
8 IFDBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_050000',
9 'connect') IS NULL THEN
10 DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
11 'APEX_050000', TRUE, 'connect');
12 ENDIF;
13 EXCEPTION
14 --When no ACL has been assigned to '*'.
15 WHENNO_DATA_FOUND THEN
16 DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
17 'ACLthat lets power users to connect to everywhere',
18 'APEX_050000', TRUE, 'connect');
19 DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
20 END;
21 /
COMMIT;
SQL>SQL>
7.3 Configuring Oracle Application Express Images
Copy the contents ofthe /images folder to
Where:
– is the directory location of the Oracle Application Expressdistribution.
–
7.4 Configuring Oracle REST Data Services
a, copyords.war from ordspackage to tomcat webapps directory.
b, configure REST DATA Services
cd ../
drwxrwxrwx 14 oracleoinstall 4096 Mar 27 14:04 docs
drwxrwxrwx 7 oracle oinstall 4096 Mar 27 14:04 examples
drwxrwxrwx 5 oracle oinstall 4096 Mar 27 14:04 host-manager
drwxrwxrwx 33 oracleoinstall 40960 May 11 02:56 i
drwxrwxrwx 5 oracle oinstall 4096 Mar 27 14:04 manager
-rw-r--r-- 1 oracle oinstall 28491706 May 11 20:17ords.war
drwxrwxrwx 3 oracle oinstall 4096 Mar 27 14:04 ROOT
7.5 配置ORDS連接
[oracle@localhostwebapps]$ java -jar ords.war setup
Jun 09, 201512:26:03 AM oracle.dbtools.common.config.file.ConfigurationFolderlogConfigFolder
INFO: Usingconfiguration folder: /tmp/apex
Enter the name ofthe database server [localhost]:
Enter the databaselisten port [1521]:
Enter 1 to specifythe database service name, or 2 to specify the database SID [1]:2
Enter the databaseSID [xe]:yang01
Enter the databaseuser name [APEX_PUBLIC_USER]:apex_public_user
Enter the databasepassword for apex_public_user:
Confirm password:
Enter 1 to enterpasswords for the RESTful Services database users(APEX_LISTENER,APEX_REST_PUBLIC_USER), 2 to use the same password as used forapex_public_user or, 3 to skip this step [1]:
Enter the databasepassword for APEX_LISTENER:
Confirm password:
Enter the databasepassword for APEX_REST_PUBLIC_USER:
Confirm password:
Jun 09, 201512:27:19 AM oracle.dbtools.common.config.file.ConfigurationFiles update
INFO: Updatedconfigurations: defaults, apex, apex_al, apex_rt
[oracle@localhostwebapps]$
啟用Tomcat,訪問報錯,已經檢查過,apex那3個數據賬號並沒有問題。
查了好久,注意到了頁面這一行字,此實例使用……, 與上面配置默認給的路徑
INFO: Using configuration folder: /tmp/apex,並不是一個路徑。
既然這樣,只能指定一個路徑專門放配置信息
[oracle@localhostwebapps]$ java -jar ords.war configdir
Jun 09, 201512:55:30 AM oracle.dbtools.common.config.cmds.ConfigDir execute
INFO: The config.dirsetting is not set
[oracle@localhostwebapps]$ java -jar ords.war configdir/u01/app/apache-tomcat-7.0.61/webapps/ordsconfig
Jun 09, 2015 1:01:57AM oracle.dbtools.common.config.cmds.ConfigDir execute
INFO: Set config.dirto /u01/app/apache-tomcat-7.0.61/webapps/ordsconfig in:/u01/app/apache-tomcat-7.0.61/webapps/ords.war
配置完路徑後,重新配置ORDS
[oracle@localhostwebapps]$ java -jar ords.war setup
Jun 09, 2015 1:03:05AM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Usingconfiguration folder: /u01/app/apache-tomcat-7.0.61/webapps/ordsconfig/ords
Enter the name ofthe database server [localhost]:
Enter the databaselisten port [1521]:
Enter 1 to specifythe database service name, or 2 to specify the database SID [1]:2
Enter the databaseSID [xe]:yang01
Enter the databaseuser name [APEX_PUBLIC_USER]:apex_public_user
Enter the databasepassword for apex_public_user:
Confirm password:
Enter 1 to enterpasswords for the RESTful Services database users(APEX_LISTENER,APEX_REST_PUBLIC_USER), 2 to use the same password as used forapex_public_user or, 3 to skip this step [1]:
Enter the databasepassword for APEX_LISTENER:
Confirm password:
Enter the databasepassword for APEX_REST_PUBLIC_USER:
Confirm password:
Jun 09, 2015 1:03:59AM oracle.dbtools.common.config.file.ConfigurationFiles update
INFO: Updatedconfigurations: defaults, apex, apex_al, apex_rt
[oracle@localhostwebapps]$ ll
total 27924
drwxrwxrwx 14 oracleoinstall 4096 Mar 27 14:04 docs
drwxrwxrwx 7 oracle oinstall 4096 Mar 27 14:04 examples
drwxrwxrwx 5 oracle oinstall 4096 Mar 27 14:04 host-manager
drwxrwxrwx 33 oracleoinstall 40960 May 11 02:56 i
drwxrwxrwx 5 oracle oinstall 4096 Mar 27 14:04 manager
drwxr-xr-x 6 oracle oinstall 4096 Jun 9 01:02 ords
drwxr-xr-x 3 oracle oinstall 4096 Jun 9 01:02 ordsconfig
-rw-r--r-- 1 oracle oinstall 28491732 Jun 9 01:02 ords.war
drwxrwxrwx 3 oracle oinstall 4096 Mar 27 14:04 ROOT
重啟tomcat,大功告成!
倒騰了這麼久, 給大家展示下界面,以及它的一個示例應用。 真心推薦大家研究並使用這個工具,很不錯~