1
2
3
4
|
-- Configuring REST Service.
@apex_rest_config.sql
|
You need to query to view the APEX users in the database:
1Select
Username
from
All_Users
where
username
like
'APEX%'
;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
Declare
Acl_Path Varchar2(4000);
Begin
-- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000 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
;
If Dbms_Network_Acl_Admin.Check_Privilege(Acl_Path
,
'APEX_050000'
,
'connect'
)
Is
Null
Then
Dbms_Network_Acl_Admin.Add_Privilege(Acl_Path
,
'APEX_050000'
,
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_050000'
,
True
,
'connect'
);
Dbms_Network_Acl_Admin.Assign_Acl(
'power_users.xml'
,
'*'
);
End
;
/
Commit
;
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
Declare
Acl_Path Varchar2(4000);
Begin
-- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000
--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
;
If Dbms_Network_Acl_Admin.Check_Privilege(Acl_Path
,
'APEX_050000'
,
'connect'
)
Is
Null
Then
Dbms_Network_Acl_Admin.Add_Privilege(Acl_Path
,
'APEX_050000'
,
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_050000'
,
True
,
'connect'
);
Dbms_Network_Acl_Admin.Assign_Acl(
'power_users.xml'
,
'*'
);
End
;
/
Commit
;
|
1
2
3
4
5
6
7
8
9
10
|
-- Sử dụng cho Oracle 12c.
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host =>
'*'
,
ace => xs$ace_type(privilege_list => xs$name_list(
'connect'
),
principal_name =>
'APEX_050000'
,
principal_type => xs_acl.ptype_db));
END
;
/
|
Note: you must sure that you have installed Jave version 7 or higher and declare PATH variable. You can see how to install Java at:
- Installing and Configuring Java
Add the path to bin folder of Java at the end of PATH
- ;C:\DevPrograms\Java\jdk1.8.0_65\bin
1
2
3
4
5
6
7
8
|
-- Disable Oracle APEX on Oracle XML DB HTTP Server.
EXEC
DBMS_XDB.SETHTTPPORT(0);
-- Note: You can enable it with command:
EXEC
DBMS_XDB.SETHTTPPORT(8080)
|
1
2
3
4
5
6
7
|
# Run command:
java -jar ords.war
# Or:
java -jar ords.war install
|
Note: You can run the command below to see the help:
1java -jar ords.war help standalone
1
|
java -jar ords.war standalone --port 8080 --apex-images C:/DevPrograms/ords/images
|
Note: If you receive an error:Unlock for APEX_PUBLIC_USER user
12345678Column
username format a25;
Column
account_status format a25;
-- Query unlocked APEX user.
select
username,account_status
from
dba_users
where
lock_date
is
not
null
and
username
like
'APEX%'
;
1Alter
user
APEX_PUBLIC_USER account unlock;