SQL & PL/SQL :: Get Last Updated Date When Data Modified?
Jun 20, 2011
I have multiple project databases where their tables are similar. I wanted to know just a single date from each project databases is modified/updated. If I run a query like select * from component order by eng_proj_id, chg_date desc then it will return many records sorted by their eng_proj_id and chg_date in their descending but I only need just a single record with last update from each project databases.
The requirement is to find the last date when either ATTRIB1 or ATTRIB2 were modified for each ID. There are many other columns in the table, but I'm not interested in other columns.
Test Case
SET LINES 100 SET PAGES 100 DROP TABLE test_log / CREATE TABLE test_log
[code]....
Expected Output
ID LAST_CHANGE_DATE ---------- -------------------- 11 02-SEP-2012 10:58:32 35 05-AUG-2012 10:58:32
I have written the below query, to get the required output.
SELECT MAX(i_date) last_change_date FROM ( SELECT seq,id, attrib1, attrib2, i_date, row_number() OVER (PARTITION BY attrib1 ORDER BY i_date) rn1, row_number() OVER (PARTITION BY attrib2 ORDER BY i_date) rn2
I want know how the values in view DBA_FEATURE_USAGE_STATISTICS gets updated i have already checked the metadata of this view but unable to find how / when the values are being updated.
The requirement is, the combination of col1,col2,col3 and col4 should always be unique, and wherever the col1, col2,col3 are same then col4 should be the sequence, starting from 1. Likewise the data should be updated back to the table.I'm able to do this using PL/SQL. Can I do the same using a single update statement?
i need a code to auto refresh or after 1 minute in form & report when the data is updated. basically i am deploying the plasma tv in hall so executive can see the status report where they need its going to be like a stock system multiple forms or reports sticky dynamically change .
I have the manipulated data on temporary table name "tempdata" and i want to display it in to my report, I am using the temporary table, and also call report from the same session on which data is updated on temporary table. but its still not showing data on the report, I think this is the session problem of the form but i also call report from the same form , so the session should b same for both the report as well as for the form, so y don't the report show the temporary table data.
I want to get data for month to date. For example, If I pass today or any day date as parameter then i should get data for that month(month of passing date) up to passing(parameter) date. As well as i have to get year to date.For example, If I pass today or any day date as parameter then i should get data for that financial year(year of passing date) up to passing(parameter) date. how to get month to date and year to date data.
I have a date field that should be filled everyday with today's date and I need to get the days that were not entered.
i.e. :
CREATE TABLE TRY_F (DAT DATE);
INSERT ALL INTO TRY_F VALUES (to_date('01/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('02/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('04/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('05/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('06/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('08/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('10/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('14/01/2011','DD/MM/YYYY')) SELECT * FROM DUAL;
I need a smart way of getting the dates that were missed in DAT.
i have a sequence for one of my table that this sequence's current value was 3000 yesterday but today when i checked current value of it, i surprised because the value changed to 50, can i check who changed my sequence? is exists any data dictionary that shows logs of modified database objects.
I have created a web source with the default settings and pointed it at a test site. The pages being craweled have both last modified response headers and meta tag last-modified being set in the rendered html but the crawler doesn't seem to be indexing the values.
It is indexing and returning last modified on the liked files (i.e. *.doc, *.pdf) but not the actual web page itself.
Am I missing a step? How do I get the last modified meta tag of html to be indexed?
pga_aggregate_target has been incorrectly set to 21gb in one of our databases.
SQL> sho parameter pga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 21686M
When I try to change it to 1g or 800m I get the following error.
SQL> alter system set pga_aggregate_target=1g scope=memory; alter system set pga_aggregate_target=1g scope=memory * ERROR at line 1: ORA-02097: parameter cannot be modified because specified value is invalid ORA-00068: invalid value 104850 for parameter smmmax_size, must be between 0 and 0
Whereas when i try to set the scope to spfile it works
SQL> alter system set pga_aggregate_target=1g scope=spfile; System altered. Version is 11.2.0.3 on RHEL 5
how I can set the pga_aggregate_target right, I am not sure whether bouncing will work or not since i m doubtful that I may get the same error related to smmmax_size while bouncing with the new pga_aggregate_target.
I have a small question is it possible to find the details of a user who modified the structure of a table, including what command he ran to change the structure of the table?
We have Forms application created in Oracle Forms Builder version 9.0.4.0.19. We have done modification in some forms and few forms created using Oracle Forms Builder 10g version 10.1.2.0.2.
Now we need to convert those forms which are around 5 or 6 in number to Oracle Forms 9.
I'm altering a column length to increase the size and getting "ORA-30556: functional index is defined on the column to be modified".
On searching more about this error, it seems like the function index must be dropped before altering the column.The table I'm dealing with is huge.
Question 1:In case of dropping and recreating the index, should the following steps be done:
- Drop Index - Alter the column to increase the size - Recreate the index with NOLOGGING and NOPARALLEL clause - ALTER INDEX to turn on LOGGING - Gather Statistics on that index
Question 2:Is there anything else that should be done when the index is dropped and re-created?
Question 3:What are the side-effects of carrying out the above steps in a huge table with around 15 million rows?
Question 4:Would it work if I disable the index, alter the column and reenable the index?Do I have to rebuild the index and gather Stats upon reenabling it?
I got an error FRM-40202: Field must be entered. I did some modifications to Standard form by copying it. after that when I selected the first Email check box in the list and then selected the Email button which I created newly for that form.
I want to compare two users on different databases, actaully there are two users one in user a on database a and another user b on database b they have same tables, and everytime when a table or object is created on user a (database a) i will take the table name ,procedure or any other object from user_objects based on ddl_created date and then i need to recreate the same on user b on database b, is there a way to find out tables which are not only created but also i need to check whether if there is any column added or any change in procedure or any other objects.Is there a way to generate the scripts based on list of objects selected from user_objects. all i want is.
a)Find out the list of objects added along with creation scripts b)find out the list of objects modified along with creation scripts.
I have a problem some user modified the objects and now objects became invalid .How to trace the ip address and operating system username and service ip who modified the objects?
I need to modify the column type that already has data in it, i need it change varchar to number then The datas entered have $ and , (e.g $3,200). I need the $ and , removed with column type set to numbers.
When i currently do this i get the following error:
The TABLE operation was not successful for the following reason:
ORA-01439: column to be modified must be empty to change datatype
I've tried unloading the data and loading the data using the spreadsheet, cut and past and csv file but both give me more errors, so i just want that one column modified.
how to get the output in below format. Count how many times each file is selected in a month.
Output format should be like below.. ============================================== File_Name Jan Feb Mar Apr ---------- Dec ============================================== file1 2 1 3 0 ---------- 2 file2 1 0 2 1 ---------- 3 file-n 8 2 3 0 ---------- 2