How to query AWR views/tables?
Hi,
AWR reports statistics related to SQLs used in DB/application.
I have a requirement to find out the location of those SQLs. Can anyone please help me how can I do that? Is there any internal table/view I can query to find the location?
Regards,
Ashok
Hi;
If you have metalink account, I suggest also see:
How to Generate an AWR Report and Create Baselines [ID 748642.1]
Which Views Can Be Used to Monitor PGA Usage in Oracle 10g and Higher? [ID 469521.1]
Regard
Helios
Similar Messages
-
Hi,
I have this problem, How can query a two table?
Table A -> Table B
id table-a_id
name table_b_name
the relationship is one-to-many
How can I get the result?
Hope my question make sense
cheers.
thanks a lot.I bet you have more luck looking for an answer in a SQL forum.
-
How to Query a database table of a remote system in a program.
How to Query a database table of a remote system in a program.
Thanks in adv.
-Satish1.Create an RFC(SE37) in Source (To Where you want to get data)
IMPORTING MATNR
EXPORTING : SYS TYPE SY-SYID
I_MARA TYPE MARA
SELECT SINGLE * FROM MARA INTO I_MARA WHERE MATNR EQ MATNR
2.Copy the same RFC to Target(From Where you want to get data)
3.Create a RFC destination(SM59.) in Source
Enter the connection type as 3 and enter the target host and system number ( may be 00)
4.Create a program to calling RFC in Source.
PARAMETERS: p_matnr LIKE mara-matnr.
PARAMETERS: p_dest LIKE rfcdes-rfcdest DEFAULT 'NONE'.
DATA: system LIKE sy-sysid.
DATA :i_mara TYPE mara.
CALL FUNCTION 'XX_RFC_GET_TEST' DESTINATION p_dest
EXPORTING
matnr = p_matnr
IMPORTING
sys = system
i_mara = i_mara
:-Gopeekrishnan -
UIX: How to add linked view table columns to the Read-only table
Hi
I have two tables
T1: ID, STAFF_ID, NOTE
T2: STAFF_ID, USERNAME
I have created corresponding entity objects (E1, E2), views (V1, V2), association A(E1->E2 as *..1 using STAFF_ID) and viewlink VL(V1->V2 as *..1 using association A).
My model in AppModule looks like
V1
----V2 via VL
Now I have single UIX page in which I drop V1 as Read-only table. The table displays columns correctly: ID, STAFF_ID, NOTE
What I want is to add a column STAFF_ID from the V2 into this table. I have tried to drop it into the table but when the page is run it does not display anything in that column. It has to do something with binding.
I have done similar test with dropping V1 as read-only FORM and then added STAFF_ID from V2 as messageTextInput and everything is rendered correctly.
Anyone knows how to do the same thing but with table?Yes that is true but I would like to give another example where this may not apply.
Say I have 3 tables
CLIENT(INDIVIDUAL_ID,...)
ADDRESS(ADDRESS_ID,...)
ADDRESS_HISTORY(ADDRESS_ID, INDIVIDUAL_ID,BEST_ADDRESS)
where ADDRESS_HISTORY is intersection table in CLIENT to ADDRESS many to many relationship.
Suppose I have VO2 that consists of ADDRESS and ADDRESS_HISTORY entities (corresponding association exists) and user needs to add new address for the selected customer in VO1 (made from CLIENT entity). There are several issues here:
1) An input form made out of VO2 must contain an entry for BEST_ADDRESS flag but since it will be read-only, seems that this approach may not work. However, I found a post re:Updating view objects with multiple entities that provides workaround this.
2) In that case assume that I use DBSequence to automatically add ADDRESS_ID when user inputs new record in this input form. I am using DB Trigger on ADDRESS table and have selected ADDRESS_ID in ADDRESS entity as DBSequence. Now observe that VO2 would contain another ADDRESS_ID from ADDRESS_HISTORY entity which has to be automatically populated with the same value. How?
In a nutshell my question relates to the problem how to automatically populate intersection table when new record is added to the detail. But the trick is that some attributes of the intersection table must be inserted by the user in the form..
Please advise -
Hi all
How to query in two different tables? Should i use the following
SET_BLOCK_PROPERTY('ins1', ONETIME_WHERE, 'serial = ''' || :GLOBAL.CODE || ''''); this is working but for one table if i want for both tables and and it display the related information in main form , eg..tables are referenced by primary key constraint and foreign key.
sarah
Edited by: SarahSarahSarah on Sep 1, 2009 4:59 AMFor the primary forign key tables no need to create two forms use the master detail functionality of forms.
create a Master/Detail form using the DEPARTMENT, EMPLOYEE tables.
DEPARTMENTwill be the Master block and EMPLOYEE will be the Detail block. The join condition between the two tables is where the deptno column of DEPARTMENT is equal to the deptno column of EMPLOYEE .
The following is an outline of the steps:
Create the DEPARTMENT data block and include the all the fields on the form.
Use the Form layout and only display one record at a time.
Go back to the Object Navigator and select the "Data Blocks" tree. Make sure the DEPARTMENT block is not selected and run the Data Block Wizard again.
Create the EMPLOYEE data block and include all of the columns.
For the master/Detail relationship, de-select the "auto" option, use a Join relationship, choose the DEPARTMENT data block as the Master and set EMPLOYEE.DEPTNO= DEPARTMENT.DEPTNO for the join relationship.
In the Layout Wizard for the Dependents data block, display all of the fields
Choose a Tabular style and display 4 up to records at once with 0 space between each record.
Save the form and run the form.
Thanks -
Flashback query to view table transactions
I am on 11g DB and have a requirement to view a set of tables transactional events that occurred every 5-10 minutes. The events for each table must be viewed in the order they occurred. From there a may need to write that information to another table. I was looking to use the flashback quey feature (as I see it is enabled on my DB) to do this. What is the best way to do this with flashback query and are there any performance considerations to consider querying the flashback tables on a regular interval?
Thanks
Edited by: bobmagan on Feb 6, 2013 4:43 AMHi,
refer ,
http://www.oracle-developer.net/display.php?id=320
Simply , you can use below query to get records as of desired TS from any table of the database, However oldest timestamp that you can query depends on your UNDO retention
SELECT count(1) FROM <table_name> AS OF TIMESTAMP to_timestamp('13-MAY-11 19:00:00','DD-MON-YY HH24:MI:SS');Thanks,
Ajay More
http://www.moreajays.com -
Our Production system is suffering performance issues which we attribute to the large volume of records in the audit tables. We want to implement an archival solution to alleviate this, which would involve transferring older audit records to a separate database. To achieve this, we need to write SQL queries against the <app>DATAAUDIT and <app>TASKAUDIT tables in the HFM database. We are aware that we need to join other tables to see descriptions, e.g. <app>SCENARIODESC. We have also deduced the translation of Activity Codes from "HFMAuditExtractSchemaDefs.xml", which accompanies the HFM Audit Extract Utility.
Unfortunately, there are some things which we do not know how to translate:
1) Period (lPeriod) on the <app>DATAAUDIT table, e.g. 67108869 but need to show "Jun" etc.
2) User (ActivityUserId) on the <app>TASKAUDIT table, e.g. -329543984
3) Module (strModuleName) on the <app>TASKAUDIT table, e.g. #@RID@#19
Can anyone advise how we should translate these pieces of data in order to give similar results to those seen on the Data Audit and Task Audit screens in Workspace?1.) Period - I'm not sure where this is coming from, but I'm pretty confident it is not sitting in the database which I find odd. I want to find this as well, but haven't had any free time to search around, sorry.
2.) User - This one I can help you with.
--Get Task Item Data by Hour for a given day by user
select datepart(HOUR, cast(endtime-2 as smalldatetime)), count(activitycode) from <APP_NAME>_task_audit where activitycode in (1,4,6,8,9,12,14,15,16,21,23,44) and cast(endtime-2 as smalldatetime) between '2011-12-7 00:00:00' and '2011-12-7 23:59:59' and ActivityUserID in (select lUserID from HSV_ACTIVITY_USERS where sUserName = '<USER_NAME>') group by datepart(HOUR, cast(endtime-2 as smalldatetime))In the sample SQL Query above, I am looking for all of the task audit activity (for the specified tasks) for a specific user by hour. The part of the query you want to focus on is
and ActivityUserID in (select lUserID from HSV_ACTIVITY_USERS where sUserName = '<USER_NAME>')The ActivityUserID in the task audit table will match up to the lUserID field in the HSV_ACTIVITY_USERS table. sUserName will be the actual text username. Depending on how you are configured, the name may look like johndoe or johndoe@Native Directory or johndoe@AD, etc. If you query that table, you'll figure it out pretty quickly.
3.) Module ID. I can only partially assist on this one.
This is not also in the HFM database. I suspected it might be floating in workspace; however, can't really find it there either.
I can tell you a couple things though....
#@RID@# Is just a placeholder for Resource ID. The important part is the number behind it. If you do a search on your folders for @RID@, you'll get one hit where it is defined as a constant, but that is it. (I was hoping a file search would reveal a table of the ID's; however, I wasn't that lucky). There is probably a table of values that correspone somewhere, but I haven't found it.
If you do a distinct select, you'll see there's not too many ...
select distinct strmodulename from <APP_NAME>_task_audit#@RID@#10
#@RID@#13
#@RID@#14
#@RID@#16
#@RID@#18
#@RID@#23
#@RID@#30
#@RID@#32
#@RID@#4294967295
#@RID@#45
#@RID@#46
#@RID@#49
#@RID@#52
#@RID@#58
#@RID@#59
#@RID@#65
#@RID@#66
#@RID@#67
#@RID@#68
#@RID@#69
#@RID@#7
#@RID@#9
HyperionReports
How can you determine these values?
The quick and dirty way would be to run a Task Audit Extract for a given date range as this will reveal the Module Name.
Then execute a SQL Query on the Task Audit Table for the same data range. You could then match up the records and deduce the values.
--Get Task Items by Date Range
select (select sUserName from HSV_ACTIVITY_USERS where lUserID = ActivityUserID) as UserName, ActivityCode, ServerName, AppName, cast(StartTime-2 as smalldatetime), cast(EndTime-2 as smalldatetime), strDescription, strModuleName from <APP_NAME>_task_audit where cast(endtime-2 as smalldatetime) between '2011-12-7 00:00:00' and '2011-12-7 23:59:59' order by endtime ascOnce you determine the values, I would create a table in your database to hold them so that you could use them in future queries. I would also recommend you do the same with the activitycodes. -
How to query 2 hierarchical tables and join?
Hi
I've been bashing my head against a well to get this to work efficiently in 10g. I can solve the following writing some pretty horrible SQL, but can't figure out how to do it elegantly and optimally.
We have two hierarchical tables as follows:
select * from data_categories dac
dac_code name parent_dac_code
10 MANAGEMENT
20 MEDICATION 10
30 PROCEDURE 10
40 SURVEY
50 ASSESS
60 NATURE 50
70 OBSERVE 60
select * from data_elements des
des_id name parent_des_id dac_code display_seq
100 DOSE MEDICATION 1
110 1MG 100 1
120 2MG 100 2
130 3MG 100 3
140 ROUTE MEDICATION 2
150 ET 140 1
160 EM 140 2
170 RESPONSE MEDICATION 3
180 IMPROVED 170 1
190 NOCHANGE 170 2
200 FILED MANAGEMENT 1
210 INPUT OBSERVE 1
You'll note:
1) We have hierarchies in both tables, and a fk from data_elements to data_categories via the dac_code.
2) The depth of both data_categories and data_elements is unlimited.
3) There is no single root node record in either table.
4) The appropriate PK and FK indexes exist.
We need to write a query that returns the following results:
root_dac_code parent_dac_code des_level des_id name display_seq
ASSESS OBSERVE 1 210 INPUT 1
MANAGEMENT MEDICATION 1 100 DOSE 1
MANAGEMENT MEDICATION 2 110 1MG 1
MANAGEMENT MEDICATION 2 120 2MG 2
MANAGEMENT MEDICATION 2 130 3MG 3
MANAGEMENT MEDICATION 1 140 ROUTE 1
MANAGEMENT MEDICATION 2 150 ET 1
MANAGEMENT MEDICATION 2 160 EM 2
MANAGEMENT MEDICATION 1 170 RESPONSE 3
MANAGEMENT MEDICATION 2 180 IMPROVED 1
MANAGEMENT MEDICATION 2 190 NOCHANGE 2
MANAGEMENT MANAGEMENT 1 200 FILED 1
You'll also note we need to return the data in order of the root_dac_code, then parent_dac_code, followed by the display_seq.
Does anybody know how to write this query in an elegant and optimal manner?
Many thanks for any help!
Cheers,
CM.Flakey model.
Why does data_elements.dac_code appear to refer to data_categories.name rather than data_categories.dac_code?
You do not appear to be ordering by root_dac_code, parent_dac_code and display_seq (if you were MANAGEMENT/MANAGEMENT would not be at the end). Did you perhaps mean ORDER BY root_dac_code, des_id, display_seq?
Something like this perhaps?
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE TABLE data_categories (
2 dac_code NUMBER,
3 name VARCHAR2 (30),
4 parent_dac_code NUMBER);
Table created.
SQL> INSERT INTO data_categories VALUES (10, 'MANAGEMENT', NULL);
1 row created.
SQL> INSERT INTO data_categories VALUES (20, 'MEDICATION', 10);
1 row created.
SQL> INSERT INTO data_categories VALUES (30, 'PROCEDURE', 10);
1 row created.
SQL> INSERT INTO data_categories VALUES (40, 'SURVEY', NULL);
1 row created.
SQL> INSERT INTO data_categories VALUES (50, 'ASSESS', NULL);
1 row created.
SQL> INSERT INTO data_categories VALUES (60, 'NATURE', 50);
1 row created.
SQL> INSERT INTO data_categories VALUES (70, 'OBSERVE', 60);
1 row created.
SQL> CREATE TABLE data_elements (
2 des_id NUMBER,
3 name VARCHAR2 (30),
4 parent_des_id NUMBER,
5 dac_code VARCHAR2 (30),
6 display_seq NUMBER);
Table created.
SQL> INSERT INTO data_elements VALUES (100, 'DOSE', NULL, 'MEDICATION', 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (110, '1MG', 100, NULL, 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (120, '2MG', 100, NULL, 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (130, '3MG', 100, NULL, 3);
1 row created.
SQL> INSERT INTO data_elements VALUES (140, 'ROUTE', NULL, 'MEDICATION', 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (150, 'ET', 140, NULL, 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (160, 'EM', 140, NULL, 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (170, 'RESPONSE', NULL, 'MEDICATION', 3);
1 row created.
SQL> INSERT INTO data_elements VALUES (180, 'IMPROVED', 170, NULL, 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (190, 'NOCHANGE', 170, NULL, 2);
1 row created.
SQL> INSERT INTO data_elements VALUES (200, 'FILED', NULL, 'MANAGEMENT', 1);
1 row created.
SQL> INSERT INTO data_elements VALUES (210, 'INPUT', NULL, 'OBSERVE', 1);
1 row created.
SQL> SELECT dc.root_dac_code, de.parent_dac_code,
2 de.des_level, de.des_id, de.name, de.display_seq
3 FROM (SELECT LEVEL des_level, des_id, name, parent_des_id,
4 CONNECT_BY_ROOT (dac_code) parent_dac_code, display_seq
5 FROM data_elements da
6 START WITH parent_des_id IS NULL
7 CONNECT BY PRIOR des_id = parent_des_id) de,
8 (SELECT CONNECT_BY_ROOT (name) root_dac_code, name dac_code
9 FROM data_categories
10 START WITH parent_dac_code IS NULL
11 CONNECT BY PRIOR dac_code = parent_dac_code) dc
12 WHERE de.parent_dac_code = dc.dac_code
13 ORDER BY dc.root_dac_code, de.des_id, de.display_seq;
ROOT_DAC_CODE PARENT_DAC_CODE DES_LEVEL DES_ID NAME
ASSESS OBSERVE 1 210 INPUT
MANAGEMENT MEDICATION 1 100 DOSE
MANAGEMENT MEDICATION 2 110 1MG
MANAGEMENT MEDICATION 2 120 2MG
MANAGEMENT MEDICATION 2 130 3MG
MANAGEMENT MEDICATION 1 140 ROUTE
MANAGEMENT MEDICATION 2 150 ET
MANAGEMENT MEDICATION 2 160 EM
MANAGEMENT MEDICATION 1 170 RESPONSE
MANAGEMENT MEDICATION 2 180 IMPROVED
MANAGEMENT MEDICATION 2 190 NOCHANGE
MANAGEMENT MANAGEMENT 1 200 FILED
12 rows selected.
SQL> -
How to query an external table?
hi,
Can anyone help me, I created an external table but I cannot query the table... I encountered the error SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout...
Attached my SQL for your reference:
CREATE OR REPLACE DIRECTORY dat_dir AS 'pos_file';
CREATE OR REPLACE DIRECTORY log_dir AS '//10.101.21.175/pos_file/Log';
CREATE OR REPLACE DIRECTORY bad_dir AS '//10.101.21.175/pos_file/Bad';
CREATE TABLE revext (person VARCHAR2(20),
rev_jan NUMBER(4),
rev_feb NUMBER(4),
rev_mar NUMBER(4),
rev_apr NUMBER(4),
rev_mai NUMBER(4),
rev_jun NUMBER(4),
rev_jul NUMBER(4),
rev_aug NUMBER(4),
rev_sep NUMBER(4),
rev_oct NUMBER(4),
rev_nov NUMBER(4),
rev_dez NUMBER(4))
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY dat_dir
ACCESS PARAMETERS
records delimited by newline
fields terminated by ','
( person,
rev_jan,
rev_feb,
rev_mar,
rev_apr,
rev_mai,
rev_jun,
rev_jul,
rev_aug,
rev_sep,
rev_oct,
rev_nov,
rev_dez
LOCATION ('revext.dat')
Thank you,
DexterHi! Thanks for your immediate response...
Here's the complete error when I tried to query the created external table.
Error starting at line 48 in command:
select * FROM revext
Error report:
SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
error opening file pos_file/REVEXT_18225.log
29913. 00000 - "error in executing %s callout"
*Cause: The execution of the specified callout caused an error.
*Action: Examine the error messages take appropriate action. -
How to query from view with parameter, only when the JSP-page loading
I use JSF/ADF BC, create two viewes:view1 and view2, in the JSP page the user press a button to query from the view1, but I hope the view2 can be queried only when the page loading, it have no relation with user-operator, and pass the column value of view2 into some variables, the view2 return one record.
Hi -
You may want to have a look at this other thread:
Re: Execute ViewObject with Parameters at JSF Page Load? JSF/ADF/BC 10.1.3
John -
How to see view table in discoverer
Hi All,
Can any one tell me how to see a view table which is a multiorg data to see in Discoverer as we know if some abc_v table by running in TOAD we are using
BEGIN
DBMS_APPLICTION_INFO.SET_CLIENT_INFO('ORG_ID');
END;
OR
BEGIN
FND_CLIENT_INFO.SET_ORG_CONTEXT('ORG_ID');
END;
But how to use this in Discoverer.
Regards,
SushantHi,
Usually you set the contexts using either a Discoverer logon trigger or using the Applications system profile "Initialization SQL Statement - Custom" which allows you to run some PL/SQL to initialize the session.
Rod West -
View Table to update Physical Inventory Number Range.
Hi,
I am looking for the 'View Table' Name to update Physical Inventory Number Range in OMMB transaction.
I will have to do it using SM30 as OMMB is display only.
ThanksHi,
OMBT still cant help me because I dont have write access on this client.
Are you aware on how to get the View Table to Maintain Number Ranges for Physical Inventory?
Thanks,
Rohit. -
I apologize in advance if this question is obvious - I am new to JDeveloper.
In JDeveloper 9.x, I recall the ability to connect to an Oracle database and view the data in a table via a "Data" tab in the Connection Manager.
Since then, I've installed JDeveloper 10 on a new computer, but find this "Data" tab is no longer available.
How do I now view table data in JDeveloper?
I see many tutorials on viewing data from new application. However, I simply want to examine the table data, not develop a new application.Assuming you are using JDeveloper 10.1.3 - when you double click a table in the database browser a window that shows it's stucture will be open.
Look at the bottom of this window and you'll find the data tab. -
How to Query E-Business Tax tables/views
I run SQL queries on the following tables:
ZX_TRANSACTION
ZX_TRANSACTION_LINES
but it returns no rows. How to query ZX tables/views?
My main purpose is to retrieve tax code which is in 12i no longer available in AP Transaction Distributions table/view.
Please advise.
Thanks in advance.Hi Srini,
I followed PL/SQL procedure stated in note 415860.1. But still can't do the query. See below.
SQL> begin
2 fnd_global.apps_initialize(1079,51569,235);
3 mo_global.init('ZX');
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> select count(*) from ZX_TRANSACTION
2 /
COUNT(*)
0
SQL> select count(*) from ZX_TRANSACTION_LINES
2 /
COUNT(*)
0
Thanks,
Corry -
How to build sql query for view object at run time
Hi,
I have a LOV on my form that is created from a view object.
View object is read-only and is created from a SQL query.
SQL query consists of few input parameters and table joins.
My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
Thanks
Srikanth AddankiAs I understand you want to change the query at run time.
If this is what you want, you can use setQuery Method then use executeQuery.
http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_
Maybe you are looking for
-
The "Go back one page" button on the Navigation toolbar doesn't work on certain web pages.
== Issue == Firefox is having problems with certain web sites == Description == The "Go back one page" button on the Navigation toolbar doesn't seem to work on certain pages. On clicking this button, the focus stays on the same page and does not move
-
Download to Excel using METHODS
I want to change the Worksheet name which in default being created as Sheet1/ Sheet2/ Sheet3 on creation of Excel file while downloading using Objects. How should I change the name of Sheet1/ Sheet2/ Sheet3 to my requirement. Attached the coding part
-
How can I remove the black borders after draggin in a M2TS file?
I record gaming videos with my HD PVR and the output of the file is M2TS. Everytime I drag it in Premiere, it will show small black borders at the top and to the right of the video. I knew how to do this in Vegas but am clueless on how to do it in Pr
-
Custom formula YTD for PERIODIC Application - BPC 7.5 NW
Dear all, The customer has 2 time hierarchies, fiscal year and calendar year. He would like to change the measures formulas to fix their fiscal year specification, their fiscal year begins in April instead of January. Some entities of the customer wi
-
How to change exchange rate in VA02
Dear Experts We have sales order which is having around 5 line item and in that 1st line item alone has been invoiced in January and later items still not invoiced In the month of February, the invoice for 1st line item has been cancelled , so to avo