In sqlplus under normal schema account (not sys), query select * from v$instance; runs OK. But when create view which references it, error happens:
create or replace view vw_test_instance
as
select * from V$instance;
SQL Error: ORA-01031: insufficient privileges
If switch v$instance to any normal table like select * from dual;, then the view created with no problem.
Oracle version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
The back ground is I'm upgrading a database run on 10g to 11g, things used to work on 10g just broken on 11g... Can I fix it without touching source code of views? Appreciated!
This is related to user GRANTS.
1. GRANT SELECT ON V$INSTANCE TO <USER>; --> Will be provided by SYSDBA
2. Then try. It will definitley help.
This link will also help you to understand why this kind of behaviour occurs.
v$views Grant
"query select * from v$instance; runs OK. But when create view which references it, error happens:"
The error you get - SQL Error: ORA-01031: insufficient privileges - indicates that your user lacks the privileges to create a view.
" things used to work on 10g just broken on 11g"
Clearly on 10g privileges your user had privileges to create views and on 11g they do not.
The most likely explanation is that your user relies on the CONNECT role. In older versions of Oracle this role had several system privileges, including CREATE VIEW. This implicit granting of privileges was always dodgy. However, in 11g this changed and the role now only has CREATE SESSION. All other privileges must be granted explicitly. This is mentioned in the 11g Upgrade docs and explained in depth by the 11g Security Guide Find out more.
Related
I'm trying to keep/pin frequently accessed table in buffer, but i see the db_keep_cache_size parameter is deprecated in 12c. is there any alternative way to perform same on 12c?
my oracle version: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit.
I tried below steps in 12c and it executed without any error, but not sure it will have any impact on 12c.
show parameter keep;
alter system set db_keep_cache_size=1M scope=both;
show parameter keep;
SELECT SEGMENT_NAME, BUFFER_POOL from dba_segments where SEGMENT_NAME='cust_table' and owner='services';
alter TABLE services.cust_table storage (buffer_pool keep);
Could someone please suggest, whether above steps are valid in 12c?
Thanks in advance.
Laks
I try to drop/alter user like this
drop user AVASILIEV_AXIOM_10X
And I get the following error
SQL> drop user AVASILIEV_AXIOM_10X;
drop user AVASILIEV_AXIOM_10X
*
ERROR at line 1:
ORA-01918: user 'AVASILIEV_AXIOM_10X' does not exist
But this user exists in the dba_users view:
SQL> select username from dba_users where username='AVASILIEV_AXIOM_10X';
USERNAME
------------------------------
AVASILIEV_AXIOM_10X
SQL>
Also, I can't create user with the same name because it already exists in the DB. What's the problem?
My Oracle version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
This is old thread but for reference Oracle Doc ID 1297361.1 suggests as follows:
SQL> drop user ahong3;
drop user ahong3
*
ERROR at line 1:
ORA-01918: user 'AHONG3' does not exist
SQL> select username from dba_users where username='ahong3';
USERNAME
------------------------------
ahong3
SQL> execute hcheck.full
HCheck Version 8i-11/1.95
Found 0 potential problems and 0 warnings
PL/SQL procedure successfully completed.
CAUSE
User was created forcibly in lower case. Drop user considers the user to be in upper case, and hence can't find it.
Ex: below statement will force the creation of the user in lower case.
SQL> Create user "ahong3";
SOLUTION
Force the drop user statement to drop the user created in lower case by specifying the user name in double quotes:
SQL> Drop user "ahong3";
This solution worked for me
DROP USER user CASCADE;
Hope this work cz its work for me
The context:
I work with oracle 11.2.0.4 standard edition.
I create a new database (CREATE DATABASE + catalog + catproc)
I have a problem when I'm connect on those database.
It works but I have a ORA-00942: table or view does not exist error!
Do you know this problem?
>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 20 16:22:27 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
SQL> create user test PROFILE DEFAULT IDENTIFIED BY test DEFAULT TABLESPACE TEST TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED on test ACCOUNT UNLOCK;
User created.
SQL> grant connect to test;
Grant succeeded.
SQL> Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
>sqlplus test/test
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 20 16:13:50 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-00942: table or view does not exist
Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
I encountered this problem at work recently - you log on to Oracle through sqlplus and on connecting it throws an ora-00942 (table or view does not exist).
It turns out the problem was we had not run pupbld.sql which is responsible for setting up a bunch of system tables that sqlplus (and only sqlplus) cares about. It's stuff to do with being able to assign different accounts different permissions when using sqlplus, hence on connect it tries to access those tables and if you haven't run pupbld.sql then it throws an ORA-00942 because the tables it expects to be there aren't there.
You should be able to solve the problem by running the following:
sqlplus system/manager #?/sqlplus/admin/pupbld.sql
NOTE: very important to run this as system as the tables are expected to exist in the system schema.
I've come across a strange datatype in oracle called MLSLABEL. It's not listed on datatype docs, and is only valid for 'trusted oracle' (whatever that is). The documentation I could find on it is this. What is MLSLABEL, and what does it do?
MLSLABEL is (was?) a datatype used by Trusted Oracle, the foreunner of Oracle's Advanced Security Option. The Admin docs say it was included in regular Oracle for compatibility. Find out more.
Trusted Oracle as a brand was replaced by ASO with Oracle 9i (I think). I don't think MLSLABEL is used in ASO (I can't find anything in the relevant docs). It is still supported in modern versions of the database. probably for backwards compatibility:
SQL> select * from v$version;
BANNER
-----------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> create table mls (id number, lbl mlslabel);
Table created.
SQL>
If I recall correctly, it is used for a finer grained permission scheme. Oracle out of the box allows users to be granted permissions on views, tables, procs, etc. But if you need to limit access to users based on the value of a column in a record, I think that you can use Labels for that. On the other hand, I am not certain when you go to virtual private databases (VPDs), but that might not be what you are asking.
I've been trying to access the dba_data_files table to see whether the autoextend is turned on for my data files. However, even though I'm using Oracle 10g, this table seems to not exist:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from dba_data_files;
select * from dba_data_files
*
ERROR at line 1:
ORA-00942: table or view does not exist
Is there some other way to check and even change whether a data file for a particular tablespace has the autoextend option turned on?
You should make sure you're connecting with an account that has privileges to see this view - try the SYSTEM account if you have that password, otherwise have your DBA grant the SELECT_CATALOG_ROLE to the account you are using.
You should be able to do this through the oracle enterprise manager under Administration