zoukankan      html  css  js  c++  java
  • Oracle创建用户

     创建临时表空间

    CREATE TEMPORARY TABLESPACE test_temp
    TEMPFILE 'C:oracleproduct10.1.0oradataorcl	est_temp01.dbf'
    SIZE 32M
    AUTOEXTEND ON
    NEXT 32M MAXSIZE 2048M
    EXTENT MANAGEMENT LOCAL;

    创建用户表空间

    CREATE TABLESPACE test_data
    LOGGING
    DATAFILE 'C:ORACLEPRODUCT10.1.0ORADATAORCLTEST_DATA01.DBF' 
    SIZE 32M 
    AUTOEXTEND ON 
    NEXT 32M MAXSIZE 2048M
    EXTENT MANAGEMENT LOCAL;

    创建用户并制定表空间

    CREATE USER username IDENTIFIED BY password
    DEFAULT TABLESPACE TEST_DATA
    TEMPORARY TABLESPACE TEST_TEMP;

    给用户授予权限

    GRANT 
      CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY INDEX, CREATE ANY PROCEDURE,
      ALTER ANY TABLE, ALTER ANY PROCEDURE,
      DROP ANY TABLE, DROP ANY VIEW, DROP ANY INDEX, DROP ANY PROCEDURE,
      SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE
      TO username;

    将role这个角色授与username,也就是说,使username这个用户可以管理和使用role所拥有的资源

    GRANT role TO username;

    查看所有用户

    SELECT * FROM DBA_USERS;
    SELECT * FROM ALL_USERS;
    SELECT * FROM USER_USERS;

    查看用户系统权限

    SELECT * FROM DBA_SYS_PRIVS;
    SELECT * FROM USER_SYS_PRIVS;

    查看用户对象或角色权限

    SELECT * FROM DBA_TAB_PRIVS;
    SELECT * FROM ALL_TAB_PRIVS;
    SELECT * FROM USER_TAB_PRIVS;

    查看所有角色

    SELECT * FROM DBA_ROLES;

    查看用户或角色所拥有的角色

    SELECT * FROM DBA_ROLE_PRIVS;
    SELECT * FROM USER_ROLE_PRIVS;
    -------遇到no privileges on tablespace 'tablespace '
    
    alter user userquota 10M[unlimited] on tablespace;
  • 相关阅读:
    若不曾忘记,便不必追忆
    C# 随机生成中文字符串
    C# SQLiteHelper
    C# SQLHelper
    C# Microsoft SQL Server 操作
    C# Excel 操作
    C# XML文件操作(续)
    C# 遍历XML文件,添加,更新,删除节点
    MES系统简介
    SQL Server 存储过程(转)
  • 原文地址:https://www.cnblogs.com/Venom/p/3934360.html
Copyright © 2011-2022 走看看