SSIS breaks Oracle Privileges - oracle

I make a privileges to user on one schema at Oracle, when accessing oracle database using SSIS I saw all tables and schema. When I use SQL Plus show me only one schema.
What is the problem here?

What query are you running to see tables in SQL*Plus? If you are querying USER_TABLES, you will only see the tables that the current user owns. If you are querying ALL_TABLES, you will see all the tables that you have permission to query regardless of the owner. If you are querying DBA_TABLES, you will see all the tables in the database (though you need additional privileges to query the DBA% objects.
There is another question on how to get a list of all the tables in a database that goes into more detail about this.

Related

How to view other users' objects like mine in Oracle SQL Developer?

When I access other users' objects, I can do something like
select * from user_2.booking_table;
given that I have the privileges over user_2's objects.
Using the console, I know I can do
alter session set current_schema=user_2;
to avoid prefixing user_2 in front of object's name - so I can do
select * from booking_table;
as if booking_table is my table without specifying user_2 each time.
If I want to bring similar idea to GUI client...
Using Oracle SQL Developer, under each connection, I know I can browse other users' objects under the tree node Other Users > user_2 > Tables/Views/Indexes etc...
Is there anyway I can "import" user_2's objects so that they appear under my Tables, Views, Indexes, etc under the connection, as if they look like they are my objects?
No. We show you what you have, or what other schemas have.
The only way to get close to what you're looking for is if you were to create synonyms to tables in other schemas, then you can ask SQL Developer to present those as TABLES in your connection list.
I'm logged in as a user with an 'empty' schema, at least as far as tables are concenred.
I enable this filter check item, and click 'OK' -
I talk about this in detail here.
Disclaimer: I'm the product manager for Oracle SQL Developer.

schemacrawler not returning all Oracle tables - what permissions are required?

Using schemacrawler and trying to connect to an Oracle database. The resulting json file is only including about 10 tables, but we are expecting a much larger number of tables in the database.
This must be restricted by permissions of the user being used to access the Oracle database, but what permissions are required for that user for schemacrawler to be able to "see" the table/columns?
Presumably schemacrawler uses the data dictionary. So the user will be restricted to what tables and columns are visible in ALL_TAB_COLS view i.e. what tables they have at least SELECT privilege on.
Otherwise the user needs select on DBA_TAB_COLS, which shows all tables in all schemas. That requires DBA access to grant.

Allow another user to access my Oracle table

I would simply like to allow a colleague to view and edit the Database I've created.
I've tried:
GRANT ALL on FISHTABLE to CDEMARES;
and it returned Grant succeeded but nothing changed for him and he still wasn't able to view my table.
I also tried
GRANT SELECT smahala.fishtable to cdemares#sole.nefsc.noaa.gov;
but that failed with SQL Error: ORA_00990: missing or invalid privilege.
Is my issue that I don't have the administrative authority to allow someone else to view my Oracle table? Any advice is appreciated, thanks.
Your colleague needs to prefix your table with your schema name, otherwise Oracle doesn't know where to look for it, e.g.:
select * from smahala.fishtable
If they don't do that, and simply try to use:
select * from fishtable
then Oracle will look for the table in their own schema, and then look for a view, or a private synonym, or a public synonym. Your colleague could create a synonym if they'll be accessing this table a lot (and they don't have their own table with the same name). It's also possible to change their session's current schema, but that will make it harder to see their own objects.
You can read more about object naming and how to refer to objects in the documentation.
SQL Developer allows you to browse objects in other schemas. If your colleague was connected when you granted the permissions, they can refresh the object list, or disconnect and reconnect. Either way they should then be abke to see your table under your schema.
(Your second grant statement is missing an on, and you can't grant permissions across a database link, if that's what you're trying to do.)

How can I ignore system created table when i am getting the list of granted privileges given to user in oracle 11g?

I am using Oracle 11g. I am successfully extracting DDL of database using userA account who created database tables, SP, Functions etc using getddl() method.
Now here is a case userA has shared / grant some action (ie. select) to userB account. and When I tried to get DDL details using same getDDL method, it is not including that shared tables.
To resolve it I used following.
SELECT * FROM USER_TAB_PRIVS;
Statement. Using this I can get list of all shared table with some unknow system tables details.
Now I am looking for the solution which either gives only shared tables or a way using that I can ignore (filter) that tables
FYI: When I am executing the above query it gives this output.
As expected it returns data related to all tables including system tables and all users created in the database including system generated users.
So can please anyone help me to create a query which will give me data related to privileges granted to all the users created manually and not by system?
To get the list of all privileges given to USER_2 from USER_1, you can use the following query.
SELECT * FROM SYS.USER_TAB_PRIVS T WHERE T.GRANTOR = 'USER_2';

How should I read the data from different oracle schema using ado.net?

The database user has got two schemas. I need to read the data from a specific schema using ado.net. I am using OleDbConnection object to create the connection to database. Appreciate your answers.
Use SCHEMA_NAME.TABLE_NAME in your queries.
If you don't specify a schema, Oracle will look into the current schema. The schema is by default the connexion user (so if you connect with USER1 and query TABLE1, Oracle will look for the table USER1.TABLE1). You can change your current schema at any time during a session with:
ALTER SESSION SET CURRENT_SCHEMA=SCHEMA2;
You can also use synonyms to point to the correct table.

Resources