Grant privileges  to new user + few tables

Hi all. How can I give my new user all privileges for inserting deleting records in some tables...
CREATE USER user1 IDENTIFIED BY user1

May be it will be better to make nobody the owner of the tables?It's definitely a good idea to make somebody else the owner of the table rather than SYSTEM... you shouldn't really be putting your own objects in the SYSTEM schema anyway if you can help it.
Whether NOBODY is the best schema to use depends on what you want the table for. If this is just a test system you are playing about with then it doesn't really matter... but if you are trying to put together a proper development/test system with a plan to move into a production environment then think through what you want (and whether NOBODY is the best name for your application schema).
Saying that, if this is just a database you are 'playing' with to learn some Oracle then you might want to look at granting system privileges rather than object privileges.
GRANT SELECT ANY TABLE TO ALEX;
Will let ALEX select form any table (other than the data dictionary).
Again, though, a word of caution - if you intend to put this into a 'real' system (rather than just one you are learning on) then think it through and only grant what you need. If you go for the 'easy' system privilege now you'll find you'll always be stuck with it because you'll never be 100% certain that you can revoke it without affecting your application.

Similar Messages

  • Error while granting privileges to new user

    hi all,
    I created new user and i tried to grant privileges to that new user by using ( SQL> CONNECT / AS sysdba;
    Connected.
    SQL> CREATE USER cdcproj IDENTIFIED BY cdcproj
    2 QUOTA UNLIMITED ON SYSTEM
    3 QUOTA UNLIMITED ON SYSAUX;
    User created.
    SQL> GRANT CREATE SESSION TO cdcproj;
    Grant succeeded.
    SQL> GRANT CREATE TABLE TO cdcproj;
    Grant succeeded.
    SQL> GRANT SELECT_CATALOG_ROLE TO cdcproj;
    Grant succeeded.
    SQL> GRANT EXECUTE_CATALOG_ROLE TO cdcproj;
    Grant succeeded.
    SQL> EXECUTE DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(grantee => 'cdcproj'); PL/SQL procedure successfully completed.
    SQL> GRANT ALL ON PL.PROJ_HISTORY TO cdcproj;
    Grant succeeded. ). All the commands worked except last command. It is giving error i.e (GRANT ALL ON PL.PROJ_HISTORY TO cdcproj; ) error is ( table / view not exists ).
    What i can do. Any help.
    Otherwise is there any other method to grant privileges.
    Thanks in advance.

    What is your Oracle version ?
    Are you sure the object PL.PROJ_HISTORY exists ?
    What is the output of (using the Oracle account that executes the GRANT):
    select * from session_roles;
    select * from session_privs;

  • How to restrict a schema owner from granting privileges to other users.

    How can we restrict a schema owner from granting privileges to other users on his objects (e.g. tables). Lets say we have user called XYZ and he has tables in his schema TAB1, TAB2 an TAB3. How can we restrict user XYZ from granting privileges on TAB1, TAB2 and TAB3 to other users in the database. Is it possible in Oracle 10g R2? Any indirect or direct way to achieve this? Please help on this.
    Thanks,
    Manohar

    Whenever someone is trying to prevent an object owner from doing something, that's generally a sign of a deeper problem. In a production database, the object owner shouldn't generally have CREATE SESSION privileges, so the user shouldn't be able to log in, which would prevent the user from issuing any grants.
    As a general rule, you cannot stop an object owner from granting privileges on the objects it owns. You can work around this by creating a database-level DDL trigger that throws an exception if the user issuing the statement is XYZ and the DDL is a GRANT. But long term, you probably want to get to the root of the problem.
    Justin
    Edited by: Justin Cave on Nov 6, 2008 9:52 PM
    Enrique beat me to it.

  • Grant privileges to a user for user_lock

    user_lock.sleep (3000);
    i am using it in my procedure.
    is it require to grant privileges to a user for user_lock.

    There is no built-in package namely user_lock. Actually it is dbms_lock.
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lock.htm#sthref3898
    I was using dbms_lock few days ago. Yes dba has to give the privilege to use this package.
    SQL> grant execute on dbms_lock to scott;
    Grant succeeded.
    [My experiment]
    http://mamohiuddin.blogspot.com/2007/02/plsql-block-abnormal-termination-ed.html

  • Grant Privileges to another user

    Hi,
    I am new to plsql. In course of my learning. I created two tables BOOKS and AUTHORS in orcl database(10g) through SYSDBA.
    Again i logged in to SCOTT user account and am unable to see the BOOKS and AUTHORS tables.
    Please let me know how do i grant administrative privileges(to edit,delete,insert,update) to SCOTT user for these tables.
    Thanks & Regards,
    Amrutha.

    808099 wrote:
    1. Got now that SYSDBA is a role and SYS is user.
    2. I was able to login to sqlplus through giving "/ as SYSDBA" as the username. Hence i thought it as user."/ as sysdba" connects to the database as the SYS user using operating system authentication with the SYSDBA role enabled.
    3. Secondly, I dont know which schema does my BOOKS table belong to. Because i just ran a create table script in scott/tiger@orcl. PLease suggest how i can know which schema it belongs to.If you connected to the database as the SCOTT user and ran the script to create the table, the table would almost certainly be owned by SCOTT. If you connected to the database as the SYS user and ran the script to create the table, the table would most likely be owned by SYS. If the script specified the schema owner, i.e.
    CREATE TABLE library.book ...the table would be created in the specified schema. But you need to have very powerful privileges in order to create objects in other user's schemas and SCOTT does not have those privileges unless you've specifically granted them.
    4. Thirdly, I will delete the BOOKS and AUTHORS from SYS and create them in SCOTT user. But thought if GRANT privileges can be an alternative.Not really. It's much better to have the tables owned by the correct schema in the first place. You use grants to allow other users to access (or modify) tables but other users are not going to have the same level of privileges (for example, they're not going to be able to run DDL against the table).
    Justin

  • Oracle APPS schema copy with all privileges to new schema and table space

    Hi all,
    Here is scenario:
    I have installed e-business suite in windows 2003 server for training environment using production (prod), single node and without vision (demo).
    i have to create a new table space in e:\oracle\prodmanz with similar content as in proddata and create a new schema called manz with same privileges as APPS.
    Kindly advice.
    Manish Kumar Chudasama
    email: [email protected] cc to [email protected]
    Thanks in advance guys.

    Hi Khalid,
    Ideally when you execute sql 'create schema <schema_name>' then the logged in user is going to default owner of the schema and you should see that under 'object privileges' of that user.
    The user will have 'create any' privileges which means the user has all the privileges on that schema.
    if you want to check who is owner of the schema in the system, please check 'SCHEMAS' under views in SYS.
    Regards,
    Venkat N.

  • Grant access to new user

    I have created a database as 'system' and try to give access for other users. I created a new user with 'create user identified by passwd' and made 'grant connect to user' and 'grant select, insert, update to table'.
    But after that the new user can't select the tables, error is 942, Table or view not found. Same in sqlplus as with jdbc.

    Shouldn't you type:
    GRANT select, insert, update to 'user'
    instead of to table like you did.

  • Grant privilege disappeared after modify versioned table

    After adding two columns to a version table using wm package, the previous grant privilege on the version table disappeared. Is it expected behavior or a bug?
    Ashley

    Ashley
    This is a bug. We have since fixed it and it will be available in the next release. For now, the workaround is that you have to grant the privilege again. Sorry for the inconvenience.
    Arun

  • Grant privileges to the user to edit only his own information

    Hi all,
    my Portal version is 9.0.4.0.99
    I would like to grant to all users the privilege to change/edit only his own information.
    When I go to the Administer Tab, enter the username in the portlet User, and then I check the checkbox: "Allow User editing", then this User can edit all users.
    How can I grant the privilege to edit only his own information?
    Regards
    Leonid Pavlov

    The Portal does not expose the DAS Edit My Profile link until version 10.1.4. Prior to this version, if the associated DAS actually supports this, you can just add the link on your portal page as a URL item:
    http://host.domain.com:7777/oiddas/ui/oracle/ldap/das/mypage/AppEditMyPage?homeURL=http%3A%2F%2Fhost.domain.com%3A7778%2Fpls%2Fportal &doneURL=http%3A%2F%2Fhost.domain.com%3A7778%2Fpls%2Fportal&cancelURL=http%3A%2F%2Fhost.domain.com%3A7778%2Fpls%2Fportal
    I.e., it takes the url:
    <infra-host>/oiddas/ui/oracle/ldap/das/mypage/AppEditMyPage
    with 3 url-encoded parameters:
    homeURL - link rendered with Home icon in DAS
    doneURL - target for [ OK ] in DAS
    cancelURL - target for [ Cancel ] in DAS

  • New user: Printing & tables

    I installed the iWork08 demo earlier, which I'm considering buying, but it's very annoying that I can't save or print as it means I can't test it out properly because each day I'm effectively back to square one. What is the point in a trial 30 days long if test files can't be saved for later? I don't have time to spend hours and hours in one go making changes to see if it will do something, and all without saving.
    Is there way to turn a selection into a new table? If so does, it affect formula and calculations in the table that are references to other tables and other worksheet? The best I've solution I've found is to duplicate a table then delete parts I don't want.
    Can I print out a specific table? Or a specific selection of cells?
    Can a selection of cells, or a whole table, be copied and pasted into other applications such as Pages or Dreamweaver?
    Thanks for your help.

    I hadn't got round to trying Pages or Keynote, or printing. Only I was getting the message about print and saving restrictions when I tried to save in Numbers, printing seems like it's all fine, I'm just not hooked up to the printer. Pages, Keynote and Numbers are all fully functional now.
    I took Peggy's advice and deleted the preferences file, albeit for Numbers and now Numbers seems to all work fine too. Oh and I worked out my iDisk URL thanks to a screencast by DonMcAllister, I'm just wanting to to cancel the .Mac trial now so I can get different username.
    Do you know if I can cut and paste cells from Numbers into a page in Dreamweaver? I can do that from Excel to DW on Windows and it's essential that I can do it on Mac.

  • OID-DAS Granting privileges to User

    Hi All,
    I am using OID to store user information from different organizations. I am using OIDDAS ( Delegated Administrative Services) to enter user information. To incorporate the delegation model I am able to create a user and give him privilege to add other users. I can also give him privilege to grant privilege to other users. However, for security purposes I do not want them to be able to grant or use the 'Allow Oracle Delegated Administration Services configuration' privilege, that appears by default in the window. Is there I can alter this.
    Any help on this will be much appreciated.
    Thanks

    It can be done but is not as trivial as GRANT priv TO user. The disco privs are stored in the EULx_ACCESS_PRIVS table. Theoretically, you would just have to add records there to implement the privileges.
    You'll need to look in the EULx_EUL_USERS to get the user IDs, and youd need to find out the application privilege IDs. They are stored in the EULx_ACCESS_PRIVS table, and there are no descriptions. What you would need to do is create a test user, add one privilege, and see what got added to the EULx_ACCESS_PRIVS table. You could then repeat this process for each priv you would want to grant through a script.

  • Create new user same as a existing roles and Privileges

    Hi Team,
    I am a junior DBA. New user Joined in Application team. So, Client requested me.....
    Crerate new user with same privileges as like as existing user.
    As of now i am creating user like "create user username identified by "password". Then grant privileges to that user. earliar I never comapare or copied users.
    Please suggest any one how to create new user as like as existing user roles and privileges.
    Thanks,
    Venkat

    For basic cloning:
    select dbms_metadata.get_ddl('USER', '...') FROM DUAL;
    SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','...') FROM DUAL;
    SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','...') FROM DUAL;
    SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','...') FROM DUAL;
    SELECT DBMS_METADATA.GET_granted_DDL(‘TABLESPACE_QUOTA’, ‘...’) FROM dual;
    Then just replace the username with the new one you want to create.

  • Created New User but Can't...

    I have created a database 'ABC' with some tables.
    Currently, only one user can access this dtatbase (The user who created it). I have created another user and gave him privileges (SELECT) to view all tables.
    He can view them in SQL but can't view them in Forms 6i, He can log on in Forms 6i but directly gets some errors saying: "Identifier tablename must be declared", He gets some errors for all tables.
    Why can't that new user access tables or view tables in forms6i??
    Thank you in advance.

    fungec wrote:
    I can see these in my user groups, and I can change the passwords on both as often as I like. But when I then try to logon, the screen just shakes and nothing happens.
    I don't do Windoze, so haven't been able to test migrating from a PC.
    There have been a few similar posts here.   Are you trying to log on to the new user account(s) via Fast User Switching?  If so, apparently that doesn't work.   You need to turn that off (via System Preferences > Users & Groups > Login Options. Remove the check from the Show fast user switching .... box.
    Then log out of all accounts, restart, select the new account from the login screen and you should be prompted to set the password.
    I'm not sure a screenshot will help (and to be honest I'm not sure how to do screenshots on the IMac - I've been a PC man for over a decade!).
    In most places, Shift+Cmd+3 will print the entire screen; Shift+Cmd+4 will produce a "target" you can drag over a portion of the screen.
    EDIT:  by "most places" I mean after you're logged-on, and OSX knows your preferences about how & where to put the screenshot.  So it won't work on the login screen itself.
    Message was edited by: Pondini

  • How to create a new user

    Hi,
    I need to script the process to create an user and grant privilege to this user.
    I know the commands i need to do from sqlplus such as:
    CREATE USER trade IDENTIFIED BY trade;.
    GRANT resource, connect , create session, create table, create procedure, create sequence, create trigger, create view, create synonym, alter session TO trade;
    My question is how to script this command and run it from root or system id?
    Thanks in advance.

    GRANT resource, connect <br>Except that these roles shouldn't be no more use.<br>
    These roles are provided for compatibility with previous versions of Oracle Database. You can determine the privileges encompassed by these roles by querying the DBA_SYS_PRIVS data dictionary view.
    Note: Oracle recommends that you design your own roles for database security rather than relying on these roles. These roles may not be created automatically by future versions of Oracle Database.<br>
    From the Oracle® Database SQL Reference 10g Release 2 (10.2)<br>
    <br>
    Nicolas.

  • Granting Privileges question

    This is not a duplicate post. User Wilhem posted it in the wrong forum.
    In the below mentioned link, user CD has provided a quick way to grant privileges to another user. But it didn't work for me. Is there something wrong with with the DECODE expressions?
    Re: Granting Privileges question

    Instead of granting privileges to a user, i wanted to grant these privileges to a role. So i created a role
    CREATE ROLE jenrole;
    And then i tried the below mentioned script. But i am getting error
    DECLARE
    v_sql VARCHAR2(4000);
    BEGIN
    FOR obj IN (SELECT object_name
    , object_type
    , DECODE (OBJECT_TYPE,
    'PROCEDURE','EXECUTE',
    'FUNCTION' ,'EXECUTE',
    'PACKAGE' ,'EXECUTE',
    'SYNONYM' ,'SELECT' ,
    'SELECT, INSERT, UPDATE, DELETE') rights
    FROM user_objects)
    LOOP
    v_sql := 'GRANT '|| obj.rights ||' ON '|| obj.object_name ||' TO JENROLE' ;
    dbms_output.put_line(v_sql);
    EXECUTE IMMEDIATE v_sql; END LOOP;
    END;
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at line 16
    Why am i getting error? The error line is boldened

Maybe you are looking for