1.數(shù)據(jù)庫安裝時的參數(shù)設(shè)定
下面數(shù)據(jù)庫所用的版本為ORACLE 9I (9.2.0),安裝數(shù)據(jù)庫時,數(shù)據(jù)庫系統(tǒng)會創(chuàng)建一個數(shù)據(jù)庫實(shí)例,其中:安裝目錄選為:\oracle,數(shù)據(jù)庫名與數(shù)據(jù)庫SID號都輸入:ora9i ,其中的字符集必須選為:ZHS16GBK(否則以后進(jìn)行跨平臺操作時對中文的操作將比較困難)。
2.數(shù)據(jù)庫用戶的創(chuàng)建、權(quán)限的分配
數(shù)據(jù)庫安裝完成后,有兩個系統(tǒng)級的用戶:
1、system 默認(rèn)密碼為:manager
2、sys 默認(rèn)密碼為:change_on_install
在安裝的數(shù)據(jù)庫目錄中找到\oracle\product\9.2\bin 中的sqlplus程序,運(yùn)行:./sqlplus system/manager@ora9i
用system用戶創(chuàng)建自己的用戶、權(quán)限;sql語句如下:
1、創(chuàng)建用戶:
create user username identified by pwd default tablespace users Temporary TABLESPACE Temp;
2、用戶授權(quán)
grant connect,resource,dba to username;
3、提交
commit;
3.用數(shù)據(jù)庫腳本創(chuàng)建數(shù)據(jù)庫
如上面所述利用sqlplus以username 用戶登陸,輸入:@創(chuàng)建數(shù)據(jù)庫的腳本名稱.sql回車,即可創(chuàng)建數(shù)據(jù)庫中的表、視圖、存儲過程等。 注:以上的創(chuàng)建用戶過程可以使用戶的表中沒有了系統(tǒng)自動產(chǎn)生的n多臨時表。