• Install Example HR Schema in Oracle DB

    When you install an Oracle Database, your db should include an HR Schema in Oracle DB which is a demo schema for you to play. If this HR Schema is not included in your database or is missing, you can still re-create this schema using the following commands in SQL Plus.

    First, open your SQL Plus Command.
    When prompted for a Username, type:

    / as SYSDBA
    

    Alter the session to allow creation of user for hr:

    alter session set "_ORACLE_SCRIPT"=true; 
    

    Then run the SQL Script:

    @?/demo/schema/human_resources/hr_main.sql
    

    When prompt for password, type:

    hr 
    

    For default tablespace, type:

    users
    

    For temporary tablespace, type:

    temp
    

    For log directory, just set any log directory location

    Scripts should run automatically after receiving the required parameters. Test your connection by connecting to hr schema using hr username and hr password in your SQL Developer Application.

    That’s it. Let us know in the comments if this works for you too or if you have questions.