天天看點

oracle10g建立使用者,表空間,權限

oracle10g建立使用者,表空間,權限

文章分類:資料庫

在控制台以管理者身份登入Oracle10g

C:\Documents and Settings\Administrator>sqlplus system/root

SQL*Plus: Release 10.2.0.1.0 - Production on 星期日 1月 17 16:09:44 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

連接配接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

建立一個名為sj密碼為sj的使用者

SQL> create user sj identified by sj;

使用者已建立。

在E:\develop\workspace建立一個名為sj-data.dbf的表空間 表空間大小為100m

SQL> create tablespace ts_sj datafile 'E:\develop\workspace\sj-data.dbf' size 100m;

表空間已建立。

将表空間指派給sj使用者

SQL> alter user sj default tablespace ts_sj;

使用者已更改。

将建立session,table,view的權限指派給名為sj的使用者

SQL> grant create session, create table, create view, unlimited tablespace to sj;

授權成功。

以sj使用者登入資料庫

SQL> conn sj/sj

已連接配接。

顯示目前使用者

SQL> show user;

USER 為 "SJ"

摘自:http://sunjin.iteye.com/blog/577751