• oracle学习之表空间


    一、oracle当中的dual表

    注意:sql语句一定要有一个 ; 结尾,不然会报错。

    Oracle数据库内种特殊DualDualOracle实际存任何用户均读取目标表SelectDual表由Oracle连同数据字典同创建用户都用名称DUAL访问该表DUMMY该列定义VARCHAR2(1)类型行值XDUAL表选择数据SELECT语句计算数表达式由于DUAL行数据

    二、pl-sql中调节字体 

    调节字体:

    http://zhidao.baidu.com/link?url=eLV_2Ng8wT7EXRCk4V6xTsAAj44wGuNt8_tDvtPD1hDg7Q2T5Jfs0J3LZlrnBABsMCvHun1fKBDt1TNnjgtxegbtomETHKbFXYwmPnJP8K7

     三、删除表空间

    删除表空间:

    四、表空间分类

    --永久表空间,也叫数据表空间,存放永久性数据,如表、索引等。

    --临时表空间,不能存放永久性数据,用于保存数据库排序,分组时产生的临时表空间

    --UNDO表空间,保存数据修改前的镜像

    五、如何创建表空间

    -- 创建表(表空间)

    create tablespace tablespaceName

    logging -- 可将表空间的创建信息记录到oracle日志中去

    datafile 'd: ablespaceName.dbf' -- 保存文件的路径,习惯上将

    size 4m -- 初始文件大小

    autoextend on -- 自增长

    next 4m maxsize 24m -- 每次增长4m,最大24m

    extent management local; -- extent 管理,两种方式:本地管理,数据字典管理

    -- 创建表(表空间文件为多个)

    create tablespace tablespaceName3

    logging

    datafile

    'tablespaceName01.dbf' size 4m autoextend on maxsize unlimited,-- 自增长,无上限

    'tablespaceName02.dbf' size 4m autoextend on maxsize unlimited,

    'tablespaceName03.dbf' size 4m autoextend on maxsize unlimited

    extent management local;

    -- 为表空间增加文件

    alter tablespace tablespaceName3

    add datafile 'tablespaceName04.dbf' size 6m autoextend on next 4m maxsize unlimited

    -- 删除表空间

    drop tablespace tablespaceName3 including contents and datafiles cascade constraints;

    -------创建临时表空间

    create tablespace tablespaceName

    logging

    tempfile 'tablespaceNamefile.dbf'

    size 4m

    autoextend on

    next 4m maxsize unlimited

    extent management local;

    create tablespace tablespaceName1

    logging

    tempfile

    'tablespaceName01.dbf' size 4m autoextend on next 4m maxsize 24m ,

    'tablesapceName02.dbf' size 4m autoextend on next 4m maxsize 24m,

    'tablespaceName03.dbf' size 4m autoextend on next 4m maxsize 24m

    extent management local;

    alter tablespace tablespaceName1

    add tempfile 'tablespaceName04.dbf' size 6m autoextend on next 4m maxsize 24m ;

    drop tablespace tablespaceName1 including contents and datafiles cascade constraints;

    --------创建UNDO表空间

    create UNDO tablespace tablespaceName

    datafile 'tablespaceName.dbf'

    size 64m;

    alter system set undo_tablespace=tablespaceName;

    drop tablespace "tablespaceName" including contents and datafiles;

    --------创建用户:设置用户名,密码; 设置数据表空间; 设置临时表空间;设置权限

    create user userName identified by password

    default tablespace dataTablespaceName

    temporary tablespace tempTablespaceName;

    grant connect , resource ,exp_full_database,imp_full_database to userName;

    -----用户修改

    alter user userName identified by password2;

    drop user userName cascade;-- cascade 解释为串行

     六、权限与角色

    ------权限与角色

    -- 一个用户可以扮演多个角色,每一个角色有相应的权限。

    /*

    在创建用户的过程中,有设置权限的操作。oracle内置了多个不同的角色,角色拥有不同的权限。

    特殊权限:

    1、系统权限是隐含在dba,resource 角色中的一个系统权限。当用户得到dba,resource的角色时,系统权限隐式的授权给用户。

    2、系统权限不能被授予角色,可以被授予用户。

    3、系统权限不会随着dba,resource被授予角色,而授予用户。

    特殊角色:

    1、dba角色,是授予数据库管理员的权限

    2、connect角色,是授予最终用户的典型权利,比如create session

    3、resource角色,是授予开发人员的。默认有8个权限:create sequence , trigger, cluster, procedure, type,operator, table,indextype

    4、exp_full_database 拥有导入数据库的权限

    5、imp_full_database 拥有导出数据库的权限

    用户授权的一些参数:

    connect resource dba unlimited tablespace

    create session

    create any sequence

    create any table

    create any view

    create any index

    create any procedure

    create any directory

    alter session

    alter any sequence

    alter any table

    alter any view

    alter any index

    alter any procedure

    alter any directory

    drop session

    drop any sequence

    drop any table

    drop any view

    drop any index

    drop any procedure

    drop any directory

    select any table

    select any directory

    insert any table

    update any table

    delete any table

    debug any procedure

    debug connect session

    exp_full_database

    imp_full_database

  • 相关阅读:
    How To Move a MySQL Data Directory to a New Location on Ubuntu 16.04
    Mysql Docker Container Command
    svg_png
    png格式图片转为svg格式图片
    Ubuntu Server如何配置SFTP(建立用户监狱)
    ubuntu用户添加adduser, useradd并给予sudo权限
    Setup FTP server on Ubuntu 14.04
    Ubuntu Server 16.04.1系统安装
    1.Linux下生成密钥
    Linux查看设备命令
  • 原文地址:https://www.cnblogs.com/zhuxuekui/p/4430166.html
Copyright © 2020-2023  润新知