1. 程式人生 > >Oracle新建資料庫 步驟

Oracle新建資料庫 步驟

確定是以管理員身份登入的:
1.首先,建立(新)使用者:
    create user username identified by password;
    username:新使用者名稱的使用者名稱
    password: 新使用者的密碼
也可以不建立新使用者,而仍然用以前的使用者,如:繼續利用scott使用者

2.建立表空間:
    create tablespace tablespacename datafile 'd:\data.dbf' size xxxm;
    tablespacename:表空間的名字
    d:\data.dbf':表空間的儲存位置
    xxx表空間的大小,m單位為兆(M)
3.將空間分配給使用者:
   alert user username default tablespace tablespacename;
   將名字為tablespacename的表空間分配給username 

4.給使用者授權:
   grant create session,create table,unlimited tablespace to username;

5.然後再以樓主自己建立的使用者登入,登入之後建立表即可。
conn username/password;

6.建立表、儲存過程、檢視等