How to grant XA_RECOVER_ADMIN to a new user by root in mysql database - sql-grant

mysql version
select ##version;
8.0.18
create user
create user 'user1'#'%' identified by 'user1_pwd';
create database
drop database if exists test_db;
create database test_db
character set utf8mb4
collate utf8mb4_0900_ai_ci;
grant privilege
grant XA_RECOVER_ADMIN on test_db.* to 'user1'#'%';
error msg
[HY000][3619] Illegal privilege level specified for XA_RECOVER_ADMIN
what can i do ? can i use a new user to grant XA_RECOVER_ADMIN instead of root?

XA_RECOVER_ADMIN is a global privilege (admins usually operate globally), meaning it cannot be granted on a particular database.
Instead of
grant XA_RECOVER_ADMIN on test_db.* to 'user1'#'%';
you have to use
grant XA_RECOVER_ADMIN on *.* to 'user1'#'%';

Related

oracle database 19c - grant [rolename] to [user] error ORA-01917: user or role does not exist

I use This script to create user and role for oracle database 19c and get error ORA-01917
CREATE ROLE C##readonlyrole;
CREATE USER "C##lysjr_ro" IDENTIFIED BY "XXXXXXXPASWORD"
DEFAULT TABLESPACE "XXX_TABLE_SPACE"
TEMPORARY TABLESPACE "XXX_TABLE_SPACE_TEMP";
GRANT CREATE SESSION to C##readonlyrole;
BEGIN
FOR x IN (SELECT * FROM dba_tables WHERE owner='C##lysjr_ro')
LOOP
EXECUTE IMMEDIATE 'GRANT SELECT ON schema_name.' || x.table_name ||
' TO C##readonlyrole';
END LOOP;
END;
GRANT C##readonlyrole TO C##lysjr_ro;
But
GRANT C##readonlyrole TO C##lysjr_ro;
Show error report with result :
GRANT C##readonlyrole TO C##lysjr_ro
Error report -
ORA-01917: user or role 'C##lysjr_ro' does not exist
01917. 00000 - "user or role '%s' does not exist"
*Cause: There is not a user or role by that name.
*Action: Re-specify the name.
now what can I do?
Try not using quotation marks in your create user command:
CREATE USER C##lysjr_ro IDENTIFIED BY XXXXXXXPASWORD
DEFAULT TABLESPACE XXX_TABLE_SPACE
TEMPORARY TABLESPACE XXX_TABLE_SPACE_TEMP;

Teradata - Create views of tables in another database

I need to create in Teradata VIEWS of tables in another database.
I have created both but now when making a select of the VIEW, It shows me the following Error: "Table/View 'MyDatabase.MyView' not found, or you have no access rights".
What type of rights need the User, View, Table, Database... to make this works? And at what time and how should I give them?
Thanks!
Suppose we have SomeDB.TableOrViewA and a view MyViews.ViewX that references SomeDB.TableOrViewA. The "view owner" MyViews is allowed to provide access (via ViewX) only if MyViews holds corresponding rights WITH GRANT OPTION.
In order for a UserN (who is not the creator of MyViews.ViewX) to SELECT from the view, not only must UserN hold SELECT permission on MyViews.ViewX (or the entire MyViews database), but the MyViews database must also hold SELECT WITH GRANT OPTION permission on SomeDB.TableOrViewA or on the entire SomeDB database. This is true whether or not UserN has SELECT permission on the underlying SomeDB.TableOrViewA itself.
GRANT SELECT ON SomeDB.TableOrViewA TO MyViews WITH GRANT OPTION;
or GRANT SELECT ON SomeDB TO MyViews WITH GRANT OPTION;

Unable to access user_tables table in oracle

I am new to oracle. I have created the user axsaum in DB and logged in as the same user. When I try to access
select * from user_tables or dba_tables
its throwing error as table not exist
Please suggest me why i dont have privilege to access default tables?
how to access those?
SQL> select * from user_tables;
* ERROR at line 1: ORA-00942: table or view does not exist
SQL> select * from dba_tables;
* ERROR at line 1: ORA-00942: table or view does not exist
I think you need to give previliages to newly created user
you can use grant for giving permission to user
once permission given you can see tables as well as can perfrom DML and DDL on DB
for gratting previliages
for all permissions you can use
GRANT DBA TO axsaum ;
For other permissions you use below
GRANT CONNECT TO axsaum ;
GRANT SELECT ANY TABLE to axsaum
is a system privilege grant that allows user to select from any Table or View.
GRANT SELECT on some_table to axsaum
is an object privilege grant that allows user to select from Table.
GRANT SELECT, UPDATE ON some_table TO axsaum;

Oracle: Granting Object Privilages

I have logged in as system and have created a user by name DEMO.
There is another connection Myconnection. Under Myconnection there is a table
Dept; I am still connected to database with SYSTEM connection.
Now when I execute the query
GRANT select
ON DEPT
TO demo it says table does not exist. How to fix this?!!

PLSQL Granted privilege to user, but still unable to modify data

I have two schemas, and one schema needs to modify data in the other schema. To facilitate this, I have granted privileges to the table as SYSDBA:
GRANT INSERT, UPDATE, DELETE, SELECT ON schema1.mytable TO schema2;
EXIT;
This returns the message Grant succeeded.
However, when schema2 tries to do an update on schema1, I get a permissions error telling me that I do not have the privileges to do an update. I took a look at the grants tab in mytable in SQLPLUS, and it apparently shows that I don't have privileges:
PRIVILEGE GRANTEE GRANTABLE GRANTOR OBJECT_NAME
INSERT schema2 No schema1 mytable
UPDATE schema2 No schema1 mytable
SELECT schema2 No schema1 mytable
DELETE schema2 No schema1 mytable
How is this possible?
There must be some other error. Schema2 does have permissions on schema1.mytable -- just not the permission to "regrant" these permissions to someone else.

Resources