All scripts necessary to install sample schemas reside in
$ORACLE_HOME
/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 Oracle Database Security Guide .
-
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
$ORACLE_HOME
/demo/schema/log/
or any other existing directory name.
Note:
Make sure that you end the log directory name with a trailing slash, for example,
$ORACLE_HOME
/demo/schema/log/
Installing the HR Schema
All scripts necessary to create the Human Resource (HR) schema reside in
$ORACLE_HOME
/demo/schema/human_resources
.
You need to call only one script,
hr_main.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
andconnect
using theAS SYSDBA
privilege.sqlplus connect sys as sysdba Enter password: password
-
To run the
hr_main.sql
script, use the following command:SQL> @?/demo/schema/human_resources/hr_main.sql
-
Enter a secure password for HR
specify password for HR as parameter 1: Enter value for 1:
See Also:
Oracle Database Security Guide for the minimum password requirements -
Enter an appropriate tablespace, for example,
users
as the default tablespace forHR
specify default tablespace for HR as parameter 2: Enter value for 2:
-
Enter
temp
as the temporary tablespace forHR
specify temporary tablespace for HR as parameter 3: Enter value for 3:
-
Enter your
SYS
passwordspecify password for SYS as parameter 4: Enter value for 4:
-
Enter the directory path, for example,
$ORACLE_HOME
/demo/schema/log/
, for your log directoryspecify log path as parameter 5: Enter value for 5:
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 table_name FROM user_tables;
Running
hr_main.sql
accomplishes the following tasks:
-
Removes any previously installed
HR
schema -
Creates the user
HR
and grants the necessary privileges -
Connects as
HR
-
Calls the scripts that create and populate the schema objects
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
