how to restrict user from grant statement in Hive - hadoop

How can I grant permission to specific users in Hive?
When I try with different users and set the permission with the GRANT statement, then these users were able to change the permission on create, update and any kind of operation on the objects(database, tables etc).
So how can I configure Hive such that only the selected user is able to grant permission?

Related

Oracle how to give permission to an user on a different schema

I have an Oracle user user1 and a schema schema1. I want to give permissions insert, update and delete to this user on this schema.
I only find in the documentation that I can give permissions on this schema tables.
Is there a way to give permission on whole schema?
You can add roles and privileges to the user or use the grant command.
https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljgrant.html
You can also use the GRANT ALL PRIVILEGES TO {USERNAME} command.

Upgrade a user's permissions in CockroachDB

If I create a read-only user, but want to give them write access, how do I do that in CockroachDB?
At any time you can simply grant a user new permissions via the GRANT family of SQL commands, as explained in the documentation for GRANT.
For example, to grant the user jordan INSERT permissions on all tables in the test database, run the following command in a SQL shell:
GRANT INSERT ON TABLE test.* TO jordan

Grant permissions on schema to specific schema in Oracle

I would like to know if there is a way to grant permissions to, for example, create table on a schema, from a different user.
I want to do this without granting DBA role, nor granting "ANY" permissions (grant create any table to XXXX).
I use this occasionally to satisfy devs who want a read-only account. This will create DDL that will give appropriate select or execute permissions. It would not be difficult to modify that to include update and delete.

How to create schema in Oracle and table spaces?

I create user(schema) in oracle. like this
create user EMP_DB identified by netsolpk account unlock;
But when i tried login through schema name and password, login failed. Below is the error message.
user EMP_DB lacks create session privilage; login denied.
I've not created any tablespaces.
For this, do I need to create any tablespace? If needed, how to create a tablespace?
And what more things are required for creating a schema in oracle 11g.
Please help me and give me step by step procedure.
The error user EMP_DB lacks create session privilage; login denied indicates that you need privilege to create a session. So you need to grant the appropriate privilege like,
GRANT CREATE SESSION TO emp_db;
Or You can go with granting the roles(group of privileges), CONNECT and RESOURCE.
CONNECT role has only CREATE SESSION privilege.
RESOURCE has the following privilges,
CREATE TRIGGER
CREATE SEQUENCE
CREATE TYPE
CREATE PROCEDURE
CREATE CLUSTER
CREATE OPERATOR
CREATE INDEXTYPE
CREATE TABLE
To find these PRIVILEGES of a ROLE, You can query the DBA_SYS_PRIVS table with a query like this:
SELECT grantee, privilege, admin_option
FROM DBA_SYS_PRIVS
WHERE grantee='RESOURCE';
Also to use the existing tablespace USERS, You can create a user with QUOTA UNLIMITED statement like,
CREATE USER emp_db IDENTIFIED BY netsolpk QUOTA UNLIMITED on USERS;
the fastest, quickest way to create a new user with privileges is
grant connect, resource to NewUser_name identified by NewUser_password;
by this command you will be sure that errors like above will not displayed.

Oracle assign table permission

In Oracle, a table, 'MyTable' is owned by 'User1', how can I grant table access permission to another user, say 'User2' ?
In SQL server, we have some application access permission, does Oracle has something ?
You can grant SELECT privileges (or INSERT, UPDATE, DELETE, and a few others like REFERENCES) to a user
GRANT SELECT
ON user1.MyTable
TO user2
It would be more common, though, to create a role, grant the privileges to the role, and then grant the role to whatever users need it, i.e.
CREATE ROLE user1_select;
GRANT SELECT
ON user1.MyTable
TO user1_select;
GRANT user1_select
TO user2;
That makes it easier in the future to grant a single role to more users and to ensure that all the users with a specific job function have the same set of roles rather than trying to make sure that you've granted everyone access to exactly the same set of objects.

Resources