Install Oracle 11g Express Centos
Install Oracle 11g Express Centos
Install Oracle 11g Express Centos
This post will cover basic installation and configuration of Oracle 11g Express Edition
(XE) on CentOS.
We will also take a quick look at configuring Application Express (APEX) for 11g XE.
If you just want to get up and running, you can just do steps 1 to 4 below (and 10 and 11
for Apex). The remaining steps (5 to 9) cover basic backup, recovery, and performance
configuration.
On every CentOS installation I have done for XE, I just needed to update/install the
packages for libaio, bc, and flex.
Unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip:
This will create the directory Disk1. Change to the Disk1 directory:
Unless you wish to change the ports, except the defaults and set SYS/SYSTEM
password.
The installation created the directory /u01 under which Oracle XE is installed.
To set the required Oracle environment variables, use the oracle_env.sh the script
included under cd /u01/app/oracle/product/11.2.0/xe/bin
view plaincopy to clipboardprint?
To set the environment for your current session run '. ./oracle_env.sh':
To set the environment permanently for users, add the following to the .bashrc
or .bash_profile of the users you want to access the environment:
1. . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
To allow remote access to Oracle 11g XE GUI (as well as Application Express GUI)
issue the following from SQL*Plus
You should now be able to access the Oracle 11g XE Home Page GUI at:
http://localhost:8080/apex/f?p=4950:1
To protect against disk failure, you should move the Flash Recovery Area to a separate
disk.
This is actually now called the Fast Recovery Area, but the existing documentation still
refers to it as the Flash Recovery Area
If a separate disk is not in your budget you should, at the very least, move the Flash
Recovery Area to a partition other than the Oracle installation directory.
1. SQL> @?/sqlplus/admin/movelogs
2. SQL> SET FEEDBACK 1
3. SQL> SET NUMWIDTH 10
4. SQL> SET LINESIZE 80
5. SQL> SET TRIMSPOOL ON
6. SQL> SET TAB OFF
7. SQL> SET PAGESIZE 100
8. SQL> declare
9. 2 cursor rlc is
10. 3 select group# grp, thread# thr, bytes/1024 bytes_k
11. 4 from v$log
12. 5 order by 1;
13. 6 stmt varchar2(2048);
14. 7 swtstmt varchar2(1024) := 'alter system switch logfile';
15. 8 ckpstmt varchar2(1024) := 'alter system checkpoint global';
16. 9 begin
17. 10 for rlcRec in rlc loop
18. 11 stmt := 'alter database add logfile thread ' ||
19. 12 rlcRec.thr || ' size ' ||
20. 13 rlcRec.bytes_k || 'K';
21. 14 execute immediate stmt;
22. 15 begin
23. 16 stmt := 'alter database drop logfile group ' || rlcRec.grp;
24. 17 execute immediate stmt;
25. 18 exception
26. 19 when others then
27. 20 execute immediate swtstmt;
28. 21 execute immediate ckpstmt;
29. 22 execute immediate stmt;
30. 23 end;
31. 24 execute immediate swtstmt;
32. 25 end loop;
33. 26 end;
34. 27 /
35.
36. PL/SQL procedure successfully completed.
37.
38. SQL>
39. SQL>
Now, set an appropriate size for the Fast Recovery Area. Use df -h to insure that there is
ample space.
You should have at least two Redo Log Groups and each group should have at least two
members.
Additionally, the members should be spread across disks (or at least directories)
For whatever reason, only one member is created per group on install.
You can view the redo log files using SQL> SELECT * FROM V$LOGFILE;
Since the default location for the two members is the Flash Recovery Area, the two
existing members have been moved to our new FRA.
You should now add an additional member for each group under
/u01/app/oracle/oradata/XE
The default values for parameters and sessions is quite low on the default installation.
Additionally, if you do not enable Archivelog Mode and take only offline or "cold"
backups, should you need to restore the database you will only be able to restore to the
last backup
To enable Archivelog Mode, shutdown the database and then startup mount:
To create automated backups, you can modify the backup.sh included under
/u01/app/oracle/product/11.2.0/xe/config/scripts
Open the backup.sh script in a text editor or vi. The last section will look like this:
view plaincopy to clipboardprint?
1. else
2. echo Backup of the database succeeded.
3. echo Log file is at $rman_backup_current.
4. fi
5.
6. #Wait for user to press any key
7. echo -n "Press ENTER key to exit"
8. read userinp
Change it to:
1. else
2. echo Backup of the database succeeded.
3. echo Log file is at $rman_backup_current.
4. mail -s 'Oracle Backup Completed' 'david@davidghedini.com' < /u01/app/
oracle/oxe_backup_current.log
5. fi
6.
7. #Wait for user to press any key
8. #echo -n "Press ENTER key to exit"
9. #read userinp
Note that we have also commented out the last two lines of the script (the prompt).
You should run it at least once a day. With Archivelog Mode enabled, it is important
that backups be taken regularly to prevent the Flash Recovery Area from filling.
If you elect to upgrade to the latest version (4.1 as of this writing), you can do so but
will loose access to the XE GUI. Not a huge loss, but something to keep in mind.
Although Apex is already installed, you will need to set the Internal Admin password.
Note: pick something simple like Password123! as you will be prompted to change it on
first log in anyways.
1. SQL> @/u01/app/oracle/product/11.2.0/xe/apex/apxchpwd.sql
2. Enter a value below for the password for the Application Express ADMIN user.
3.
4.
5. Enter a password for the ADMIN user []
6.
7. Session altered.
8.
9. ...changing password for ADMIN
10.
11. PL/SQL procedure successfully completed.
12.
13.
14. Commit complete.
15.
16. SQL>
http://localhost:8080/apex/f?p=4550:1
Workspace: Internal
User Name: admin
Password: (whatever you selected above).
http://localhost:8080/apex/f?p=4550:10 or http://localhost:8080/apex/apex_admin
Again, replace localhost above with your IP or domain as required.
Unless you have a license for Oracle HTTP Server (OHS), your options are the
embedded PLSQL Gateway (EPG) or Apex Listener.
The Application Express that comes installed with Oracle 11g XE is configured using
the EPG.
While the EPG is simpler than Apex Listener, it can be painfully slow as of Apex 3.2.
I have run Apex Listener on both Tomcat (unsupported) as well as Oracle GlassFish 3.x
(supported) and was not impressed with either.
A lot of people who know far more than I do about APEX (read: 99.9999% of the
population) like the Apex Listener.
The Apex Listener installation guide is well done and simple to follow.