--创建表空间:
create tablespace jereh01
datafile
'e:\a.dbf'
size 100m
autoextend on next 1m maxsize unlimited;
--创建用户
create user epat identified by mima
default tablespace jereh01;
可加可不加:
-- Grant/Revoke role privileges
grant dba to JLPTUSER;
-- Grant/Revoke system privileges
grant unlimited tablespace to JLPTUSER;
--权限
grant resource, connect to epat;
2、//修改用户口令 格式 alter user 用户名 identified by 新密码;
www.2cto.com
SQL> alter user system identified by manager;
重命名表空间
前提条件: 修改表空间的名称时,表空间的状态必须为online.否则无法修改。alter tablespaces tablespace_name rename to new_tablespace_name;
select * from cusproduct FOR UPDATE;
select * from cusorderdetail for update;
--约束名:约束类型简写_列名
alter table cusproduct
add constraint PK_PRODNO primary key(prodno);
alter table cusproduct
add constraint UNIQUE_PRODNAME UNIQUE(PRODNAME);
--域完成性:check、null、defalut
alter table cusproduct
add constraint CK_PRIDPRICE
CHECK(PRODPRICE >=10 AND PRODPRICE <=200);