SQL & PL/SQL :: Generating Hourly Report From Oracle Database
Jun 30, 2011
I am working on SQL Developer 1.5.1, i need to prepare hourly record of the activity on the database, for that i have a sql query that gives me the report as per selected columns on hourly basis.I need to prepare 24 reports a day.
Each time i have to go to the query , change the date as per hours like form 22:06:2011 10:00:00 to 22:06:2011 11:00:00 and get the report and export it in excel.
I want to automate the script so that whenever i run the script , it just asks me the date and runs the script 24 times and fetch me the hourly report of whole day.
the query syntax is something like this
Select
............................
...........................
..........................
from
..........................
........................
........................
where
And.......................
And...................
And......................
And req date between to-date( 22:06:2011 10:00:00) And to-date(22:06:2011 11:00:00)
Order by 7,1,2,3,4,5
Is there any possibility that i can automate the script to automatically change the hour itself and generate a report in excel 24 times?
My database is hung while generating the AWR report. I observe the mmon is running for long time. is it okay if i kill, will that have any impact to database.
I have a table called 'orders' and having date and time of order placed in the field timeplaced. I need to generate a report which is having hourly based number of orders placed . If no order is placed in an hour then it should show 0 for that hour in the result .
Im using forms & reports 6i and 10g. I migrated a form from 6i to 10g.The form is working fine, But Im facing problem in report output.When i try to run the report in oracle 10g web layout. It shows error message.
Terminated with error: <br>REP-1247: There exist uncompiled program unit(s). REP-1247: Report contains uncompiled PL/SQL.
When i already compiled the report so many times. ctrl+k ctrl+shift+k ctrl+s
at an Oracle 11gR2 (11.2.0.3.0) Enterprise Edition (fully licensed) with RHEL 6 as OS
I'm trying to generate a statistic, that shows me a weekly or monthly report over the traffic on a tablespace or a schema. Until now, I've worked with the
HIST_VIEW dba_hist_tbspc_space_usage
(I mean there is also one nearly called so for schema), but that view show me only the grow of a tablespace in a timeline of 1 week.
But that would not be the hole traffic. Because SELECT statements will nothing do on the grow of the tablespace but it generates traffic. In that case it wouldn't be so important, if it is more tablespace or schema sided because at this database each tablespace has it's own schema and timeline would be nice if it is weekly or monthly.
I am actually having problems with a report that is generating wrong data in Windows 7 only. I have the same report working correctly on many Windows XP Computers.
Is there any API to generate XSDs from Oracle tables? DBMS_XMLSCHEMA.GENERATESCHEMA accepts only Types and not the Table names. I want to generate XSD from the tables including length, null and default validations.
I have a table which have two columns date on hourly basis and response time. I want to pull the previous date's data on hourly basis with the corresponding response time. The data will be loaded to the table every midnight.
eg: Today's date 23/10/2012 I want to pull data from 22/10/12 00 to 22/10/12 23
The below query is pulling the date as required but I am not able to pull the response time.
with a as (select min(trunc(lhour)) as mindate, max(trunc(lhour)) as maxdate from AVG_HR) SELECT to_char(maxdate + (level/25), 'dd/mm/yyyy hh24') as dates FROM a CONNECT BY LEVEL <= (1)*24 ;
I have a table with a date time column which actually stores the data as and when it is inserted. I need to calculate the time the machine has worked hourly wise. For example the table contains records from 13:00 to 13:15 and 13:45 to 14:00 i should get 30 mins as working time..
i want to ask that is there any way to use the excel formulas on oracle forms, reports and database level. for example if we want to use IRR formula of excel to use in oracle forms, database and report.
In the below data, a container is moving from one city to another. 1,2 ,3 can be any number which i want to generate and use as keys to group the cities. Eg: AUH, JEB, CIW belong to the same key=2; SIN, IKT belong to a new group 4. The City where difference between the Seq# is greater than 1 (eg between S8W and AUH), a new group starts.
Below is the procedure I created to generate csv file from oracle procedure.
PROCEDURE proc_csv(p_path varchar2 , p_separator varchar2 default ',') AS CURSOR c_data IS select * FROM product ; v_file UTL_FILE.file_type; BEGIN
[code]...
I have two doubts about this procedures
1) In one schema this procedure is generating empty csv file with zero bytes, while in other schem It's working fine, It's showing data. I am unable to make what's the difference.
2) The csv file is not displaying column headings. I want column headings to be displayed on csv file.
we have to split the date by 7 days,should be on Sunday...and if we split by 7 days we have upto 31/01,07/02 and 14/02...but we have to generate 6 days because 20,10,10,15,25,20 (since comma separated value is 6 ).
In weblogic server Axis2 is deployed and it is showing Active.And we have uploaded ODI invoke service also in AXIS2 succesfully and it is showing Active status also...By using the soap its generating the XML with below mentioned error..
some info:- We rae using ODI 10g. Weblogic 10.3.5.0
I Have got a requirement where we have to generate an xml conforming to a particular XSD.
What i will be having already in place is an XSD document.
We are thinking of making a procedure which will be recieving the set of inputs required for creating that xml.(Data content of that XML.)We would have to make the XML according to that XSD.
Everytime Parsing the XSD is not feasible.We are looking at a solution which would be easy to make the xml from xsd at runtime.These values (DATA) will be available at run time.
Below is what I am trying to find from the above data.
col1Unalloc Alloc Metric 13450.16 1.07 1.3
the result is Hours.Minutes.
I am trying to minus the two dates and find the time taken for a particular section( eg, unalloc ).
I tried using three union queries .
Select block,timestamp From ( Select 'Unalloc' As Block ,col1,col4 From table_1 Where col2 = 'Batch Started' And col3 = 'proc_unalloc' And Parms Like '1345' Union Select 'Unalloc' As Block ,col1,col4 From table_1 Where col2 = 'Unalloc Ended' And col3 = 'proc_unalloc' And
[code].....
I will minus the start and end time for unalloc to get time taken for un alloc. Then i will minus end time of unalloc and end time for alloc to get time taken for alloc... like wise for metric.
generating an xml file using the below data.Table name is T_Data having 4 columns as given below with some data.
Region Divison District Store ---------- ----------------------- ----------- ----------- Northwest Northern California San Jose SJStore1 Northwest Northern California San Jose SJStore2 Northwest Northern California North LA LAStore1 Northwest Northern California North LA LAStore2 Northwest Northern California North LA LAStore3
I want to generate an XML File using SQL/XML Functions and the XML File should look like as given below.
We are using dbms_crypto.hash to generate the MD5 hash value for a CLOB that will be sent to other feeder systems. The feeder systems validate the file by generating the MD5 hash value on their end and compare with the MD5 generated in Oracle and accept the file only if the MD5 hash value matches.
I want to import schema1 from sourcedb to targetdb. For this I need to generate create sripts and grant scripts for roles related to schema. For example schema1 has role1; rol1 has rol2; rol2 has rol3 and some system privileges and object privileges. How can I generate this script from sourcedb?