Oracle JHeadstart 11g - End-to-end Tutorial - Downloads - Oracle
Oracle JHeadstart 11g - End-to-end Tutorial - Downloads - Oracle
Oracle JHeadstart 11g - End-to-end Tutorial - Downloads - Oracle
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2.4. Setup the <strong>Oracle</strong> HR Schema and Sample Data<br />
This tu<strong>to</strong>rial uses the sample HR schema that comes with the recent versions of the <strong>Oracle</strong> database.<br />
Create the HR Schema If Necessary<br />
If you don't already have an HR user account created in your database, you can follow these steps <strong>to</strong><br />
create it.<br />
C:\jhs-step-by-step> sqlplus /nolog<br />
SQL> connect sys as sysdba<br />
SQL> create user hr identified by hr;<br />
created.<br />
SQL> alter user hr default tablespace users;<br />
altered.<br />
SQL> grant connect, resource <strong>to</strong> hr;<br />
SQL> connect hr/hr<br />
connected.<br />
SQL> quit<br />
Create the HR Schema Sample Tables<br />
In the hr_schema subdirec<strong>to</strong>ry of this tu<strong>to</strong>rial, you'll find the hr.sql script. This script drops, recreates, and<br />
repopulates all the tables in the HR sample schema. Change direc<strong>to</strong>ry <strong>to</strong> the hr_schema subdirec<strong>to</strong>ry, and<br />
run the script as the HR user, with the command:<br />
C:\jhs-step-by-step> cd hr_schema<br />
C:\jhs-step-by-step\hr_schema> sqlplus hr/hr @hr.sql<br />
Unlock the HR Schema If Necessary<br />
If you already have an HR schema in your database it might be locked for security reasons. To unlock the<br />
schema, follow these steps:<br />
C:\jhs-step-by-step> sqlplus /nolog<br />
SQL> connect sys as sysdba<br />
SQL> alter user hr identified by hr account unlock;<br />
User altered.<br />
SQL> quit<br />
2.5. Define a JDeveloper Connection for the HR Schema<br />
Select View | Resouce Palette <strong>to</strong> show the Application Resources palet and follow these steps:<br />
Create a New Database Connection.<br />
Click on the Database folder, and select New Connection -> Database ... from the right-mouse menu.