表空间
建立表空间(一般建N个存数据的表空间和一个索引空间):
create tablespace 表空间名
datafile ' 路径(要先建好路径)\***.dbf ' size *M
tempfile ' 路径\***.dbf ' size *M
autoextend on --自动增长
--还有一些定义大小的命令,看需要
default storage(
initial 100K,
next 100k,
);
CREATE tablespace表空间名
datafile 'F:\tablespace\demo' size 800M
datafile extent management local segment space management auto;
删除表空间
drop tablespace 表空间名 tablespace including contents and datafiles ;
用户
建立用户指定表空间: create user 用户名 by identified by "密码" create default tablespace pfm temporary tablespace 表空间名 ;
删除用户:create drop user 用户名 casecade;--加上cascade则将用户连同其创建的东西全部删除
授权
grant create session,
grant create any table,
grant create any view to 用户名;
管理角色
1.建一个角色
sql>create rolerole;
2.授权给角色
sql>grant create any table,create any view to role;
3.授予角色给用户
sql>grant role grant 用户名 ;
系统权限回收:系统权限只能由DBA用户回收
命令:SQL>Revoke role from 用户名;
--oracle 添加字段时添加字段注释
alter table TABLENAME addZIDUANA NVARCHAR2(200);
alter table TABLENAME addZIDUANB NVARCHAR2(200);
comment on column TABLENAME.ZIDUANA
is "字段A注释";
comment on column TABLENAME.ZIDUANB
is "字段B注释";