Get the App
SLTechnology News&Howtos  ›  Database  › 

Establishment of HR sample user of Oracle11g

Shulou Source: shulou.com Published: 2022-06-01 11:38:58 10月02日 Update

Establishment of HR sample user of Oracle11g

1. Hr users in oracle 11g need to be installed separately, which is troublesome. Many of the learning examples in books are cases of HR users, which are downloaded and released to the $ORACLE_HOME/demo/schema/human_resources/ directory.

Script Name

Description

Hr_analz.sql

Collects statistics on the tables in the schema.

Hr_code.sql

Creates procedural objects in the schema.

Hr_comnt.sql

Creates comments for each object in the schema.

Hr_cre.sql

Creates the HR objects.

Hr_dn_c.sql

Adds the distinguished name column used by Oracle Internet Directory to the employees and departments tables.

Hr_dn_d.sql

Drops the Oracle Internet Directory distinguished name column from employees and departments.

Hr_drop.sql

Drops the HR schema and all its objects.

Hr_idx.sql

Creates indexes on the HR tables.

Hr_main.sql

Main script for the HR schema; calls other scripts.

Hr_popul.sql

Populates the objects.

2. [oracle@OCM] $sqlplus / as sysdba

3. Execute hr_main.sql under $ORACLE_HOME/demo/schema/human_resources/

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

Note:

1. Before installation, you need to use root users to execute the files under human_resources: chmod 777 *.

2. Five parameters need to be determined before installation. They are:

Password of HR user: dbbocom

Default user space: users. (must be a user space that already exists)

Temporary user space: temp. (must be a user space that already exists)

Password of SYS user: dbbocom

The directory where the log files are stored: $ORACLE_HOME/RDBMS/log

Download address of HR personnel management database:

Http://down.51cto.com/data/1037205

Or:

Http://download.csdn.net/detail/johnlxj/6689713

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

Specify password for HR as parameter 1:

Enter value for 1: dbbocom

Specify default tablespeace for HR as parameter 2:

Enter value for 2: users

Specify temporary tablespace for HR as parameter 3:

Enter value for 3: temp

Specify password for SYS as parameter 4:

Enter value for 4: dbbocom

Specify log path as parameter 5:

Enter value for 5: / home/oracle/app/oracle/

DROP USER hr CASCADE

*

ERROR at line 1:

ORA-01918: user 'HR' does not exist

Old 1: CREATE USER hr IDENTIFIED BY & pass

New 1: CREATE USER hr IDENTIFIED BY dbbocom

User created.

Old 1: ALTER USER hr DEFAULT TABLESPACE & tbs

New 1: ALTER USER hr DEFAULT TABLESPACE users

Old 2: QUOTA UNLIMITED ON & tbs

New 2: QUOTA UNLIMITED ON users

User altered.

Old 1: ALTER USER hr TEMPORARY TABLESPACE & ttbs

New 1: ALTER USER hr TEMPORARY TABLESPACE temp

...

PL/SQL procedure successfully completed.

...

PL/SQL procedure successfully completed.

Check to see if it has been installed correctly

SQL > show user

USER is "HR"

Tags: Users space passwords files directories books personnel personnel management examples parameters addresses data databases logs cases trouble learning inspection management Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Microsoft Shulou Information vpn MariaDB