欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

oracle常用功能语句

程序员文章站 2022-06-15 23:16:18
...
  <!--新建用户-->
  create user HIRISUN identified by hirisun;
  <!--新建表空间-->
  create tablespace hirisun_space datafile 'd:\dataBase\HIRISUNDATA.DBF' size 5120m;
  <!--修改用户默认表空间-->
  alter user HIRISUN default tablespace hirisun_space;
  <!--赋予用户权限-->
  grant create session  to HIRISUN;
  grant connect,resource to HIRISUN; 
  <!--赋予用户DBA权限(普通用户不用)-->
   GRANT DBA TO HIRISUN; 
<!--导入dmp文件的语句(根据情况修改库名等)-->
exp TMREMOTEEDU/remoteedu@orcl file=d:\tmremoteedu.dmp owner=(orcl,TMREMOTEEDU)
imp HIRISUN/hirisun@scga-new  file='D:\数据\full.dmp' log='D:\dataBase\hirisunData.log' fromuser=HIRISUN touser=HIRISUN  ignore=y  full=y;
<!--查看用户的默认表空间-->
 select username, DEFAULT_TABLESPACE from dba_users a where a.username='HIRISUN';

 <!--删除用户-->
  drop user HIRISUN cascade;
  <!--删除表空间-->
  drop tablespace hirisun_space INCLUDING CONTENTS AND DATAFILES;
  <!--解锁/锁定帐户-->
  alter user HIRISUN account unlock/lock;
  <!-- 修改用户密码 -->
  alter user TMREMOTEEDU identified by remoteedu;
  <!--杀用户session-->
  alter system kill session'151,2333';
  select saddr,sid,serial#,paddr,username,status from v$session where username is not null
alter database open;
相关标签: oracle sql