- 浏览: 4414816 次
- 性别:
- 来自: 厦门
文章分类
- 全部博客 (634)
- Oracle日常管理 (142)
- Oracle体系架构 (45)
- Oracle Tuning (52)
- Oracle故障诊断 (35)
- RAC/DG/OGG (64)
- Oracle11g New Features (48)
- DataWarehouse (15)
- SQL, PL/SQL (14)
- DB2日常管理 (9)
- Weblogic (11)
- Shell (19)
- AIX (12)
- Linux/Unix高可用性 (11)
- Linux/Unix日常管理 (66)
- Linux桌面应用 (37)
- Windows (2)
- 生活和工作 (13)
- 私人记事 (0)
- Python (9)
- CBO (15)
- Cognos (2)
- ORACLE 12c New Feature (2)
- PL/SQL (2)
- SQL (1)
- C++ (2)
- Hadoop大数据 (5)
- 机器学习 (3)
- 非技术 (1)
最新评论
-
di1984HIT:
xuexilee!!!
Oracle 11g R2 RAC高可用连接特性 – SCAN详解 -
aneyes123:
谢谢非常有用那
PL/SQL的存储过程和函数(原创) -
jcjcjc:
写的很详细
Oracle中Hint深入理解(原创) -
di1984HIT:
学习了,学习了
Linux NTP配置详解 (Network Time Protocol) -
avalonzst:
大写的赞..
AIX内存概述(原创)
表空间quota概述
Oracle 官网对quota的定义如下: A limit on a resource, such as a limit on the amount of database storage used by a database user. A database administrator can set tablespace quotas for each Oracle Database username
有关Oracle Quota 这块可以参考Oracle官方文档
http://download.oracle.com/docs/cd/E11882_01/network.112/e16543
quota的日常管理
常见问题
ORA-01536:space quota exceeded for table space 'CYYD'
解决办法:
alter user USERNAME quota 100M on TABLESPACENAME;
alter user USERNAME quota unlimited on TABLESPACENAME;
grant unlimited tablespace to USERNAME;
quota是为了限制用户对表空间的使用,比如你限制用户Guotu在tablespace CYYD中的quota为10m,当用户Guotu在tablespace CYYD中的数据量达到10m后,无论你的tablespace CYYD中有多少空间,Guotu都无法再使用tablespace CYYD了。
所以你需要:
alter user aGuotu quota 1000M on CYYD;
alter user Guotu quota unlimited on CYYD;
grant unlimited tablespace to Guotu
dba_ts_quotas
与quota相关的数据字典视图为dba_ts_quotas,以下是相关的信息
Assigning a Tablespace Quota for the User
You can assign each user a tablespace quota for any tablespace (except a temporary tablespace). Assigning a quota accomplishes the following:
Users with privileges to create certain types of objects can create those objects in the specified tablespace.
Oracle Database limits the amount of space that can be allocated for storage of a user's objects within the specified tablespace to the amount of the quota.
By default, a user has no quota on any tablespace in the database.
If the user has the privilege to create a schema object, then you must assign a quota to allow the user to create objects. At a minimum, assign users a quota for the default tablespace, and additional quotas for other tablespaces in which they can create objects.
可以使用下列语句来创建用户
CREATE USER jward
IDENTIFIED BY password
DEFAULT TABLESPACE data_ts
QUOTA 100M ON test_ts
QUOTA 500K ON data_ts
TEMPORARY TABLESPACE temp_ts
PROFILE clerk;
配额的指定可以禁止用户的对象使用过多的表空间
You can assign a user either individual quotas for a specific amount of disk space in each tablespace or an unlimited amount of disk space in all tablespaces. Specific quotas prevent a user's objects from using too much space in the database.
You can assign quotas to a user tablespace when you create the user, or add or change quotas later. (You can find existing user quotas by querying the USER_TS_QUOTAS view.) 。
If a new quota is less than the old one, then the following conditions remain true:
(1)If a user has already exceeded a new tablespace quota, then the objects of a user in the tablespace cannot be allocated more space until the combined space of these objects is less than the new quota.
(2)If a user has not exceeded a new tablespace quota, or if the space used by the objects of the user in the tablespace falls under a new tablespace quota, then the user's objects can be allocated space up to the new quota.
Restricting the Quota Limits for User Objects in a Tablespace
You can restrict the quota limits for user objects in a tablespace by using the ALTER USER SQL statement to change the current quota of the user to zero.
After a quota of zero is assigned, the objects of the user in the tablespace remain, and the user can still create new objects, but the existing objects will not be allocated any new space.
For example, you could not insert data into one of this user's exiting tables. The operation will fail with an ORA-1536 space quota exceeded for tables error.
Granting Users the UNLIMITED TABLESPACE System Privilege
To permit a user to use an unlimited amount of any tablespace in the database, grant the user the UNLIMITED TABLESPACE system privilege. This overrides all explicit tablespace quotas for the user. If you later revoke the privilege, then you must explicitly grant quotas to individual tablespaces. You can grant this privilege only to users, not to roles.
Before granting the UNLIMITED TABLESPACE system privilege, you must consider the consequences of doing so.
Advantage:
You can grant a user unlimited access to all tablespaces of a database with one statement.
Disadvantages:
(1)The privilege overrides all explicit tablespace quotas for the user.
(2)You cannot selectively revoke tablespace access from a user with the UNLIMITED TABLESPACE privilege. You can grant selective or restricted access only after revoking the privilege.
Listing All Tablespace Quotas
Use the DBA_TS_QUOTAS view to list all tablespace quotas specifically assigned to each user. For example:
SELECT * FROM DBA_TS_QUOTAS;
TABLESPACE USERNAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS
---------- --------- -------- ---------- ------- ----------
USERS JFEE 0 512000 0 250
USERS DCRANNEY 0 -1 0 -1
When specific quotas are assigned, the exact number is indicated in the MAX_BYTES column
. This number is always a multiple of the database block size, so if you specify a tablespace quota that is not a multiple of the database block size, then it is rounded up accordingly.
Unlimited quotas are indicated by -1.
注意当对用户赋予resource角色时将同时赋予unlimited tablespace的系统权限。详情见下文
创建用户
SQL> create user test_privs identified by test_privs default tablespace users;
User created.
SQL> select * from dba_sys_privs where GRANTEE='TEST_PRIVS';
no rows selected
赋予resource角色
SQL> grant resource to TEST_PRIVS;
Grant succeeded.
查询resource角色所具有的系统权限
SQL> select * from dba_sys_privs where GRANTEE='RESOURCE';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
RESOURCE CREATE TRIGGER NO
RESOURCE CREATE SEQUENCE NO
RESOURCE CREATE TYPE NO
RESOURCE CREATE PROCEDURE NO
RESOURCE CREATE CLUSTER NO
RESOURCE CREATE OPERATOR NO
RESOURCE CREATE INDEXTYPE NO
RESOURCE CREATE TABLE NO
查看用户所具有的角色
SQL> select * from dba_role_privs where GRANTEE='TEST_PRIVS';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
TEST_PRIVS RESOURCE NO YES
查询用户所具有的系统权限
SQL> select * from dba_sys_privs where GRANTEE='TEST_PRIVS';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
TEST_PRIVS UNLIMITED TABLESPACE NO
可以看到,Oracle默认的把unlimited tablespace的系统权限赋予了用户
查询表空间
SQL> select TABLESPACE_NAME,USERNAME,BYTES,MAX_BYTES from dba_ts_quotas;
TABLESPACE_NAME USERNAME BYTES MAX_BYTES
------------------------------ ---------- ---------- ----------
INDX HR 65536 10485760
SYSAUX OLAPSYS 16318464 -1
USERS HR 196608 -1
SYSAUX SYSMAN 54460416 -1
SYSAUX DMSYS 262144 209715200
TRANS TRANS 0 10485760
可以看到对于具有unlimited tablespace系统权限的用户,在dba_ts_quota上没有体现。
这里补充说一句,一般创建用户时,如果没有特殊需求只要将resource和connect角色赋予用户即可。
SQL>
select * from dba_sys_privs where GRANTEE=
'CONNECT';
ROLE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
CONNECT CREATE SESSION NO
SQL> grant resource,connect to test_privs;
Grant succeeded.
参考至:http://docs.oracle.com/cd/E11882_01/network.112/e16543/users.htm#DBSEG10220
http://tech.it168.com/o/2006-04-08/200604081532523.shtml
http://www.itpub.net/thread-345851-1-1.html
本文原创,转载请注明出处、作者
如有错误,欢迎指正
邮箱:czmcj@163.com
发表评论
-
Oracle 11g、12c大量错误登陆尝试带来的数据库异常
2018-07-16 09:21 1538APPLIES TO: Oracle Database - ... -
如何定位那些SQL产生了大量的redo日志
2018-05-15 14:38 1811在ORACLE数据库的管理、 ... -
When Memory_target Is Set and Swap Size Is Not Big (Doc ID 2356025.1)
2018-03-16 18:13 1194Kkjcre1p: unable to sp ... -
Transparent Hugepage is not getting disabled (Doc ID 2279458.1)
2018-03-16 18:10 825Transparent Hugepage is ... -
Troubleshooting: "log file sync" Waits (文档 ID 1376916.1)
2017-03-09 14:32 1374What is a 'log file sync' wai ... -
log file sync总结
2017-03-09 14:36 3268log file sync等待时间发生在redo log从 ... -
Oracle Log File Sync Wait Event
2017-03-08 18:46 1175The Oracle “log file sync” wai ... -
Tuning ‘log file sync’ Event Waits
2017-03-08 18:41 865Tuning ‘log file sync’ Event ... -
Diagnosing buffer busy waits with the ash_wait_chains.sql script (v0.2)
2017-03-08 16:56 859Diagnosing buffer busy waits w ... -
Advanced Oracle Troubleshooting Guide – Part 11: Complex Wait Chain Signature An
2017-03-08 16:05 1109Here’s a treat for the hard-co ... -
Oracle 10046 SQL TRACE
2017-03-08 15:19 950为什么我们要使用10046 trace? 10046 ... -
Automatic Storage Management
2016-11-03 15:33 875SYSASM Role When Automatic ... -
ASM FAQ
2016-11-03 15:29 738ASM FAQ Oracle Automatic ... -
Oracle ALTER PROFILE语法
2016-10-10 11:36 3420ALTER PROFILE Purpose Use th ... -
Oracle FGA审计
2016-09-20 09:42 1394大家对trigger可能比较熟悉,但Oracle还有一个叫 ... -
Secret.txt
2016-09-14 17:20 0考试登录账号:YAMAC0043865 Chen1988协会网 ... -
Oracle Data Pump Internals
2016-09-13 16:38 793IntroductionOracle Data Pump w ... -
UDEV SCSI Rules Configuration for ASM in Oracle Linux 5, 6 and 7
2016-09-12 16:32 858UDEV SCSI Rules Configuration ... -
Cannot Allocate New Log
2016-02-21 12:28 5459故障报错 Thread 1 cannot allocat ... -
Oracle flashback dropped tablespace(原创)
2015-11-15 22:21 2021Oracle官方并不推荐在数据库物理结构发生改变的情况下进行 ...
相关推荐
### ORACLE Quota 表空间限制详解 #### 一、Quota 概念与作用 在 Oracle 数据库中,为了更好地管理和控制用户对不同表空间的使用情况,引入了 Quota 的概念。Quota 主要用于限制用户在一个或多个表空间内所能使用...
### Oracle导入时表空间不一致解决方法 在Oracle数据库管理中,经常会出现因表空间不一致而导致的数据导入失败的问题。本文将详细介绍如何解决这一常见问题,并确保数据能够顺利地从一个环境迁移到另一个环境中。 ...
### Oracle新手入门指导之六——Oracle回收站详解 #### 回收站概念介绍 在Oracle数据库中,**回收站(Recycle Bin)**是一项非常实用的功能,它为用户提供了一种安全删除对象的方式。当用户删除一个表、视图、索引等...
在Oracle数据库管理中,表空间(Tablespaces)和用户(Users)是两个核心概念,用于组织和管理数据库的数据存储及权限控制。以下是关于这两个主题的详细介绍: **一、表空间(Tablespaces)** 表空间是Oracle...
### Oracle 闪回技术详解 #### 一、概述 Oracle闪回技术是Oracle数据库中一项非常重要的特性,它主要用于逻辑错误的恢复,而非物理损坏的修复。这项技术可以帮助数据库管理员在遇到逻辑错误的情况下,比如误删数据...
### Oracle 创建表空间、用户与用户授权详解 #### 一、概述 在Oracle数据库中,创建表空间、用户以及对用户进行授权是非常重要的基础性工作。这些操作对于确保数据库的有效管理和资源合理分配至关重要。本文将详细...
### Oracle 创建用户与数据库知识点详解 #### 一、Oracle创建表空间 在Oracle数据库管理中,**表空间**是逻辑存储单元,它由一个或多个数据文件组成,用于存储数据库对象(如表、索引等)。创建表空间是管理数据库...
### Oracle EXP/IMP 表空间转换详解 #### 一、背景与目的 在数据库管理过程中,经常需要通过Oracle的导出(EXP)和导入(IMP)工具来迁移数据。这一过程中,表空间的转换是非常常见的一项操作。对于不包含特定复杂...
以上命令中,`CREATE USER`语句创建了一个名为`nc65job`的新用户,并设置了密码为`nc65job`,默认表空间为`HR_DATA01`,临时表空间为`TEMP`,并且对`HR_DATA01`表空间没有空间限制(`QUOTA UNLIMITED ON HR_DATA01`)...
通过上述步骤,我们可以看到Oracle数据库中创建用户、分配权限以及设置表空间配额的完整过程。这些操作对于数据库的安全性和性能管理至关重要,也是Oracle数据库管理员必须掌握的核心技能之一。
### Oracle数据库还原与管理命令详解 #### 一、Oracle服务启动与停止命令 在进行数据库操作之前,我们首先需要确保Oracle服务已经启动。如果需要关闭服务进行维护,则也需要掌握相应的命令。 - **启动Oracle服务*...
例如,授予用户wanghao创建会话、使用表空间、创建表、删除表、插入和更新数据的权限: ```sql SQL> grant create session to wanghao; SQL> alter user wanghao quota unlimited on USERS; SQL> grant create table...
首先,**创建表空间**是Oracle数据库管理的基础。表空间是Oracle存储数据的逻辑单位,它由一个或多个数据文件组成。在导入数据前,你需要确保有足够的表空间来容纳新导入的数据。创建表空间的SQL语句大致如下: ```...
### Oracle配置手顺详解 在IT领域,Oracle数据库的配置与管理是许多系统管理员和数据库工程师的核心工作之一。本文将基于提供的文件信息,详细解析Oracle配置的手顺,涵盖数据库空间的创建、调整以及用户权限的设定...
这里创建了一个名为 `rmants` 的表空间,其数据文件路径为 `c:\oracle\oradata\cc\rmants.ora`,初始大小为 20MB。 ##### 2. 创建用户 接着,需要创建一个拥有恢复目录所有者权限的用户: ```sql SQL> create ...
### Oracle复习知识点详解 #### 一、创建与管理数据库对象 **1. 创建表空间** 在Oracle中,数据存储在表空间中。表空间由一个或多个数据文件组成,是逻辑存储单元。例如: ```sql createtime EXAM_DATAFILE 'C:\...
### Oracle 创建新用户过程详解 在Oracle数据库管理中,创建新用户是一项常见的操作。通过创建新用户,可以为不同的人员或应用程序提供访问数据库的权限。本文将详细介绍如何在Oracle环境中创建新用户、备份用户...
15. 分配磁盘空间给用户:在 `CREATE USER` 语句中使用 `QUOTA` 子句来指定用户在特定表空间的磁盘配额。 16. 开启口令检验函数:通过在 `SYS` 模式中执行 `utlpwdmg.sql` 脚本来启用密码检查函数。 17. 没有赋予...