--删除原来的用户
drop user USER01 cascade;
DROP TABLESPACE RAS INCLUDING CONTENTS AND DATAFILES;
--如果不小心删除了数据库文件,执行下列语句,文件路径改成原来对应的路径
--ALTER DATABASE DATAFILE 'e:\OracleData\RAS01.DBF' OFFLINE DROP
--ALTER DATABASE DATAFILE 'e:\OracleData\RAS03.DBF' OFFLINE DROP
create tablespace RAS datafile '/data1/RAS/RAS01.DBF' size 32000m; --创建RAS表空间
alter tablespace RAS add datafile '/data1/RAS/RAS02.DBF' size 32000m; --扩展数据文件
CREATE USER "USER01" --创建一个用户,名称为 USER01
IDENTIFIED BY "1234567" --密码
DEFAULT TABLESPACE "RAS" --默认表空间
TEMPORARY TABLESPACE "TEMP1" --临时表空间
profile DEFAULT;
GRANT"CONNECT" TO "USER01" WITH ADMIN OPTION;
--授予用户USER01 创建连接的角色,并可再授权
GRANT"DBA" TO "USER01" WITH ADMIN OPTION;
--授予用户USER01 数据库管理员的角色,并可再授权
grant select on dba_tables to USER01;
grant SELECT ANY DICTIONARY to USER01;
GRANT
CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY INDEX, CREATE ANY PROCEDURE,
ALTER ANY TABLE, ALTER ANY PROCEDURE,
DROP ANY TABLE, DROP ANY VIEW, DROP ANY INDEX, DROP ANY PROCEDURE,
SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE
TO USER01;