标签:each 授权 dba ORC 数据 start 临时 删除 信息
--创建表空间 CREATE TABLESPACE caiyl DATAFILE ‘D:\Oracle\app\caiyl\oradata\orcl\caiyl_space.dbf‘ size 500m AUTOEXTEND ON NEXT 200M MAXSIZE 20480M EXTENT MANAGEMENT LOCAL; --创建临时表空间 CREATE TEMPORARY TABLESPACE caiyl_temp TEMPFILE ‘D:\Oracle\app\caiyl\oradata\orcl\caiyl_temp.dbf‘ SIZE 200M AUTOEXTEND ON NEXT 50M MAXSIZE 20480M EXTENT MANAGEMENT LOCAL; --创建用户并指定表空间 CREATE USER caiyl IDENTIFIED BY 123456 DEFAULT TABLESPACE caiyl_space; --创建用户并指定表空间和临时表空间 CREATE USER caiyl IDENTIFIED BY 123456 DEFAULT TABLESPACE caiyl_space TEMPORARY TABLESPACE caiyl_temp; --授权用户 GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW , DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE, DBA,CONNECT,RESOURCE,CREATE SESSION TO caiyl; --授权标准权限(开发权限) GRANT CONNECT,RESOURCE TO caiy1 --查看临时表空间 SELECT TABLESPACE_NAME FROM DBA_TABLESPACES; --增加表空间大小 ALTER TABLESPACE caiyl_space ADD DATAFILE ‘D:\Oracle\app\caiyl\oradata\orcl\caiyl_space.dbf‘ size 4096M; --增加临时表空间大小 ALTER DATABASE TEMPFILE ‘D:\Oracle\app\caiyl\oradata\orcl\caiyl_temp.dbf‘ RESIZE 8192M; --删除用户 DROP USER caiyl CASCADE --删除表空间 DROP TABLESPACE caiyl_space INCLUDING CONTENTS AND DATAFILES; --查询用户信息 select * from dba_users order by created desc --查看你能管理的所有用户: select * from all_users; --查看当前用户信息 : select * from user_users; --查看用户权限 --查看所有用户 SELECT * FROM DBA_USERS; SELECT * FROM ALL_USERS; SELECT * FROM USER_USERS; --查看用户系统权限 SELECT * FROM DBA_SYS_PRIVS; SELECT * FROM USER_SYS_PRIVS; --查看用户对象或角色权限 SELECT * FROM DBA_TAB_PRIVS; SELECT * FROM ALL_TAB_PRIVS; SELECT * FROM USER_TAB_PRIVS; --查看所有角色 SELECT * FROM DBA_ROLES; --查看用户或角色所拥有的角色 SELECT * FROM DBA_ROLE_PRIVS; SELECT * FROM USER_ROLE_PRIVS;
1.给要实现ID自增的数据表创建一个序列
SQL> CREATE SEQUENCE "序列名称"
increment by 1 ----- 每次递增:1
start with 1 ----- 从哪开始:1
nomaxvalue ----- 递增最大值:没有
minvalue 1 ----- 递增最小值:1
NOCYCLE; ----- 不循环
2.给要实现ID自增的数据表创建一个触发器
SQL> CREATE OR REPLACE TRIGGER "触发器名称"
BEFORE INSERT ON "要实现ID自增的数据表名称"
FOR EACH ROW
BEGIN
SELECT "之前创建的序列名称".nextval INTO :new."要实现ID自增数据表中的ID字段名" FROM dual;
END;
标签:each 授权 dba ORC 数据 start 临时 删除 信息
原文地址:https://www.cnblogs.com/superming/p/13507498.html