Database delete by example?
Based on my cursory testing, the default delete operation for database adapter seems to use only the table key to identify the record to delete. Is there a delete counterpart of query by example so that I can specify field value other then just the key to match for deletion? I can use custom SQL with parameters for such delete. Or I can do a standard query first and feed the IDs to a standard delete. But I would like to know if anyone have other brilliant ideas. TIA
790072 wrote:
Hi Guru's
Just thought of asking for a experts tips on database delete.
we have few database's running on oracle 11g and we just want to get rid of these databases.
what could be the best procedure to delete the database.
Thanks in advance .
Hi,
To delete database you can use DBCA.
When DBCA deletes a database, it shuts down the database instance and then deletes all database files. On the Windows platform, it also deletes associated Windows services.
Cheers
Similar Messages
-
RMAN in 10g database deletes archivelog files before standby receives them
Hi all,
We currently have problem with our Oracle 10gR1 database on Windows 2000 server in that the RMAN backups on the primary database delete archivelogs before the standby database can receive current and new archivelogs from primary database. What happens is that RMAN backs up the archivelogs and deletes them from disk before the archivelogs are sent to the standby. The standby then looks for these archivelogs on the primary but is unable to locate them. Whenever this happens, the production database (primary) hangs and we have to restart the instance on the primary. We have our Data Guard setup in maximum performance mode so this should not happen.
As a short term fix, we have changed the backups to have RMAN backup and delete the archive logs 15 minutes older than current time so that the standby can receive the logs and not have problems. Besides this fix is there a long term solution to the problem or is it a bug in Oracle 10g? The issue came up after we upgraded from 9i to 10g and never saw it before in 9i with RMAN and Data Guard physical standby databases.
Thanks
Ben Prusinski, Oracle DBAthanks for answer...
did you managed to make it 'work'?
according to doc. if set on standby it should:
<>
Then, these files are eligible for deletion:
Archived redo log files in the flash recovery area that
were applied on the standby database.
<>
and this is to my understanding irespective to retention policy...unfortunately report obsolete does not report applied archived logs as eligable for deletion.
How this works in your case?
regards.
goran -
TimesTen Release 11.2.1.9.6 (64 bit Linux/x86_64)
Command> dssize;
PERM_ALLOCATED_SIZE: 51200000
PERM_IN_USE_SIZE: 45996153
PERM_IN_USE_HIGH_WATER: 50033464
TEMP_ALLOCATED_SIZE: 2457600
TEMP_IN_USE_SIZE: 19680
TEMP_IN_USE_HIGH_WATER: 26760
Is there any command/query/etc, which would allow to understand what database objects (for example tables) are consuming memory and how much of it?
tried to use ttsize function, but it gives some senseless results – for example, for the biggest table, tokens, it produces following output (that this table is 90GB in size – what physically cannot be true):
Command> call ttsize('tokens',null,null);
< 90885669274.0000 >
1 row found.Are you able to use the command line version of ttSize instead? This splits out how much space is being used by indexes (in the Temp section of the TT memory segment), which I think is being combined into one, whole figure in the procedure version of ttSize you're using. For example:
ttSize -tbl ia my_ttdb
Rows = 4
Total in-line row bytes = 17524
Total = 17524
Command> create index i1 on ia(a);
ttSize -tbl ia my_ttdb;
Rows = 4
Total in-line row bytes = 17524
Indexes:
Range index JSPALMER.I1 adds 5618 bytes
Total index bytes = 5618
Total = 23142
Command> call ttsize ('ia',,);
< 23142.0000000000 >
1 row found.
In 11.2.2 we added the procedure ttComputeTabSizes which populates system tables with detailed table size data, and was designed to be an alternative to ttSize. Unfortunately it still doesn't calculate index usage though, and it isn't in 11.2.1. -
Litigation Hold, Single Item Recovery, & Mailbox Database Deleted Items Retention
Hello
I'm looking for a simple explanation of how the three features mentioned in the subject line interact and affect one another.
Specifically, I'm after the answer to the following question:
If a users mailbox has litigation hold enabled, and the mailbox database it lives on has a deleted items retention value of 365 days, does that users "Recoverable Items" get deleted after 365 days, or does litigation hold, as I supspect bypass the retention
value?
If Single Item Recovery is enabled for said user as well, and added to the scenario above - how does this affect the retention of the deleted items?
I cannot find a definitive article that describes mailbox database deleted items retention, litigation hold and single item recovery and their behaviours when used together.
Regards
Matt
MattHello again,
Just wanted to open this thread up again, and gain some further clarification, specifically on the behaviour of items in "Recoverable Items\ Deletions" folder.
In the following scenario how will items be processed:
-SingleItemRecoveryEnabled -True
-LitigationHoldEnabled - True
-UseDatabaseRetentionDefaults -True
-Items in the Deletions folder have passed the retention value date as specified on the database.
Given the parameters above, when the I run the Managed Folder Assistant against a mailbox, I'm expecting to see the items in the Deletions folder move, and be placed in Purges folder.
This is not happening however, items are only removed from the Deletions folder when LitigationHold is disabled. Then, items bypass the Purges folder altogether and are removed from the mailbox/database altogether.
I referred to the article below for clarification:
http://blogs.technet.com/b/exchange/archive/2009/09/25/3408389.aspx#_Short-Term_Preservation_of
"...the message was not purged from the mailbox store. Instead the message was moved from the Recoverable
Items\Deletions folder to the Recoverable Items\Purges folder. All store hard-deleted items end up in this folder when single item recovery is enabled. The Recoverable Items\Purges folder is not visible to the end user, meaning that they do not see data retained
in this folder in the Recover Deleted Items tool.
When the message deletion timestamp has exceeded the deleted item retention window, Records Management will purge the item."
Can anyone assist in explaining the behaviour I'm observing?
I'm in a transition period where by our organisation has been journalling all
email to an Online service since 2008 and this service will continue to be used solely as our archiving and compliance mechanism.
Since Exchange 2010 was adopted by the company around 18 months ago, the previous mail administrator had litigation hold enabled on all mailboxes
from the outset, so I'm in the position now where by I have two retention methods running side by side.
Long story short, the online archiving will be used moving forward and litigation hold will be disabled within Exchange.
What I want to do is transition from long term data
preservation inside Exchange, to short term preservation - hence the reason for now enabling SIR.
Currently I have mailboxes with 10's of GB's of mail sat in the "Recoverable Items\Deletions" folder, and very little, if anything in some
cases, in the respective "Purges" folder.....
Can anyone advise on a "correct" procedure for making this transition?
Regards
Matt
Matt -
Logical Database of SAP Example Program
Hi all,
I need an example ABAP program using standard Logical Database ( LDB ) .
Help me.
Regards,
Peachi.Hi,
Some links to refer..
/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
A sample prog with LDB PNP
*& Report ZH_REPT_PAYMENT *
report zh_rept_payment line-size 80 no standard page
heading.
tables: pernr, " Standard Selections for HR Master Data Reporting
pcl1, " HR Cluster 1
pcl2, " HR Cluster 2
pa0009,
PA9001,
PA9006,
pa0002,
pc260 , " Cluster Directory for Payroll Results
bnka .
Infotypes
infotypes: 0001. " Organizational Assignment
Declaration of Internal Tables
data : bnka1 like bnka occurs 0 with header line .
data: begin of t_int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
end of t_int_rep.
data: begin of int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
begda like pa0009-begda, "Begin date
end of int_rep.
Declaration of Data Variables
data: ws_betrg like pc209-betrg, " BT Amount
w_val like spell occurs 0 with header line,
int_rep1(6), " TYPE I, " Employee Number
cnt type i value 0, " Counter
calcmolga like t500l-molga value '40', " Country Grouping
v_id(15),
calc_currency like t001-waers value 'INR'. " Currency
data : ctr type i,
dt_merge like pa0009-begda.
data: ws_totemp(6) type c,
ws_totamt(20) type c,
r_mth(9) type c,
ws_fpbeg(6) type c,
ws_fpend(6) type c,
ws_mthyr(6) type c,
ws_mthyr_r(14) type c,
r_mth_t(3) type c,
ws_amt(8) type c,
ws_bankl(14) type c,
ws_date(6) type c,
amount_word(500),
total_page type i,
pages type i,
remain type i.
data begin of i_spell.
include structure spell .
data end of i_spell .
data : c_molga type t500l-molga value '40',
c_banks type bnka-banks value 'IN'.
Standard Includes
include rpc2cd09. "Cluster CD data definition
include pc2rxin0.
include rpc2rx09.
include rpppxd00. " Data Definition buffer PCL1/PCL2
include rpppxd10. " Common Part buffer PCL1/PCL2
include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
Selection Screen
selection-screen begin of block b1 with frame title text-001.
parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
pa_year(4) type c default sy-datum(4) obligatory,
p_bankl like pc209-bankl, " Bank Number
p_zlsch like pc209-zlsch. " Payment method
selection-screen end of block b1.
save_calc_currency = calc_currency.
count_top = 0.
get_pernr_flag = 0.
Top-Of-Page
top-of-page.
perform convert_month using pa_mth(2) r_mth.
ws_mthyr_r = r_mth.
concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
SKIP 5.
skip 1.
skip 4.
if int_rep-bankl eq ' '.
if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
int_rep-zlsch eq ' '.
write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
elseif int_rep-zlsch eq 'L'.
write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
endif.
else.
write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
endif.
skip.
write: /34 ws_mthyr_r,
62 'Page :'(008),69(2) sy-pagno intensified off,
' Of ',78(2) pages intensified off.
clear pages.
read table bnka1 with key bankl = int_rep-bankl .
if sy-subrc = 0.
if int_rep-zlsch eq 'T'.
write:/03(10) 'Bank Name : ', bnka1-banka.
write:/03(10) 'Branch : ', bnka1-brnch.
write:/03(10) 'Address : ', bnka1-stras.
endif.
endif.
skip.
write:/1(80) sy-uline.
write: /1 sy-vline, 2(5) 'Sl.No'(002),
7 sy-vline, 8(8) 'Emp.No.'(003),
16 sy-vline,17(35) 'Employee Name'(004).
*--added for Demand Draft
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline, 48(15) 'Payable at'(005).
else.
write : 47 sy-vline,48(15) 'Account No.'(005).
endif.
write: 63 sy-vline,64(16) 'Amount'(006),
80 sy-vline.
write:/1(80) sy-uline.
end-of-page.
write:/1(80) sy-uline.
write:/2 'Printed on ', sy-datum.
Start-of-selection.
start-of-selection.
*perform h_headr.
ctr = 0.
set margin 5.
call function 'RP_GET_CURRENCY'
exporting
molga = calcmolga
importing
waers = calc_currency
exceptions
others.
if sy-subrc ne 0.
calc_currency = 'DEM'.
calc_currency = save_calc_currency.
endif.
get pernr.
cd-key-pernr = pernr-pernr.
perform import_cluster.
get_pernr_flag = 1.
check : ocd-version-molga eq calcmolga.
The table 'tabpernr' is filled with the personnel numbers
and is used after selection is finished.
move-corresponding pernr to tabpernr.
append tabpernr.
The table 'tab_rgdir' is filled
loop at rgdir.
rx-key-pernr = pernr-pernr.
unpack rgdir-seqnr to rx-key-seqno.
perform int_tab. "fill tab_rgdir
perform import_bt.
perform validate.
endloop.
End of Selection
end-of-selection.
*perform h_headr.
perform convert_date_a using pa_mth r_mth_t.
sort int_rep by bankl zlsch pernr betrg descending.
delete adjacent duplicates from int_rep
comparing bankl zlsch pernr .
sort int_rep by bankl zlsch bankn . "PERNR.
loop at int_rep.
at new bankl.
select single * into bnka1 from bnka
where banks = c_banks and
bankl = int_rep-bankl .
append bnka1.
clear bnka1.
endat.
endloop.
for Demand Draft - purpose added
loop at int_rep.
concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
select single * "zweck into int_rep-zweck
from pa0009 where
pernr = int_rep-pernr and
bankl = int_rep-bankl and
zlsch = int_rep-zlsch
and begda <= dt_merge and
endda >= dt_merge .
if sy-subrc = 0.
int_rep-zweck = pa0009-zweck.
modify int_rep.
endif.
endloop.
*-for DD and Chq sorted by PAyable at and EMPNO wise
if p_zlsch = 'T' .
sort int_rep by bankl zlsch bankn . "PERNR.
else. "added for "payable at" for DD/Chq
else.
sort int_rep by zweck pernr . "PERNR.
endif.
*delete adjacent duplicates from int_rep.
t_int_rep] = int_rep[.
loop at int_rep.
*-for page of page no.
total_page = 0.
loop at t_int_rep where bankl = int_rep-bankl
and zlsch = int_rep-zlsch.
total_page = total_page + 1.
endloop.
pages = total_page div 25.
remain = total_page mod 25.
comment bcoz its adding one extra page no.
done as on 29/11/2004
if remain > 0.
pages = pages + 1.
endif.
**-end
at new bankl.
ctr = 0 .
new-page.
endat.
at new zlsch.
ctr = 0 .
new-page.
endat.
clear v_id.
select single natio
into pa0002-natio
from pa0002
where pernr eq int_rep-pernr.
*-testing......for soma
if ctr > 24.
ctr = 0 .
write:/1(80) sy-uline.
new-page .
endif.
ctr = ctr + 1 .
cnt = cnt + 1.
pack int_rep-pernr to int_rep1.
write:/1 sy-vline, 2(3) cnt intensified off,
7 sy-vline, 9(6) int_rep1 intensified off,
16 sy-vline,17(35) int_rep-ename intensified off .
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline,48(15) int_rep-zweck intensified off.
else.
write:
47 sy-vline,48(15) int_rep-bankn intensified off .
endif.
write: 63 sy-vline,64(16) int_rep-betrg
intensified off currency 'INR',
80 sy-vline.
ws_betrg = ws_betrg + int_rep-betrg.
*-testing......for soma
skip.
write :
/1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
sy-vline .
*-end testing......for soma
at end of zlsch.
if int_rep-bankl = ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed On ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
endif.
endat.
at end of bankl.
if int_rep-bankl ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed on ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
NEW-PAGE.
endif.
endat.
endloop.
End of Page
end-of-page.
write: /2 'Prepared by :'(010), '_______________',
45 'Checked by :'(011),'_______________'.
*& Form IMPORT_CLUSTER
Importing Data from Cluster *
form import_cluster.
sy-subrc = 0.
rp-imp-c2-cd.
if sy-subrc eq 0.
if cd-version-number ne ocd-version-number.
endif.
endif. " SY-SUBRC EQ 0
endform. " IMPORT_CLUSTER
*& Form INT_TAB
Filling internal table tab_rgdir
form int_tab.
*Fill internal table tab_rgdir.
move-corresponding rgdir to tab_rgdir.
tab_rgdir-pernr = pernr-pernr.
append tab_rgdir.
endform. " INT_TAB
*& Form IMPORT_bt
Import Values from Bank Transactions Table (BT)
form import_bt.
rp-init-buffer.
RP-IMP-C2-RX.
rp-imp-c2-in.
if rp-imp-in-subrc eq 0.
if in-version-number ne oin-version-number.
write: / 'Schlüssel des Clusters RX:'(015),
rx-key-pernr, rx-key-seqno.
write: / 'The imported version of the cluster'(016), 'RX',
'is not current'(017).
write: / 'Imported version :'(018),
oin-version-number.
write: / 'Current version of cluster :'(019),
in-version-number.
stop.
else.
sy-subrc = 0.
endif.
else.
sy-subrc = 8.
write: /
'Inconsistencies between cluster directory and directory for'(020).
write: /
'No payroll results found for data in cluster directory'(021).
write : /
'Please contact hotline to solve the current problem'(022).
endif.
ws_fpbeg(2) = versc-fpbeg+4(2).
ws_fpbeg+2(4) = versc-fpbeg(4).
ws_fpend(2) = versc-fpend+4(2).
ws_fpend+2(4) = versc-fpend(4).
ws_mthyr(2) = pa_mth.
ws_mthyr+2(4) = pa_year.
check ws_mthyr = ws_fpbeg.
check ws_mthyr = ws_fpend.
loop at bt. "from pc209
int_rep-pernr = pernr-pernr.
int_rep-ename = pernr-ename.
int_rep-bankl = bt-bankl.
int_rep-bankn = bt-bankn.
int_rep-betrg = bt-betrg.
int_rep-zlsch = bt-zlsch.
append int_rep.
endloop.
IF P_BANKL ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE ZLSCH P_ZLSCH.
ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ENDIF.
endform. " IMPORT_BT
*& Form CONVERT_MONTH
Fetching Month Text
form convert_month using mth t_mth.
case mth.
when '01'.
t_mth = 'January'(023).
when '02'.
t_mth = 'February'(024).
when '03'.
t_mth = 'March'(025).
when '04'.
t_mth = 'April'(026).
when '05'.
t_mth = 'May'(027).
when '06'.
t_mth = 'June'(028).
when '07'.
t_mth = 'July'(029).
when '08'.
t_mth = 'August'(030).
when '09'.
t_mth = 'September'(031).
when '10'.
t_mth = 'October'(032).
when '11'.
t_mth = 'November'(033).
when '12'.
t_mth = 'December'(034).
endcase.
endform. " CONVERT_MONTH
*& Form CONVERT_DATE_A
Fetching Month Text *
form convert_date_a using mth_t t_mth_t.
case mth_t.
when '01'.
t_mth_t = 'Jan.'(035).
when '02'.
t_mth_t = 'Feb.'(036).
when '03'.
t_mth_t = 'Mar.'(037).
when '04'.
t_mth_t = 'Apr.'(038).
when '05'.
t_mth_t = 'May.'(039).
when '06'.
t_mth_t = 'Jun.'(040).
when '07'.
t_mth_t = 'Jul.'(041).
when '08'.
t_mth_t = 'Aug.'(042).
when '09'.
t_mth_t = 'Sep.'(043).
when '10'.
t_mth_t = 'Oct.'(044).
when '11'.
t_mth_t = 'Nov.'(045).
when '12'.
t_mth_t = 'Dec.'(046).
endcase.
endform. " CONVERT_DATE_A
*& Form VALIDATE
text
--> p1 text
<-- p2 text
form validate .
if p_bankl <> ' ' and p_zlsch ' '.
delete int_rep where bankl p_bankl.
elseif p_bankl = ' ' and p_zlsch ' '.
delete int_rep where zlsch p_zlsch.
elseif p_bankl ' ' and p_zlsch = ' '.
delete int_rep where bankl p_bankl.
endif.
endform. " VALIDATE
check this weblog.....
/people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
Also , check the following link too.
http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
Regards,
Satish -
DFM database delete for one device
Hello,
I want to delete DFM database for one of devices in LMS 4.2. Or just delete and add that device in DFM (if possible in lms 4.2, in 3.2 it was posssible).
Regards,
MladenAs DFM depends of SNMP output from the device to show all this info, before we claim it corrupt, lets check directly for the interface details.
For this show the CLI output of the device:
show run interface <int_name>
show snmp mib ifmib ifindex <int_name>
Example if it is Ethernet2/1
show run int Ethernet2/1
show snmp mib ifmib ifindex Ethernet2/1
The output would be similar to :
Router# show snmp mib ifmib ifindex Ethernet2/1
Ethernet2/1: Ifindex = 3
Do a snmpwalk on the following OIDs with the ifIndex number :
ifTable (1.3.6.1.2.1.2.2)
ifXTable (1.3.6.1.2.1.31.1.1)
Example :
snmpwallk -v2c -c public 10.10.10.10 ifTable.3
Please share the output for me to check more.
Also, for the device, to remove the entire details, we have no option left than to delete it from DCR and add it back after a short while.
-Thanks
Vinod
**Encourage Contributors. RATE them. ** -
Other database delete is not working on forall statement
Dear all,
My scenario is , i create a program, the program fetch the data from database x and i want to delete on the same x database but i am running this program at y database, so
so i created a view
create or replace view vw_ibs_pda_bills_x as
SELECT *
FROM ibs_pda_bills_x@testarch1my program
Declare
CURSOR c2 IS
SELECT *
FROM vw_ibs_pda_bills_x
WHERE bill_month <= '31-dec-2008'; -- AND bpref_no = :cons;
opr varchar2(10) := 'DELETE';
TYPE tsch IS TABLE OF c2%ROWTYPE;
vtsch tsch;
cnt NUMBER := 0;
stime NUMBER;
etime NUMBER;
DURATION NUMBER;
rcount NUMBER;
errorsd PLS_INTEGER;
ecode NUMBER;
val1 VARCHAR2 (100);
val2 VARCHAR2 (100);
val3 VARCHAR2 (100);
val4 VARCHAR2 (100);
BEGIN
BEGIN
stime := DBMS_UTILITY.get_time ();
OPEN c2;
LOOP
FETCH c2
BULK COLLECT INTO vtsch LIMIT 1000;
IF vtsch.COUNT = 1000
THEN
cnt := cnt + 1;
END IF;
If opr = 'INSERT' Then
FORALL i IN 1 .. vtsch.COUNT SAVE EXCEPTIONS
INSERT INTO dlul.ibs_pda_bills
VALUES vtsch (i);
Else
FORALL i IN 1 .. vtsch.COUNT SAVE EXCEPTIONS
Delete from vw_ibs_pda_bills_x where bill_month = vtsch(i).bill_month;
End if;
EXIT WHEN c2%NOTFOUND;
END LOOP;
etime := DBMS_UTILITY.get_time ();
DURATION := ((etime - stime) / 100) / 60;
rcount :=
(cnt * 1000) + vtsch.COUNT - NVL (SQL%BULK_EXCEPTIONS.COUNT, 0);
If opr = 'INSERT' Then
INSERT INTO process_stage_log
VALUES (SYSDATE, 'IBS_PDA_BILLS', DURATION, rcount);
Else
INSERT INTO process_stage_log
VALUES (SYSDATE, 'IBS_PDA_BILLS-D', DURATION, rcount);
End if;
CLOSE c2;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
errorsd := SQL%BULK_EXCEPTIONS.COUNT;
IF errorsd > 0
THEN
FOR j IN 1 .. errorsd
LOOP
ecode := SQL%BULK_EXCEPTIONS (j).ERROR_CODE;
val1 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).sch_code;
val2 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).bpref_no;
val3 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).bill_month;
val4 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).service_code;
If opr = 'INSERT' Then
INSERT INTO process_error_log
VALUES (SYSDATE, ecode, 'IBS_PDA_BILLS', 'sch_code', val1,
'bpref_no', val2, 'bill_month', val3, 'service_code', val4,'INSERT');
Else
INSERT INTO process_error_log
VALUES (SYSDATE, ecode, 'IBS_PDA_BILLS', 'sch_code', val1,
'bpref_no', val2, 'bill_month', val3, 'service_code', val4,'DELETE');
End if;
END LOOP;
END IF;
END;
END pda_insert;the program want to do the delet option for all delete is not working. The program executed successful but the operation delete is not happening
how to solve this issue.
please help me
kanishNo error encountered in my log table
the new workaround you said, that is instead of for all , already i tried for i in 1.. to like
instead of forall delete i tried the following way
Declare
CURSOR c2 IS
SELECT *
FROM ibs_pda_bills_x@testarch1
WHERE bill_month <= '31-dec-2008'; -- AND bpref_no = :cons;
opr varchar2(10) := 'DELETE';
TYPE tsch IS TABLE OF c2%ROWTYPE;
vtsch tsch;
cnt NUMBER := 0;
stime NUMBER;
etime NUMBER;
DURATION NUMBER;
rcount NUMBER;
errorsd PLS_INTEGER;
ecode NUMBER;
val1 VARCHAR2 (100);
val2 VARCHAR2 (100);
val3 VARCHAR2 (100);
val4 VARCHAR2 (100);
BEGIN
BEGIN
stime := DBMS_UTILITY.get_time ();
OPEN c2;
LOOP
FETCH c2
BULK COLLECT INTO vtsch LIMIT 1000;
IF vtsch.COUNT = 1000
THEN
cnt := cnt + 1;
END IF;
If opr = 'INSERT' Then
FORALL i IN 1 .. vtsch.COUNT SAVE EXCEPTIONS
INSERT INTO dlul.ibs_pda_bills
VALUES vtsch (i);
Else
/* fORALL i IN 1 .. vtsch.COUNT SAVE EXCEPTIONS
Delete from vw_ibs_pda_bills_x where to_char(bill_month,'dd-mm-rrrr') = to_char(vtsch (i).bill_month,'dd-mm-rrrr');*/
for i in 1..vtsch.count loop
delete ibs_pda_bills_x@testarch1 where to_char(bill_month,'dd-mm-rrrr') = to_char(vtsch (i).bill_month,'dd-mm-rrrr');
end loop;
End if;
EXIT WHEN c2%NOTFOUND;
END LOOP;
etime := DBMS_UTILITY.get_time ();
DURATION := ((etime - stime) / 100) / 60;
rcount :=
(cnt * 1000) + vtsch.COUNT - NVL (SQL%BULK_EXCEPTIONS.COUNT, 0);
If opr = 'INSERT' Then
INSERT INTO process_stage_log
VALUES (SYSDATE, 'IBS_PDA_BILLS', DURATION, rcount);
Else
INSERT INTO process_stage_log
VALUES (SYSDATE, 'IBS_PDA_BILLS-D', DURATION, rcount);
End if;
CLOSE c2;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
errorsd := SQL%BULK_EXCEPTIONS.COUNT;
IF errorsd > 0
THEN
FOR j IN 1 .. errorsd
LOOP
ecode := SQL%BULK_EXCEPTIONS (j).ERROR_CODE;
val1 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).sch_code;
val2 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).bpref_no;
val3 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).bill_month;
val4 :=
vtsch (SQL%BULK_EXCEPTIONS (j).ERROR_INDEX).service_code;
If opr = 'INSERT' Then
INSERT INTO process_error_log
VALUES (SYSDATE, ecode, 'IBS_PDA_BILLS', 'sch_code', val1,
'bpref_no', val2, 'bill_month', val3, 'service_code', val4,'INSERT');
Else
INSERT INTO process_error_log
VALUES (SYSDATE, ecode, 'IBS_PDA_BILLS', 'sch_code', val1,
'bpref_no', val2, 'bill_month', val3, 'service_code', val4,'DELETE');
End if;
END LOOP;
END IF;
END;
END pda_insert;i am receiving the following error
ORA-02055: distributed update operation failed; rollback required
ORA-06531: Reference to uninitialized collection
ORA-06512: at line 77
ORA-06531: Reference to uninitialized collection
kanish -
how do i make it so that when i do a DELETE query to delete a entry in database so it doesnt say #DELETED# in the database?
NEVER MIND!!GOT IT
-
Web database application design examples wanted
Hi! I�ve written a couple of smaller web database applications in Java but I�m not completely satisfied with my design, especially where and how to put the database code. Now I�m looking for small open source examples of good design of web database applications in Java. I would appreciate if you could direct me to a good example application, preferably easy to understand. Also feel free to mention any other resource that you think I should look at. At the moment I don�t have the time to read a complete book but I plan to do this later � so book recommendations for professional Java developer are also very welcome.
Summary of recommendations I would like to get:
1) Java web database application with good design
2) Design book for professional Java developers
3) Any other design related resource
Thanks!http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step.html
-
I'm using DW 2004 MX on WinXP Pro using WAMP suite and am
having trouble getting the example for selecting a line for
deletion, displaying the record for confirmation and then deleting
the record.
The documentation that comes with DW 2004MX describes the
process, but I can't get the record to delete on a confirmation
page.
Is there a different example that someone might have that
describes the steps to go thru and delete the record from a
confirmation page?
FYI - I've even tried the following link and the confirm page
doesn't delete the row.
http://www.adobe.com/support/dreamweaver/building/users_delete_rcrds_php/index.html
TIA.
-jPIf you have Dreamweaver 2004 MX, then try the steps that are
described in the following link
http://www.adobe.com/support/dreamweaver/building/users_delete_rcrds_php/index.html
I'm trying to use the Dreamweaver tool, as described in the
link, without adding custom code as you have mentioned. Dreamweaver
2004 MX generates the code similar to what you've described. I'm
going to create a VERY BASIC (three pages - add or create item,
list items, and confirm item delete) site to show the behavior that
I'm generating and you should be able to see the source code from
those pages. It may take a day to generate, but please take a look
at the code on the pages that I publish.
Regards,
-jP -
Database: Deleting multiple records
I have a database with a lot of records in it. I want to delete all the records but the ones that match a find request so I can reuse this database for new data without having to recreate it. I do not see in the manual how to delete a large number of records at once. Thanks.
Hello
Organize > Show All Records
apply your request
Select All
Organize > Hide Selected
Select All
Edit > Delete Record
Organize > Show All Records
I know, the menu item title is not clear enough
It would have been better if it was "Delete Record(s)"
Yvan KOENIG (from FRANCE dimanche 24 septembre 2006 18:44:53) -
Database Deleted that had all the Arbitration Mailboxes, AD accounts still exist.
So in doing a little house cleaning on Exchange 2010 in a new environment I'm noticing that the Arbitration Mailboxes do not exist but the accounts exist in AD.
I ran the below command and got that output.
Get-Mailbox -Arbitration | Ft Name, Database
Name
Database
SystemMailbox{1f05a927-7ba6-4008-81eb-7c42e5be81f5} Old-Database
SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} Old-Database
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 Old-Database
"Old-Database" does not exist in my DAG nor do any of the associated files are listed in any of the Exchange Volumes. In AD Users I see all three AD accounts. I've tried to move requests, knowing of course that a mailbox doesn't exist
so might not work but just giving it a try, and of course it failed. I've tried to enable the mailbox for the account, which I think would be the closest solution but I think it is trying to recreate the account in the old database that doesn't exist.
So I guess what I'm trying to do is enable all the mailboxes but have it recreated in a different database.
Unless my thought process is entirely wrong I'm was hoping for assistance with next steps or the powershell command to accomplish what I'm doing. I did read this in another post though and to run this command. I'm hesitant as the poster seemed
hesitant initially.
Set-Mailbox -Arbitration -Database <DatabaseID>
https://social.technet.microsoft.com/forums/exchange/en-US/c1aec19d-f101-4c5a-b086-c7cc3e86b2f9/deleted-database-that-was-housing-arbitration-mailboxesHi There,
I used the link below to re created them after we lost a DB that contained them.
http://social.technet.microsoft.com/wiki/contents/articles/5317.recreate-and-enable-missing-arbitration-user-accounts-and-mailboxes-in-exchange-server-2010.aspx
Exchange Blog:
www.ntweekly.com
MCSA, MCSE, MCITP:SA, MCITP:EA, MCITP:Enterprise Messaging Administrator 2010,MCTS:Virtualization -
Drop database deletes the alert log
Hi DBA's ,
I ran into a strange situation i never faced before.
We have a Oracle database version 11.2.0.3.0.
This is dev db which i had to refresh from production via rman.
After the drop database command finished all the contents of my trace folder dissapered including the alert log.
Has anyone faced this situation before or help me understand what happenedhimmy, if you are dropping the database why would you need the old alert.log or any other diagnostic directory files? Ideally if you drop a database there should be no record of it left on the system when the drop completes. Why is this a problem?
If you are refreshing the database from production then instead of dropping the database and creating a new database via rman restore perhaps you should be using either the export/import transportable tablespace feature to move the files or traditional export/import of the data.
HTH -- Mark D Powell -- -
Aperture repair database deleted all files
Hi Everyone!
I was trying to open an old Aperture database that I haven't used in a while, so Aperture told me it would need to update the Library. When it proceeded, however, it told me that it couldn't open the .aplibrary, so I opened it with cmd+alt pressed, selected Repair permissions, and then, Repair database. That's when the fit hit the shan: Aperture opened something right away, and it's a library with the correct name - although completely empty. No pictures, no folders, no projects, nothing.
I immediately freaked out and closed Aperture, and took a look at the library file: it shrunk from some 60GB to 800MB. Looking inside, there are no more masters anymore. The free space on the hard drive, however, remains about the same, so it appears that the data itself is still there.
Unfortunately, I do not have a backup of that old library (I'm still beating myself up about that!), so here's my question: what to do next? Is it possible that Aperture replaced the old library folder with the new, empty one, and hid the old one somewhere in the file system?
Any help is greatly appreciated!
DorianMy similar horror story had a good ending after all, and maybe this will help someone else.
I connected my iphone to the MacBookPro and fired up Aperture to import photos.
Aperture said it needed to upgrade the database, and I said fine.
It said there was an error and I would need to hold Option + Command and restart Aperture, and do the "Repair Database" option.
I did.
Aperture then opened to a brand new, empty Aperture library. All projects gone, and all images gone.
I searched, came here, tried everything, to no avail.
At this point I called Apple. They graciously initiated 90 days of complimentary support for Aperture, and helped me.
While I could not locate a single Aperture library on my harddrive using the Finder method, combined with a "show hidden files" option... the Apple support agent guided me to search for them using Aperture itself:
In Aperture: File > Switch to Library > Other/New
We found that my old library had apparently been moved (no doubt by me, during an accidental drag and drop) into a subfolder of my Pictures folder. That was the reason why, when Aperture was being started, the lack of a library in the usual location (root of the Pictures folder) caused it to create a new one, which was, of course, blank.
The above step (in Aperture: File > Switch to Library > Other/New) not only revealed the other library that contained all the old files, but it also revealed the location of it (scan near the bottom of the dialog box).
He had me open it to verify all the pics were still there.
All I had to do was close Aperture, then drag and drop it from the subfolder back to the root folder (Pictures) and I was back in business.
It does not sound like your situation is the same as mine, but this is something to consider. -
Hi All,
The OLAP cube processing was running fine until today all of a sudden I faced a problem. The same OLAP database was showing as not built. Can I come to know how could this happen?
Also the following message is showing in the ULS logs:
"Leaving Monitored Scope (ExecuteStoredProcedureNoResult -- MSP_WEB_SP_QRY_CUBESTATUS_DeleteStatus). Execution Time=35490.602496"
Cheers, Amit WairkarAmit,
Is this issue related to 2013 or 2010?
Hrishi Deshpande Senior Consultant
Maybe you are looking for
-
Amber light won't work, green still does
I've encountered an odd problem, albeit not that serious. When I first plug my magsafe power adapter in the light on the magnet part turns green, then instead of turning to amber as it previously did it simply goes off. The computer is showing that i
-
F110 : program name of posting cleared document during F110
Dear all, I need to figure out the "PAYMENT DOCUMENT SPLITTING" issue after F110 via debugging. I believe the main program for F110 is SAPF110V and SAPF110S is the program handle the posting. However, after I put the break point in SUBMIT SAPF110S A
-
Panasonic HDTV doesn't show MBP's Display?
Hello, Today, I went to best buy to get a belkin mini display port to HDMI adapter and an HDMI-to-HDMI cable to connect to my panasonic viera plasma tv in order to watch Youtube videos... However, when I came home, and found the HDMI 3 input on the s
-
How do I re-establish my verizon 3g account?
I am attempting to re-establsih my 3g account with Verizon. However when I access the menu "Cellular Data" and View Account I receive a message that says ""Session Expired". Verizon is at a loss as to what to do. Also in the "General Option" under "
-
when turn imessage on there is a message saying waiting for activation but it doesnt change anybody knows why?