Apex Install
--
-- Uninstall APEX
--
cd $ORACLE_HOME/apex
sqlplus sys as sysdba
@apxremov.sql
--
-- Install APEX 4.1
--
cd $ORACLE_BASE i.e. /local/oracle/gs/orahome/product
mkdir apex
cd apex
wget "4.1/apex_4.1.zip"
unzip apex_4.1.zip
rm apex_4.1.zip
cd apex
sqlplus sys as sysdba
Create APEX_USERS_TS tablespace 1G;
Create APEX_FILES_TS tablespace 1G;
Create APEX_TEMP_TS temp tablespace 1G; e.g. create temporary tablespace apex_temp_ts tempfile '+ATA/gd/datafile/apex_temp_ts_01.dbf' size 1G;
sqlplus sys as sysdba
@apexins apex_users_ts apex_files_ts apex_temp_ts /i/
when prompted please set the password to 'what123'
@apxchpwd
alter user anonymous account unlock;
@apex_epg_config.sql /local/oracle/orahome/product/apex
DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_040100
-- the "connect" privilege if APEX_040100 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_040100'
-- 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_040100',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_040100', 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_040100', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;
--
-- Enable EPG
--
-- if the env is 'SD', then set the port to 7778, all other environments run on 7777, following script should do this:
--
declare
l_db_name global_name.global_name%type;
begin
select upper(substr(global_name, 0, instr(global_name,'.')-1))
into l_db_name
from global_name;
case l_db_name
when 'GPSD' then
dbms_xdb.sethttpport(7778);
else
dbms_xdb.sethttpport(7777);
end case;
end;
/
--
-- Set Shared Servers
--
alter system set shared_servers = 5 scope=both;
--
-- Set APEX Password Properties
--
BEGIN
APEX_INSTANCE_ADMIN.SET_PARAMETER('PASSWORD_HISTORY_DAYS',0);
APEX_INSTANCE_ADMIN.SET_PARAMETER('STRONG_SITE_ADMIN_PASSWORD','N');
APEX_INSTANCE_ADMIN.SET_PARAMETER('ACCOUNT_LIFETIME_DAYS',36500);
COMMIT;
END;
/
exit
--
-- Rename install dir
--
mv /local/oracle/orahome/product/local/oracle/gps/orahome/product/apex/4.1
No comments:
Post a Comment