ORACLE is QUOTA required? - oracle

I have a quick question about assigning quotas to users on tablespaces. Does a user require quota in order to select, update and insert data into a table stored in x tablespace? Do I need to grant that user quota on that x tablespace?
Thanks

The schema needs a quota, explicit or unlimited, in order to be able to create objects within that tablespace, such as tables and indexes.
It is the owner of the table who needs the quota, not the user who modifies it by adding rows.

Related

Same table name for two schemas on the same tablespace

In Oracle, is it possible to store in one tablespace the data for two tables that share the same name but are defined for different users (schemas)?
Or maybe I need to create separate tablespace per user if there might be a name clash?
I cannot easily check it for myself, as I dont' have any instance with proper privilliges available currently.
If you mean you have 2 users (schemas) so yes you can create 2 tables with same name with different users for example create table user1.tab1 ... and create table user2.tab1 ...
I need to create separate tablespace per user if there might be a name
clash
let me do some explanation ..in oracle you already have several users , for example system users that as it obvious have high privileges then you have/create other users that have specific privilege , every users has his own objects, his own tables , procedure... and this users and its objects normally and can resides in one datafiles which the datafile resides in the tablespace.

Oracle: Can you grant CREATE GLOBAL TEMPORARY TABLE specifically?

Can you grant privilege to allows the creation of a global temporary table ONLY, i.e. without CREATE TABLE?
The background of this stems from security models that don't allow 'CREATE TABLE'... I can't find a reference to any specific privileges.
I can't find a reference to any specific privileges.
Because, as far as I know, there is none. You'll still have to grant CREATE TABLE privilege to a user so he could create TEMPORARY tables.
In order to prevent a user from creating regular tables, and allow him to create only temporary tables you might consider the following:
Grant CREATE TABLE privilege to a user and revoke quota on a specific tablespace.
alter user <<user_name>> quota 0M on <<tablespace>>;
It might be the user's default tablespace or a different one.
In Oracle's versions with no DEFFERED_SEGMENT_CREATION it'll be enough for the user to see space quota exceeded for tablespace when he/she tries to create a regular table.
In Oracle's version with DEFFERED_SEGMENT_CREATION a user will still be able to create regular tables, but will not be able populate them. The second the user tries to execute an INSERT statement the space quota exceeded for tablespace appears.
So you might consider setting deferred_segment_creation parameter to false.
alter system set deferred_segment_creation = false;

Can Oracle schema used size can be greater than tablespace used size?

In Oracle schema used size can be greater than tablespace used size ? If yes how its possible as schema is associated with tablespace ?
A schema is not "associated" with a tablespace.
A user (=schema) can have a default tablespace, but that does not necessarily mean that all tables that user owns are stored in that default tablespace. If the user has the privileges, tables can be created in other tablespaces as well.
In addition to what #a_horse_with_no_name mentioned, you need to undrstand few basics of orale as well.
Oracle Tablespace -
This is a logical structure, meaning that a tablespace is not a
physical object
A tablespace is made of 1 or more physical structures called
datafiles. A datafile is a physical file on disk, just like any other file which sits on a hard disk but in an Oracle format. The datafile is created as part of a tablespace, and only one tablespace
Each tablespace can have different characteristics, such as extent
size and how the extents are managed
They are used to group segments into logical
groups. For example, you may have accounting data in one tablespace
and reporting data in another.
The Oracle Schema or User
Oracle Schema and user are synonymous and the terms are usually used
interchangeably
There can be thousands of users within one database
The schema owns segments and objects (tables, indexes,views,
constraints, etc) and each segment/object can belong to only one
schema

How to determine who owns a schema (PL/SQL)

I am new to PL/SQL Developer, and I used the File->New->Table option to create a new table. After using the GUI to set up my table descriptions, when I click "apply" I get the error "no privileges on table space".
I tried googling a solution and I read that I need to give the owner of the schema privileges to modify this table. How do I determine who the owner of a schema is so that I can give them privileges?
Is there another solution to this issue that I do not know of?
You have created the table, so it belongs to you, there is no need to grant something on schema level.
A different story altogether is the tablespace in which the table is created. There, you need a quota. With a privileged user, you can give the quote like so:
alter user <your-username>
quota unlimited on <tablespace-name>;
You need someone with sysdba privileges on the database your schema belongs to (typically a DBA) to grant your schema the necessary privileges to create objects (tables, procedures etc), along with a quota on the tablespace in question.

Are tablespaces associated with user accounts?

I have very basic question related to tablespaces.
When I was creating a user, I was asked to assign a default tablespace for this account. So, I assigned a previously created tablespace (TABLESPACE1).
If I create another user and assign a different tablespace (TABLESPACE2) for this user, then will I not be able to see tables created in TABLESPACE1?
If I create a user having access to both tablespaces (TABLESPACE1 and TABLESPACE2)
then for that user, there is another new database, but it is not actually new.
Could somebody help me to understand table space concept here.
Tablespaces are a storage concept only. They don't play a role in what user can see what tables.
You can set a default tablespace for a user, and you can allow them (or not) to create objects in specific tablespaces, but that is unrelated to what tables they have access to.
Table (and object in general) access is managed with grants. Tablespaces are for physical storage. The two are essentially unrelated.

Resources