oracle 常用命令

-----创建用户

create user ocs
identified by ocs_2015
default tablespace USERS
temporary tablespace temp
profile DEFAULT;
-- Grant/Revoke role privileges
grant connect to ocs;
grant dba to ocs;
-- Grant/Revoke system privileges
grant unlimited tablespace to ocs;

------创建表空间

CREATE TABLESPACE ocsdata DATAFILE '/home/oracle/oradata/ocs/ocsdata01.dbf' SIZE 5000M UNIFORM SIZE 128k;

 查看用户和默认表空间的关系。   
  select   username,default_tablespace   from   dba_users;

用户默认表空间

 alter user ocs default tablespace ocsdata

定时器不能用可以试试

ALTER SYSTEM SET job_queue_processes = 10;

--连接数查看

select username,count(0) from v$session group by username;

--查看链接进程

select sid,serial# from v$session where username='OCS_GXYZ';

--杀次连接进程
alter system kill session 'sid,serial#';

备注此处执行多遍

--查询表空间与用户对应关系

 select   username,default_tablespace   from   dba_users;

原文地址:https://www.cnblogs.com/xianlg/p/4877488.html