Sample user installation instructions in Oracle 11gR2

In Oracle10g, if we didn't select the installation sample when we created the instance, we can also create it with a script under $ORACLE_HOME/demo/schema after we created the instance. The official documentation has detailed instructions on how to create it:

SampleSchema Scripts and Object Descriptions

There are also related creation scripts in 11gR1:

These scripts create a series of sample users, including HR, OE, and so on. These user data allows us to simply perform some functional testing, and many examples of Oracle documentation use these users as well.

However, in 11gR2 we can no longer find the mksample .sql file under $ORACLE_HOME/demo/schema/directory, and there is no longer an SQL script in each individual subdirectory that creates the sample user.

In fact, Oracle separates the installation of these sample users into an installation disk, such as
for Linuxx86-64, which can be downloaded directly from OTN:

Oracle Database 11g Release 2Examples is the sample user installation file we need. But now this installation file has more than 500 M, if you do not expect to download such large content, or you just need HR and OE users, then you can directly download the following URL ready-made SQL script, decompression can be run later.


$ ls

hr_cre.sql hr_main.sql  hr_popul.sql

$ sqlplus / as sysdba

SQL> @hr_main.sql



Email:[email protected]






DBA1 GROUP: 62697716 (FULL); DBA2 GROUP: 62697977 (FULL) DBA3 GROUP: 62697850 (FULL)

DBA SUPERGROUP: 63306533 (FULL); DBA4 GROUP: 83829929 (FULL) DBA5 GROUP: 142216823 (FULL)

DBA6 GROUP: 158654907 (FULL) CHAT GROUP: 40132017 (FULL) CHAT GROUP 2: 69087192 (FULL)

--Adding groups is required to explain the relationship between Oracle table space and data files in the notes, otherwise the request will be rejected