oracle 10g R2 创建用户时默认表空间改变

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1021

oracle 10g R2 创建用户时默认表空间改变

在10g以前,如果我们创建用户时 要是没指定默认表空间,系统就会把默认表空间指向system表空间
这样在这个用户下建立的所有表都放在system表空间,会影响到系统表空间

而10g在这方面做了改进,要是创建用户没指定表空间 ,默认放在user表空间下
以下是测试验证过程:
1:oracle 9i
C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Wed May 7 15:16:54 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> create user paul identified by paul;
User created.
SQL> conn /as sysdba
Connected.

SQL> grant connect to paul;
Grant succeeded.
SQL> grant resource to paul;
Grant succeeded.
SQL> conn paul/paul
Connected.
SQL> create table test as select rownum id from dual;
Table created.
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TEST SYSTEM
SQL> conn /as sysdba
Connected.

SQL> select username,default_tablespace from dba_users where username='PAUL';
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
PAUL SYSTEM
SQL>

2:ORACLE 10g R2
SQL> conn mailto:sys/abcdefg@oracle10g]sys/abcdefg@oracle10g as sysdba
Connected.
SQL> create user paul identified by paul;
User created.
SQL> grant connect to paul;
Grant succeeded.
SQL> grant resource to paul;
Grant succeeded.
SQL> conn mailto:paul/paul@oracle10g]paul/paul@oracle10g
Connected.
SQL> create table test as select rownum id from dual;
Table created.
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TEST USERS
SQL> conn mailto:sys/abcdefg@oracle10g]sys/abcdefg@oracle10g as sysdba
Connected.
SQL> select username,default_tablespace from dba_users where username='PAUL';
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
PAUL USERS
SQL>

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】