ora 01031 insufficient privileges in oracle while creating view - oracle11g

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.

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;

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;

ORA-00959: tablespace 'USERS' does not exist. But I have it in select results

I'm trying to import a DB dump {Oracle XE 11g (11.2.0.2.0)}, created by using the EXPDP command. Following is the command that I used to import.
impdp vnp/vnp directory=MY_DATA_PUMP_DIR dumpfile=EXPDP_DUMP_26_01_2018.DMP remap_schema=VNP_ADMIN:VNP remap_tablespace=SYSTEM:USERS,DATA:USERS;
When I run this command, I get a lot of errors containing the same reason
ORA-00959: tablespace 'USERS;' does not exist
However, when I run select tablespace_name from dba_tablespaces; I see that USERS tablespace is present.
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
After reading a few related questions, I saw that it could be related to privileges for the user VNP and I have provided privileges too.
SQL> alter user vnp quota unlimited on users;
User altered.
SQL> grant UNLIMITED TABLESPACE to vnp;
Grant succeeded.
Still I'm getting the same error when I try to import this DB dump. Can you please point me to a correct direction as to why this happens..? Thanks in advance.
How trivial!
ORA-00959: tablespace 'USERS;' does not exist
^
tablespace doesn't really have a semi-colon as a part of its name, eh?
IMPDP is ran at the operating system command prompt. As such, it doesn't require (and shouldn't have) a terminator (as opposed to SQL commands).
Additionally, if it still doesn't work once you remove the semi-colon, try to split REMAP_TABLESPACE in two:
remap_tablespace=SYSTEM:USERS remap_tablespace=DATA:USERS

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