Special DELETE command
Hello everybody!
I don't know what does this DELETE instruction:
DELETE /*+ BYPASS_UJVC */FROM (SELECT a.ROWID
FROM TABLE1 a,
TABLE2 b,
TABLE3 c,
TABLE4 d
WHERE a.id_sipm = b.id_sipm
AND b.id_sitr_pefe = c.id_sitr_pefe
AND c.id_dece_400 = d.id_dece_400
AND d.cod_dece_tica = 'MI') e;
Delete rows ONLY from TABLE1?
Delete rows from all tables joined?
Wich is the use of this DELETE?
And the /*+ BYPASS_UJVC */ hint?
Thanks for advanced.
Hoek:
Interesting demonstration, but the OP needs to check a couple of things first before deciding which table will be deleted.
Same setup as yours (thanks for the scripts) but I added:
SQL> alter table table2 add constraint t2_pk primary key (col);
Table altered.
SQL> alter table table3 add constraint t3_pk primary key (col);
Table altered.
SQL> delete
2 from (select z.rowid
3 from table1 z, table2 a, table3 b
4 where a.col = z.col and
5 a.col = b.col);
5 rows deleted.
SQL> select * from table1;
no rows selected
SQL> select * from table2;
COL
1
2
3
4
5
SQL> select * from table3;
COL
1
2
3
4
5So, it deletes the non-key preserved table. I get the same result with and without the hint.
When I add a PK to table1, so now all three have PKs I get:
SQL> delete
2 from (select z.rowid
3 from table1 z, table2 a, table3 b
4 where a.col = z.col and
5 a.col = b.col);
5 rows deleted.
SQL> select * from table1;
no rows selected
SQL> select * from table2;
COL
1
2
3
4
5
SQL> select * from table3;
COL
1
2
3
4
5Again, the hint does not change the result. If I then drop the PK on table2, I get table2 deleted both with and without the hint.
So, it appears that if the query would succeed without the hint, it will delete the non-key preserved table if there is one and if not it will delete the first one mentioned with ot without the hint. If the query requires the hint to succeed, it will delete the last table mentioned, even if that is key preserved. I ran this up to 5 tables and the pattern seemed to hold. I also played around with the join orders and got the same results.
In an attempt to influence the behaviour, I attempted to use the selected rowid as a predicate to influence the table deleted. In the key preserved case table1 and table2 had PKs table3 did not. Without a predicate, table3 was deleted when I tried this delete, I was surprised to see the result.
SQL> delete
2 from ( select z.rowid rd
3 from table1 z, table2 a, table3 b
4 where z.col = a.col and
5 z.col = b.col)
6 where rowid = rd;
0 rows deleted.I got the same result trying with a.rowid but using b.rowid in the select deleted 5 rows in table3
After dropping the PKs on table1 and table2 and trying the same thing with the hint I got:
SQL> delete /*+ bypass_ujvc */
2 from ( select z.rowid rd
3 from table1 z, table2 a, table3 b
4 where z.col = a.col and
5 z.col = b.col)
6 where rowid = rd;
from table1 z, table2 a, table3 b
ERROR at line 3:
ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved tableattempting to select any of the rowid values.
John
Edited by: John Spencer on Oct 30, 2010 1:32 PM
That's what I get for testing additional things while in the middle of posting, Hoek beat me to the keyed version :-(
Similar Messages
-
one server using 11.2.0.1.0 under Suse Linux
configured catalog db, main db & jobs & ... almost everything with enterprise manager
keep backups 14 days
To make 14 full online dumps I had to aktive the archive mode and try to get rid of thoose unwanted additional files.
Additional I make every night (less til no db activity) a dump and compress it myself.
After some days the backupjob complain that it can not delete old files.
EM / manage all backups / crosscheck all(
CROSSCHECK BACKUPSET;
CROSSCHECK COPY;
sucessful
EM / manage all backups / delete old backups
DELETE NOPROMPT OBSOLETE;
failed.
script result
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Sep 7 17:20:55 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN>
connected to target database: <SID> (DBID=773091283)
RMAN>
connected to recovery catalog database
RMAN>
echo set on
RMAN> DELETE NOPROMPT OBSOLETE;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 14 days
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=196 device type=DISK
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
Control File Copy 3831 03-AUG-10 /opt/oracle/base/product/11gR1/db/dbs/snapcf_<SID>.f
Backup Set 18750 23-AUG-10
Backup Piece 18754 23-AUG-10 /srv/ora/data/flash_recovery_area/<SID>/backupset/2010_08_23/o1_mf_nnndf_BACKUP_<SID>CH0_673c0hbp_.bkp
Backup Set 18751 23-AUG-10
Backup Piece 18755 23-AUG-10 /srv/ora/data/flash_recovery_area/<SID>/backupset/2010_08_23/o1_mf_nnndf_BACKUP_<SID>CH0_673c0hbo_.bkp
Backup Set 19479 24-AUG-10
Backup Piece 19482 24-AUG-10 /tmp/o0lm3qh9_1_1
Backup Set 19490 24-AUG-10
Backup Set 20087 24-AUG-10
Backup Piece 20089 24-AUG-10 /srv/ora/data/flash_recovery_area/<SID>/autobackup/2010_08_24/o1_mf_s_727891232_677n40r3_.bkp
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 09/07/2010 17:20:57
ORA-19606: Cannot copy or restore to snapshot control file
exit;
Recovery Manager complete.
google found some questions, but not fittung answers.
So far:
- I checked the folder & users rights.
- I found some /tmp/ files - yes I "backup" the backuped archivelogs to-delete files in /tmp - I only active archivelogmode so I can onlinebackup
- I managed to login via rman and execute DELETE OBSOLETE manual - result above.
- Actual I delete the set one by one to find the problem set. (delete backupset 12345 ) from the list manually.
Some a good idea what went wrong?
additional: Is there a way to let oracle delete the empy archvielog-directories after deleting the logs within?
18:00- the command "RMAN> BACKUP CURRENT CONTROLFILE" also fails.
Edited by: 793286 on 07.09.2010 09:00Meanwhile I managed to delete all backupsets one by one.
The problem with $ORACLE_HOME/dbs/snapcf_<SID>.f persists.
cd $ORACLE_HOME/dbs
mv snapcf_<SID>.f snapcf_<SID>.f.bak
# replaced actual dbsidname with <SID>
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 14 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
Control File Copy 3831 03-AUG-10 /opt/oracle/base/product/11gR1/db/dbs/snapcf_TARMED1P.f
Do you really want to delete the above objects (enter YES or NO)? y
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 09/08/2010 09:44:07
ORA-19606: Cannot copy or restore to snapshot control file
mv snapcf_<SID>.f.bak snapcf_<SID>.fRMAN> backup current controlfile;
Starting backup at 08-SEP-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 08-SEP-10
channel ORA_DISK_1: finished piece 1 at 08-SEP-10
piece handle=/srv/ora/data/flash_recovery_area/TARMED1P/backupset/2010_09_08/o1_mf_ncnnf_TAG20100908T095000_68gj1b2m_.bkp tag=TAG20100908T095000 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-SEP-10
Starting Control File and SPFILE Autobackup at 08-SEP-10
piece handle=/srv/ora/data/flash_recovery_area/TARMED1P/autobackup/2010_09_08/o1_mf_s_729165003_68gj1d1b_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 08-SEP-10
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 14 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
Control File Copy 3831 03-AUG-10 /opt/oracle/base/product/11gR1/db/dbs/snapcf_<SID>.f
Do you really want to delete the above objects (enter YES or NO)? y
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 09/08/2010 09:52:37
ORA-19606: Cannot copy or restore to snapshot control file
No different effect, if I changed the filename via 2nd terminal to .bak or not.
RMAN> delete controlfilecopy 3831;
will fail, if the file exists or not.
Any chance to reset/kill that file?
Is there a need to restart the dbms after rename the file? -
Insert,update and delete commands
hi everybody,
how can i make a button that runs a specific insert update and delete commands
i am using adf faces jdeveloper 11.1.1.2.0
than you for allthank you guys for your interest what i need in my button click is to take some values from outputtext controls and execute an insert command according to these values what i have done is make a stored procedure and make a client interface function to my amImpl class and i have called getDBTransaction().executeCommand(command); it runs well when i didn't enter values in outputtext controls and it throws an exception when i put the values
the exception is javax.servlet.ServletException: Unable to resolve a Validator instance using either validatorId '' or binding '#{bindings.FileName.validator}'.
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.bea.content.manager.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:178)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.faces.convert.ConverterException: Unable to resolve a Validator instance using either validatorId '' or binding '#{bindings.FileName.validator}'.
at com.sun.faces.taglib.jsf_core.ValidatorTag$BindingValidator.validate(ValidatorTag.java:168)
at org.apache.myfaces.trinidad.component.UIXEditableValue.validateValue(UIXEditableValue.java:345)
at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:172)
at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:503)
at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$101(ContextSwitchingComponent.java:39)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$3.run(ContextSwitchingComponent.java:122)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processValidators(ContextSwitchingComponent.java:125)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$101(ContextSwitchingComponent.java:39)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$3.run(ContextSwitchingComponent.java:122)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processValidators(ContextSwitchingComponent.java:125)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
at org.apache.myfaces.trinidad.component.UIXForm.processValidators(UIXForm.java:82)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:700)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$ProcessValidationsCallback.invokeContextCallback(LifecycleImpl.java:1203)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:303)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
... 42 more
thank you for help -
Skip the DELETE command on logical standby
Hi All,
I want to skip the DELETE command on logical standby.
DB Version - 10.2
OS - Linux
Primary DB and logical standby DB .
In our DB schema some transaction tables. We delete data from those tables by delete commands.
Delete command, also delete data from logical standby DB. But we want to skip on logical standby DB .
I use following for that and get error.
ALTER DATABASE STOP LOGICAL STANDBY APPLY;
EXECUTE DBMS_LOGSTDBY.SKIP (stmt =>'DELETE TABLE', schema_name =>'TEST',object_name =>'TRANS',proc_name => null);
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
But I got error
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SKIP'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
When I change stmt =>'DELETE TABLE' to stmt =>'DML', no error happen
Please help me to solve this issue . This is urgent.
Thanks in advance.
RegardsDear aditi2,
Actually it is so simple to understand the problem. Please read the following documentation and try to understand the SKIP procedure.
http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
*SKIP Procedure*
Use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
By default, all SQL statements executed on a primary database are applied to a logical standby database.
If only a subset of activity on a primary database is of interest for application to the standby database,
you can use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
While skipping (ignoring) SQL statements is the primary goal of filters,
it is also possible to associate a stored procedure with a DDL filter so that runtime determinations can be made whether to skip the statement,
execute this statement, or execute a replacement statement.
Syntax
DBMS_LOGSTDBY.SKIP (
stmt IN VARCHAR2,
schema_name IN VARCHAR2,
object_name IN VARCHAR2,
proc_name IN VARCHAR2,
use_like IN BOOLEAN,
esc IN CHAR1);Hope That Helps.
Ogan
Edited by: Ogan Ozdogan on 30.Tem.2010 13:03 -
I am trying to add a delete command using DreamWeaver 8. I am
using SQL. I add my Delete Command, however, since updating to
Dreamweaver 8.02, I notice two additional columns in the properties
and I am unsure what gets entered.
I can see NAME which i enter IDParam, I see TYPE - unknown, I
see SIZE - unknown, and RUN-TIME VALUE, which I enter
Request.Form("MM_recordId"). I get an error when opening the
DeleteCommand dialog SQL type not recognized
Can someone tell me what I enter in the TYPE and Size
column?Sorry but wanted to correct u fundamentally
what r u trying to do ?
delete from table1 where table1.id = table2.id and table1.firstname = 'john'
how will u get table2.id when u r not selecting ithe table anywhere ?
Hope u got my hint ....
try this way
delete from table1
where table1.id =(select table2.id from table1,table2
where table1.id=table2.id and table1.firstname = 'john' )
cheers
SHUBH -
Delete Command in Internal table
Hi Friends,
Currently i am using DELETE command in internal table. My main requirement is delete the records in internal table based on the select -options given in Selection screen.
Synatx is given below.
DELETE i_list WHERElifsk NOT in S_lifsk[].
It is working fine if we give positive values ie EQ 24 etc.
if we give negetive values if NE 23(in select options) here
sy-subrc is failing.
Can any one kindly suggest.
Regards,
DVNS.Hi DV
Its so simple... u r requirement is to delete all the entries which are not in the select options.
Ur sintax is working correct. Because, even if u hit a database table with select querry using this select option, it will fetch all the positive entries and excludes all negative entries....
if still u feel problem is persisting... then fetch the lifsk from db table using this select option into an internal table and then filter how ever u want.
Venkata Raju Duggirala -
Problem with delete command through JDBC
hi all,
I have the following code in a Java program
try
DriverManager.registerDriver
(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:orcl", "airport", "airport");
catch (SQLException ex)
ex.printStackTrace();
Every statement works fine except the delete command. When i try to execute this statement:
stmt = conn.createStatement();
stmt.executeUpdate("DELETE FROM distances");
the program stalls. The table "distances" is owned by the user airport and this sql command works fine when I execute it in SQL+. The problem occurs when I try to execute a delete command through JDBC.
Can anyone help me?
Thanks...It seems that the problem ocuurs only when there are pending transactions.Correct. There are uncommitted INSERT/UPDATE/DELETEs on the table. Readers never block writers, thus having opened SELECT cursors on the table is not a problem. You writer process must be blocked by another writer process. (assuming of course no JDBC thin driver error - of which I've heard rumours there are or were quite a few - not using thin JDBC myself, thus cannot comment on whether these rumours are valid or not)
What I would think a bit concerning is that one application trashing a table (deleting all the data) while other applications/users are busy changing data in that table. Why are they changing data that will be immediately trashed after they have committed their transactions? Surely they are wasting time and resources all around (user-side and server-side) by doing work that will be immediately invalidated? This kind of points to me to a database or application design problem. -
How to filter the "delete" command in oracle streams ?
How to filter the "delete" command in oracle streams ? (oracle 9i R2 )
Message was edited by:
user507013Hello
write a procedure doing "nothing" for delete transcation :
connect adminstrm/..
CREATE OR REPACE PROCEDURE write_delete_lcr (
message IN SYS.ANYDATA,
error_stack_depth IN NUMBER,
error_numbers IN DBMS_UTILITY.NUMBER_ARRAY,
error_messages IN EMSG_ARRAY )
AS
s_id sys.anydata ;
ad SYS.ANYDATA;
lcr SYS.LCR$_ROW_RECORD;
ret PLS_INTEGER;
vc VARCHAR2(30);
apply_name VARCHAR2(30) ;
errlog_rec log_errors%ROWTYPE ;
ov2 SYS.LCR$_ROW_LIST;
BEGIN
return;
End;
for your apply do :
BEGIN
DBMS_APPLY_ADM.SET_DML_HANDLER(
object_name => TABLE_NAME,
object_type => 'TABLE',
operation_name => 'DELETE',
error_handler => true,
user_procedure => 'write_delete_lcr',
apply_database_link => NULL);
END;
Hafedh KADDACHI
Oracle DBA -
Performance slow on DELETE command on global temporary table!
Hi,
I have a delete on a global temporary table that is taking long time!.
Anyone have a clue about how to improve delete command's against global temporary table??
Tks,
Paulo PortugalSame problem here!
<QUOTE>
SELECT DISTINCT PDT_CHILD.SUP_ID, PDT_CHILD.SUB_ID,
PDT_CHILD.SUB_LEAF_FLAG_ID
FROM
PJI_FP_AGGR_RBS_T PDT_CHILD WHERE 1=1 AND PDT_CHILD.SUP_ID = :B2 AND
PDT_CHILD.SUP_ID <> PDT_CHILD.SUB_ID AND PDT_CHILD.WORKER_ID = :B1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 88561 20.71 20.23 0 0 0 0
Fetch 90269 926.19 906.80 45 45164134 0 176545
total 178831 946.91 927.03 45 45164134 0 176545
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 173 (APPS) (recursive depth: 1)
Rows Execution Plan
0 SELECT STATEMENT MODE: ALL_ROWS
0 HASH (UNIQUE)
0 TABLE ACCESS (FULL) OF 'PJI_FP_AGGR_RBS_T' (TABLE (TEMP))
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
latch: row cache objects 1 0.00 0.00
direct path write temp 3 0.00 0.00
direct path read temp 3 0.00 0.00
</QUOTE>
The fetch is too high for TEMP table... Any help would be much appreciated!
Note: Please teach me on how we can format the above in my future posts in OTN forums.
=== -
Delete Command button doesn't take more than one parameter while update command does
Hi,
Does anybody have an idea WHY sharepoint does not send the parameter information to a delete command while the exact same parameter is being sent to the Update command?, the data is being pulled from an asp:TextBox bound to the 'comments' field in
the data source which happens to be the field I need to update, the code works for Update commands but not for Delete commands. Unfortunately I have to use sharepoint designer because SP is restricted at work, so I can't write code behind the scenes. I would
appreciate any help, here's my code
<%@ Page Language="C#" masterpagefile="../_catalogs/masterpage/v4.master" title="Test" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="cc2" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebUI" namespace="Microsoft.Office.InfoPath.Server.Controls.WebUI" assembly="Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderMain">
<asp:SqlDataSource runat="server" ProviderName="System.Data.SqlClient" UpdateCommand="sp_updateStartedApprovals" ID="SqlDataSource2" ConnectionString="Data Source=MCARLOSJ2;User ID=sa;Password=****;Initial Catalog=MyDB;" SelectCommand="SELECT * FROM mainView " __designer:customcommand="true" UpdateCommandType="StoredProcedure" DeleteCommand="sp_rejectApprovals" DeleteCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="comments" Type="String"/>
<asp:parameter Name="id" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="comments" Type="String"/>
<asp:parameter Name="id" Type="Int32"/>
</DeleteParameters>
</asp:SqlDataSource>
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" DataKeyNames="id" GridLines="None" ForeColor="#333333" CellPadding="4">
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>
<asp:boundfield DataField="description" HeaderText="Status" ReadOnly="True" SortExpression="description">
</asp:boundfield>
<asp:boundfield DataField="Employee Last Name" HeaderText="Employee Last Name" ReadOnly="True" SortExpression="Employee Last Name">
</asp:boundfield>
<asp:boundfield DataField="Employee First Name" HeaderText="Employee First Name" ReadOnly="True" SortExpression="Employee First Name">
</asp:boundfield>
<asp:boundfield DataField="Pending approval" HeaderText="Pending approval" ReadOnly="True" SortExpression="Pending approval">
</asp:boundfield>
<asp:boundfield DataField="Atnmt %" HeaderText="Atnmt %" ReadOnly="True" SortExpression="Atnmt %">
</asp:boundfield>
<asp:boundfield DataField="Country" HeaderText="Country" ReadOnly="True" SortExpression="Country">
</asp:boundfield>
<asp:boundfield DataField="comments" HeaderText="comments" ReadOnly="True" SortExpression="Comments">
</asp:boundfield>
<asp:boundfield DataField="processStartedDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date Opened" ReadOnly="True" SortExpression="processStartedDate">
</asp:boundfield>
<asp:boundfield DataField="Due Date" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Due Date" ReadOnly="True" SortExpression="Due Date">
</asp:boundfield>
<asp:templatefield>
<ItemTemplate>
<asp:TextBox runat="server" id="comments" Text='<%# Bind("comments") %>'/>
<asp:LinkButton runat="server" Text="Approve" id="Button1" CommandName="Update" CausesValidation="False" />
<asp:LinkButton runat="server" Text="Reject" id="Button2" CommandName="Delete" CausesValidation="false"/>
</ItemTemplate>
</asp:templatefield>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle HorizontalAlign="Center" BackColor="#284775" ForeColor="White" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</asp:Content>Hi,
you have multiple options here:
1) upload as a script:
a) save the statements in a file
b) go to sql workshop > sql scripts
c) upload script and run the script
2) run the script line by line in the sql commands window directly:
a) go to sql workshop > sql commands
b) copy all statements there
c) highlight the first statement with the mouse
d) click "run" or press <ctrl>+enter
3) use sql developer
a) go to http://www.oracle.com/technology/products/database/sql_developer/index.html
b) download and install
c) connect to XE
d) run the statements there
Regards,
~Dietmar. -
RMAN-03002: failure of delete command
DB:10.2.0.3.0
OS:AIX 64 bits
Hi All,
We have configured backup default device on Disk.
On using the command within run block:
delete noprompt obsolete;
We get the error:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 02/06/2009 11:07:04
RMAN-06091: no channel allocated for maintenance (of an appropriate type)
RMAN>
Recovery Manager complete.
Return Code: 1
Now when we use the commmand :RMAN> delete noprompt obsolete device type disk;
We do not get the above error.
Question: Is it necessary to issue the command - "device type disk"; as above with "delete noprompt obsolete " though default backup device type is configured to DISK.Won't RMAN itself identify the default device type - Disk.
Thanks for your time!
Regards,RMAN> show all;
starting full resync of recovery catalog
full resync complete
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/production_dump/database/EW01/Backup%d_DB_%u_%s_%p_%T';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/apps/ew01/oracle/10.2.0/dbs/snapcf_ew01.f'; # default
RMAN>
RMAN> -
Hi. My keyboard only appears to have a backspace button to delete. I'm doing a lot of editing now and wish to delete with the cursor in front of the text too. I've found where I can create commands on the keyboard, but I'd like to know how to create a forward deleting command.
Feel EcstasyThank you so much, Stedman. It's a great help. I have a button on my keyboard with a carrot top symbol and a bar over it. It doubles the return key function, so I'd like to make it a forward delete key instead. I've gone into keyboard shortcuts and found where to create them, but so far, I haven't re-baptized this key.
-
UCS manager blade memory "Delete" command
I have a question, and I cannot seem to find an answer in documentation or other questions on the support community. In UCS Manager, if you click a blade server, click the inventory tab, click the memory subtab, you see a graphical display of the memory modules. If you click on a moduleto select it then right-click it, the menu available includes a "Delete" command. Does this shut down that particular module, or does it just keep UCS Manager from monitoring it? Or is it something else more damaging or permanent? Is it possible to "Add" the module back once that command was issued? If possible, please provide any documentation or links that would answer this definitively. Thanks!
GilThanks for the information! I work with a group that is performing some failure testing, and we were trying to figure a way to fail a memory module while the blade is running. We were not sure of the purpose of the mentioned command in UCS manager and did not want to try it without knowing if it had serious consequences.
-
Understanding the dataadapter.delete command
I'm new to ADO and ODP so forgive me if I'm missing the obvious. I want to do a simple delete from the database. The problem is I feel like I have to issue the delete command twice. The code I've posted blow works but I don't understand why. I create two commands one a select command the second a delete command. I apply these commands to a dataadapter and then use dataadapter .fill() to get a dataset.
Great it works fine up to this point. The problem was when I called dataadapter.update nothing would happen. The delete command was ignored. So I looped through the resulting dataset and deleted the record from there. Then I called dataadapter.update and it worked. I tried not setting the dataadapter.deletecommand but then update failed.
Now my question is: Is it always necessary to delete from a dataset as well as issue a delete command or is there a way of issuing just one delete command? Is it possible to simplify my code?
Any suggestions or help greatly appreciated.
Drew
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim oradb As String = "Data Source=vulcan.world;User Id=adowling;Password=aragon;"
Dim conn As New OracleConnection(oradb)
Dim cmd As New OracleCommand
Dim cmd2 As New OracleCommand
Dim orada As New OracleDataAdapter
Dim dsLog As New DataSet
Dim drDelete As DataRow
Dim myCol As DataColumn
Dim dcPK(1) As DataColumn
Dim i As Integer
Dim rc As DataRowCollection
Dim pSDEWorkspace As IWorkspaceFactory2
Try
conn.Open()
cmd.Connection = conn
cmd.CommandText = "select * from t.reconcile_log"
cmd.CommandType = CommandType.Text
orada.SelectCommand = cmd
cmd2.Connection = conn
cmd2.CommandText = "delete from t.reconcile_log where objectid = " + TextBox1.Text
cmd2.CommandType = CommandType.Text
orada.DeleteCommand = cmd2
orada.Fill(dsLog, "Reconcile_Log")
orada.MissingSchemaAction = MissingSchemaAction.AddWithKey
myCol = dsLog.Tables("Reconcile_Log").Columns.Item(dsLog.Tables("Reconcile_Log").Columns.IndexOf("OBJECTID"))
dcPK(0) = myCol
dsLog.Tables("Reconcile_Log").PrimaryKey = dcPK
drDelete = dsLog.Tables("Reconcile_Log").Rows.Find(TextBox1.Text)
drDelete.Delete()
orada.Update(dsLog, "Reconcile_Log")
ListBox1.Items.Clear()
rc = dsLog.Tables("Reconcile_Log").Rows
For i = 0 To rc.Count - 1
ListBox1.Items.Add(Convert.ToString(rc.Item(i).Item(0)) + " " + rc.Item(i).Item(1) + " submitted " + rc.Item(i).Item(2) + " on " + rc.Item(i).Item("submitted"))
Next i
Catch ex As OracleException
Select Case ex.Number
Case 1
MessageBox.Show("Error attempting to insert duplicate data.")
Case 12545
MessageBox.Show("The database is unavailable.")
Case 904
MessageBox.Show("invalid type")
Case Else
MessageBox.Show("Database error: " + ex.Message.ToString())
End Select
Catch ex As Exception
MessageBox.Show(ex.ToString)
Finally
conn.Close()
conn.Dispose()
End Try
End SubBecause the dataset is disconnected from the database. This allows you to load some data (into your dataset), disconnect from the network or whatever, make whatever changes you like and have none of this affect the data in the database until you issue the update.
If you actually want to have your changes applied immediately then you can (assuming your application is constantly connected of course). Don't bother with a dataset/data adaptor at all. For example set up the sql select statement, assign it to a reader, execute the reader, store the rows returned in some custom objects or whatever. Make some changes and then use executeNonQuery to apply the updates, either one at a time or as a batch using array binding. There is a samples folder where you installed ODP.NET, have a look at some of the others. -
Handle same delete command from 2 different sessions!
Dear All,
My database is 11gR2. I am in a situation where 2 applications are using the same database. There are times when the same delete command is issued from both applications that hangs the DB. None of the query is successfully executed.
I want to lock the rows so that the first query executes and while second waits and when first completes second query is executed, though it wont delete any records as records are delete from the first query. But there is no hanging situation. Should I lock the table before running the query? or i first select the records using for update?
Kindly help on this.
Regards,
ImranThanks, The details are:
Actually my applications are the 2 radius servers that are again getting requests from BRAS server. BRAS issues a delete command to radius server 1, if radius server is busy and takes longer then 3 seconds to respond BRAS issues the same command to radius server 2. When the same command from 2 different servers executes on the DB there is kind of dead lock, when this situation happens I have to terminate session of any one radius server and then the other query gets executed.
I understand that Oracle takes care of this automatically but in my situation my DB is under tremendous load and sometimes I have to terminate sessions.
Its a simple delete command with some selection. I hope this helps a bit.
Regards, Imran
Maybe you are looking for
-
How to change the column position for address in BP
Hi, My user want to move up the column of "Attention To" just after "Address Name", I tried in UI(Matrix) but seems UI (2007) doesn't support that kind of operation in Matrix. I am wondering if we can do something inside SAP. Apparently the address i
-
How much better is Logic Pro?
Would it be a real disadvantage to get logic express over Logic, i mean has it still got all the loops, synths, drum machines and actual audio recording capabilities? Thanks
-
Proper use of rp_provide_from_last
Hello Experts, I've used the macro rp_provide_from_last p0000 space pn-begda pn-endda pn-begda = 05.07.2010 pn-endda = 05.07.2010 I can't retrieve the last record with p0000-begda = 07.07.2010 p0000-endda = 31.12.9999 Instead I keep retrieving the se
-
How do I change what folders open when I log in?
Every time I log into our Mac Mini the MacOS folder pops up. How do I stop this?
-
Hello there and hi fellow MAC users, in particular! I'm saying this because I'm dealing with an issue that seems to be exclusive to Apple's Safari browser. I'm currently working on a site that makes quite some use of CSS. Unfortunately, the "bodytext