oracle数据库怎么创建新用户?

oracle数据库怎么创建新用户?,第1张

在CRT中进入oracle --连接sqlplus

按照下面写完代码直接复制进去回车就行了

---建立用户代码为:CREATE USER "用户名字" PROFILE "DEFAULT" IDENTIFIED BY "密码" DEFAULT TABLESPACE "指定表空间名字" TEMPORARY TABLESPACE "临时表空间" ACCOUNT UNLOCK

---赋权

begin

EXECUTE IMMEDIATE 'GRANT SELECT ANY DICTIONARY TO 用户名'

EXECUTE IMMEDIATE 'GRANT ALTER ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT ALTER SYSTEM TO 用户名'

EXECUTE IMMEDIATE 'GRANT ALTER ANY PROCEDURE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CONNECT TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY PROCEDURE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY INDEX TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE DATABASE LINK TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE PUBLIC DATABASE LINK TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY VIEW TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE PUBLIC SYNONYM TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT DELETE ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP PUBLIC DATABASE LINK TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP ANY TRIGGER TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP ANY INDEX TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP ANY PROCEDURE TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP ANY VIEW TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE PUBLIC SYNONYM TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP PUBLIC SYNONYM TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY SEQUENCE TO 用户名'

EXECUTE IMMEDIATE 'GRANT EXECUTE ANY PROCEDURE TO 用户名'

EXECUTE IMMEDIATE 'GRANT GRANT ANY PRIVILEGE TO 用户名'

EXECUTE IMMEDIATE 'GRANT GRANT ANY ROLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY TRIGGER TO 用户名'

EXECUTE IMMEDIATE 'GRANT INSERT ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT SELECT ANY DICTIONARY TO 用户名'

EXECUTE IMMEDIATE 'GRANT SELECT ANY SEQUENCE TO 用户名'

EXECUTE IMMEDIATE 'GRANT DROP ANY SEQUENCE TO 用户名'

EXECUTE IMMEDIATE 'GRANT SELECT ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT UNLIMITED TABLESPACE TO 用户名'

EXECUTE IMMEDIATE 'GRANT UPDATE ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT COMMENT ANY TABLE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE ANY TYPE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE TABLESPACE TO 用户名'

EXECUTE IMMEDIATE 'GRANT CREATE USER TO 用户名'

EXECUTE IMMEDIATE 'GRANT EXP_FULL_DATABASE TO 用户名'

EXECUTE IMMEDIATE 'GRANT IMP_FULL_DATABASE TO 用户名'

End

---或者直接给DBA权限希望有所提示,有空到CSDN,IT实验室,365testing进一步交流!

在配置和移植选项中选中Database Configuration Assistant,按照向导就可创建一个数据库了,然后以一个比较高的权限的身份进sqlpius,找到user,右键新建就可以了。

oracle权限分系统权限和对象权限;

create table是系统权限;而insert into table values是对象权限;

如果对scott来说,对自己本用户下的对象都有insert权限的;

如果想拥有别的用户下对象的insert权限,需在别的用户下授予scott对某个table的权限

命令如下:grant insert on tablename to scott;

求采纳 求推荐 求赞


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11911046.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存