使用SQLplus工具登录连接

开始-》运行CMD-》

C:\Users\Admininstrator> sqlplus

请输入用户名:sys@orcl as sysdba
输入口令:root SQL> 或者直接输入 sqlplus sys/root@orcl as sysdba 进入

查询当前用户

SQL>show user;

启用被锁定的用户username

SQL> alter user username account unlock;

创建表空间 (默认永久数据文件为xx.dbf,设置大小为100M,每次自增涨100M,TEMPFILE表示零时数据文件,根据需要而定)

SQL>CREATE  [TEMPORARY] TABLESPACE tablespace_name TEMPFILE | DATAFILE 'xx.dbf' SIZE 100M  AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED

  查看表空间的信息(注意大小写)

SQL>SELECT * FROM dba_data_files WHERE TABLESPACE_NAME=‘TEST';

  修改表空间的状态(联机或者脱机)

SQL>ALTER TABLESPACE tablesapce_name ONLINE | OFFLINE

  查询表空间的状态

SQL>SELECT status from dba_tablespaces WHERE tablespace_name = 'spacename';

  删除表空间(选项为删除表空间的同时删除数据文件)

SQL>DROP TABLESPACE tablespace_name [INCLUDING CONTENTS]

创建用户(需要有创建用户的权限

  创建一个用户名为test的用户,密码为password,默认表空间为A,零时表空间为B

SQL>create user test identified by password default tablespace A temporary tablespace B;

  删除用户

SQL>drop user testl;

  给表空间授权    

    grant create session to test;          //授予test用户创建session的权限,即登陆权限
    grant unlimited tablespace to test;     //授予test用户使用表空间的权限
    grant create tablespace to test;         //授予test用户创建表空间的权限
    grant alter tablespace to test;        //授予test用户修改表空间的权限
    grant drop tablespace to test;       //授予test用户删除表空间的权限
    grant manage tablespace to test;      //授予test用户管理表空间的权限
    grant create table to test;         //授予创建表的权限(包含有create index权限, alter table, drop table权限)
    grant create view to test;             //授予用户操作视图的权限(包含有alter view, drop view权限)
    grant create trigger to test;          //授予用户操作触发器的权限(包含有alter trigger, drop trigger权限)
    grant create procedure to test;       //授予用户操作存储过程的权限(包含有alter procedure, drop procedure 和function 以及 package权限)
    grant create sequence to test;        //授予用户操作序列的权限:(包含有创建、修改、删除以及选择序列)
    grant select any dictionary to test;           //允许从sys用户所拥有的数据字典表中进行选择

Oracle入门基础的更多相关文章

  1. Oracle入门基础(1)

    1.数据库系统和数据管理系统的区别? 数据库系统=数据库的管理系统+oper操作员+硬件 2.Oracle的版本   8i /9i   10g/11g   12c(cloud) 3.Oracle主要组 ...

  2. Oracle入门基础(十三)一一java调用oracle存储过程

    package demo; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.ResultS ...

  3. Oracle入门基础(十)一一数据库其他对象-视图/序列/索引/同义词

    SQL> --视图 SQL> create view empinfoview as select e.empno,e.ename,e.sal,e.sal*12 annsal,d.dname ...

  4. Oracle入门基础(八)一一数据处理

    SQL> SQL的类型 SQL> 1.DML(Data Manipulation Language 数据操作语言): select insert update delete SQL> ...

  5. Oracle入门基础(十二)一一储存过程及触发器

    1.第一个存储过程 打印Hello World 调用存储过程: 1.exec sayhelloworld(); 2.begin sayhelloworld(); sayhelloworld(); en ...

  6. Oracle入门基础(十一)一一PL/SQL基本语法

    1.打印Hello World declare --说明部分 begin --程序 dbms_output.put_line('Hello World'); end; 2.引用型变量 查询并打印783 ...

  7. Oracle入门基础(九)一一创建表和管理表

    练习:查询每一年入职人数及总人数 SQL> select count(*) Total, 2 sum(decode(to_char(hiredate,'yyyy'),'1980',1,0)) & ...

  8. Oracle入门基础(七)一一集合运算

    SQL> /* SQL> 查询10和20号部门的员工 SQL> 1. select * from emp where deptno=10 or deptno=20; SQL> ...

  9. Oracle入门基础(六)一一子查询

    SQL> --查询工资比SCOTT高的员工信息 SQL> --1. SCOTT的工资 SQL> select sal from emp where ename='SCOTT'; SA ...

随机推荐

  1. iOS静态库开发中对Bitcode的支持

    1.bitcode bitcode是LLVM编译器将C/C++/OC/Swift等前端变成语言编译成多种不同芯片上的机器指令过程中的中间代码.并且这个中间代码是CPU无关的. 原本我们的APP里要包含 ...

  2. Codeforces 划水

    Codeforces 566F 题目大意:给定$N$个数,任意两个数之间若存在一个数为另一个数的因数,那么这两个数存在边,求图中最大团. 分析:求一个图最大团为NP-Hard问题,一般不采用硬方法算. ...

  3. mybatis generator.xml 配置 自动生成model,dao,mapping

    generator.xml文件: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE gener ...

  4. 使用vlc进行二次开发做自己的播放器

    可参考: 使用vlc播放器做rtsp服务器 使用vlc播放器播放rtsp视频 web网页中使用vlc插件播放相机rtsp流视频 使用 https://github.com/ZeBobo5/Vlc.Do ...

  5. sql 注入问题

    1. 关于使用intval强制转换成数字的问题.数字大于2147483647会出现溢出出现负数.使用个方法来替代这个吧$n="\n";$a=2147483648.05555;ech ...

  6. getElementsByClassName简单实现

    function getElementsByClassName(node, className) { var aClassReg = className.split(' ').map(function ...

  7. ORACLE 常见错误

    ora-00904 :   标识符无效:查询语句中的列或表在oracle 中不存在:

  8. JQuery+Ajax+Struts2+Hibernate 实现完整的登录注册

    写在最前: 下午有招聘会,不想去,总觉得没有准备好,而且都是一些不对口的公司,可是又静不下心来,就来写个博客. 最近在仿造一个书城的网站:http://www.yousuu.com ,UI直接拿来用, ...

  9. Hibernate之lazy延迟加载

    一.延迟加载的概念 当Hibernate从数据库中加载某个对象时,不加载关联的对象,而只是生成了代理对象,获取使用session中的load的方法(在没有改变lazy属性为false的情况下)获取到的 ...

  10. MyBatis处理一行数据-MyBatis使用sum语句报错-MyBatis字段映射-遁地龙卷风

    第二版 (-1)写在前面 我用的是MyBatis 3.2.4 (0) 编程轶事 select sum(value) ,sum(value2)  from integral_list where  Me ...