创建表test再user表空间 create table test ( name varchar(20), pwd varchar(20) ) tablespace users;
首先需要在指定的表空间有权限,或者有unlimited tablespace权限,然后是建表的时候指定tablespace字句,如:SQL> show user USER 为"SYS" SQL> alter user lunar quota 5m on users;用户已更改。SQL> conn lunar/lunar 已连接。 SQL> create table aa (a number) 2 tablespace users;表已创建。SQL> select TABLE_NAME,TABLESPACE_NAME 2 from user_tables 3 where table_name='AA';TABLE_NAME TABLESPACE_NAME ------------------------------ ------------------------------ AA USERSSQL>或者 SQL> grant unlimited tablespace to lunar;授权成功。SQL> 这样的话,用户lunar可以在任何表空间创建对象,并且没有限额
补充一下。 create table table_name tablespace_name as select * from tab where 1=2 /
create table test
(
name varchar(20),
pwd varchar(20)
)
tablespace users;
USER 为"SYS"
SQL> alter user lunar quota 5m on users;用户已更改。SQL> conn lunar/lunar
已连接。
SQL> create table aa (a number)
2 tablespace users;表已创建。SQL> select TABLE_NAME,TABLESPACE_NAME
2 from user_tables
3 where table_name='AA';TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
AA USERSSQL>或者
SQL> grant unlimited tablespace to lunar;授权成功。SQL>
这样的话,用户lunar可以在任何表空间创建对象,并且没有限额
create table table_name
tablespace_name as
select * from tab where 1=2
/
(
dog_name varchar2(40),
ower varchar2(40)
)
tablespace dogs
storage
(
initial 2m next 2m pctincrease o minextents 2
);