oracle新建schema

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.将空间分配给用户:  
   alter user username default tablespace tablespacename;  
   将名字为tablespacename的表空间分配给username   
  
4.给用户授权:  
   grant create session,create table,unlimited tablespace to username;  
  或者dba权限
   grant dba.resource,connect to user;

实例

SQL> create user ct_ods_dba identified by "ctzqbj262700!";

User created.

SQL> create tablespace ct_ods datafile '/u02/ct_ods/ods01.dbf' size 30G;

Tablespace created.

SQL> alter user ct_ods_dba default tablespace ct_ods;

User altered.

SQL> grant dba,resource,connect to ct_ods_dba;

Grant succeeded.

SQL> alter tablespace ct_ods add datafile '/u02/ct_ods/ods02.dbf' size 30G;

Tablespace altered.

SQL> alter tablespace ct_ods add datafile '/u02/ct_ods/ods03.dbf' size 30G;

Tablespace altered.

SQL> alter tablespace ct_ods add datafile '/u02/ct_ods/ods04.dbf' size 30G;

Tablespace altered.

SQL> alter tablespace ct_ods add datafile '/u02/ct_ods/ods05.dbf' size 30G;

Tablespace altered.

SQL> alter tablespace ct_ods add datafile '/u02/ct_ods/ods06.dbf' size 30G;

Tablespace altered.

SQL> alter tablespace ct_ods add datafile '/u02/ct_ods/ods07.dbf' size 30G;

Tablespace altered.
  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值