How to solve tora issue of "object can not be described" - debugging

in tora program when i press f4 to open any table this massage appear "Object TABLE_NAME (DB_USER) cannot be described",
please, how to solve.

The permissions are the issue:
A user account only allows a successful login
Permissions to view a table is granted by the table owner
Use a SELECT statement of the ALL_OBJECTS data dictionary view to see which tables you have access to:
SELECT * FROM ALL_OBJECTS
Use the DBA_TABLES data dictionary view to see all tables:
SELECT * FROM DBA_TABLES
References
Managing Security for Oracle Database Users
The Data Dictionary
Catalog Views/Data Dictionary Views
Tables Data Dictionary Views
Data Dictionary Translation Support
ALL_OBJECTS
Syntax for Schema Objects and Parts in SQL Statements
torasql - knowhow:debugger
Granting Object Privileges on Behalf of the Object Owner
ALTER USER
DBMS_DESCRIBE, 1 of 2
DBMS_DESCRIBE, 2 of 2

Related

ORA-00942: Table or View not exist connecting with another user

in Oracle SQL developer I got error ORA-00942: Table or View not exist connecting with another user when I do the following:
CREATE USER marta IDENTIFIED BY 'marta';
GRANT SELECT, INSERT ON myTable TO marta;
so then, executing:
CONNECT marta/marta;
INSERT INTO myTable VALUES ('1', 'foo', bar');
got the ORA-00942...
Obviusly, If I use system user I can insert row with no issues.
I searched other answers but I couldnt solve this... what is wrong
Obviusly, If I use system user I can insert row with no issues.
Uh-oh. There's nothing obvious about that. The SYSTEM user should not own a table called MY_TABLE (or whatever application table that is actually named). The SYSTEM user is part of the Oracle database, its schema is governed by Oracle and using it for our own application objects is really bad practice.
But it seems you have created a table in that schema and user MARTA can't see it. That's standard. By default users can only see their own objects. They can only see objects in other schemas if the object's owner (or a power user) grants privileges on that object to the other user.
So, as SYSTEM
grant select on my_table to marta;
Then, as MARTA
select * from system.my_table;
To avoid prefixing the owning schema MARTA can create a synonym:
create or replace synonym my_table for system.my_table;
select * from my_table;
But really, you need to stop using SYSTEM for your own tables.

How could I prevent a user from querying SELECT on other schemas in Oracle?

I'm using Oracle 11g(11.2.0.1.0). I created about 20 tablespaces and users. And the data came by [Tools] - [Database Copy] on Oracle SQL Developer.
Somehow I found that a user is using SELECT query on the table from another schema. I want to prevent it for security. How should I change my grant options?
I read "Oracle Database Security Guide 11g Release 2(11.2)", but couldn't find the solution clearly.
Here are my creating and granting queries.
create user [USER_NAME]
identified by [PASSWORD]
default tablespace [TABLESPACE_NAME]
temporary tablespace TEMP;
grant create session,
create database link,
create materialized view,
create procedure,
create public synonym,
create role,
create sequence,
create synonym,
create table,
drop any table,
create trigger,
create type,
create view to [USER_NAME];
alter user [USER_NAME] quota unlimited on [TABLESPACE_NAME];
And here is the SELECT result of session_privs on a user.
SQL> SELECT * FROM session_privs;
PRIVILEGE
--------------------------------------------------------------------------------
CREATE SESSION
CREATE TABLE
DROP ANY TABLE
CREATE SYNONYM
CREATE PUBLIC SYNONYM
CREATE VIEW
CREATE SEQUENCE
CREATE DATABASE LINK
CREATE ROLE
CREATE PROCEDURE
CREATE TRIGGER
PRIVILEGE
--------------------------------------------------------------------------------
CREATE MATERIALIZED VIEW
CREATE TYPE
13 rows selected.
I want to prevent a user from querying SELECT on other schemas.
For example, the following query
-- connected with USER1
SELECT *
FROM USER2.table1;
should make an error like:
ERROR: USER1 doesn't have SELECT privilege on USER2.
Edited:
Use appropriate terms (changed some words from tablespace to schema)
Add SELECT result of session_privs on a user
Add the method of how the data came by.
It was my fault. I missed that I had added some roles.
To copy data using Oracle SQL Developer, I added predefined roles to users. The roles were exp_full_database and imp_full_database.
According to Oracle Database Security Guide: Configuring Privilege and Role Authorization, exp_full_database contains these privileges:
SELECT ANY TABLE
BACKUP ANY TABLE
EXECUTE ANY PROCEDURE
EXECUTE ANY TYPE
ADMINISTER RESOURCE MANAGER
INSERT, DELETE, UPDATE ON SYS.INCVID, SYS.INCFIL AND SYS.INCEXP
and roles:
EXECUTE_CATALOG_ROLE
SELECT_CATALOG_ROLE
Those roles are not required now. So the answer is removing them from users.
REVOKE exp_full_database, imp_full_databsae FROM USER1;
And I get the result I wanted.
-- connected with USER1
SELECT * FROM USER2.TABLE1;
ERROR at line 1:
ORA-01031: insufficient privileges

What Oracle privilege is to be granted to a role so it allows users to see tables in Oracle SQL Developer schema

Using Oracle 12c, I have a role which I have granted basic CRUD operations to using Oracle SQL Developer. The problem is, users of the group can not see the list of tables in Oracle SQL Developer. All they see is the branch that shows a tables node but there is no plus sign to expand and see the tables for the one schema they need to work with. What other privilege needs to be granted to the group so they can see all the table nodes for their schema when using Oracle SQL Developer? Thanks in advance.
If I understood you correctly, you
created a role
granted certain privileges to that role
created bunch of users
granted role (from step 1) to those users
but they still don't see anything.
If that's so, they won't see anything regardless of what you grant - it is because they don't have those objects in theirs schemas.
What you (or they) should/could do is to precede table name with owner name while selecting data from those tables. Suppose that there's a table named EMPLOYEE and your users want to select data from it - they should run select * from robertcode.employee (presuming that user robertcode owns that table)
Although it works, users won't be happy because they don't know table names. Therefore, create a script which they will run in their schemas - that script will create synonyms to your tables.
In order to do that, write query which will create query:
SQL> select 'create synonym ' || table_name || ' for ' || table_name ||';'
2 from user_tables;
'CREATESYNONYM'||TABLE_NAME||'FOR'||TABLE_NAME||';'
--------------------------------------------------------------------------------
create synonym EMP for EMP;
create synonym BONUS for BONUS;
create synonym SALGRADE for SALGRADE;
create synonym DEPT for DEPT;
Copy/paste all those create synonym ... statements into an e-mail message and let them create synonyms for themselves.
They still won't see anything under the Tables node (because those users don't have tables (until they create them in their own schema), but will see something in Synonyms.

In Oracle, how to list all the tables in *my* schema that *I* created (without having DBA privileges)

I'm an Oracle11XE user with privileges to create and drop tables and procedures. I create a few tables, then while visiting the restroom, MIB zap me with a memory wipe (I foolishly looked into the light). Returning to sit at my workstation, I realize I need to query the database with my regular user privs, and figure out what that table or tables I created and the DBA has mysteriously gone missing.
You can use USER_TABLES view to get all the tables currently in your schema:
select table_name
from user_tables
If, additionally, you are interested in knowing when the tables were created, then you can use the USER_OBJECTS view where OBJECT_TYPE = 'TABLE'. That view includes the CREATED column.
select object_name, created
from user_objects
where object_type = 'TABLE'

oracle 11g dispaly user created tables

Hi I m new to oracle using 11g exprs edition and familiar with mysql. We can use the below code to display all databases in mysql
show databases;
What is the corresponding command in Oracle. Or how can i display all databases. Also We have
use mydatabase;
to chanage database in mysql. How can i change database in oracle. I tried to display all owners and their tables using the following command
select table_name, owner from all_tables;
It working fine. But when I tried to display tables I have created, by adding a where cluase
select table_name, owner from all_tables where owner='root';
it shows no rows were selected. Why this happens? Also I am facing the same problem with most of the queries when using the where clause. Without where clause it works fine. but when using it, the result is no rows selected for example
select * from all_tab_comments where owner='root';
select constraint_name, constraint_type from user_constraints where table_name='location';
Is there anything special in oracle for where clause or the problem with my query.
Your username is very unlikely to be root; it could however be ROOT, in which case you could do:
select table_name, owner from all_tables where owner='ROOT';
The owner name is case-sensitive, and all objects including users and table names are upper-case by default (unless they're created with double-quotes, which is a bad idea). If you're connected as that user, to see only your own tables you can also do:
select table_name from user_tables;
And there is the dba_tables view which also shows you tables you don't have permissions on, but you can only see that with elevated privileges.
Oracle doesn't have 'databases' in the same sense as other products. You probably means schemas, as the logical grouping of objects. And schemas and users are essentially synonymous.
To get a list of all schemas you can query dba_users (if you have the right privileges), or to get a list of schemas that have objects - as you may have users who only use objects in other schemas - you can do:
select distinct owner from dba_objects;
... or all_objects to again only see things you have permissions for. To see what kind of objects:
select owner, object_type, count(*) from dba_objects group by owner, object_type;
The documentation explains the static data dictionary views which hold all of this information. You won't be able to see all of them though, unless you're connected as a privileged user.
There will be a lot of differences between the two products; you might be better off trying to find a tutorial that works through them rather than using trial and error and trying to understand what's gone wrong at each step. Or at least familiarise yourself with the Oracle documentation so you can research issues.
First, there is going to be a terminology difference when you change platforms. What MySQL calls a "database" is most similar to what Oracle calls a "schema". If you are using Oracle XE, you can only have one database (using Oracle terminology) on the machine. You can have many schemas within that database.
The owner in all_tables is the name of the schema that owns the table. Assuming that you created an Oracle user root (which seems like an odd choice for a database user) and assuming that you did not create a case-sensitive user name in all lower case (which would create a ton of issues down the line), the owner will always be upper-case.
SELECT owner, table_name
FROM all_tables
WHERE owner = 'ROOT'
In Oracle, you do not generally change from one schema to another. You either fully qualify the table name
SELECT *
FROM schema_name.table_name
or you create synonyms (public or private) for objects that you want to reference
CREATE SYNONYM synonym_name
FOR schema_name.table_name;
SELECT *
FROM synonym_name
If you really want to, however, you can change your current schema for name resolution purposes
ALTER SESSION SET current_schema = <<schema name>>
use the view : tabs
select * from tabs;

Resources