revoke unlimited tablespace

Hi all

I'm using sql * plus, oracle 10 g, windows 7.

I have the users below. I want to have unlimited tablespace privilege revoked for all users listed below.
SQL > select name from USER sys.dba_users
2 where USER_USERS = 'ACCOUNT '.

User
name
--------------------
TOM
JUNE
STUDENT
ALEX
WINNIE
SQL > SPOOL OFF

I can use
"REVOKE UNLIMITED TABLESPACE TOM;"
"REVOKE UNLIMITED TABLESPACE FROM JUNE;" and so on.

Is there an easier way to do it?

Maybe

SET PAGES 0
SET LINES 80
SET TRIMS ON
SET FEEDB OFF
SPOOL

SELECT 'REVOKE UNLIMITED TABLESPACE FROM ' || username || ';'
FROM   sys.dba_users
WHERE  default_tablespace = 'ACCOUNT';

SPOOL OFF

I would join DBA_SYS_PRIVS to check what they acturally have this privilege.

If you prefer, you could also do some PL

DECLARE
  k_stmt constant VARCHAR2(100) :=
     'REVOKE UNLIMITED TABLESPACE FROM :user';
BEGIN
   FOR rec IN (SELECT p.grantee
               FROM   dba_users u, dba_sys_privs p
               WHERE  u.username = p.grantee
               AND    u.default_tablespace = 'ACCOUNT'
               AND    p.privilege = 'UNLIMITED TABLESPACE')
   LOOP
      EXECUTE IMMEDIATE REPLACE (k_stmt, ':user', rec.grantee);
   END LOOP;
END;
/

Concerning
Peter

Tags: Database

Similar Questions

  • System of grant "UNLIMITED TABLESPACE" automaticalli not assigned

    Hi all

    I have following question:

    When I create a user and grant RESOURCE sheet him then system grant UNLIMITED TABLESPACE is automatically granted as well. I can verify according to USER_SYS_PRIVS.

    When I revoke UNLIMITED TABLESPACE RESOURCE role also disappeared. It's ok.

    However, when I have my own role (let's call it MY_ROLE) who already has the role of RESOURCE assigned and then I assign role MY_ROLE to some users, while the user does not grant UNLIMITED TABLESPACE automatically and I have to add it manually. Why?

    Oracle version:

    SELECT * FROM V$ VERSION;

    Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    "CORE 11.2.0.4.0 Production."

    AMT for Linux: Version 11.2.0.4.0 - Production

    NLSRTL Version 11.2.0.4.0 - Production

    In addition, the unlimited tablespace privilege CANNOT be granted to a role, taken below link (although it is quite old)

    https://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:7540675724395 #72949126159962

  • Why it is the role of resource is implicitly grant unlimited tablespace?

    referring to unlimited storage space - is it necessary on a daily basis for the developers of the Apex, the user

    exec: v_grantee: = "XYZ";

    Select the dealer, the privilege of dba_sys_privs where dealer =: v_grantee;

    UNLIMITED TABLESPACE XYZ

    Select the dealer, granted_role from dba_role_privs where dealer =: v_grantee;

    XYZ CONNECT
    RESOURCE OF XYZ

    exec: v_granted_role: = "CONNECT";
    Select the role, the privilege of role_sys_privs where role =: v_granted_role;
    -I check which privileges associated with CONNECT system

    exec: v_granted_role: = 'RESOURCE ';
    Select the role, the privilege of role_sys_privs where role =: v_granted_role;

    CREATE TYPE RESOURCES
    RESOURCES CREATE TABLE
    CREATING CLUSTER RESOURCES
    CREATE TRIGGER RESOURCES
    OPERATOR TO CREATE RESOURCES
    CREATE SEQUENCE RESOURCES
    CREATE INDEXTYPE RESOURCES
    RESOURCE CREATE PROCEDURE

    -I check what are associated with RESOURCE access privileges

    but the moment I revoke resource of XYZ

    There is no more unlimited tablespace to XYZ. I found it quite confusing because none of the roles granted to a UNLIMTED TABLESPACE XYZ, why is it so?

    I encounter this problem in 9 and 10 g.

    Thank you very much!

    Hello

    Take a look at the thread AskTom following-

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:7540675724395

    In particular, where it says -

    It is so documented that when you grant DBA or RESOURCE, the unlimited tablespace privilege (which
    CANNOT be granted to a role) is granted to the user as well.
    
    It is just the way it works. 
    

    Hope this helps,

    John.
    --------------------------------------------
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    AWARDS: Don't forget to mark correct or useful posts on the forum, not only for my answers, but for everyone!

  • ORA-01536 Quota of space with the resource and the unlimited tablespace privilege

    Hello.
    I have the following error ORA-01536: space quota exceeded for tablespace, but my landlord has the following grants:
    -RESOURCES
    -UNLIMITED TABLESPACE
    The transaction of tablespace has allocated 150 GB and when it is almost 90% of used space error occurs, but we have auto extend in all areas of storage.

    My environment:
    Database Oracle 10.2.0.2
    RAC - ASM
    Version of server Red Hat 4

    Best regards
    Rafael Ceolim

    your welcome. If problem still appears to reopen this thread, but for now mark this thread as answered.

  • tablespace of remapping the colors using imp

    Hello

    How to redefine storage space using the IMP but not impdp command. can someone help me?

    Kind regards

    yous

    Hello

    As I mentioned earlier, make sure UserB enough tablespace default (BC) and the quota on BC. So if you have unlimited quota for UserB on all areas of storage, then objects will go to original tablespace and not the space of storage that you want (to default tablespace).

    Revoke unlimited tablespace from UserB all privs and only have a default tablespace.

    REVOKE  UNLIMITED TABLESPACE FROM USERB;
    

    Hope this helps, if it marks no useful post or reply.

    Concerning

  • Find the schemas whose tables are in unallocated storage spaces

    DB version: 10.2.0.4

    In our data base, all objects in a schema (user) will be provided only in a tablespace with the same name.
    For example: for a schema as BMN_PROD, we create a tablespace named BMN_PROD.
    CREATE USER BMN_PROD IDENTIFIED by dottie DEFAULT TABLESPACE BMN_PROD TEMPORARY TABLESPACE temp ;
    
    grant connect,resource,create view to BMN_PROD;
    revoke unlimited tablespace from BMN_PROD;   
    alter user BMN_PROD quota unlimited on BMN_PROD
    Now, we noticed that the tables owned by a single user are lying on a different tablespace.
    We want to find all these patterns that has objects in storage greater than 1.
    I wrote a query using DBA_TABLES view, but it is not wearing the correct result
    SELECT owner, tablespace_name, count(*)
    FROM DBA_TABLES DT
    WHERE OWNER NOT IN ('SYS','SYSTEM')
    --AND ROWNUM < 2000
    group by owner, TABLESPACE_NAME
    order by count(*) desc
    Published by: herbaceous January 3, 2011 06:26
    Changed the password

    This should do the trick:

    Select the owner, count (distinct tablespace_name)
    from dba_tables
    Group by owner
    having count (distinct nom_tablespace) > 1

  • problem in tablespce by default during the imp objects

    Hello

    during the User1 to User2 exp/imp objects, oracle cannot store the default tablespace that is assigned to the User2

    user default tablespace tables

    User1 selvatb conf
    User2 selvatb2-


    SQL > alter user user2 quota 0 on selvatb;
    Modified user.

    $ imp/Manager fromuser = user1 touser = User2 file system = sss.dmp


    SQL > select table_name, nom_tablespace, user_stats, owner of dba_tables where
    2 table_name like '% CONF;

    OWNER NOM_TABLESPACE TABLE_NAME
    ------------------------------ ------------------------------ ---------------------

    User1 SELVATB CONF

    User2 SELVATB CONF


    See user2... There same QUOTA 0 on SELVATB... . He import and store the table on selvatb...

    WHAT SHOULD I DO... IF I WANT TO IMPORT THE OBJECTS AND STORE THEM ON THE DEFAULT TABLESPACE THAT IS ASSIGNED TO EACH USER.


    ORACLE 9.2
    RHCE 5


    Thank you
    Selva...

    When you import, it try to use the DOF as well as in the export file and in your case since all objects belong to the selvatb tablespace, imp tries to create/import all objects in the same tablespace (selvatb) and since User2 has unlimited tablespace role, the import succeeded. But if you revoke unlimited tablespace and then imp will try to put objects in the selvatb tablespace and when it finds that the user has no quota on that then it will try to import in the default tablespace for the user and then you will have all the objects in the tablespace selvatb2.

    Thank you
    Daljit Singh

  • Problem with import in 10g

    Hi all

    Oracle 10.2.0.3.0
    Windows 2003 server.

    I am trying to export a schema * 'A' * a database and import it into the same database in different schema * "B."

    Export succeeded. I used utility (exp) traditional export.

    I created a user * "B" * and tablesapce * "B_data" * and privileges.

    My problem is when I try to import, objects are created in the * 'A' * user tablespaces.

    Then I tried to set the quota of '0' on the tablespace to the user * "B." But its import back into the 'A' tablespace users.

    I want to import in the * "B" * users tablespace * "B_data." Please advice how to get this...


    TIA,

    You already set 0 for user B tablespace quota, in addition that:

    REVOKE UNLIMITED TABLESPACE from B;

    Then - in the target database - try to create a table for user B in the 'old' user A tablespace, it do not work. Give a quota on the tablespace B to B. Then try to create a table in the table space B, he HAS to work.

    Now imp should import into tablespace B.

    Werner

  • Get ORA-01653 while the tablespace is set to unlimited.

    When I import data in the table P.TEST, I received the error "ORA-01653: unable to extend table P.TEST 128 in tablespace P.

    Here's a tablespace P, and P user information
    SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='P' AND PRIVILEGE='UNLIMITED TABLESPACE';
    
    GRANTEE       PRIVILEGE                            ADMIN_OPTION
    ------------ -------------------------------- -----------------------
    P                UNLIMITED TABLESPACE        NO
    
    CREATE TABLESPACE P DATAFILE 
      '/data/oradata/wapbi/p01.dbf' SIZE 33554416K AUTOEXTEND ON NEXT 1024M MAXSIZE UNLIMITED,
      '/data/oradata/wapbi/p02.dbf' SIZE 33554416K AUTOEXTEND ON NEXT 1024M MAXSIZE UNLIMITED
    LOGGING
    ONLINE
    PERMANENT
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE
    BLOCKSIZE 8K
    SEGMENT SPACE MANAGEMENT AUTO
    FLASHBACK ON;
    The user P has "unlimited tablespace" privilege and a P tablespace is set to 'unlimted' too.

    Comments will be appreaciate!


    Best wishes
    Satine

    There are 2 limits:
    1. size imposed by the operating system. Usually 32 GB but can be more if filesystem supports LARGEFILES
    2-4 million blocks of Oracle block size. With 8 KB blocks, this translates into 32 GB

    Hemant K Collette

  • Having problems to import tables to a new user with new tablespace

    Hi all

    Here is my scenario:

    I have a user, the latter having data stored in storage - say q, w, e.
    I would like to export all the tabledata and import it to a new user USER_B. All data imported to B must be kept in the USER_B_PERM tablespace.

    I tried a lot of things yet, but imp always try importing the tables for the original tablespaces.

    What have I done now:


    create new databases:

    create tablespace USER_B_PERM
    DATAFILE ' / oradata_big, path, USER_B, USER_B_PERM. DBF' SIZE 126 M
    SIZE UNIFORM LOCAL 125M MANAGEMENT MEASURE;

    ALTER DATABASE DATAFILE ' / oradata_big, path, USER_B, USER_B_PERM. DBF'
    AUTOEXTEND ON;


    create temporary tablespace USER_B_TEMP
    TEMPFILE ' / oradata_big, path, USER_B, USER_B_TEMP. DBF' SIZE 126 M
    SIZE UNIFORM LOCAL 125M MANAGEMENT MEASURE;

    ALTER DATABASE TEMPFILE ' / oradata_big, path, USER_B, USER_B_TEMP. DBF'
    AUTOEXTEND ON MAXSIZE 3000M;


    CREATE user B:


    -SQL USER
    CREATE USER USER_B IDENTIFIED BY USER_B
    DEFAULT TABLESPACE "USER_B_PERM".
    TEMPORARY TABLESPACE "USER_B_TEMP";

    -ROLES
    GRANT "RESOURCE" TO USER_B;
    'CONNECT' GRANT TO USER_B.
    ALTER USER USER_B ROLE BY DEFAULT "RESOURCE", "CONNECT";

    -SYSTEM PRIVILEGES
    GRANT CREATE ANY VIEW TO USER_B;
    REVOKE A USER_B UNLIMITED TABLESPACE;
    change the quota USER_B unlimited user on USER_B_PERM.

    export of old data
    owner file = exp_user_a.exp exp = USER_A compatible exp.log = LINES Y = Y = log


    new user import
    IMP file = exp_user_a.exp fromuser = USER_A, USER_B log = imp.log ROWS = touser = Y



    Because I revoked the UNLIMITED TABLESPACE privilege imp creates tables in the original storage spaces (q, w, e) but the data import failed:
    ORA-01536: space-Programmvielfalt fur Tablespace 'q' passed.

    Any ideas? I don't see what is different to the docs:
    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/exp_imp.htm#i1023312


    We are using oracle 11.2.0.1 and we have still a few columns long raw if it matters.

    Thanks in advance,
    Andreas

    I tried a lot of things yet, but imp always try importing the tables for the original tablespaces.

    If the table was created with the specific tablespace clause, then it will go in particular tablespace.

    I would like to export all the tabledata and import it to a new user USER_B. All data imported to B must be kept in the USER_B_PERM tablespace.

    easy to solve this problem in impdp datapump, use clause REMAP_TABLESPACE.

    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/dp_import.htm

  • import users in the differtnt tablespace

    Dear all,


    I have a live server in which all users default tablespace USERS, while it has some data in the system tablespace.

    I want to do another test system and import each in a different tablespace. but it has failed.

    I do the following.

    create a separate tablespace for the user
    unlimited quota on the tablespace
    quota 0 users tablespace.
    etc.

    Then run the import command
    IMP System/oracle leader = D:\full_exp.dmp log fromuser = mi touser = mi statistics = none D:\full_exp.log = ignore = y

    It will give the above errors and imported, but not in their tablespace default so that it will go the tablespace as the live server
    IMP-00003: ORACLE error 1542
    ORA-01542: tablespace 'USERS' is currently offline, cannot allocate space inside
    . . table 'LS_TTEST' import 659 lines imported
    IMP-00017: statement failed with error ORACLE 1917:

    While it will give many error

    IT OF SIMPLE I EXPORT A USER FROM THE USERS TABLESPACE AND WANT TO IMPORT IT INTO THE OTHER SYSTEM IN THE TABLESPACE WHIMS (WHICH IS THE DEFAULT TABLESPACE USER WHIMS)
    HOW IT IS POSSIBLE TO IMPORT IT INTO WHIMS INSTEAD OF USERS TABLESPACE

    NEED YOUR HELP PLEASE GIVE ME YOU KIND SUGGESTION.

    CONCERNING
    SOHAIL
    Need your help I have

    What version of Oracle? Please try to post the version of Oracle and the details of the OS before posting the thread.

    You can do 2 things to solve your problem:

    Pre-create the table(s) in the correct tablespace:
    Import the dump file using the INDEXFILE= option
    Edit the indexfile. Remove remarks and specify the correct tablespaces.
    Run this indexfile against your database, this will create the required tables in the appropriate tablespaces
    Import the table(s) with the IGNORE=Y option.
    Change the default tablespace for the user: 
    
    Revoke the "UNLIMITED TABLESPACE" privilege from the user
    Revoke the user's quota from the tablespace from where the object was exported. This forces the import utility to create tables in the user's default tablespace.
    Make the tablespace to which you want to import the default tablespace for the user
    Import the table 
    

    Kind regards

  • How to import tables, index, tablespace, etc. of a DMP.

    Hello

    I would like to know how to import tables, index, tablespace, etc. of an export an Oracle 10.2.0.1 to apply on an Oracle 11.2.0 DMP. When I import the DMP file a unique Tablespace, for example, will users tablespace data.

    On the basis of origin, we have different tablespace each separated with different content (tables, index) and I would like to know if it is posible to import the same schema, tables, index, tablespace quite with a DMP alone, Export. I can't use DBUA because the database on the 10.2 software is missing, I have only one file (24 GB) DMP DMP!.

    Thanks for the reply,

    Sorry for my English :).

    Kind regards.

    The standard solution is

    -Make sure that the target user doesn't have the UNLIMITED TABLESPACE privilege, using REVOKE
    -Make sure that the target user has no QUOTA on the default tablespace using ALTER USER... QUOTA
    -Make sure that there is quota on the tablespace (s) of the target, using ALTER USER... QUOTA
    -import indexes = n
    -empty the index orders in a separate file
    IMP indexfile =...
    -run this file

    --------------
    Sybrand Bakker
    Senior Oracle DBA

  • How to limit the privilege of tablespace to a user?

    Hi, I simply login as sys and create a user with the default 'users' in the table of his user space, then I'll give him the 'create table' and "unlimited tablespace" privileges, then I switch to this user and conclude that it can create the table in the tablespace 'users', but also others like "sysaux", how do I grant to revoke his privilege If I want to him to use only the privilege of 'users', it seems that I can't write that kind of command: 'grant unlimited tablespace on xxx users?
    Thanks in advance.
    Alter user xxx quota 1m on users;
    

    Concerning

  • export from 8i to 11g does not create an object in the default tablespace

    Hello

    I exported and schema from oracle 8i and I try to import it in oracle 11 g in a different architecture (8i is sparc. 11 g is x 86)

    I created a user with default tablespace and tablespace of origin does not exist in this database, but I get the error message;

    IMP-00003: ORACLE error 959

    ORA-00959: tablespace "TS_ARCCLAIMS_DAT" does not exist

    If I create an indexfile and create all the objects by removing the REM of the indexfile I countless errors grouped so I bet that this is not an option.

    This is how the user is created in 11g:

    CREATE THE USER ARCCLAIMS

    IDENTIFIED BY < password >

    DEFAULT TABLESPACE ARCCLAIMS_DAT

    GN_TMP TEMPORARY TABLESPACE

    DEFAULT PROFILE

    RELEASE OF ACCOUNT;

    -2 roles for ARCCLAIMS

    GRANT CONNECT TO ARCCLAIMS;

    RESOURCE GRANT AT ARCCLAIMS;

    ALTER USER ARCCLAIMS ROLE DEFAULT ALL;

    -1 system privilege for ARCCLAIMS

    GRANT UNLIMITED TABLESPACE TO ARCCLAIMS;

    -1 contingent of Tablespace to ARCCLAIMS

    ALTER USER ARCCLAIMS QUOTA UNLIMITED ON ARCCLAIMS_DAT;

    What should I do to have the items to go to the user's default storage space?

    Thank you

    Mario G.

    You can try this:

    Export file DDL extract.

    imp file % = test.dmp = full test/test display y = log y =

    Use the log file to create the table first, and then ignore object creation errors.

    imp file % = test.dmp = full test/test is ignore = y

    EXPLANATION

    ===========

    Doc 1058330.6 - pl DO NOT send a content - it is a violation of your Support contract >

  • ORA-01950: no privileges on tablespace

    Hi you all :)

    I get an error no privileges every time I try to run a procedure that suppose to insert data in different tables on different tablespaces.
    When I created the user I gave her a tablespace by default, and having been created I gave also the following privileges:

    SYS > grant unlimited tablespace to Bishop;
    SYS > ALTER USER MGR
    2 QUOTA UNLIMITED ON TEL_AVIV_TBS;
    SYS > ALTER USER MGR
    2 QUOTA UNLIMITED ON JERUSALEM_TBS;

    And always whenever I try to execute the procedure I get:
    Error report:

    ORA-01950: no privileges on tablespace "JERUSALEM_TBS".
    ORA-06512: at "VOTE. VOTING_PROC', line 14
    ORA-06512: at line 14
    01950 00000 - "no privileges on tablespace"%s '"
    * Cause: The user does not have the privileges to allocate an extent in the
    specified tablespace.
    * Action: Grant the user appropriate access privileges or grant the user
    resource space in the tablespace.

    I checked the OEM interface and see the following topics:

    General
    MGR name
    Profile DEFAULT_PROFILE
    Password authentication
    ELECTION_MASTER_TBS of default Tablespace
    Temporary tablespace TEMP
    UNBLOCKING of the situation
    By default the Group consumption no
    Roles
    Admin default role
    MANAGER N Y
    Access privileges
    Option of Admin privilege system
    CREATE SESSION N
    RUN A PROCEDURE N
    INSERT ANY TABLE N
    SELECT ANY TABLE N
    UNLIMITED TABLESPACE N
    Privileges of the object
    Object Schema Object Grant Option privilege
    INSERT ELECTION_MASTER JER_VOTES N
    INSERT ELECTION_MASTER TA_VOTES N
    Quotas
    Unlimited Tablespace System privilege granted

    Please help :)))

    Itzik

    915417 wrote:
    JER_VOTES JERUSALEM_TBS

    TA_VOTES TEL_AVIV_TBS

    Exactly what I said. Given that the table belongs to ELECTION_MASTER, you MUST grant tablespace quota to ELECTION_MASTER. Question:

    ALTER USER ELECTION_MASTER QUOTA UNLIMITED ON JERUSALEM_TBS;
    ALTER USER ELECTION_MASTER QUOTA UNLIMITED ON TEL_AVIV_TBS;
    

    SY.

Maybe you are looking for