When a table was dropped
Hi,
in 9i , is it a way to know when a table was dropped ?
Thank you.
user10274093 wrote:
Hi,
in 9i , is it a way to know when a table was dropped ?
Thank you.
DBMS_LOGMNR
Similar Messages
-
Find out when a table was dropped.
Hi,
Looks like one of the application tables had been dropped. I want to find out when it got dropped. Any ideas? I know there is a view called DBA_OBJECTS.
Thanks,
IreneMaybe it's still in the RECYCLEBIN:
SQL> drop table t;
Table dropped.
SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
T BIN$jpbH7Bp2JBzgQO2nB3pTHg==$0 TABLE 2010-08-24:13:17:42 -
How to find out when a table was last updated?
Is there a way to find out when a table was last updated/inserted/deleted? Thanks!
There may be an easier way but if you are trying to get info on something that has already happened look at your redo logs and archived logs. It would be hard but in V$LOGMNR_CONTENTS you could find the max time for a given object. Note to use this you need to set up log miner. Since you did not give a version try the Oracle 9i DBA Guide pg 9-1.
-
when a table is dropped, are the associated indexes, constraints and views automatically dropped?
CASCADE CONSTRAINTS allows you to drop a parent table before a child table that has a foreign key constraint that references the parent table. The constraints that you are dropping in this case are not constraints on the table you're dropping, they are constraints on other tables that refer to the table you're dropping.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Hi,
in 10g, how can I see when a table was lastly updated ?
thank you.I don't believe Oracle maintains a date of last update for DML operations, unlike DDL operations where you can see the date and time of the last change by looking at USER_TABLES.
If you need such a feature you would have to build it in, either adding a column which could for example be updated by a trigger every time the table is updated. However you may wish at that point to evaluate all the requirements. Is it a production database and if so are you looking for some kind of auditing solution ? It is probably to ask some questions liek this to fully understand the requirements before making any changes.
Regards -
Synonyms cant be recompiled when the tables are dropped and recreated?
hi
i have a synonym pointing to a table .
1)when i drop and recreate a table.............
isnt it enough to recompile the synonym? do i need to drop the synonym as well and recreate again?
2) when i add new columns to a table will the synonym also show up the new column?
thanks in advance
rajRecompiled is probably not quite the correct word. Re-validated is more like it.
Notice that the synonym goes invalid when the table is dropped, but does NOT become valid when the table is recreated.
That happens the first time it's used (similar to invalid stored procedures).
SQL> drop table t;
Table dropped.
SQL> select object_name, status
2 from user_objects
3 where object_name = 'T_SYN';
OBJECT_NAME STATUS
T_SYN INVALID
SQL> create table t(c number);
Table created.
SQL> select object_name, status
2 from user_objects
3 where object_name = 'T_SYN';
OBJECT_NAME STATUS
T_SYN INVALID
SQL> select * from t_syn;
no rows selected
SQL> select object_name, status
2 from user_objects
3 where object_name = 'T_SYN';
OBJECT_NAME STATUS
T_SYN VALID -
How to view when a table was last used!!?
Hi,
Pls let me know where I can view when a table in the database was last utilitized i.e. any selection or manipulation was performed on it.
Thanks in Advance,
AbhiHi,
you can see if some structure changes were done (DDL statements) through user/all/dba_objects view
select * from user_objects where object_name = 'A1';
... LAST_DDL_TIME
11/14/05 07:59:10 ...
alter table a1 add (c2 int);
...LAST_DDL_TIME
11/14/05 07:59:38 ...
Also you can monitor access to tables (with some degree of errors) using V$ACCESS and the monitoring can be set up through v$segment_statistics.
Andrey -
To find time when the user was dropped oracle
Hi Experts,
I have query from my auditor that will it be possible to find the time when the oracle user was dropped .
Vesrion oracle 10g,11g
Can we find it through audit trail or there is some dynamic performacne view which keeps this information.
Or other wise we have to create some trigger manually to capture the time if so then please provide the details of the same
A quick responce will be helpfull ....See here : 11.2.0.1 Windows XP
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select username from dba_audit_trail
2 where
3 action=53;
no rows selected
SQL> show parameter audit;
NAME TYPE VALUE
audit_file_dest string E:\APP\SERVERROOM\ADMIN\ORCL\A
DUMP
audit_sys_operations boolean FALSE
audit_trail string DB_EXTENDED
SQL> audit drop user;
Audit succeeded.
SQL> create user test identified by test;
User created.
SQL> drop user test;
User dropped.
SQL> column sql_text for a50;
SQL> set line 200;
SQL> select username,
2 timestamp,
3 sql_text
4 from dba_audit_trail
5 where
6 action=53
7 /
USERNAME TIMESTAMP SQL_TEXT
SCOTT 30-APR-12 drop user test
SQL>So, answer is action=53 in dba_audit_trail for drop user and for specific user just add like operator with sql_text column. Means, scott user droped the test user on 30-APR-12.
If you wish to know the meaning of action column of dba_audit_trail then see below link :
http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2088.htm#g1432037
command.v$session = action.dba_audit_trail
If this answer your question, please close the thread, else continue.
Regards
Girish Sharma -
Hi BW Experts
I need your help...
I activated a navigational attribute in the dev environment and transported it to the prod system. During the import the system crashed. Because of that the sid table (/BI0/YCUST_SALES) ist complete empty now - what can I do?
Is there a possibility to repair the table?
It's quite big...(/BI0/QCUST_SAKES about 15mio entries).
Thank you in advance
JoeHi,
hmm, that not good at all; since this occured while transporting, I suggest to raise an OSS ticket very high to SAP and to STOP any load involving 0CUST_SALES; otherwise you will generate an iconsistency.
If your transport required an "adjust" of the table" and performed it automatically (which I doubt since this should be done manually even in PROD system) it could be that this data has been stored in a temp table.
15 milions records is quite big for a mater data characteristic! I guess that the database could not handle the table adjustment with the corresponding dump in SAP.
Then I would ask the basis/DBA team to restore this table (or even the full DB) when it was last known with data, regardless what SAP will tell you.
not sure to be of help really but strongly hope that there will be a solution.
Olivier. -
When is table analyzed after mapping
The OWB 10.1 User Guide says this about the mapping configuration parameter Analyze Table Statements:
"If you set this parameter to true, Warehouse Builder generates code for analyzing the target table after the target is loaded if the resulting target table only is double or half its original size."
But if I look in the generated package, DBMS_STATS is performed when the number of records loaded is greater than NUM_ROWS in ALL_TABLES (so greater than when the table was analyzed last).
I'm I missing something or is this a document error?
Jaap.No, you are correct!
Thats a BIG mistake from the OWB developers if you ask me. They know about it since several people opened a TAR regarding this issue.
MB -
Does RollbackToSP will work if table column was dropped?
Hello Everyone,
I would really appreciate any opinion on these two scenarios in OWM.
Scenario One
Steps:
Savepoint1 created on May 20
CALL DBMS_WM.CreateSavepoint('LIVE', 'RRR_Test');
May 21 we alter a versioned table:
EXEC DBMS_WM.BEGINDDL('users');
--removing unused column
alter table users_LTS drop column domain;
EXEC DBMS_WM.COMMITDDL('users');
3. Rolling back to savepoint created on May 20
CALL DBMS_WM.RollbackToSP('LIVE', 'RRR_Test);
End of Scenario
Question: Will the OWM properly rollback changes made to USERS table schema?
Second Case Scenario
1 Savepoint1 created on May 20
CALL DBMS_WM.CreateSavepoint('LIVE', 'RRR_Test');
May 21 we alter a versioned table:
EXEC DBMS_WM.BEGINDDL('users');
--removing unused column
alter table users_LTS drop column domain;
EXEC DBMS_WM.COMMITDDL('users');
3. Rolling back to savepoint created on May 20
1) Add column domain back to the schema
2) Rollback
CALL DBMS_WM.RollbackToSP('LIVE', 'RRR_Test);
End of Scenario
Question: Since the schema is exactly the same as it was originally, will this work?
Your insights are most welcome.
Thank you
Serge
Edited by: sbornow on 27-May-2009 11:29 AMHello Ben,
Thanks for your response.
What do you suppose happens if you restore the changes you made (DDL) to the original state at which the savepoint was taken.
I've described it here:
Second Case Scenario
1 Savepoint1 created on May 20
CALL DBMS_WM.CreateSavepoint('LIVE', 'RRR_Test');
May 21 we alter a versioned table:
EXEC DBMS_WM.BEGINDDL('users');
--removing unused column
alter table users_LTS drop column domain;
EXEC DBMS_WM.COMMITDDL('users');
3. Rolling back to savepoint created on May 20
1) Add column domain back to the schema
2) Rollback
CALL DBMS_WM.RollbackToSP('LIVE', 'RRR_Test);
End of Scenario
Will the rollback of a savepoint work then? Considering it is acceptable for column domain to be null and would lose its values when restored.
Also, is there some information about how savepoints work in OWM ? Unfortunately the documentation does not go into detail about how they are saved and work when structural changes occur , whether they become invalid or what happens to it.
Thank you very much
Serge -
Does anyone now of any views/tables that you coupld query in EM to see when a target was added to OEM? Date Wise...
Thanks In advance!
ChrisI see MGMT_TARGETS has the following columns.
Does any of these represent closely when the target was added to OEM?
Any help appreciated. I need this for a management report.
Thanks!
SQL> desc MGMT_TARGETS
Name Null? Type
TARGET_NAME NOT NULL VARCHAR2(256)
TARGET_TYPE NOT NULL VARCHAR2(64)
TYPE_META_VER VARCHAR2(8)
CATEGORY_PROP_1 VARCHAR2(64)
CATEGORY_PROP_2 VARCHAR2(64)
CATEGORY_PROP_3 VARCHAR2(64)
CATEGORY_PROP_4 VARCHAR2(64)
CATEGORY_PROP_5 VARCHAR2(64)
TARGET_GUID NOT NULL RAW(16)
LOAD_TIMESTAMP DATE
TIMEZONE_DELTA NUMBER
TIMEZONE_REGION VARCHAR2(64)
DISPLAY_NAME VARCHAR2(256)
OWNER VARCHAR2(256)
TYPE_DISPLAY_NAME VARCHAR2(128)
SERVICE_TYPE VARCHAR2(64)
HOST_NAME VARCHAR2(256)
EMD_URL VARCHAR2(1024)
LAST_LOAD_TIME DATE
IS_GROUP NUMBER(1)
BROKEN_REASON NUMBER
BROKEN_STR VARCHAR2(512)
LAST_RT_LOAD_TIME DATE
LAST_UPDATED_TIME DATE
MONITORING_MODE NUMBER
REP_SIDE_AVAIL NUMBER
LAST_E2E_LOAD_TIME DATE -
my ipod touch was dropped on the ground, screen is cracked, won't even turn on when it's being charged, what to do?
What gen and GB is it? Replacements start at 99 for 8GB 4th Gen, Accidental damage is not covered under hardware warranty, thats not a hardware defect.
-
Determine when a database was backed up without using MSDB tables?
Hi all,
I was wondering if there was another method to determine when a database was last backed up without using the backup history tables in msdb? whether using DBCC DBINFO, DBCC PAGE on a specific database page...etc.
Also, when restoring a database, is there a trace flag you can use to force restore details to be written to the error log?
John M. CouchThe backup success message is written to the log, but the question is whether you can get restore information outside of successful restore messages to the log. i.e. backup file header information
And on a server I just restored a database too, if its not the source server, there will be no backup information in MSDB for the database or log file. Is there something internal to the database that would have that information?
John M. Couch
if you restore the database -- your msdb database has restore tables, that will tell you where you got the backup from etc..
select * from msdb.dbo.restorehistory
if the backup is from another server, use linked server in the msdb fr backup tables(not restore tables)
refer https://sqlwhisper.wordpress.com/2015/01/08/database-restore-report/
also, AFAIK,i do not think backup information is stored in the database, i would be curious know
as well. -
How to check if a constraint existed in the table and drop it?
Hi all,
I want to drop a constraint from a table. I do not know if this constraint already existed in the table. So I want to check if this exists first.
Below is my query:
DECLARE
itemExists NUMBER;
BEGIN
itemExists := 0;
SELECT COUNT(CONSTRAINT_NAME) INTO itemExists
FROM ALL_CONSTRAINTS
WHERE UPPER(CONSTRAINT_NAME) = UPPER('my_constraint');
IF itemExists > 0 THEN
ALTER TABLE my_table DROP CONSTRAINT my_constraint;
END IF;
END;
Here is the error I got when I executed the above query:
ORA-06550: line 11, column 5: PLS-00103: Encountered the symbol "ALTER" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge
Please help me with this!
Greatly appreciate!
Khoi LeYes, I also tried to put the pl-sql in the Execute Immediate. However, the error still remains
EXECUTE IMMEDIATE 'DECLARE
itemExists NUMBER;
BEGIN
itemExists := 0;
SELECT COUNT(CONSTRAINT_NAME) INTO itemExists
FROM ALL_CONSTRAINTS
WHERE UPPER(CONSTRAINT_NAME) = UPPER('my_constraint');
IF itemExists > 0 THEN
ALTER TABLE my_table DROP CONSTRAINT my_constraint;
END IF;
END';
I execute the above code via running the batch file.
Here is the error after I ran the batch file:
ORA-06550: line 11, column 5:
PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
( begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
continue close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe purge
The symbol "lock was inserted before "ALTER" to continue.
ORA-06550: line 11, column 53:
PLS-00103: Encountered the symbol "DROP" when expecting one of the following:
. , @ in <an identifier>
<a double-quoted delimited-identifier> partition subpartition
ORA-06512: at line 2117
I can not manually drop it. I need to do this via running an update script file.
Is there a different way to accomplish this?
Thank you very much!
Maybe you are looking for
-
My apple tv does not show up on itunes
i pluged my apple tv 2nd generation into my computer and it didnt show up in itunes
-
Sales orders flow - dates difference
Dear All, I need to build a model for a report which needs to have the days difference between the sales order creation date, delivery date, goods issue date and billing date. The lowest level of detail should be the Sales Order/Item and one Sales O
-
at the top left corner of the tool bar, there is a 'back' arrow and a 'forward' arrow. before the latest software upgrade to firefox, i used a teeny tiny 'down' arrow that was to the right of the 'forward' arrow. when i clicked on the tiny 'down' arr
-
PDF Protection that allows for file placement?
When I set a password on a PDF (mainly to prevent someone from grabbing the photos out of it), it has the side effect of not allowing someone to place the pdf in an InDesign file. This is a big problem, as we're always sending ad files to publishers,
-
Naive Bayes Training - CLOB as output data type for JSON string?
Hello everyone, My training model outputs a large JSON string that doesn't fit into one row, so the string is split across multiple rows. Default - or only possible output data type for that matter - is varchar according to the official documentation