Granting "Create Directory" Privileges in Oracle - oracle

I want to run a CREATE DIRECTORY query in Oracle 10, but it's giving me an insufficient privileges error.
Can anybody tell me how to grant this privilege to my user through the system as a user?

From the Oracle 10gR2 documentation:
You must have CREATE ANY DIRECTORY system privilege to create directories.
You would use the following command to grant the privilege to the schema that will create the directory:
SQL> GRANT CREATE ANY DIRECTORY TO vnz;
Grant succeeded
As always with the privileges ANY, be careful who you will grant them to. It is indeed a powerful privilege best left to DBAs.

From Oracle docs:
"You must have CREATE ANY DIRECTORY system privilege to create directories."
So,
grant create any directory to userOfInterest;

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.

ORA-65175: cannot grant SYSDBA privilege locally in the root

I have a oracle 12c database .
I would like to grant sysdba to C##user1.
Here is user table.
When I execute this command I can get a error.
grant sysdba to c##user1 container=current
Error report -
SQL Error: ORA-65175: cannot grant SYSDBA privilege locally in the root
65175. 00000 - "cannot grant SYSDBA privilege locally in the root"
*Cause: An attempt was made to grant SYSDBA privilege locally in the root
of a multitenant container database (CDB).
*Action: While connected to the root, SYSDBA privilege can only be granted
commonly.
and when I execute this command , I can get 2 users of C##user1.
grant sysdba to c##user1 container=all
How can I grant sysdba to C##user1.
Thank you for viewing.
Pls help me.
Are you trying to grant sysdba to c##user1 at the Container or Root level? This is an important distinction within 12C, as the Container is logically separate from the rest of the CDB. The CON_ID column will tell you where each user resides - Con_ID=0 means that the row pertains to the entire CDB, whereas CON_ID=1 means that the row pertains to the root.
You currently have two "C##user1" users, one is a common user that is present in all containers (CON_ID=0,) and the other is a local user that is specific to the root.
You already have one "C##user1" user that has the SYSDBA privilege on the entire CDB, so if that's what you want, you can connect to the root and drop the local "C##user1" user. If you just wanted a local user with the SYSDBA privilege on that root only, I would recommend dropping the "C##user1" common user, then connecting to the root and granting sysdba to the local user there.
The article I linked to is titled "Overview of the Multitenant Architecture", I would suggest giving it a review before you make a decision either way.
under cdb connection try it
grant sysdba to c##user1 container=all

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

Oracle- GRANT ALL PRIVILEGES?

Whenever I give a user "all privileges" in ORACLE (example below), what does this actually do?
My understanding is that it gives a user any privilege, e.g inserting, deleting etc within that schema but not to any schema in the DB?
grant all privileges to my_user;
You can grant all [privileges] on <some object>, but you aren't specifying an object; so you are granting system privileges:
The documentation for system privileges says:
Oracle Database provides the ALL PRIVILEGES shortcut for granting all the system privileges listed in Table 18-1, except the SELECT ANY DICTIONARY, ALTER DATABASE LINK, and ALTER PUBLIC DATABASE LINK privileges.
System privileges are not always restricted to a schema. That table includes a lot of ANY privileges, which are specifically not restricted to a schema. If you grant all privileges to a user they will be able to create or alter a table in any schema, for example. That probably isn't what you want.
There is no shortcut to grant only schema-restricted privileges. You'll need to grant CREATE TABLE, CREATE INDEX, etc. explicitly.
It's common practice to create a role to which you grant the necessary privileges, and then you just have to grant that role to your users. (Although you sometimes still need to grant privileges directly to users, e.g. if they are required in a stored procedure).

Oracle Trigger Permissions

I want to create a trigger owned by user A for a table that is owned by user B. What permissions must I set on B.table to avoid an ORA-01031: insufficient privileges error?
GRANT CREATE ANY TRIGGER ON b TO a
There is no way to grant a permission to create a trigger on a certain table.

Resources