Protect table againts deletes & truncates
Hi
I need to protect a table in my schema againts the DDl commands DELETE & TRUNCATE ? is this can be done via triggers ???
please share your idea's
thanks in advance
regards
raj
you can use trigger but not to avoid DML statement delete. you can use trigger to see affected row values before or after the event.
The trigger can be invoked once, when some event occurs, or many times, once for each row affected by an INSERT, UPDATE, or DELETE statement. The trigger can be invoked before or after the event.
refer:
http://download.oracle.com/docs/cd/B10500_01/server.920/a96524/c18trigs.htm
http://psoug.org/reference/table_trigger.html
Edited by: rajeysh on Jun 22, 2010 3:38 PM
Similar Messages
-
Release of space after delete/truncate table
Hello,
How does release of space after delete/truncate table works? Is the space used before deletion released once delete is complete or not? Will I see the space occupied by deleted table as free in dba_segments or will I need to reorganize the table (drop and recreate again?). Reason why I am asking is that I can see table with 0 rows, but in dba_segment I can see it is occupying few gigabytes....
Thank youHere is a little illustration for you;
SQL> conn ogan/password
Connected.
SQL> create table ogan_deneme as select * from all_objects;
Table created.
SQL> select count(*) from ogan_deneme;
COUNT(*)
228470
SQL> set line 1000
SQL> set pagesize 1000
SQL> select * from dba_segments where owner='OGAN';
OWNER SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE TABLESPACE_NAME HEADER_FILE HEADER_BLOCK BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS RELATIVE_FNO BUFFER_
OGAN OGAN_DENEME TABLE SYSTEM 854 319981 *30408704* *1856* *44* 65536 1 2147483645 1 1 854 DEFAULT
SQL> truncate table ogan_deneme;
Table truncated.
SQL> select * from dba_segments where owner='OGAN';
OWNER SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE TABLESPACE_NAME HEADER_FILE HEADER_BLOCK BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS RELATIVE_FNO BUFFER_
OGAN OGAN_DENEME TABLE SYSTEM 854 319981 *65536* *4* *1* 65536 1 2147483645 1 1 854 DEFAULT
SQL>Hope it Helps,
Ogan -
Update Function Module Required for Deletion/Truncation of Open Hub Table
Hi All,
I need to delete/Truncate DB tables i.e. Ztables using Update FM
can anyone help me with few Update FM.
Regards,
NS.If you want to Delete Custom DB table then you can use FM RS_DD_DELETE.
You can delete, if the table is not used anywhere in SAP.
Close thread if you got a answer
Kanagaraja L
Edited by: Kanagaraja Lokanathan on Mar 16, 2010 9:54 AM -
Different between drop,delete,truncate.
hi.
kindly what is the different between drop table,delete table,truncate table.
thanke you all .Hi
Drop is a ddl statement which removes the existence of the table along with the data.
Delete is a dml statement which removes only the data from the table.
Truncate is a ddl statement which removes only the data from the table.
1) You can specify condition in delete statement which would remove only the specific data from the table. You cannot specify condition in truncate statement so all the data would be remove.
2) Delete keeps the records in buffers/undo segment so that you can rollback. Whereas truncate does not so you cannot rollback, moreover implicit commit is done on issuing of truncate
3) Truncate also resets high water mark of the table whereas delete does not.
Regards -
Tables are deleted but database size does not change in sql server 2008r2
Hi All,
20GB Tables are deleted in my database but database size does not change and disk size showing same size.Hi ,
I have ran the Disk usage by Top Tables report and Identified couple of tables with unwanted data for last 5 years. I have deleted the data for the first 3 years and then ran the Disk usage by Top Tables report again. When I compared the report before
and after the data deletion, I have noticed certain facts which is not matching with what I know or learned from experts like you. The following are the points where I am looking for clarification:
1.Reserved (KB) has been reduced. I was expecting the data Reserved (KB) will remain the same after the data deletion.
2. The Data(KB) and Indexes(KB) fields have been reduced as expected. The Unused(KB) field have been increased as expected.
I was expecting the total of Data(KB) and Indexes(KB) field space gained will be equal to the Unused(KB) field gained after deleting the data. But that is not the case. When I deducted(subtracted) the difference in the Reserved(KB)(Difference before
and after data deletion) field from the Total of space gained from the data deletion is equal to the Unused(KB) gained field value.
I am not a SQL expert and not questioning but trying to understand whether we really gain space by deleting data from the tables. Also keen to get the concepts right, but my testing by deleting some records confused me.
Looking ahead to all your expert advice.
Thanks,
Vennayat -
Shrink Oracle Table after Deletion
A few database tables are very big. An Oracle table still holds the disk space occupied by deleted records according to http://stackoverflow.com/questions/6540546/oracle-10g-table-size-after-deletion-of-multiple-rows. Re: shrink table after delete teaches the following commands to release the idle space from the table.
ALTER TABLE TABLE1 DEALLOCATE UNUSED;
ALTER TABLE TABLE1 ENABLE ROW MOVEMENT;
ALTER TABLE TABLE1 SHRINK SPACE;
ALTER TABLE TABLE1 MOVE;
1. Are the commands feasible?
2. Are they safe?
3. What will be the impacts of running the commands?
4. Is there any other workable safe approach shrinking a table?Hi,
I advise using shrink table operation.
The tablespace which belong to your table must be in ASSM (Automatic segment space management) to use shrink.
Shrink is safe but you need to run two commands :
1)ALTER TABLE TABLE1 SHRINK SPACE COMPACT; (This is long operation which moves data, but can be done online)
2)ALTER TABLE TABLE1 SHRINK SPACE; (this is quick if you run SHRINK SPACE COMPACT before, it only shift the High Water Mark. Be carreful if you don't run SHRINK SPACE COMPACT before your table will be locked for a long time)
Another point, is that execution plans are calculed using the HWM so SHRINK the table (The 2nd command) will invalidate all the cursors in shared pool where the table is in. So execution plan need to be recalculated (often not a problem).
Regards, -
Table entries deleted in Customized table.
Respected Guru's
table entries in a customized table were deleted in production system, no transports pertaining it was found.
Table entries were updated using bapi.
Please help me to know how the table entries were deleted.
Daya.
Edited by: Dayananadan Anandan on Nov 12, 2009 11:35 AMHi Johnson,
you might have to restore the DB Backup for the table to gt back the data....
Furthermore, if you want to track how the entried were deleted then there are 2 ways to go about it:
If the Deletion of the records was through an application (FM,Program call) then there should be Chande Documents available for them and you can search them by hitting tables CDHDR and CDPOS...
If the Deletion of the records was done physically the you can try looking into the tables UASE16N_CD_KEY and UASE16N_CD_DATA (deletion from transaction UASE16N) or tables SE16N_CD_KEY and SE16N_CD_DATA(Deletion from SE16). This will give change pointer documents if the records were deleted using these transactions...
Another option might be that somebody has used the Database utility and selected the option Delete Data. In this case you can have a look at the object log....
Hope this helps....
Regards,
Sitakant. -
Pasting content into table cell deletes existing content. Why?
Pasting content into table cell deletes existing content. Why?
I'm not sure why you would expect something different. If you put something into a cell, then that is the contents of the cell. If you want to preserve the existing contents when pasting additional content, you don't want to paste into the cell, you want to paste into its contents.
Select the cell, then click again to put the insertion point into the contents, then Paste. -
Count total number of record of table with deletion from archiving object
Does anyone know is there any SAP standard program to count the total number of record of the table with deletion from Archiving Object and display in repprt?
Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
If you are looking just to get the count from a table/class, you can use a ReportQuery:
ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
rquery.addCount(); //equivalent to count(*);
session.executeQuery(rquery);
You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
Best Regards,
Chris -
Global Temporary Table not deleting Rows
why is my Global temp table not deleting the rows after commit see below,
CREATE GLOBAL TEMPORARY T_CHG
TBE VARCHAR2(7),
ABC VARCHAR2(8),
EFDA VARCHAR2(6),
ABD VARCHAR2(9),
A_ID VARCHAR2(128),
C_DATE,
ON COMMIT DELETE ROWS;Quite a few syntax issues with your create statement. It would have helped if you had posted a SQL*Plus session showing your results. Here is mine which works just fine:
sql>create global temporary table t_chg
2 (
3 tbe varchar2(7),
4 abc varchar2(8),
5 efda varchar2(6),
6 abd varchar2(9),
7 a_id varchar2(128),
8 c_date date
9 )
10 on commit delete rows;
Table created.
sql>insert into t_chg values ('1', '2', '3', '4', '5', sysdate);
1 row created.
sql>select count(*) from t_chg;
COUNT(*)
1
1 row selected.
sql>commit;
Commit complete.
sql>select count(*) from t_chg;
COUNT(*)
0
1 row selected. -
Hello, everybody!
I need your advice.
I made copy of one org.unit for example 50000100 with evaluation path O-O-S-P from my sender system.
After execution I saw my data in reciever system.
All data from PA-tables was deleted and inserted only transfered records.
But data in HRP-tables was not deleted.
Is it correct?Yes. This setting's is ok.
-
Hi All,
In which table shall i get the deleted item from Bill of material. I checked in STPO but in this table after deleting the item it will not appear.
Regards,
RBSHi RBS,
Please go through the Tables below Pertaining to BOM
STPO BOM Item Details
STPU BOM Sub Items (designators)
STKO BOM Header Details
MAST BOM Group to Material
STZU BOM History Records
STAS BOM Item Selection
STPF BOM Explosion Structure
PLMZ Allocation of bill of material items to operations
Regards
Varma -
Protect from Accidental Deletion -Users
How to apply Protect from accidental deletion for all the users and computers in the domain. Any easiest way to do this???
Hello,
Using Powershell it is easy.
For Users:
Import-Module activedirectory
Get-ADUser -Filter * | Set-ADObject -ProtectedFromAccidentalDeletion:$true
For Computers:
Import-Module activedirectory
Get-ADcomputer -Filter * | Set-ADObject -ProtectedFromAccidentalDeletion:$true
Do not forget to run Powershell in elevated if you faced errors.
Regards.
Mahdi Tehrani |
|
www.mahditehrani.ir
Please click on Propose As Answer or to mark this post as
and helpful for other people.
This posting is provided AS-IS with no warranties, and confers no rights.
How to query members of 'Local Administrators' group in all computers? -
DBM order - table to delete split
Dear Sap Expert
i would like to know what is the table to delete for split data in /DBM/Order. Currently im using ECC 5.0. The user had wrongly do split. The DBM cant delete through front end screen. I need to delete it from table. Need your suggest or advise What are the table involve and i should delete to remove the split data from the order.
Thanks very much
Regards
ZaliDear Zali,
You can check these tables:
AFSPOPR Split Operations in an Order Split
AFSPREL Relation Between Orders in an Order Split
T312B Profile for Transfer Order Split
MLAUFKEPH ML: Cost Component Split (Components) for Order History
MLBEKEPH ML: Cost Comp. Split (Elements) for Purchase Order History
Regards,
Naveen. -
HI,
What is the table for Deleted Purchase requisitions through MRP.
Thanks in Advance.Hi,
As per as MRP deleted PR are concren you will not get those PR because in MR PR are created when you explore the process order and once you run the MRP that process order get deleted and new process order comes into picture so you will not get those PRs
One thing like to add if you have explore the Process oder and once Prrocess orders are converted into PR those PR you can get in EBAN by selecting Creation indicator ad B and deletion indicator as X
Hope this will help
regards
Edited by: Roy Anamika on Jul 2, 2009 11:17 AM
Maybe you are looking for
-
Proble with adobe extension manager CC
OS win7 64 bit and photoshop CC2014. I installed AEM CC but after boot does not recognize php cc2014 and so I cant install any exstension. Please could someone help me?
-
HT4858 how do I enable icloud on my pc, I have downloaded the software
how do i enable icloud on my pc, i have downloaded the software, when i try to open icloud i am told the programme is not enabled, but it is not made clear how i can enable the programme
-
Valuation Class mapping to GL account
Hi - This is my first time using this forum. Which transaction is used to "view" the GL account that is assigned to a particular valuation class. I tried OBYC but the GL account is not displayed here.
-
hello i have following data in my internal table RUBBER1 1100 2007 BISO AA 9.000 0.000 RUBBER1 1100 2007 BISO AB 5.000 0.000 RUBBER1 1100 2007 EXTO AB 3.000 0.000 RUBBER1 110
-
New family pack .mac - how to republish iweb parts to new .mac accounts
Ok, that subject isn't very clear so I'll try here: Tonight I upgraded my .mac to a Family Pack. I have split my previous iWeb 'domain.sites2' into individual sites that I have renamed. One needs to go to my hubby's computer under his .mac account an