我用sqlplus环境,模拟了 创建表的几种情况,你可以通过这个对照你现在的环境:
1.当没给普通用户指定默认表空间时,用户创建表时未指定表空间,创建表会在user表空间下;
2.当给普通用户指定了默认的表空间时,用户创建表时未指定表空间,会创建在默认表空间下;
3.当给普通用户指定了默认的表空间时,用户创建表时指定了表空间,会创建在相应的表空间下。
4.普通用户也可以在system表空间建立表,这个主要看资源的权限。
[oracle@oracle ~]$ sqlplus / as sysdba
SQL> create user test identified by test;
SQL> grant resource,connect to test;
SQL> create tablespace test datafile '/oracle/oradata/orcl/test.dbf' size 20m;
SQL> create tablespace test2 datafile '/oracle/oradata/orcl/test2.dbf' size 20m;
SQL> conn test/test
SQL> create table t1(a number);
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
T1 USERS
SQL> conn / as sysdba
SQL> create tablespace test2 datafile '/oracle/oradata/orcl/test2.dbf' size 20m;
SQL> alter user test default tablespace test2;
SQL> conn test/test
SQL> create table test2(a number);
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
T1 USERS
TEST2 TEST2
SQL> create table test3(a number) tablespace test;
Table created.
SQL> create table test4(a number) tablespace system;
Table created.
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TEST3 TEST
T1 USERS
TEST2 TEST2
TEST4 SYSTEM
温馨提示:答案为网友推荐,仅供参考