使用sql脚本建立表空间,用户名
建立表空间:
CREATE TABLESPACE "SEXAM" LOGGING DATAFILE 'C:\ORACLE\product\10.1.0\ORADATA\SEXAM.ora'
SIZE 50M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
删除表空间:
DROP TABLESPACE SEXAM INCLUDING CONTENTS AND DATAFILES;
使表空间脱机:
ALTER TABLESPACE SEXAM OFFLINE;
如果是意外删除了数据文件,则必须带有RECOVER选项
ALTER TABLESPACE SEXAM OFFLINE FOR RECOVER;
使表空间联机:
ALTER TABLESPACE SEXAM ONLINE;
使数据文件脱机:
ALTER DATABASE DATAFILE 3 OFFLINE;
使数据文件联机:
ALTER DATABASE DATAFILE 3 ONLINE;
使表空间只读:
ALTER TABLESPACE SEXAM READ ONLY;
使表空间可读写:
ALTER TABLESPACE SEXAM READ WRITE;
建立用户:
CREATE USER SE PROFILE DEFAULT IDENTIFIED BY "SE"
DEFAULT TABLESPACE SEXAM TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK;
GRANT CONNECT,RESOURCE,DBA TO SE WITH ADMIN OPTION;
GRANT CREATE TABLE TO SE;
GRANT CREATE TRIGGER TO SE;
GRANT ALTER ANY TABLE TO SE;
GRANT SELECT ANY TABLE TO SE;
GRANT UNLIMITED TABLESPACE TO SE;
GRANT QUERY REWRITE TO SE;
commit;
(红色部分分别表示用户名和密码)
删除用户:
DROP USER SE CASCADE;
修改用户密码:
ALTER USER SE IDENTIFIED BY "newPassword";