ORACLE-删除及创建新用户及表空间

来源:互联网 发布:java特种兵 pdf完整版 编辑:程序博客网 时间:2024/06/06 01:26

完全删除一个老的user及表空间

DROP USER username CASCADE;DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES;# DROP TABLESPACE tablespace_name;alter database datafile 'v$datafile/tablespace_name.dbf' offline drop;

创建新的user及表空间

CREATE TABLESPACE username DATAFILE 'v$datafile/tablespace_name.dbf' SIZE 200M AUTOEXTEND ON NEXT 100M MAXSIZE 10240M EXTENT MANAGEMENT LOCAL;CREATE USER username IDENTIFIED BY passwd DEFAULT TABLESPACE tablespace_name;grant connect,resource to username;grant unlimited tablespace to username;grant create database link to username;grant select any sequence,create materialized view to username;

备注:
ORA-00950: invalid DROP option
ORA-02142: missing or invalid ALTER TABLESPACE option
ORA-01543: tablespace ‘tablespace_name’ already exists
ORA-01109: database not open
ORA-01516: nonexistent log file, data file, or temporary file
ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
ORA-01116: error in opening database file 8
ORA-01110: data file 8: ‘tablespace_name.dbf’
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3