`

如何创建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数据库

    使用以下命令从文本初始化参数文件创建二进制SPFILE,以提高数据库启动效率: ``` SQL> alter database backup controlfile to trace as '/oracle/soft/ctl.txt'; ``` 这一步骤需要预先确认目标目录的存在性,并且...

    oracle创建数据库脚本

    Oracle数据库提供了许多内置的角色,如DBA(数据库管理员)、CONNECT(连接)等,可以通过`GRANT`语句把这些角色授予特定的用户,以便他们能够执行特定的操作。 在数据库维护方面,定时导出导入备份是确保数据安全...

    ORACLE 数据库创建用户和脚本执行方法

    对于1.2版本,用户需要"connect"和"dba"角色,这使得用户能够连接到数据库并执行数据库管理员的操作。而对于2.0版本,用户则需要"connect"和"resource"角色,并在"系统权限"选项卡中额外赋予"create view"权限,以便...

    oracle预定义角色.doc

    关于Segment的初始化参数,如INITIAL、NEXT和MINEXTENTS,它们控制了段扩展的大小和方式。INITIAL定义了初始扩展的大小,NEXT定义了后续扩展的初始大小,而MINEXTENTS设定了段至少需要的扩展数量。这些参数影响数据...

    Oracle创建表空间、临时表、用户及用户授权

    - `size` 初始化数据文件的大小。 - `autoextend` 允许数据文件自动扩展。 - `next` 设置每次扩展的大小。 - `maxsize` 设置数据文件的最大大小。 - `extent management local` 表示本地段管理,意味着每个表...

    oracle创建表空间和用户

    总的来说,创建Oracle表空间和用户是数据库初始化的重要步骤,这涉及到数据存储的规划和访问控制的设置。通过合理地创建和配置表空间及用户,可以有效地管理和保护数据库资源,确保系统的稳定运行。

    oracle新建数据库和连接配置步骤

    1. **编辑init.properties文件**:这个文件是初始化参数文件,用于设置数据库启动时的一些参数。通常位于$ORACLE_HOME/dbs目录下,名为`init<sid>.ora`,其中`<sid>`是数据库的SID。在这个文件中,你可以配置诸如...

    oracle创建表空间

    - **授予 CONNECT 和 RESOURCE 角色**:这两个角色包含了创建和管理数据库对象的基本权限。 ```sql GRANT CONNECT, RESOURCE TO test; ``` - **授予 DBA 角色**:DBA 角色拥有所有系统级权限,包括管理数据库...

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

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

    oracle11g创建用户的资源

    ### Oracle 11g 创建用户的资源管理与操作详解 #### 一、Oracle 11g 创建用户及其资源分配 在Oracle 11g数据库中,创建用户并为其分配合适的资源是一项重要的任务。以下是对给定内容中的关键步骤进行详细解析。 #...

    Oracle审计功能详解

    1. 修改初始化参数文件(init<sid>.ora),设置AUDIT_TRAIL参数,并且重启数据库。 2. 设置AUDIT_TRAIL参数,取值可以是DB、TRUE、OS、DB_EXTENDED、NONE或FALSE等。 3. 如果设置AUDIT_TRAIL = OS,还需要修改参数...

    Oracle巡检手册指南

    - **检查Oracle初始化文件中相关参数值**:初始化参数文件(init.ora或spfile.ora)设置数据库的行为,如内存分配、最大连接数等。通过`show parameter`命令查看。 - **检查数据库连接情况**:使用`v$session`视图...

    oracle10g从入门到精通[整理].pdf

    Oracle 10g 是一款广泛使用的...总的来说,Oracle 10g的管理涉及用户权限、数据库连接、表空间和初始化参数等多个方面,理解并熟练掌握这些概念和技术对于软件开发者来说至关重要,能够确保数据库的安全高效运行。

    vcenter6.0采用oracle11g独立数据库

    - 需要以“VPXADMIN”用户的身份登录到Oracle数据库,并执行以下脚本,这些脚本将用于初始化vCenter数据库模式,并创建必要的存储过程和视图。 ``` @D:\dbschema\VCDB_oracle.sql @D:\dbschema\VCDB_views_...

    手工创建数据库的全部脚本及说明

    创建数据库用户,并分配相应的权限,如`CONNECT`、`RESOURCE`角色,以及对特定表空间的使用权。 15. **数据库安全与备份**: 设置数据库的审计策略,确保数据安全。同时,制定备份和恢复计划,以防数据丢失。 在...

    Oracle DBA应该定期做什么笔记

    为了使自定义的回滚段在启动时生效,可以在初始化参数文件 (`initorcl.ora`) 中加入以下语句: ``` rollback_segments=(rb0,rb1,...) ``` 这里的 `rb0`, `rb1` 等为自定义的回滚段名称。通过这种方式配置,可以...

    oracle创建删除表空间和用户授权的一些语句 可以直接使用

    在Oracle数据库管理中,创建与删除表空间、用户授权等操作是数据库管理员(DBA)经常需要处理的任务。这些操作对于确保数据库资源的有效分配、数据安全性和系统性能至关重要。下面将详细介绍如何在Oracle中执行这些...

Global site tag (gtag.js) - Google Analytics