How to create Sample Schemas in Oracle 11g database – ORA-19613
The Oracle Database Sample Schemas provide a common platform for examples in each release of Oracle Database. They are easy to use for testing and training purposes. All Oracle Database documentation and training materials refer to the Sample Schemas environment.
Following are Oracle Sample Schemas
– OE (Order Entry schema) – useful for dealing with matters of intermediate complexity. Many data types are available in this schema, including non-scalar data types.
– HR (Human Resources schema) – useful for introducing basic topics. An extension to this schema supports Oracle Internet Directory demos.
– PM (Product Media schema) is dedicated to multimedia data types.
– IX (Information Exchange main schema) includes a set of schemas for demonstrate Oracle Advanced Queuing capabilities
– SH (Sales History schema) is designed to allow for demos with large amounts of data. An extension to this schema provides support for advanced analytic processing.
– SCOTT – old-fashioned famous schema with its two prominent tables EMP and DEPT that is used by Oracle for many years.
– BI – includes only synonyms on SH schema
With this simplicity I personally found difficulties in creating Sample Schemas in Oracle 11g database. In fact I could not do it in a standard way with Oracle installation binaries before 18.104.22.168. If somebody experienced similar issues, I give below the way how to install Sample Schemas manually.
1. Create a new fresh Oracle database with following prerequisites
– with US7ASCII character set
– with database components (JVM, XML DB, Multimedia, Spatial)
– WITHOUT Sample Schemas component
– No new tablespaces should be created after the database creation
2. Create Sample Schemas manually following the procedure below
Enter passwords for input parameters 1-7 and the following parameters:
Enter value for 8: example.dmp
Enter value for 9: example01.dfb
Enter value for 10: /opt/app/oracle/oradata/example01.dbf
Enter value for 11: /opt/app/oracle/product/11.2.0/dbhome_1/demo/schema/
Enter value for 12: /opt/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates/
All directories above should be correct and correspond to your $ORACLE_HOME which is my case is /opt/app/oracle/product/11.2.0/dbhome_1
As a result of executing the above SQL script, a new tablespace EXAMPLE is attached to a database with file number 5, and the Sample Schemas will show up in the database.
3. This procedure does not work in case one of the below
– non-US7ASCII database
– example tablespace was created during the database creation
– at least one new tablespace is created after the database creation.
You might get following error while executing the script if the next available database file number <> 5:
ERROR at line 1:
ORA-19583: conversation terminated due to error
ORA-19870: error while restoring backup piece
ORA-19615: some files not found in backup set
ORA-19613: datafile 6 not found in backup set
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 5824
ORA-06512: at line 33
4. If SCOTT user is missing
After the successful SQL script execution some may miss a famous SCOTT user. Unfortunately it might not be a part of Sample Schemas data file before Oracle binaries 22.214.171.124. You can create it later using a below SQL script: