Rights for all table

Hi,
I have a Role with the name siud_Data (select, insert, update, delete in shema Data). When a User has this Role, he can Select, Insert, Update and Delete in the shema Data.
Now i have the problem that evry time i create a table in Data i must grant the right to siud_Data. We have 5 workmate who write stored procedures evry 2 - 3 mounth. Sometimes we forgot tho grant the rights.
Now my Question.
Is there Possible to say that evry time a new table is created the role siud_Data has the rights?
Thanks for u answer.
My english is bad, i know :-(

Hi,
Try this code, trigger @ schema level
create or replace trigger grant_permission
after create on schema
declare
pragma autonomous_transaction;
begin
execute immediate 'GRANT SELECT ON ' || ora_dict_obj_name || ' TO hr';
end;
there might get a case where dead lock might get.
- Pavan Kumar N
Oracle 9i/10g - OCP
http://oracleinternals.blogspot.com/

Similar Messages

  • How do I run sp_spaceused for all tables in a database?

    Hi,
    I am struggling to understand how to run the sp_spaceused sproc for all tables in a database.
    I know how to use it for one table but how would I replicate it automatically for each table in a given database?
    Regards,
    Ian.

    I just managed to alter the code of VidyaSagar and have pulled out all the information including Schema name. Below is what it looks like:
    set
    nocount
    on
    select
    'Database Name: ',
    db_name
    if
    exists(select
    name from tempdb..sysobjects
    where name='##tmp'
    drop
    table ##tmp
    create
    table ##tmp(TABLE_SCHEMA
    nvarchar(256),TABLE_NAME
    nvarchar(256),
    num_rows int,
    reserved_KB varchar(15),data_KB
    varchar(15),index_KB
    varchar(15),unsed_KB
    varchar(15
    go
    declare
    @tbl_schema nvarchar(256
    declare
    @tbl_name nvarchar(256
    declare
    @schema_tbl_name nvarchar(256
    declare
    tblname CURSOR
    for
    select
    TABLE_SCHEMA
    TABLE_NAME
    from
    INFORMATION_SCHEMA.TABLES
    where TABLE_TYPE='BASE
    TABLE' 
    open
    tblname
    Fetch
    next
    from tblname
    INTO @tbl_schema,@tbl_name
    WHILE
    @@FETCH_STATUS
    = 0
    BEGIN
    set @schema_tbl_name=@tbl_schema+'.'+@tbl_name
    insert
    into ##tmp(TABLE_NAME
    , num_rows
    , reserved_KB
    ,data_KB
    ,index_KB
    ,unsed_KB
    exec
    sp_spaceused
    @schema_tbl_name
    update ##tmp
    set TABLE_SCHEMA
    =@tbl_schema
    where TABLE_SCHEMA
    is
    NULL
    and TABLE_NAME=@tbl_name
    FETCH
    NEXT
    FROM tblname
    INTO @tbl_schema,@tbl_name 
    END
    CLOSE
    tblname
    deallocate
    tblname
    go
    select
    from
    ##tmp
    drop
    table ##tmp
    Warm Regards, Ajay

  • Extract schema/metadata - names for all tables and attributes

    Hi, I am quite new to Oracle DB (only been doing dev mostly with sqlserver before). Is there a way to extract schema (names for all tables and attributes) for 10g and 11g in application code (either java or .net) or pl/sql?
    Thank you,
    -Tony

    There are built in views that start with DBA_, ALL_, and USER_. All means all the user can see, user means all the user has, and dba means everything, which generally means the same as the others plus an owner. So you can desc user_tables to see what-all that view has, then select columns from the view with ordinary sql. See the doc set for all the views available, interesting ones are ...views, ...objects, ...tab_cols and so forth.
    There are also built in procedures for getting metadata, google for details.
    Many tools have easy GUI's for this too. EM has ways on the administration screen to get to various objects, and then you can show the ddl. Maybe sqldeveloper has something too.

  • Transaction SE16: Field selection (User-Specific Settings) is NOT working for ALL tables

    Hi Guru’s,
    I have an issue in Transaction SE16, Field selection (User-Specific Settings) is NOT working in Tables (ALL tables).
    Following is the screenshot attached for your kind reference,
    That is in the initial screen of transaction SE16 if I choose Filed Name or Filed Label only the technical details (Field Names) are appearing and not the descriptions like Client, Purchasing Doc, and Company Code Doc. Category Document Type etc…
    Right now I am using ECC6 and EHP7 SAP system.
    Please help me to resolve this issue by implementing any OSS note or User Role creations or any technical changes required in system.
    Hope the requirement is clear and in case need any clarification please revert back.
    NOTE: Right now in Development System we don’t have any successful user to compare the settings.
    Regards,
    Kumar.S

    Thanks Patra.
    Even I searched in SAP portal and couldn't able to find the relevant OSS note.
    Following is my BASIS team response,
    "Only you can view Table Field values from higher release"
    Can you suggest / guide on this comment as well.
    Looking forward to your speedy response.
    Regards,
    Kumar.S

  • How to tcack the table update event in sap for all tables by use of single

    Hello,
         I want to store the list of all OM,HR tables in a file which are updated after perticular date. For that i tried TRIGGER but i can write only one trigger for one table, i want such a that  i have to write only one trigger which will be invoked affter update operation on every HR,OM tables and i store information in a file  regarding which rows are updated and external application can use it.
    Thanks in advance,     
    SANDIP

    hi all the log for the change of any thing will be available in the tables DBTABLOG..REPOSRC ....
    regards,
    venkat.

  • Creating sequences for all tables in the database at a time

    Hi ,
    I need to create sequences for all the tables in my database.
    i can create individually ,using toad and sqlplus.
    Can any one give me a code for creating the sequences dynamically at a time for all the tables.
    it is urgent ..
    Regards.

    I need to create sequences for majority of the tables that are having ID column
    which is sequences."The majority" is not the same as all. So you probably want to drive your generation script off the ALL_TAB_COLUMNS view...
    where column_name = 'ID'You need to think about this carefully. You might want different CACHE sizes or different INCREMENT BY clauses for certain tables. You might even (whisper it) want a sequence to be shared by more than one table.
    Code generation is a useful technique, but it is a rare application where one case fits all.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Creating SYNONYM for all tables who don't have one at once!

    Hello to all,
    I'm trying to create synonyms for every table who's missing one at the moment. I'm trying this code:
    declare
    cursor cur_objects is
    select obj.object_name , obj.owner
    from all_objects obj
    where owner = '&&SCHEMA_OWNER'
    AND NOT EXISTS (SELECT *
    FROM all_synonyms syn
    WHERE obj.object_name = syn.table_name)
    AND obj.object_type = 'TABLE'
    AND obj.object_name LIKE 'CI_%';
    begin
    for rec_objects in cur_objects loop
    begin
    dbms_output.put_line(rec_objects.object_name);
    execute immediate('create public synonym ' || rec_objects.object_name || ' for '
    || rec_objects.owner ||'.'||rec_objects.object_name )
    exception when others then
    null;
    end;
    end loop;
    end;
    I'm getting this error:
    ORA-06550: line 10, column 37:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    begin function package pragma procedure subtype type use
    <een ID>
    <een scheidingsteken-ID tussen dubbele aanhalingstekens> form
    current cursor
    I'm still pretty new at PL/SQL and can't get it to work. Does anyone got any tips ?
    Thnx already

    Ok now I got this error:
    RA-06550: line 17, column 1:
    PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem return
    returning <een exponent (**)> <> or != or ~= >= <= <> and or
    like LIKE2_ LIKE4_ LIKEC_ between into overlaps using ||
    multiset bulk year DAY_ member SUBMULTISET_
    The symbol ";" was substituted for "EXCEPTION" to continue.

  • Creating synonys for all table

    i want to create synonyms for all atbles.the synonyn name and table name are same.instead creating one by one synonym i wnat to create all synonyms at a time.
    1)select 'CREATE PUBLIC SYNONYM'||' '||'test'||' '||'for' ||' '||'test' from dual
    2)select OBJECT_NAME from user_objects where OBJECT_TYPE ='TABLE'
    in the first query if we replace with test with 2nd query then we can get the script for that.
    i replaced that biut its not working how to do it

    Here is a generic grant script. If you review it, you will see how it works and can adapt it to your varying needs.
    BEGIN
        FOR x IN ( SELECT owner,
                          object_name,
                          DECODE(object_type, 'TABLE' ,   'select, insert, update, delete',
                                              'SEQUENCE', 'select',
                                              'VIEW',     'select',
                                                          'execute') AS privs,
                          DECODE (owner, 'SCHEMA_1', 'USER_1',
                                         'SCHEMA_2', 'ROLE_A'
                                          ) AS app_user
                     FROM dba_objects
                    WHERE object_type IN ('TABLE',    'PACKAGE', 'PROCEDURE',
                                          'FUNCTION', 'SEQUENCE', 'VIEW')
                      AND owner       IN ('SCHEMA_1', 'SCHEMA_2' ))
        LOOP
          BEGIN
            EXECUTE IMMEDIATE 'grant ' || x.privs       || ' on ' || x.owner ||
                              '.'      || x.object_name || ' to ' || x.app_user   ;
            EXECUTE IMMEDIATE 'create or replace synonym '|| x.app_user||'.'||x.object_name||
                               ' for ' ||x.owner||'.'||x.object_name ;
          EXCEPTION
            WHEN others THEN
              dbms_output.put_line('Bad owner = '||x.owner||';  Bad app_user='||x.app_user||
                                   ';  Bad object_name='||x.object_name);
          END;
        END LOOP;
    END;
    /

  • Create user with read access for all tables SAP SID .*

    Hello all,
    could you please help me ? I would like to grant select privilege on all tables SAP<SID>.* for newly created user.
    I have created standard database user (not exclusive).
    I`m able to grant select for individual tables, but I would like to grant select for this user on all SAP<SID>
    schema in simplier way
    But as far as I know, the schema`s owner name must be different then schema name.
    Any idea please ?
    Thank you.
    Pavol

    create user <user_name> identified by <password> <options>;
    grant read on all tables:-
    CREATE OR REPLACE PROCEDURE GRANT_SELECT AS
    CURSOR ut_cur IS
    SELECT table_name
    FROM user_tables;
    RetVal NUMBER;
    sCursor INT;
    sqlstr VARCHAR2(250);
    BEGIN
    FOR ut_rec IN user_tabs_cur;
    LOOP
    sqlstr := 'GRANT SELECT ON '|| ut_rec.table_name
    || ' TO <user_name>';
    sCursor := dbms_sql.open_cursor;
    dbms_sql.parse(sCursor,sqlstr, dbms_sql.native);
    RetVal := dbms_sql.execute(sCursor);
    dbms_sql.close_cursor(sCursor);
    END LOOP;
    END grant_select;
    Edited by: varun4dba on Jan 18, 2011 4:13 PM

  • Import tables using same file name for all tables

    hi,
    We are using oracle 11.2.0.3.0, we have taken export of multiple tables in schema, unfortunately in exp command we have mention same file name for all the tables, now it has created one file for all export but the size of that file shows that all the tables included in it , when we try to import the tables only last table mention in export command is imported for other tables it hangs, example of code show below.
    Is there any way to import the remaining tables.
    exp system file =exp05042013.dmp tables=gr.table1
    exp system file =exp05042013.dmp tables=gr.table2
    exp system file =exp05042013.dmp tables=gr.table3

    Hi,
    You can use as :
    exp username@database tables=table1,table2 file=tabledata.dmpDid you have any RMAN full backup?
    Why you are not recover crash database?
    Mahir

  • Bean classes for all tables ?

    Hi All,
    I am working on a very small project with 6 tables and 2 lookup tables.The form consists of lot of queries to the database.The technologies used are java,jsp and weblogic with MVC2 pattern.My question is do I need to have bean class(setter,getter) methods for each tables.
    Suggest a good approach.

    drop.any wrote:
    SET SERVEROUTPUT ON
    DECLARE
    num_corrupt INT;
    BEGIN
    for t in (select owner, table_name from dba_tables) loop
    num_corrupt := 0;
    DBMS_REPAIR.CHECK_OBJECT (
    SCHEMA_NAME => t.Owner,
    OBJECT_NAME => t.Table_Name,
    REPAIR_TABLE_NAME => 'REPAIR_TABLE',
    CORRUPT_COUNT => num_corrupt);
    DBMS_OUTPUT.PUT_LINE('number corrupt: ' || TO_CHAR (num_corrupt));
    END;
    END;
    Yes but change one thing:
    DBMS_OUTPUT.PUT_LINE('Table: '||t.Owner||'.'||t.Table_Name||' number corrupt: ' || TO_CHAR (num_corrupt));Edited by: kendenny on Nov 5, 2009 9:35 AM

  • Single query for displaying all but 1 column values for all tables

    Hi,
    All the tables have SYS_CREATION_DATE column.
    But I dont want to display this column value
    Can someone suggest some way in which i could achive this?
    Oracle version:11gR1
    OS:SunOS
    Cheers,
    Kunwar
    Edited by: user9131570 on Jul 6, 2010 7:57 PM

    user9131570 wrote:
    @Tubby
    I *want to display table-wise the values of all but 1(SYS_CREATION_DATE) columns in my database.*
    I need this in order to compare it to another database for all these values .Let me make a wild guess at what you are getting at.
    Given these two tables
    create table emp
       (empid number,
        empname varchar2(15),
        empaddr   varchar2(15),
        sys_creation_date date);
    create table dept
       (deptid number,
        deptmgr varchar2(10),
        sys_creation_date date);you want to somehow combine
    select empid,
             empname,
             empaddr
    from emp;with
    select deptid,
             deptmgr
    from dept;into a single sql statement?

  • Trigger for logging changes(DML changes) for All tables in Schema

    Hi ,
    Is there a way to create a schema level trigger to audit the DML changes that affect all the tables.I need the output in my log table as
    1) the table name on which the DML occurred
    2) type of DML
    3) column names affected.
    I know this can be achieved through enabling AUDIT or by creating dynamically, triggers for each tables...
    Is there a way to create a single trigger to achieve this??

    It's not possible to create DML trigger on schema level
    I think the only way is to create the triggers dynamically for each table..
    Re: Schema level Database triggers by Kamran Agayev
    Edited by: jeneesh on Oct 12, 2012 6:39 PM

  • Unable to edit table data, but not for all tables

    I have multiple tables in a schema. For some tables, I am able make edits to table data directly, i.e., context menu Table | Open, and the Data tab. When I am able to edit, I do get a pencil icon inside the cell I am editing/typing (and am able to commit the changes). When I am not able to edit, it does nothing (no error messages, sound, or visual cue). I thought it had to do with who owns the table object, but I log in as the same owner of the affected table objects.
    Any pointers would be greatly appreciated so I am equipped when asking the DBA.
    Thanks,
    OS: Windows XP Professional SP2
    Java(TM) Platform: 1.6.0_11
    Oracle IDE: 2.1.1.64.45
    Versioning Support: 2.1.1.64.45
    Edited by: New2OWB10gR2 on Jun 23, 2010 12:20 PM

    Hello again,
    Here you are the DDL of the offending table:
    CREATE TABLE "DBADMEX"."T50SEC82"
    "COD_EMPRESA" CHAR(4 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_EMPR_CONT" CHAR(4 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_SECT_CONT" CHAR(2 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "NUM_CUEN_CONT" CHAR(18 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_PAIS" CHAR(4 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_SECTOR" CHAR(6 BYTE) DEFAULT ' ' NOT NULL ENABLE
    PCTFREE 10 PCTUSED 40 INITRANS 50 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
    TABLESPACE "TS_50" ;
    CREATE UNIQUE INDEX "DBADMEX"."I5000082" ON "DBADMEX"."T50SEC82"
    "COD_EMPRESA", "COD_EMPR_CONT", "COD_SECT_CONT", "NUM_CUEN_CONT"
    PCTFREE 10 INITRANS 50 MAXTRANS 255 COMPUTE STATISTICS STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
    TABLESPACE "TS_50" ;
    We are using the following versions:
    Oracle database: 11.1.0.7.0
    Oracle Client: 11.2.0.1.0
    Windows (where the client runs): XP SP3 (version 5.1 Build 2600_spsp_sp3_gdr.080814-1236) in spanish.
    SQL Developer: 2.1.1.64 (MAIN-64.45)
    I think I haven't forgotten anything.
    Thanks in advance for your help!

  • Count(*) for all tables

    Hi ,
    I want the Query to get the table name and count(*) display in excel like this.Can i get count(*) from metadata table .Please let me know ??
    ACCT 53
    ACCT_CHEQUE 45
    EMP 50
    DEPT 90

    Karthick_Arp wrote:
    A XML solution.
    This one is not mine. This question comes up often in this forum. And once i saw this answer. And i thought its really cool so just saved it in my Google Note Book ;)You need to update your google note book. It doesn't take account of Index Organised Tables.
    Based on answer from Laurent Schneider
    http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html
    SQL> select
      2    table_name,
      3    to_number(
      4      extractvalue(
      5        xmltype(
      6 dbms_xmlgen.getxml('select count(*) c from '||table_name))
      7        ,'/ROWSET/ROW/C')) count
      8  from user_tables
      9 where iot_type != 'IOT_OVERFLOW';
    TABLE_NAME                      COUNT
    DEPT                                4
    EMP                                14
    BONUS                               0
    SALGRADE                            5Edited by: BluShadow on Jul 8, 2009 12:00 PM

Maybe you are looking for

  • Upgrade Stopped - Unable to logon system

    Windows 2003 Server 64bit , Sql 2005, Upgrade erp2004 -> erp2005. Upgrade has stopped in phase startsap_nbas, and although the system will start you are unable to logon due to the error "error when initialising the work area SYST". On investigation t

  • Flashing finder icon and showing "don't restore windows" and "restore windows" text box

    hi, i hav problem with the flashing finder icon and showing "don't restore windows" and "restore windows" text box. im using macbookpro MAC OS X 10.7.5. i've search for solutions, lik relaunch the finder by pressing COMMAND+ALT+esc, but it didn't wor

  • Record missing in file in Proxy to file interface

    I am using proxy to file , in which i am using i have header , header_tax, and line, everything is fine , even i have checked the mesage monitoriing and component monitoring , i am getting all the data. but in the file generated i am getting only one

  • Accessing previous iTunes purchases in Snow Leopard

    I recently upgraded to Snow Leopard. Sparing you all the details, I am having to rebuild my iTunes Library from scratch, bringing it over from Time Machine is causing problems, basically, it causes my Time Machine backups to fail once I bring the old

  • I want to connect Visual foxpro database through forms6i.

    Hi , I want to connect Visual foxpro database through forms6i. actually i want to access Visual foxpro database in forms6i and retrive and update data from forms6i. please help me urgently how can i do this in forms6i. Thanks, Md.Muniruzzaman Khan Em