When an 11g database is created without tweaking any of the options, using either dbca or the installer, the schema listed in the table below, 36 of them(!), are created by default. This document gives an overview of their purpose and function and, should the functionailty not be required, whether they can be safely deleted. or not without compromising the fundamental operation. 2011-8-19 oracle 10g的hrschema,可以导进11g以上进行练习更多下载资源、学习资料请访问CSDN下载频道. DirectX修复工具V3.7在线修复版 DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易.
![](/uploads/1/2/7/4/127416128/645944660.png)
Oracle creates a number of default database or when a new database is created.
Using the Database Configuration AssistantWhen you install Oracle Database with the Oracle Universal Installer, the sample schemas are installed by default if you select the Basic Installation option. Selecting the sample schemas option installs all five schemas (HR, OE, PM, IX, and SH) in the database.
![Schema Schema](/uploads/1/2/7/4/127416128/425027463.png)
If you choose not to install the sample schemas at that time, you can add them later by following the instructions in section.At the end of the installation process, a dialog box displays the accounts that have been created and their lock status. By default, all sample schemas are locked and their passwords are expired. Before you can use a locked account, you must unlock it and reset its password. You can unlock the accounts at this point in the installation process. Alternatively, after the installation completes, you can unlock the schemas and reset their passwords by using the ALTER USER. ACCOUNT UNLOCK statement. For example:ALTER USER hr ACCOUNT UNLOCK IDENTIFIED BY Password.
Schema DependenciesVarious dependencies have been established among the schemas. So, when you create the schemas manually, you must create them in the following order: HR, OE, PM, IX, and SH.Use this sequence to create the schemas:.Create the HR schema.Create the OE schema: The HR schema is already present, and you must know the password for the HR schema to grant HR object privileges to OE. Some HR tables are visible to the OE user with the use of private synonyms.
In addition, some OE tables have foreign key relationships to HR tables.Create the PM schema: Foreign key relationships require that the OE schema already exist when the PM schema is created. You must know the password for OE, to grant to PM the right to establish and use these foreign keys. Note:The PM schema requires the database to be enabled for the Java Virtual Machine (JVM) and interMedia. You can accomplish this during installation or later using the DBCA.Create the IX schema: The information exchange schema IX is based on order entry data in OE.
Again, foreign key relationships require that the OE schema already be present when the IX schema is created. You must know the password for OE to grant to IX, the right to establish and use the foreign keys.Create the SH schema. The SH schema logically depends on the OE schema, though you can create this schema without creating the other four schemas.
Guidelines for Installing Sample SchemasAll scripts necessary to install sample schemas reside in $ORACLEHOME /demo/schema directory. Before you install sample schemas by running these scripts, follow these guidelines:.You must connect as a system administrator using the SYSDBA privilege.When prompted to enter a password for the schema, enter a secure password that meets the requirements described in.When prompted for tablespace names while running scripts:.Enter an appropriate tablespace name, for example, users as the default tablespace for a schema.Enter temp as the temporary tablespace for a schema.When prompted for the log directory name, enter $ORACLEHOME /demo/schema/log/ or any other existing directory name. Installing the HR SchemaAll scripts necessary to create the Human Resource (HR) schema reside in $ORACLEHOME /demo/schema/humanresources.You need to call only one script, hrmain.sql, to create all the objects and load the data. The following steps provide a summary of the installation process:.Log on to SQL.Plus as SYS and connect using the AS SYSDBA privilege.sqlplus connect sys as sysdbaEnter password: password.To run the hrmain.sql script, use the following command:SQL @?/demo/schema/humanresources/hrmain.sql.Enter a secure password for HRspecify password for HR as parameter 1:Enter value for 1. See Also:before you run oemain.sqlYou need to call only one script, oemain.sql, to create all the objects and load the data.
Running oemain.sql accomplishes the following tasks:.Removes any previously installed OE schema.Creates the user OE and grants the necessary privileges.Connects as OE.Calls the scripts that create and populate the schema objectsAfter the oemain.sql script runs successfully and the OE schema is installed, you are connected as the user OE. To verify that the schema was created, use the following command:SQL SELECT tablename FROM usertables;For a complete listing of the scripts and their functions, refer to.The oedrop.sql and ocdrop.sql scripts are used to drop the OE schema and OC subschema, respectively.
See Also:before you run pmmain.sqlYou need to call only one script, pmmain.sql, to create all the objects and load the data. Running pmmain.sql accomplishes the following tasks:.Prompts for passwords and tablespace names used within the scripts as well as datafile and log file directories.Removes any previously installed PM schema.Creates the user PM and grants the necessary privileges.Connects as PM.Calls the scripts that create and populate the schema objectsAfter the pmmain.sql script runs successfully and the PM schema is installed, you are connected as the user PM. To verify that the schema was created, use the following command:SQL SELECT tablename FROM usertables;For a complete listing of the scripts and their functions, refer to.The pmdrop.sql script is used to drop the PM schema. See Also:before you run ixmain.sqlTo install the Information Exchange ( IX) schema, you need to call only one script, ixmain.sql, which creates all the objects and loads the data.Running ixmain.sql accomplishes the following tasks:.Prompts for passwords and tablespace names used within the scripts.Removes any previously installed IX schema.Creates the user IX and grants the necessary privileges.Connects as IX.Calls the scripts that create and populate the schema objectsAfter the ixmain.sql script runs successfully and the IX schema is installed, you are connected as the user IX. To verify that the schema was created, use the following command:SQL SELECT tablename FROM usertables;For a complete listing of the scripts and their functions, refer to.The ixdrop.sql script is used for dropping the IX schema.
See Also:before you run shmain.sqlYou need to call only one script, shmain.sql, to create all the objects and load the data. Running shmain.sql accomplishes the following tasks:.Prompts for passwords and tablespace names used within the scripts as well as datafile and log file directories.Removes any previously installed SH schema.Creates the user SH and grants the necessary privileges.Connects as SH.Calls the scripts that create and populate the schema objectsAfter the shmain.sql script runs successfully and the SH schema is installed, you are connected as the user SH. To verify that the schema was created, use the following command:SQL SELECT tablename FROM usertables;For a complete listing of the scripts and their functions, refer to. Note:The dimension tables PROMOTIONS, CUSTOMERS, PRODUCTS and the fact table SALES are loaded by SQL.Loader, after which directory paths are created inside the database to point to the load and log file locations. This allows the loading of the COSTS table by using the external table salestransactionsext.A pair of optional scripts, sholpc.sql and sholpd.sql, is provided as a schema extension.
To prepare the SH schema for use with the advanced analytical capabilities of OLAP Services, run the sholpc.sql create script. If you want to return to the initial setup of the SH schema, then use the script sholpd.sql to undo the effects of sholpc.sql and reinstate dimensions as they were before.The file used to drop the SH schema is shdrop.sql. Resetting Sample SchemasTo reset sample schemas to their initial state, use the following syntax from the SQL.Plus command-line interface:@?/demo/schema/mksample systempwd syspwd hrpwd oepwd pmpwd ixpwd shpwd bipwd defaulttablespace temptablespace logfiledirectory/The mksample script expects 11 parameters. Provide the password for SYSTEM and SYS, and for the HR, OE, PM, IX, SH, and BI schemas.
![](/uploads/1/2/7/4/127416128/645944660.png)