http://www.oracle.com/tech
- 1
- First download the RPM from Oracle.
http://www.oracle.com/technology/sof tware/prod ucts/datab ase/ xe/ind ex.html
- 2
- As the root user, check prerequisites, then perform the install.
glibc and libaio are required. Use the rpm command as shown. If you don't have them installed, add them from the Linux distribution media.1: 2: 3: 4: 5: 6:
root# rpm -q glibc glibc-2.5-34 root# rpm -q libaio libaio-0.3.106-3.2
- 3
- Check kernel parameters for adequate resources.
The RPM installer will insert the minimum recommended kernel setting of "kernel.sem" for you, but since you may want to upgrade from XE to full Oracle at a later time, its a good idea to go ahead and set various other kernel parameters to adequate values for Standard or Enterprise Edition.
/etc/sysctl.conf should have the following params set. After editing the file, either reboot or use "sysctl -p" to load the params dynamically.1: 2: 3: 4: 5: 6: 7: 8: 9:
kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6553600 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 262144
- 4
- As the root user, install the Oracle XE RPM.
1: 2: 3: 4: 5:
root# rpm --install oracle-xe-univ-10.2.0.1-1.0.i386.rpm Executing Post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.
- 5
- As the root user, perform the configuration.
Run "/etc/init.d/oracle-xe configure". Be aware that it will create the oracle user and dba group during this step. You should answer Y (YES) to the question, "Do you want Oracle Database 10g Express Edition to be started on boot (y/n)" in order to install Oracle as a "service".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:
root# /etc/init.d/oracle-xe configure Oracle Database 10g Express Edition Configuration ------------------------------------------------- This will configure on-boot properties of Oracle Database 10g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Press <Enter> to accept the defaults. Ctrl-C will abort. Specify the HTTP port that will be used for Oracle Application Express [8080]: Specify a port that will be used for the database listener [1521]: Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration: Confirm the password: Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: Starting Oracle Net Listener...Done Configuring Database...Done Starting Oracle Database 10g Express Edition Instance...Done Installation Completed Successfully. To access the Database Home Page go to "http://127.0.0.1:8080/apex"
Verify that the instance was started by checking for the smon process "ps -ef | grep smon".1: 2: 3:
root# ps -ef | grep smon oracle 4482 1 0 11:34 ? 00:00:00 xe_smon_XE
Verify that /etc/oratab was created with the instance entry was inserted by the installer.1: 2: 3:
root# cat /etc/oratab XE:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server:N
Verify that you can access the web port with your web browser. Make sure you have disabled firewalling, or added a rule for port 8080, your you will only be able to reach the web port locally.
http://localhost:8080/apex
You can stop here if you intend to use Oracle and APEX through the web interface as a learning experience, however, it is a better practice to setup the oracle shell for sqlplus access, DBA tasks, and even RMAN backup and recovery.
- 6
- Setup oracle shell user
To use the Oracle tools from a UNIX shell, you need to configure a few environment variables for the oracle owner. You can also configure the same environment for other users. You can either set the variables directly in the .profile just as with Oracle Standard/Enterprise manual installation, or you can simply reference the default profile that comes with Oracle XE.
If you are still root, switch to the oracle user again.1: 2:
su - oracle
Add these to ".profile" in the home directory with the proper Oracle environment variables. I use vi, you can use pico, nano, whatever.1: 2: 3: 4: 5: 6: 7: 8:
# .profile for oracle user - This is how we would usually do it in a SE/EE install export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server export ORACLE_SID=XE export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 echo "Default Oracle instance is $ORACLE_SID"
Or the shortcut, just source in the default profile.1: 2: 3:
# .profile for oracle user - XE has a default profile . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
Test the profile by logout and re-login as oracle user1: 2: 3: 4: 5: 6:
-bash-3.2$ exit logout [root@localhost ~]# su - oracle Default Oracle instance is XE -bash-3.2$
Test sqlplus:1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
-bash-3.2$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 31 13:06:13 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production SQL>
- 7
- Enable the HR demo account
While connected to sqlplus as sysdba, take care of the final loose end.
Enable the HR user so you can connect via the APEX web interface and use the demo schema. You need to unlock the account, then login as the HR user to set a new password. (Sure you could enable the default password, but this is not secure)1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
SQL> alter user hr account unlock; User altered. SQL> connect hr/hr ERROR: ORA-28001: the password has expired Changing password for hr New password: Retype new password: Password changed Connected. SQL>
Oracle XE is now ready. Within the size and memory limitations, you can deploy your application free of licensing fees. Keep in mind, however, once you need support, you'll need to upgrade to Standard Edition One, at minimum.
You can stop here if you like. If you are concerned with protecting your database and taking backups, some optional steps are included below.
Appendix A : Enable Oracle Database archive mode
This is optional but recommended. Enabling ARCHIVELOG mode will improve your recoverability and allow you to take hot backups with no downtime. Without this, you can only take cold backups or exports.
From sqlplus, switch back to SYSDBA
1: 2: 3: 4: | SQL> connect / as sysdba Connected. SQL> |
Shutdown the database, then start in mount mode, and set ARCHIVELOG option before re-opening the database.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: | SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started. Total System Global Area 209715200 bytes Fixed Size 1258028 bytes Variable Size 75501012 bytes Database Buffers 130023424 bytes Redo Buffers 2932736 bytes SQL> alter database archivelog; Database altered. SQL> alter database open; Database altered. SQL> exit Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production |
Appendix B: Configure RMAN and perform a hot backup
From the "oracle" shell user, run RMAN and enable controlfile autobackup, and take an initial hot backup.
1: 2: 3: 4: | rman target / RMAN> configure controlfile autobackup on; RMAN> backup database plus archivelog; |
The output from the RMAN backup is a bit wordy and not included here, but look for the last two lines, which are:
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 31-AUG-09
1: 2: | RMAN> exit; |