Oracle在cmd命令行下创建新用户并且创建表空间并给用户授权

可以在cmd下完成操作。(By Oralce菜鸡)

1.首先我们可以用scott用户以sysdba的身份登录oracle. 

  conn scott/tiger as sysdba

2.然后我就可以来创建用户了. (我创建的用户名为test)

  create user test identified by test;

3.修改用户的密码.(密码:123456)

  alter user test identified by 123456

4.创建一个表空间.(我在这里创建的空间名为test_test,指定了文件路径为:'D:\Oracle\zs_zs.dbf')

  create tablespace test_test datafile 'D:\Oracle\zs_zs.dbf' size 200M;

        (上面创建的表空间千万别让他出问题!!!!不要误删除,误操作,因为笔者就干过!!结果很痛苦)

5.创建好表空间,还需要将表空间分配给用户. 

  alter user  test default tablespace test_test ;

6.给用户分配了表空间,用户还不能登陆(没有登录权限),因此还需要为用户分配权限 

  grant create session,create table,create view,create sequence,unlimited tablespace to test;

猜你喜欢

转载自blog.csdn.net/weixin_41847607/article/details/81109871