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;
Related
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;
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;
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?!!
Error received when creating a view:
ora 01031 insufficient privileges
Example:
SQL> create view wiew1
2 as select ename from emp;
create view wiew1
*
ERROR at line 1:
ORA-01031: insufficient privileges
You need to have the create_view or create_any_view privilege. See your DBA. If you have DBA privileges do:
grant create_view,create_any_view on [user name] ;
That will solve the problem.
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.