码迷,mamicode.com
首页 > 数据库 > 详细

oracle常用命令

时间:2017-01-13 14:07:05      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:删除表空间   add   size   cal   base   default   命令   contents   export   

#搜索用户
select default_tablespace,username from dba_users where default_tablespace like NEWYZ%;
#搜索连接的用户sessionid
select username,sid,serial# from v$session where username = NEWYZ; #强行中断用户连接session
alter system kill session495,2285; select saddr,sid,serial#,paddr,username,status from v$session where username is not null and username = NEWHJ and status = INACTIVE
#删除表空间及文件 drop tablespace newyz including contents and datafiles; #删除表空间用户
drop user newyz cascade; #新建表空间newyz create tablespace newyz datafile “D:\oracldata\newyz.dbf” size 32m autoextend on next 32m maxsize 2048m extent management local; #新建表空间用户newyz密码123456789 并将表空间newyz授权给用户newyz
create user newyz identified by "123456789" default tablespace newyz temporary tablespace temp profile default quota unlimited on newyz; #授权给用户newyz
grant create session, resource to newyz; grant EXPORT FULL DATABASE to newyz; grant connect to newyz grant dba to newyz
#变更表空间test为读(写)权限
alter tablespace test read only; alter tablespace test read write; #修改密码 alter user sw identified by sw;

 

oracle常用命令

标签:删除表空间   add   size   cal   base   default   命令   contents   export   

原文地址:http://www.cnblogs.com/Tester-ABX/p/6282414.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!