【Oracle】新建用户,删除用户,授权

一、创建用户

oracle内部有两个建好的用户:system和sys。用户可直接登录到system用户以创建其他用户,因为system具有创建别 的用户的 权限。 在安装oracle时,用户或系统管理员首先可以为自己建立一个用户。

语法[创建用户]: create user 用户名 identified by 口令[即密码];

例子: create user test identified by test;

语法[更改用户]: alter user 用户名 identified by 口令[改变的口令];

例子: alter user test identified by 123456;

创建用户并指定表空间

例子:

create user test_user identified by 123
default tablespace test_DM;

二、删除用户

语法:drop user 用户名;

例子:drop user test;

若用户拥有对象,则不能直接删除,否则将返回一个错误值。指定关键字cascade,可删除用户所有的对象,然后再删除用户。

语法: drop user 用户名 cascade;

例子: drop user test cascade;


三、授权


授dba权限给用户test
grant connect,resource,dba to test;

原文地址:https://www.cnblogs.com/OliverQin/p/9565100.html