dbca裡面的 示例方案 和 HR schema是一個東西嗎

warehouse發表於2013-05-21

透過dbca建庫如果選擇的是 定製建立資料庫 這個模板 示例方案還沒法選上,建庫之後又不知道如何新增進來,如果選擇一般用途或者資料倉儲模板建庫,hr schema是進來了,但是其他schema也進來一堆,所以沒法區分,下面簡單介紹一下如何手動新增hrschema吧,不過從doc的描述來看hr shcema應該就是 示例方案:

About Sample Schema HR

The HR schema is a sample schema that can be installed as part of Oracle Database. This schema contains information about employees—their departments, locations, work histories, and related information. Like all schemas, the HR schema has tables, views, indexes, procedures, functions, and other attributes of a database schema.

The examples and tutorials in this document use the HR schema.

See Also:

[@more@]

這個網上有現成的,別人總結的,我拿過來引用一下,防止連線過期,複製出來一份:

http://blog.csdn.net/ecjtuxuan/article/details/6365294

先將附件上的 10 .sql 檔案放入這個路徑中 :

E:/oracle/product/10.1.0/db_1/demo/schema/human_resources

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.

然後在 SQL*PLUS 上執行 hr_main.sq 這個檔案。

a) SQL>@e:/oracle/product/10.1.0/db_1/demo/schema/human_resources/hr_main.sq

b) Specify password for HR as parameter 1:

c) Enter value for 1: hr

d) Specify default tablespeace for HR as parameter 2:

e) Enter value for 2: users

f) Specify temporary tablespace for HR as parameter 3:

g) Enter value for 3: temp

h) Specify password for SYS as parameter 4:

i) Enter value for 4: welcome1

j) Specify log path as parameter 5:

k) Enter value for 5: C:/oracle/product/10.1.0/db_1/RDBMS/log

可以透過此命令來檢視 HR 使用者是否已經建立成功。

desc dba_users;

Select username, account_status from dba_users;

備註:關於 這個樣例資料庫使用者的 script 檔案在我的資源下載中有,名字是Oracle HR Schema

可以去下載 然後 裡面有附有說明文件。

下載地址:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1060529/,如需轉載,請註明出處,否則將追究法律責任。

相關文章