<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; ORA-00990</title>
	<atom:link href="https://www.xifenfei.com/tag/ora-00990/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sat, 07 Nov 2026 15:45:44 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>回收dba中alter system处理方法</title>
		<link>https://www.xifenfei.com/2011/12/%e5%9b%9e%e6%94%b6dba%e4%b8%adalter-system%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html</link>
		<comments>https://www.xifenfei.com/2011/12/%e5%9b%9e%e6%94%b6dba%e4%b8%adalter-system%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html#comments</comments>
		<pubDate>Fri, 09 Dec 2011 16:22:34 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[ORA-00990]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=2104</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2011/12/%e5%9b%9e%e6%94%b6dba%e4%b8%adalter-system%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2011/12/%e5%9b%9e%e6%94%b6dba%e4%b8%adalter-system%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html" target="_blank">回收dba中alter system处理方法</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>今天在pub上看到一个问题，一个朋友想回收dba的alter system权限，直接回收这个系统权限从dba的做法是不推荐使用，因为修改了系统默认的dba角色所具有的系统权限，可能会导致未知的后果。好的做法是创建新的角色，使其有dba中除alter system之外的所有权限。<br />
<strong>1、数据库版本</strong></p>
<pre class="brush: sql; title: ; notranslate">SQL&gt; select * from v$version;

BANNER
-------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production</pre>
<p><strong>2、创建角色并授权</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; create role xifenfei;

角色已创建。

SQL&gt; declare
  2  cursor cur is select privilege from role_sys_privs where role='DBA'
  3  AND PRIVILEGE NOT IN ('ALTER SYSTEM','ADMINISTER RESOURCE MANAGER');
  4  BEGIN
  5    FOR C in cur loop
  6    EXECUTE IMMEDIATE  'grant '||c.privilege||' to xifenfei';
  7    END loop;
  8  END;
  9  /

PL/SQL 过程已成功完成。

SQL&gt; SELECT PRIVILEGE FROM ROLE_SYS_PRIVS
  2  WHERE ROLE ='DBA' AND PRIVILEGE NOT IN(
  3  SELECT PRIVILEGE FROM ROLE_SYS_PRIVS
  4  WHERE ROLE ='XIFENFEI'
  5  );

PRIVILEGE
----------------------------------------
ALTER SYSTEM
ADMINISTER RESOURCE MANAGER
</pre>
<p>说明：授予创建角色出ALTER SYSTEM和ADMINISTER RESOURCE MANAGER系统权限之外的所有权限<br />
<br />
<strong>3、创建用户并授权角色</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; create user chf_xff identified by xifenfei;

用户已创建。

SQL&gt; grant xifenfei to chf_xff;

授权成功。
</pre>
<p><strong>4、单独授予ADMINISTER RESOURCE MANAGER权限</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; exec dbms_resource_manager_privs.grant_system_privilege(
   2 grantee_name =&gt; 'CHF_XFF',admin_option =&gt; false);

PL/SQL 过程已成功完成。

SQL&gt; CONN chf_xff/xifenfei
已连接。

SQL&gt; SELECT * FROM SESSION_PRIVS WHERE
  2  PRIVILEGE ='ADMINISTER RESOURCE MANAGER';

PRIVILEGE
----------------------------------------
ADMINISTER RESOURCE MANAGER
</pre>
<p>说明:<br />
1)通过授权xifenfei角色和ADMINISTER RESOURCE MANAGER权限，完成回收dba中的alter system权限要求。<br />
2)如果只有个别用户有这样的需求，那么可以直接生成批量授权语句实现，而不用建立类此xifenfei这样的角色。<br />
<br />
<strong>5、为何单独授予ADMINISTER RESOURCE MANAGER权限</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; CONN / AS SYSDBA
已连接。
SQL&gt; GRANT ADMINISTER RESOURCE MANAGER TO CHF_XFF;
GRANT ADMINISTER RESOURCE MANAGER TO CHF_XFF
      *
第 1 行出现错误:
ORA-00990: 权限缺失或无效
</pre>
<p>说明：ADMINISTER RESOURCE MANAGER这个系统权限在10g及其以后版本中，就不能直接使用GRANT/REVOKE直接授权/回收权限,而必面使用dbms_resource_manager_privs.grant_system_privilege和revoke_system_privilege过程进行处理。<br /></p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/oracle%e5%b8%b8%e7%94%a8%e7%94%a8%e6%88%b7%e6%9d%83%e9%99%90%e8%a7%86%e5%9b%be.html" rel="bookmark" class="crp_title">Oracle常用用户权限视图</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/%e5%88%9b%e5%bb%ba%e8%a7%86%e5%9b%be%e6%8f%90%e7%a4%baora-01031.html" rel="bookmark" class="crp_title">创建视图提示ORA-01031</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/03/grant-dml-to-public-authorization-expires.html" rel="bookmark" class="crp_title">表dml操作权限授权给public,导致只读用户失效</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/08/oracle%e4%b9%8buser-%e7%ae%a1%e7%90%86.html" rel="bookmark" class="crp_title">oracle之user 管理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/ora-01031-insufficient-privileges.html" rel="bookmark" class="crp_title">ORA-01031: insufficient privileges</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/resmgrcpu-quantum%e7%ad%89%e5%be%85.html" rel="bookmark" class="crp_title">resmgr:cpu quantum等待</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/in-memory-database-cache-%e5%85%a5%e9%97%a8%e9%85%8d%e7%bd%ae.html" rel="bookmark" class="crp_title">In-Memory Database Cache 入门配置</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/plsql%e7%9a%84%e5%ae%9a%e4%b9%89%e8%80%85%e4%b8%8e%e8%b0%83%e7%94%a8%e8%80%85.html" rel="bookmark" class="crp_title">pl/sql的定义者与调用者</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/plsql-dev%e4%b8%addynamic-performance-tables-not-accessible%e5%88%86%e6%9e%90%e8%a7%a3%e5%86%b3.html" rel="bookmark" class="crp_title">plsql dev中Dynamic Performance Tables not accessible分析解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/05/oracle%e4%b8%ad%e7%9a%84default-roleset-role.html" rel="bookmark" class="crp_title">ORACLE中的default role/set role</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/%e9%87%8d%e5%bb%badbms_stats%e5%8c%85.html" rel="bookmark" class="crp_title">重建DBMS_STATS包</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/oracle-10g%e7%bb%95%e8%bf%87%e5%af%86%e7%a0%81%e7%99%bb%e9%99%86%e6%95%b0%e6%8d%ae%e5%ba%93.html" rel="bookmark" class="crp_title">Oracle 10g绕过密码登陆数据库</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2011/12/%e5%9b%9e%e6%94%b6dba%e4%b8%adalter-system%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
