您好,登錄后才能下訂單哦!
環境
操作系統:RHEL 6.4 x86_64
DB:oracle 11.2.0.3
一個測試庫,在安裝建庫的時候忘了安裝example了,有些時候沒有這些用戶的話做測試還真不容易,例如沒有scott用戶,你想做connect by測試,就只能自己建emp表了......
以下是安裝example的過程
step1:下載安裝包
到http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html下載安裝包
linux.x64_11gR2_examples.zip
傳到服務器上,之后解壓
[oracle@server package]$ unzip linux.x64_11gR2_examples.zip
step2:進到解壓目錄,之后執行安裝
su - ##切換到root執行命令
xhost +
su - oracle ##切換到oracle用戶執行命令
[oracle@server ~]$ cd package/examples/
[oracle@server examples]$ ls
doc install response runInstaller stage welcome.html
./runInstaller ##注意:最好是在服務器上用桌面來操作,遠程的話xshell斷掉的話需要重新做
step3:安裝過程及配置
缺少了很多包,一次性yum安裝上
可以看到,在我的系統上這些包都已經安裝上了,并且版本比oracle提供的更新
所以我這里可以忽略這些報錯,點ignore all,如下
至此,安裝完成了,接下來是運行配置腳本
step4:安裝后的配置過程
進入到demo目錄
[oracle@server schema]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/demo/schema
[oracle@server schema]$ ls
bus_intelligence human_resources log mk_dir.sql.ouibak mkplug.sql mksample.sql.sbs mkverify.sql product_media
sales_history sted_mkplug.sql.dbl
drop_sch.sql info_exchange mk_dir.sql mk_dir.sql.ouibak.1 mksample.sql mkunplug.sql order_entry README.txt shipping
可以看到,安裝了很多腳本
需要開啟數據庫,之后運行mksample.sql腳本
在這里需要你輸入system/sys的密碼,以及為sh/oe等用戶都設置密碼,還需要輸入默認表空間和臨時表空間的路徑
SYS@fgh> startup
SYS@fgh> @?/demo/schema/mksample.sql
specify password for SYSTEM as parameter 1:
Enter value for 1: oracle
specify password for SYS as parameter 2:
Enter value for 2: oracle
specify password for HR as parameter 3:
Enter value for 3: hr
specify password for OE as parameter 4:
Enter value for 4: oe
specify password for PM as parameter 5:
Enter value for 5: pm
specify password for IX as parameter 6:
Enter value for 6: ix
specify password for SH as parameter 7:
Enter value for 7: sh
specify password for BI as parameter 8:
Enter value for 8: bi
specify default tablespace as parameter 9:
Enter value for 9: users
specify temporary tablespace as parameter 10:
Enter value for 10: temp
specify log file directory (including trailing delimiter) as parameter 11:
Enter value for 11: /u01/app/oracle/diag/rdbms/fgh/fgh/trace
Sample Schemas are being created ...
Connected.
DROP USER hr CASCADE
*
ERROR at line 1:
ORA-01918: user 'HR' does not exist
DROP USER oe CASCADE
*
ERROR at line 1:
ORA-01918: user 'OE' does not exist
DROP USER pm CASCADE
*
ERROR at line 1:
ORA-01918: user 'PM' does not exist
DROP USER ix CASCADE
*
ERROR at line 1:
ORA-01918: user 'IX' does not exist
DROP USER sh CASCADE
*
ERROR at line 1:
ORA-01918: user 'SH' does not exist
DROP USER bi CASCADE
*
ERROR at line 1:
ORA-01918: user 'BI' does not exist
Connected.
specify password for HR as parameter 1:
specify default tablespeace for HR as parameter 2:
specify temporary tablespace for HR as parameter 3:
specify password for SYS as parameter 4:
specify log path as parameter 5:
......
在這個過程中,oracle會創建多個用戶,以及會到這些用戶下創建很多示例表
配置完成后,查看各個用戶下的樣例表
SH用戶
SYSTEM@fgh> conn sh/sh
Connected.
SH@fgh> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
CAL_MONTH_SALES_MV TABLE
CHANNELS TABLE
COSTS TABLE
COUNTRIES TABLE
CUSTOMERS TABLE
DIMENSION_EXCEPTIONS TABLE
DR$SUP_TEXT_IDX$I TABLE
DR$SUP_TEXT_IDX$K TABLE
DR$SUP_TEXT_IDX$N TABLE
DR$SUP_TEXT_IDX$R TABLE
FWEEK_PSCAT_SALES_MV TABLE
PRODUCTS TABLE
PROFITS VIEW
PROMOTIONS TABLE
SALES TABLE
SALES_TRANSACTIONS_EXT TABLE
SUPPLEMENTARY_DEMOGRAPHICS TABLE
TIMES TABLE
OE用戶
OE@fgh> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
ACCOUNT_MANAGERS VIEW
ACTION_TABLE TABLE
BOMBAY_INVENTORY VIEW
CATEGORIES_TAB TABLE
COUNTRIES SYNONYM
CUSTOMERS TABLE
CUSTOMERS_VIEW VIEW
......
其他用戶就不一一驗證了
OK,安裝樣例用戶完成。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。