Identify active users and tables in a legacy database - oracle

I am working on very legacy database. It is Oracle 19c database. It contains 120 database users and 900 tables at present. There is no documentation as of now on this database. I must identify following items.
How to identify who is using the database and for what purpose?
Who are frequently/actively connected users?
Which tables do we access most frequently?
Which tables are not in use?
It would be great help if you provide different options & data dictionary tables to meet this.

Oracle does not collect that information by default. The only way to collect that information is to enable auditing on the users and tables in question. That will allow you - over time - to create a profile of activity and usage patterns.
See the Introduction to Auditing for more information.

Related

In Oracle, how do I determine what audit settings are present for individual schemas?

I manage an Oracle database as DBA in my current role, but the database infrastructure including audit settings was defined by my predecessor, who I cannot contact.
I am trying to identify how my predecessor set up Oracle auditing. I suspect they configured auditing at a schema level with different configurations for different schemas. Is this possible?
If so, how do I see the different configurations for each schema?
Thanks

Get time and number of OBIEE 12c users login

My requirement is just to monitor and know how many a user log in per month.I need to count number of logins for a user with the time they login
Can anyone please help me in how to do this?
Is there any log file such as obis1-query log file for queries processing monitoring in OBIEE to get these info?
Thanks
Not familiar with obiee and if users log in via a connection pool, but if they log in as an Oracle defined user ID, you want a System Trigger in PL/SQL:
create trigger user_logged_in
after logon database
begin
insert into some_audit_table
(user_id, login_time)
values (sys_context('USERENV', 'CURRENT_USER'), sysdate);
end;
/
Not tested, but that should give you a start. Above example derived from Oracle PL/SQL Language Reference Example 9-21.
User tracking is your friend. You can set up to log information in the OBIEE RCU database (that database you create/configure as part of OBIEE installation), and it includes the login information. Look how to set up it in Oracle documentation, as well as blog posts (look for OBIEE User tracking in Google). Keep in mind your OBIEE version, as the details to set it up have changed in different versions, basically it involves two steps:
Set up the RPD to query to the RCU database and table (mainly, in
your XXX_BIPLATFORM DB user, the S_NQ_ACCT table for general
information, and the S_NQ_DB_ACCT table for the physical
queries)
Modify the OBIEE config file or in the EM Beans (depending on
your OBIEE version) referencing the RPD Physical layer you have set
up.
Regards
I am going to share with you my finding about my question which has asked. As you may know, OBIEE repository tables, which can be used to show to end users as subject area that this is usgae tracking utility, just track information around sent queries to BI server and not more about users specifically. In this occasion, you can use a method which called enhanced usage tracking for OBIEE that is presented completely here: https://www.rittmanmead.com/blog/2016/12/enhanced-usage-tracking-for-obiee-now-available-as-open-source/
This is exactly what you want. All detail information about users activities in OBIEE and even some redundant ones. You can create a physical table, then add it to repository file and display as subject area to end user with any permission. Of course, according to your software environment or implementation structure, you are supposed to make some changes in this manner.
I hope this goes well.

Oracle return difference result from the same user but difference windows user

I have two users on windows server
Administrator
devUser
Both can use SQL Developer to connect to Oracle 11g Server (Oracle e-Business suite) but in the same query (from synonym) they got the difference result: devUser got the correct result and Administrator got null in first three columns.
SELECT * from XXAUTO.XXFND_OU_COMPANY_V
where ou_name like 'ASL%'
Query Result from Administrator(Windows User)
Seems like the view has some form of VPD in place. Oracle supports Fine-Grained Access Control through its DBMS_RLS package, which despite the name allows us to implement security policies on columns as well as rows (since 10g). Find out more.
The common model is, when users connect to the database a LOGON trigger populates an application context with details about them. These details are used to generate as additional filters on tables and views which have security policies in place. You can confirm this by using the pertinent views: start with ALL_POLICIES and drill down depending on what you find.
It's possible the view implements a hand-rolled version of this (FGAC is an Enterprise Edition feature) but if you're using EBS that seems unlikely.
Another option is that your database is protected by Oracle Database Vault. This product is a chargeable extra to the EE license. It is a very powerful tool, and one of its uses is to prevent super users like sysadmins or DBAs abusing their privileges to look at sensitive data. It seems unlikely that an organisation would put Database Vault in place on a server that developers have access to but I offer this suggestion for completeness. Find out more.
Thank you for all.
Now I found the problem that is both user set the different Windows locale.

Accessing SAP Pool Table A016 from Sql Developer

We have two divisions in our company, one uses E1 on Oracle 11g the other uses SAP on Oracle 11g.
We also have a SQL Server system we use to data warehouse information once a night from both system to run our report server against.
The question I have is for pooled tables in SAP, such as A016, how would I get that information out of SAP?
Currently we have SSIS's setup with a linked server to the two Oracle servers which pull the data we need I just don't have the knowledge of SAP to find the Pooled tables.
if I can't pull the pooled tables because they don't physically exist is there a tool I can use in SAP to find out what tables the pooled table is getting it's information from? This way I can rebuild that table in SQL using a open query and some fun Joins.
Thanks
You have to access those tables using the application server. They can't be accessed directly from the database.
You'll probably want to write an ABAP program to extract the data you need go from there.

How do I determine if I a user requires a schema to access a table?

An application needs to access various Oracle database. Some databases have tables in Schemas, some don't - there's no control over this.
If a database has a schema in use, the applicable won't work unless the user enters a schema. I'd like it to be able determine via a SQL query if a schema is required to access the tables so the user can be alerted to this.
I'm aware of the question - How do I obtain a list of schemas that an Oracle user has access to - but that only tells me what schema's can be accessed, not if use of the schema is required to access tables.
Is there an SQL query to one of the system tables that can do this with that user's rights?
Note: The application only has login credentials and doesn't know any table details.
Hope that's clear. Thanks.
Question is confusing. For most part in Oracle, you can consider LOGIN == USER == SCHEMA. When you login into your database with your user, you are able to see and access all objects in that user's schema.
Objects in other schemas (on same database server) can be accesed by SCHEMA2.TABLE1 if connected user has privileges to acces table (there are different privileges...). As already stated in some comments, you do not need to prefix table if synonym exists. Your user can access even tables on some remote server if exists appropriate database link.

Resources