`

如何创建Oracle 初始化DBA、Connect角色

阅读更多

|举报|字号 订阅

 
 
一、创建DBA角色
 
1.在plsql中以 sys/****  as sysdba登陆,创建角色DBA
使用下列语句进行创建,创建过程中会报错,不用管,这是给DBA赋权时有部分权限没有赋上
-- Create the role 
create role DBA;
-- Grant/Revoke object privileges 
grant execute on SYS.DBMS_DBVERIFY to DBA;
grant execute on SYS.DBMS_DEFER_QUERY to DBA;
grant execute on SYS.DBMS_DEFER_SYS to DBA;
grant execute on SYS.DBMS_FEATURE_USAGE to DBA;
grant execute on SYS.DBMS_FLASHBACK to DBA;
grant execute on SYS.DBMS_MONITOR to DBA;
grant execute on SYS.DBMS_RESUMABLE to DBA;
grant execute on SYS.DBMS_SERVER_ALERT to DBA;
grant execute on SYS.DBMS_SERVER_TRACE to DBA;
grant execute on SYS.DBMS_SERVICE to DBA;
grant execute on SYS.DBMS_STORAGE_MAP to DBA;
grant execute on SYS.DBMS_UADV_ARR to DBA;
grant execute on SYS.DBMS_UNDO_ADV to DBA;
grant execute on SYS.DBMS_WORKLOAD_REPOSITORY to DBA;
grant execute on SYS.LOAD_UNDO_STAT to DBA;
grant select, insert, update, delete, alter on SYS.MAP_OBJECT to DBA;
grant execute on SYS.OUTLN_EDIT_PKG to DBA;
grant execute on SYS.OUTLN_PKG to DBA;
grant execute on SYS.RESET_UNDO_STAT to DBA;
grant update on WKSYS.WK$SYS_CONFIG to DBA;
-- Grant/Revoke role privileges 
grant delete_catalog_role to DBA with admin option;
grant execute_catalog_role to DBA with admin option;
grant exp_full_database to DBA;
grant gather_system_statistics to DBA;
grant imp_full_database to DBA;
grant java_admin to DBA;
grant java_deploy to DBA;
grant olap_dba to DBA;
grant scheduler_admin to DBA with admin option;
grant select_catalog_role to DBA with admin option;
grant wm_admin_role to DBA;
grant xdbadmin to DBA;
-- Grant/Revoke system privileges 
grant administer any sql tuning set to DBA with admin option;
grant administer database trigger to DBA with admin option;
grant administer resource manager to DBA with admin option;
grant administer sql tuning set to DBA with admin option;
grant advisor to DBA with admin option;
grant alter any cluster to DBA with admin option;
grant alter any dimension to DBA with admin option;
grant alter any evaluation context to DBA with admin option;
grant alter any index to DBA with admin option;
grant alter any indextype to DBA with admin option;
grant alter any library to DBA with admin option;
grant alter any materialized view to DBA with admin option;
grant alter any outline to DBA with admin option;
grant alter any procedure to DBA with admin option;
grant alter any role to DBA with admin option;
grant alter any rule to DBA with admin option;
grant alter any rule set to DBA with admin option;
grant alter any sequence to DBA with admin option;
grant alter any sql profile to DBA with admin option;
grant alter any table to DBA with admin option;
grant alter any trigger to DBA with admin option;
grant alter any type to DBA with admin option;
grant alter database to DBA with admin option;
grant alter profile to DBA with admin option;
grant alter resource cost to DBA with admin option;
grant alter rollback segment to DBA with admin option;
grant alter session to DBA with admin option;
grant alter system to DBA with admin option;
grant alter tablespace to DBA with admin option;
grant alter user to DBA with admin option;
grant analyze any to DBA with admin option;
grant analyze any dictionary to DBA with admin option;
grant audit any to DBA with admin option;
grant audit system to DBA with admin option;
grant backup any table to DBA with admin option;
grant become user to DBA with admin option;
grant comment any table to DBA with admin option;
grant create any cluster to DBA with admin option;
grant create any context to DBA with admin option;
grant create any dimension to DBA with admin option;
grant create any directory to DBA with admin option;
grant create any evaluation context to DBA with admin option;
grant create any index to DBA with admin option;
grant create any indextype to DBA with admin option;
grant create any job to DBA with admin option;
grant create any library to DBA with admin option;
grant create any materialized view to DBA with admin option;
grant create any operator to DBA with admin option;
grant create any outline to DBA with admin option;
grant create any procedure to DBA with admin option;
grant create any rule to DBA with admin option;
grant create any rule set to DBA with admin option;
grant create any sequence to DBA with admin option;
grant create any sql profile to DBA with admin option;
grant create any synonym to DBA with admin option;
grant create any table to DBA with admin option;
grant create any trigger to DBA with admin option;
grant create any type to DBA with admin option;
grant create any view to DBA with admin option;
grant create cluster to DBA with admin option;
grant create database link to DBA with admin option;
grant create dimension to DBA with admin option;
grant create evaluation context to DBA with admin option;
grant create indextype to DBA with admin option;
grant create job to DBA with admin option;
grant create library to DBA with admin option;
grant create materialized view to DBA with admin option;
grant create operator to DBA with admin option;
grant create procedure to DBA with admin option;
grant create profile to DBA with admin option;
grant create public database link to DBA with admin option;
grant create public synonym to DBA with admin option;
grant create role to DBA with admin option;
grant create rollback segment to DBA with admin option;
grant create rule to DBA with admin option;
grant create rule set to DBA with admin option;
grant create sequence to DBA with admin option;
grant create session to DBA with admin option;
grant create synonym to DBA with admin option;
grant create table to DBA with admin option;
grant create tablespace to DBA with admin option;
grant create trigger to DBA with admin option;
grant create type to DBA with admin option;
grant create user to DBA with admin option;
grant create view to DBA with admin option;
grant debug any procedure to DBA with admin option;
grant debug connect session to DBA with admin option;
grant delete any table to DBA with admin option;
grant dequeue any queue to DBA with admin option;
grant drop any cluster to DBA with admin option;
grant drop any context to DBA with admin option;
grant drop any dimension to DBA with admin option;
grant drop any directory to DBA with admin option;
grant drop any evaluation context to DBA with admin option;
grant drop any index to DBA with admin option;
grant drop any indextype to DBA with admin option;
grant drop any library to DBA with admin option;
grant drop any materialized view to DBA with admin option;
grant drop any operator to DBA with admin option;
grant drop any outline to DBA with admin option;
grant drop any procedure to DBA with admin option;
grant drop any role to DBA with admin option;
grant drop any rule to DBA with admin option;
grant drop any rule set to DBA with admin option;
grant drop any sequence to DBA with admin option;
grant drop any sql profile to DBA with admin option;
grant drop any synonym to DBA with admin option;
grant drop any table to DBA with admin option;
grant drop any trigger to DBA with admin option;
grant drop any type to DBA with admin option;
grant drop any view to DBA with admin option;
grant drop profile to DBA with admin option;
grant drop public database link to DBA with admin option;
grant drop public synonym to DBA with admin option;
grant drop rollback segment to DBA with admin option;
grant drop tablespace to DBA with admin option;
grant drop user to DBA with admin option;
grant enqueue any queue to DBA with admin option;
grant execute any class to DBA with admin option;
grant execute any evaluation context to DBA with admin option;
grant execute any indextype to DBA with admin option;
grant execute any library to DBA with admin option;
grant execute any operator to DBA with admin option;
grant execute any procedure to DBA with admin option;
grant execute any program to DBA with admin option;
grant execute any rule to DBA with admin option;
grant execute any rule set to DBA with admin option;
grant execute any type to DBA with admin option;
grant export full database to DBA with admin option;
grant flashback any table to DBA with admin option;
grant force any transaction to DBA with admin option;
grant force transaction to DBA with admin option;
grant global query rewrite to DBA with admin option;
grant grant any object privilege to DBA with admin option;
grant grant any privilege to DBA with admin option;
grant grant any role to DBA with admin option;
grant import full database to DBA with admin option;
grant insert any table to DBA with admin option;
grant lock any table to DBA with admin option;
grant manage any queue to DBA with admin option;
grant manage scheduler to DBA with admin option;
grant manage tablespace to DBA with admin option;
grant on commit refresh to DBA with admin option;
grant query rewrite to DBA with admin option;
grant restricted session to DBA with admin option;
grant resumable to DBA with admin option;
grant select any dictionary to DBA with admin option;
grant select any sequence to DBA with admin option;
grant select any table to DBA with admin option;
grant select any transaction to DBA with admin option;
grant under any table to DBA with admin option;
grant under any type to DBA with admin option;
grant under any view to DBA with admin option;
grant update any table to DBA with admin option;
 
2.在sqlplus中以 sys/****  as sysdba登陆,给dba角色赋权
用 sys/**** as sysdba登录sqlplus,然后执行下列语句: 
 
      
grant all privileges to dba with admin option;  
 
grant select_catalog_role to dba with admin option;  
 
grant execute_catalog_role to dba with admin option;  
 
grant delete_catalog_role to dba with admin option;  
 
 
 
二、创建CONNECT角色
在plsql中直接创建角色CONNECT,执行下列语句即可:
-- Create the role 
create role CONNECT;
-- Grant/Revoke system privileges 
grant alter session to CONNECT;
grant create cluster to CONNECT;
grant create database link to CONNECT;
grant create sequence to CONNECT;
grant create session to CONNECT;
grant create synonym to CONNECT;
grant create table to CONNECT;
grant create view to CONNECT;
 
 
然后给system和相应的用户赋予DBA的角色,即可操作
 
注:如果是linux用户可以使用终端之后输入
su-oracle
sqlplus
之后按照以上步骤就可以了~
linux里面这个文件可以用查看的方式打开之后就能复制如果用记事本貌似复制不了~
分享到:
评论

相关推荐

    操作系统重装后oracle数据库的恢复

    在"计算机管理"控制台中->系统工具->本地用户和组->组中,增加名称为"ORA_DBA",描述为"Members can connect to the Oracle database as a DBA without a password"的组,并将系统管理员用户如"Administrator"添加到...

    Oracle 主要配置文件介绍

    保护数据考虑的 尤其在 CAMS 双机应用模式下 能够保证数据的一致性 具体的修改操作可参考 Linux与 Oracle 安装手册 初始化参数文件是一个包含实例配置参数的文本文件 这些参数被设置为特 定的值 用于...

    最全的oracle常用命令大全.txt

    带初始化参数文件的启动方式 先读取参数文件,再按参数文件中的设置启动数据库 例:startup pfile=E:Oracleadminoradbpfileinit.ora 8、startup EXCLUSIVE 二、用户如何有效地利用数据字典 ORACLE的数据字典是...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

     创建角色 SQL> create role admin;  授权给角色 SQL> grant connect,resource to admin;  撤销角色的权限 SQL> revoke connect from admin;  删除角色 SQL> drop role admin;   第三章 Sql查询与函数 一、...

    Oracle数据库——数据库安全性管理.pdf

    (3)具体步骤如下: 使⽤ALTER SYSTEM命令修改初始化参数resource_limit,使资源限制⽣效。 ALTER SYSTEM set resource_limit=true; 使⽤CREATE PROFILE命令创建概要⽂件 。 使⽤CREATE USER命令 或ALTER USER命令...

    Oracle SQL高级编程(资深Oracle专家力作,OakTable团队推荐)--随书源代码

     Oracle开发人员和DBA必备 内容简介  Oracle 数据库中的SQL是当今市场上功能最强大的SQL实现之一,而本书全面展示了这一工具的威力。如何才能让更多人有效地学习和掌握SQL呢?Karen Morton及其团队在本书中提供...

    ORACLE 常用手册导入导出

    create database及所有的tablespace: 以每2分钟初始化一个2G的数据文件来计算,建立一个400G的Oracle数据库需要约6.7个小时。 b. import。时间较难确定,但保守估计应在10个小时以上(如果import过程中出现问题,...

    orcale常用命令

    带初始化参数文件的启动方式 先读取参数文件,再按参数文件中的设置启动数据库 例:startup pfile=E:Oracleadminoradbpfileinit.ora 8、startup EXCLUSIVE 二、用户如何有效地利用数据字典 ORACLE的数据字典是...

    RMAN测试演练即讲解

    Rman不能备份口令文件和初始化参数文件(也就是前面提到的init.ora)。 1、 备份DataBase backup database; backup database是一次全备份,其实省略的很多参数,相当于用的默认的。而备份好的备份集放在哪里呢? 在...

Global site tag (gtag.js) - Google Analytics