`

create user and role

阅读更多

/*********************************************************************************************************************

1、创建表空间,角色及用户

**********************************************************************************************************************/

/* 以sys 用户登录  */
conn sys/pwd AS SYSDBA;

/* 在sys用户下执行 */
---create tablespace
DROP TABLESPACE tongTabSpace INCLUDING CONTENTS AND DATAFILES;
CREATE TABLESPACE tongTabSpace
LOGGING
DATAFILE 'E:\oracle\product\10.2.0\oradata\orcl\tongTabSpace01.DBF'
SIZE 100M
AUTOEXTEND ON
NEXT 50M MAXSIZE 10240M
EXTENT MANAGEMENT local;

/* 创建用户 */
---并指定表空间

DROP USER admin;
CREATE USER admin IDENTIFIED BY admin
    DEFAULT TABLESPACE tongTabSpace TEMPORARY TABLESPACE temp;

---create role
--系统管理员角色
DROP ROLE roleadmin;
CREATE ROLE roleadmin;

--grant privilege
/* 授权系统管理员角色权限 */
REVOKE
    --创建会话
    CREATE SESSION,
    --replace SESSION,
    --创建表
    CREATE TABLE,
    --replace TABLE,
    --表空间不受限制--权限大太,无法授予
    --UNLIMITED TABLESPACE,
    --创建视图
    CREATE VIEW,
    ---replace VIEW,
    --创建序列
    CREATE SEQUENCE,
    --replace SEQUENCE,
    --创建存储过程  
    CREATE PROCEDURE,
    --replace PROCEDURE,
    --创建触发器
    CREATE TRIGGER,
    replace TRIGGER,
    --创建索引
    CREATE INDEXTYPE,
    replace INDEXTYPE
FROM roleadmin; 



GRANT
    --创建会话
    CREATE SESSION,
    --replace SESSION,
    --创建表
    CREATE TABLE,
    -- replace PROCEDURE,
    --表空间不受限制--权限大太,无法授予
    --UNLIMITED TABLESPACE,
    --创建视图
    CREATE VIEW,
   -- replace VIEW,
    --创建序列
    CREATE SEQUENCE,
    --replace SEQUENCE,
    --创建存储过程  
    CREATE OR replace PROCEDURE,
    replace PROCEDURE,
    --创建触发器
    CREATE TRIGGER,
    replace TRIGGER,
    --创建索引
    CREATE INDEXTYPE,
    replace INDEXTYPE
TO roleadmin;





---表空间不受限制权限单独授予(因为权限大太,无法授予)
GRANT UNLIMITED TABLESPACE TO admin;


/* 将角色权限授予用户 */
REVOKE roleadmin FROM admin;
GRANT roleadmin TO admin;

 

 

 

/*********************************************************************************************************************

2、创建表空间,角色及用户

**********************************************************************************************************************/

/* 以sys 用户登录  */
--conn sys/change_on_install AS SYSDBA;

/* 创建用户 */
---并指定表空间

DROP USER jtosa;
CREATE USER jtosa IDENTIFIED BY dawning
    DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;

---create role
--系统管理员角色
DROP ROLE roleadmin;
CREATE ROLE roleadmin;

--grant privilege
/* 授权系统管理员角色权限 */
REVOKE
    --创建会话
    CREATE SESSION,
    --创建表
    CREATE TABLE,
    --表空间不受限制--权限大太,无法授予
    --UNLIMITED TABLESPACE,
    --创建视图
    CREATE VIEW,
    ---replace VIEW,
    --创建序列
    CREATE SEQUENCE,
    --创建存储过程 
    CREATE PROCEDURE,
    --创建触发器
    CREATE TRIGGER,
    --创建索引
    CREATE INDEXTYPE
FROM roleadmin;


GRANT
    --创建会话
    CREATE SESSION,
    --创建表
    CREATE TABLE,
    --表空间不受限制--权限大太,无法授予
    --UNLIMITED TABLESPACE,
    --创建视图
    CREATE VIEW,
    --创建序列
    CREATE SEQUENCE,
    --replace SEQUENCE,
    --创建存储过程 
    CREATE PROCEDURE,
    --创建触发器
    CREATE TRIGGER,
    --创建索引
    CREATE INDEXTYPE
TO roleadmin;

---表空间不受限制权限单独授予(因为权限大太,无法授予)
GRANT UNLIMITED TABLESPACE TO jtosa;


/* 将角色权限授予用户 */
REVOKE roleadmin FROM jtosa;
GRANT roleadmin TO jtosa;

分享到:
评论

相关推荐

    mongodb create user

    Mongodb3.0createUser说明

    oracle对象创建

    Create user <user> identified by Alter user <user> default tablespace Alter user <user> quota <size> on Alter user <user> account lock|unlock Alter user <user> identified by Alter user <user...

    oracle_create

    sql>create user wwuser identified by wwuser default tablespace wwspace temporary tablespace temp 位置:D:\wwOracle\wwspace.dbf 用户名: wwuser 密码: wwuser 临时表:temp 3、创建角色 ...

    Microsoft Press Windows Azure Step by Step

    Create a worker role project to perform backend processes Store persistent data with Windows Azure Storage Develop a scalable database application in the cloud using Microsoft SQL Azure™ Connect ...

    Unity.5.x.2D.Game.Development.Blueprints

    Set up game events to trigger and NPCs, and create a role-playing game Add artificial intelligence to game characters to add some life to game NPCs Create 2D maps and add them to the strategy game ...

    PostgreSQL 角色与用户管理介绍

    在PostgreSQL 里没有区分用户和角色的概念,”CREATE USER” 为 “CREATE ROLE” 的别名,这两个命令几乎是完全相同的,唯一的区别是”CREATE USER” 命令创建的用户默认带有LOGIN属性,而”CREATE ROLE” 命令创建...

    Creating.Dynamic.UI.with.Android.Fragments.2nd.Edition.1785889

    Create engaging apps with fragments to provide a rich user interface that dynamically adapts to the individual characteristics of your customers' tablets and smartphones About This Book From an ...

    Microsoft SQL Server2005 Analysis Services Step by Step

    and drillthrough capabilities with cubes •Manage role-based security and restrict data access •Deploy and maintain a database in a production environment CD features •All practice exercises and ...

    Microsoft SQL Server 2005 Analysis Services Step by Step

    Create dimensions and measure groups to build, browse, and modify OLAP cubes•Design objects to handle unique financial analysis requirements•Improve query performance with aggregations and user ...

    Microsoft SQL Server2005 Analysis Step by Step

    and drillthrough capabilities with cubes •Manage role-based security and restrict data access •Deploy and maintain a database in a production environment CD features •All practice exercises and ...

    DBMS调优,依据执行计划SQL 优化

    性能的注意点,无法理清部分...3) 新建 t_user , t_role , t_user_role 表 先不要建立索引和主外键,编写一个存储过程 Create procedure proc_init_sysdata(INT userNum,INT role roleNum),填写一个 spring-dbms-demo1

    WebGL Programming Guide

    important role in the development of next generation, easy-to-use and intuitive user interfaces and web content. Some examples of this are shown in Figure 1.1. Over the next few years, you can expect ...

    Wrox.Beginning.Windows.8.Application.Development

    Learn to use exciting new development tools and create applications for Windows 8 If you're a beginning developer, there's no better place to get up to speed on the Windows 8 SDK than this Wrox guide...

    loopback-load-user:自动加载回送用户和角色模型

    loopback-load-user,基于配置的模块,用于自动加载静态用户此模块与回送一起使用,以处理静态用户,角色和... // Create an Admin Role // Create a User named 'some-user' // Map 'some-user' to the Admin Role.

    AJAX and PHP.pdf

    explain the basics of jQuery and show how to create a simple, yet efficient client- server chat mechanism using AJAX. Chapter 9: AJAX Grid explains the usage of an AJAX-enabled data grid plugin, ...

    Beginning T-SQL with Microsoft SQL Server 2005 and 2008

    Depending on your role and skill level, this book will serve as a companion to the other Wrox books in the Microsoft SQL Server Beginning and Professional series.. This book will help you to learn: ...

    10231A.Designing.A.Microsoft.Sharepoint.2010.Infrastructure.Vol2

    * Design a SharePoint 2010 environment that supports social computing features including user profiles and My Sites * Design and implement search strategy in SharePoint 2010 * Translate business ...

    10231A.Designing.A.Microsoft.Sharepoint.2010.Infrastructure.Vol1

    * Design a SharePoint 2010 environment that supports social computing features including user profiles and My Sites * Design and implement search strategy in SharePoint 2010 * Translate business ...

    数据库系统原理学习资料

    CREATE ROLE app_user IDENTIFIED BY hello; GRANT CREATE VIEW TO app_user; GRANT app_user TO <用户名>; Oracle的预安装角色有: 角 色 权 限 CONNECT 登录数据库 RESOURCE 创建新对象(表、索引) DBA ...

Global site tag (gtag.js) - Google Analytics