月度归档:2013年07月

Linux环境下oracle创建和删除表空间及用户

#su – oracle 
$ sqlplus /nolog 
SQL> connect / as sysdba 
 
–//创建临时表空间 
create temporary tablespace myuser_temp 
tempfile '/home/oracle/storage/myuser_temp01.dbf' 
size 64m 
autoextend on 
next 64m maxsize 2048m 
extent management local; 
 
–//创建数据表空间 
create tablespace myuser_data 
logging 
datafile '/home/oracle/storage/myuser_data01.dbf'
size 64m 
autoextend on 
next 65m maxsize 2048m 
extent management local; 
 
–//创建用户并指定表空间 用户名和密码均为"myuser" 
create user myuser identified by myuser 
default tablespace myuser_data 
temporary tablespace myuser_temp; 
 
 
–//给用户授予权限 
grant connect,resource to myuser;
grant create view to myuser;

– // 增加表空间的最大值
alterdatabase datafile '/home/oracle/storage/myuser_data01.dbf'
autoextend on next 128m
maxsize 20480m;
 
–//删除表空间 
drop tablespace myuser_temp including CONTENTS and datafiles; 
 
–//修改用户密码 
alter user myuser identified by new_password; 
 
–//删除用户 
drop user myuser cascade; –//会级联删除该用户下所有对象。

转自:http://www.cnblogs.com/little-mat/articles/2193767.html