oracle常用命令
时间:2021-07-01 10:21:17
帮助过:22人阅读
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 session
‘495,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