Oracle Tutorial

 
 
 

Basic Oracle Tutorial

 
 

Step 1

All scripts necessary to install sample schemas reside in $ORACLE_HOME/demo/schema directory. So you don\'t need to explicitly download anything.

Let\'s begin installation of sample schema for oracle.

Start > Run > cmd > Type \"sqlplus\"

Username: system Password: your password


Step 2

We are trying to create sample HR schema which comes with oracle express edition. In order to do so you need to run the hr_main.sql script, use the following command:

SQL> @?/demo/schema/humanresources/hrmain.sql


Step 3

Enter a password for HR Schema

specify password for HR as parameter 1:
Enter value for 1: YourPassword

Step 4

Enter an appropriate tablespace, For example: enter users as the default tablespace for HR

specify default tablespace for HR as parameter 2:
Enter value for 2: users

Step 5

Enter temp as the temporary tablespace for HR

specify temporary tablespace for HR as parameter 3:
Enter value for 3: temp

Step 6

Enter your password for system username

specify password for SYS as parameter 4:
Enter value for 4: YourSystemUserPassword

Step 7

Enter the directory path for your log directory, For example: $ORACLE_HOME/demo/schema/log/

specify log path as parameter 5:
Enter value for 5: $ORACLE_HOME/demo/schema/log/

Step 8

After the hr_main.sql script runs successfully and the HR schema is installed, you are connected as the user HR. To verify that the schema was created, use the following command:

SQL> SELECT tablename FROM usertables;

You have successfully created a sample database schema \"HR\". To verify this open a new command window.

Start > Run > cmd > Type \"sqlplus\"

Username: HR and Password: PasswordForHR

Select * from Employees;

Above command should able to list all employees.


 
 
Didn't find what you were looking for? Find more on Download and Install Sample Oracle database