管理员创建表空间
create tablespace 表空间名
datafile 表空间创建的路径(自定义,方便查找)
size 100M
autoextends on next 10M
MaxSize 500M
logging–启动重做日志
permanent——设置为永久表空间
修改:
alter tablespace add datafile 表空间位置及要创建的名称如(‘D:/space.dbf’) size 100M;
删除:
drop tablespace space including contents and datafiles --删除数据库对象和数据文件
注意:这个创建的表不可删除,否则数据库可能出问题。要么不建,建了不能删除
Scott 用户创建用户:
create user aaa
identified by a
default tablespace space–之前创建的表空间名为space,故此处为space
temporary tablespace temp
account unlock
Scott用户来创建表:
create 表名(
id int;
name varchar2(20),
code varchar(20) --此处无逗号
);
以上是最为简单的建表,表类型里面的知识需要在之后跟进
赋权:grant connect ,resource to 用户
connect 为连接权限
resource为赋予操作db资源