Oracle XE Database


Other Databases

How do I set up Oracle XE Database?

  1. Download the correct release for your machine.
  2. Unzip the folder and run setup.exe to install Oracle XE.
  3. When asked where to install, chose a location for the folder.
  4. When asked to create a password, use '123'. So it would be same as all others.
  5. When finished installing, start the 'Get Started with Oracle ..." that appeared on the Desktop.
  6. Within the browser, click on 'Application Express' and login as System with password 123.
  7. Fill in the following information:
    • Database User: Create New
    • Database Username: sa
    • Application Express Username: batgen
    • Password: 123
    • Confirm Password: 123
    Click on create Workspace.
  8. You will get a message telling you that a workspace is successfully created, and click there to login. You can also click on 'Application Express', and then click on 'Already have an account? Login here'.
  9. Login with the information that was used to create the workspace.
  10. Click on the 'SQL Workshop'.
  11. OPTIONAL but recommended: click on 'Object Browser', select one of the tables on the left, and the click on Drop on the right. Select 'Cascade Constraints' and click 'Finish'. Repeat this for all the tables until the list is empty. Now do this for 'Sequences' and 'Functions' on the drop-down list.
  12. Under 'SQL Workshop', click on 'SQL Commands'.
  13. The SQL commands for creating the tables can be found in CreateTables.sql under the sql folder of batGenTutorial project. Oracle XE does not take multiple commands at once, so commands have to be entered one at a time. (Or they can be all added to the SQL console, then highlight/select one command and click 'run' at a time, till all commands had ran.)
      Example:
    • 1st command:
      create table EMPLOYEE (
          EMPLOYEE_KEY       NUMBER(10) not null,
          SALARY             NUMBER(10,2),
          LAST_NAME          VARCHAR2(132),
          FIRST_NAME         VARCHAR2(132),
          SUPERVISOR_KEY     NUMBER(10),
          constraint EMPLOYEE_PK primary key (EMPLOYEE_KEY)
      );
      
    • 2nd command:
      create sequence EMPLOYEE_SEQ;
      
    • And so on, till all of the commands on CreateTables.sql had ran.
  14. Now the database is ready for use. On Eclipse, add the OracleDriver to the build path. Right click on project, click 'Properties' and select 'Java Build Path'. Click on 'Libraries' and then click on 'Add External JARs..'. The OracleDriver is located in the installed folder, app/oracle/product/11.2.0/server/jdbc/lib. Select the ojdbc6 jar and click done.
  15. To turn database on or off, click on the window start menu -> All Programs -> Oracele Database xxg Express Edition -> Get Started.