Processing Flags
Hello experts,
Is anyone aware of the term "Processing Flags" in either R/3 or BW??I am not sure about its functionality,but it relates to the data transfer between R/3 and BW.Can anyone shed some light on this??
Arvind,
CO-PA usually has huge data volumes and when loading COPA data , you load it according to the existing Cost center assignment data , in COPA inR/3 however this assignment can bechanged from time to time depending on business needs , this would mean that the entire COPA data has to be reloaded which would mean a massive data load , however if the business is ready to look at only new data according to the assignments , the older data can be marked a 'Dirty' and they will notbe uploadd once again , only the new data that is created will be uploaded , this is the 'Dirty' flag that is used in COPA.
hope it helps..
Arun
Similar Messages
-
Two process flag symbos in proc.h has same values
Can anybody explain this (they are found in sys/proc.h defined as p_flag value):
#define SGETUREGS 0x00002000 /* state save on svc call */
#define SLKDONE 0x00002000 /* proc has "done" locks(not used)*/
Thanks,
LanHi Lan,
What version of Solaris are you loking at? Thanks. SUN/DTS -
Bill and Routing Interface concurrent program is not processing component
Hi All,
While running Bill and Routing Interface concurrent program,not processing the component item(Line Item) from bom_inventory_comps_interface,still it show process flag as 1. where as billing item(Header Item) is successfully done..i have tried with all the option by giving component sequence id and batch id still it is not processing component item..
Is it recommendable to give bill sequence id and component sequence id in interface table using bom_inventory_component_s sequence..
I will be very pleased if i listen from u guys... Plz help me in resolving this issue..
My Header Insert Stmt..
INSERT INTO apps.bom_bill_of_mtls_interface@system_link_visma
(assembly_item_id, organization_id,
alternate_bom_designator, last_update_date,
last_updated_by, creation_date, created_by,
revision, item_number, item_description,
implementation_date, transaction_type,
process_flag, assembly_type, batch_id
VALUES (l_inv_item_id, l_org_id,
NULL, SYSDATE,
1318, SYSDATE, 1318,
l_revision, l_item_num, l_description,
SYSDATE, 'CREATE',
1, 1, 10003535
Component Insert stmt
INSERT INTO apps.bom_inventory_comps_interface@system_link_visma
(operation_seq_num, component_item_id,
item_num, basis_type, component_quantity,
auto_request_material, effectivity_date,
disable_date, planning_factor,
component_yield_factor,
enforce_int_requirements,
include_in_cost_rollup, wip_supply_type,
supply_subinventory, supply_locator_id,
check_atp, optional,
mutually_exclusive_options,
low_quantity, high_quantity,
so_basis, shipping_allowed,
include_on_ship_docs, required_to_ship,
required_for_revenue, component_remarks,
transaction_type, process_flag,
assembly_item_id, component_item_number,
batch_id,component_sequence_id
VALUES (l_operation_seq, l_comp_item_id,
cur2.item_sequence, l_basis, cur2.quantity,
l_auto_request_mtls, cur2.from_date,
cur2.TO_DATE, cur2.planning_factor,
cur2.yield_factor,
l_enforce_int_requirements,
l_include_in_cost_rollup, l_supply_type,
l_supply_subinventory, NULL,
l_check_atp, l_optional,
l_mutually_exclusive_options,
cur2.minimum_quantity, cur2.maximum_quantity,
l_sale_order_basis, l_shippable_flag,
l_include_on_ship_docs, l_required_to_ship,
l_required_for_revenue, cur2.comments,
'CREATE', 1,
l_inv_item_id, l_comp_item_num,
10003535,apps.bom_inventory_components_s.nextval@system_link_visma
For Subcomponent Insert Stmt
INSERT INTO apps.bom_sub_comps_interface@system_link_visma
(substitute_component_id,
substitute_item_quantity,
assembly_item_id, component_item_id,
operation_seq_num, organization_id,
substitute_comp_number,
component_item_number,
assembly_item_number,
transaction_type, process_flag,
enforce_int_requirements,
effectivity_date,component_sequence_id,batch_id
VALUES (l_sub_comp_item_id,
cur3.quantity,
l_inv_item_id, l_comp_item_id,
cur2.operation_sequence, l_org_id,
l_sub_comp_item_num,
l_comp_item_num,
l_item_num,
'CREATE', 1,
l_enforce_int_requirements,
SYSDATE,apps.bom_inventory_components_s.currval@system_link_visma,10003535
Thanks
Raman Sharma
Edited by: 929841 on May 4, 2012 12:28 AM
Edited by: 929841 on May 4, 2012 2:58 AMYou need to populate the organization_id or organization_code in bom_inventory_comps_interface.
Here is a minimal insert
INSERT INTO bom.bom_inventory_comps_interface
(operation_seq_num, last_update_date, last_updated_by,
creation_date, created_by, process_flag, transaction_type,
bom_item_type,
effectivity_date, organization_code, assembly_item_number,
item_num, component_item_number, component_quantity
VALUES (1 -- op_seq_num
,SYSDATE, 1433
,SYSDATE, 1433, 1 -- process_flag
,'Create',
4 -- bom_item_type 1 Model; 2 Option class; 3 Planning; 4 Standard; 5 Product family
,SYSDATE - 1, 'PUB', 'SSGPARENT1' -- assembly_item_number
,10 --item_num
, 'SSGCOMP1' -- component_item_number
, 10 --qty
)Sandeep Gandhi -
Re: Update Cache Objects in Delta Process Dosn't work
Hi All,
Re: Update Cache Objects in Delta Process doesn't work.
BI 7 - SP 17
This is the scenario I am working on, am running a bex query on a Cube(via a multi) with bunch aggregates.
The daily extraction & Aggregate rollup is correct, but when I run a Bex Query it display incorrect keyfigure values as compared to what we see in LISTCUBE for the infocube.
So when I ran the same query in RSRT with "Do not use Cache", it gave correct results and then when I ran the Bex Query again it fixed itself and it displayed correctly.
InfoCube - standard & No compression for requests
Query Properties are
Read Mode - H
Req Status - 1
Cache - Main Memory Cache Without swaping
Update Cache Objects in Delta Process (Flag selected)
SP grouping - 1
This problem occurs once in couple of weeks and my question is there a permanant fix for it??
OR should we turn the cache off??
Can anyone please help.
Thanking You.
RaoHi Kevin/Rao,
We are currently experiencing problems with the 'Update Cache Objects in Delta' process. Did either of you manage to resolve your issues, and if so, how? -
Generation of MMON process trace files in large file size (GB Size)
Hi,
I have created a database using the dbca in windows platform. Few days I found that, in the BDUMP directory the MMON process trace files are getting generated. The files starts to generate in MB size and will increase upto GB size. I know that the back ground process trace files cannot be disabled. So now iam force to manually delete these files from the bdump directory.plz help me to resolve this issue.
I have checked and verified the SGA size, Shared Pool size and other memory areas.
The statistics level in Typical also.
But still the files are generated.
PLease Helppp.....
Shiyashi
As per your instruction i have checked the Alert log file. I have pasted a part of errors that found in the alert log file.
Mon Jun 07 09:30:58 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_652.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:31:02 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_652.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:36:00 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_652.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:36:08 2010
Restarting dead background process MMON
MMON started with pid=11, OS id=656
Mon Jun 07 09:36:11 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_656.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:36:15 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_656.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:41:12 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_656.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:41:16 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_656.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:46:13 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_656.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:46:17 2010
Errors in file d:\oracle\product\10.2.0\admin\mir\bdump\mir_mmon_656.trc:
ORA-00600: internal error code, arguments: [kjhn_post_ha_alert0-862], [], [], [], [], [], [], []
Mon Jun 07 09:50:18 2010
Shutting down instance: further logons disabled
Mon Jun 07 09:50:19 2010
Stopping background process QMNC
Mon Jun 07 09:50:19 2010
Stopping background process CJQ0
Mon Jun 07 09:50:20 2010
Stopping background process MMNL
Mon Jun 07 09:50:21 2010
Stopping background process MMON
Mon Jun 07 09:50:22 2010
Shutting down instance (immediate)
License high water mark = 4
Mon Jun 07 09:50:22 2010
Stopping Job queue slave processes, flags = 7
Mon Jun 07 09:50:22 2010
Job queue slave processes stopped
Waiting for dispatcher 'D000' to shutdown
All dispatchers and shared servers shutdown
Mon Jun 07 09:50:23 2010
alter database close normal
Mon Jun 07 09:50:23 2010
SMON: disabling tx recovery
SMON: disabling cache recovery
Mon Jun 07 09:50:23 2010
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Thread 1 closed at log sequence 71
Successful close of redo thread 1
Mon Jun 07 09:50:23 2010
Completed: alter database close normal
Mon Jun 07 09:50:23 2010
alter database dismount
Completed: alter database dismount
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
But I am not able to understand anything above of this.
And I am sorry we dont have the metalink support or srs support.
Is there any other way to resolve this issue.
Shiyas -
Cannot process IDocs in sequential order with qRFC
I have an issue posting MBGMCR goods movement IDocs. When a large number for the same material are posted into the receiving system, I get the following error:
The plant data of the material 2000311 is locked by the user RFC_XD1
I know that this is caused by the same material being processed by several IDocs at the same time, so I have been trying to serialise the processing to use qRFC processing. However, I cannot get it to work.
here is what I have done:
1. I have made sure in the interface determination to set the "Maintain Order At Runtime" flag.
2. In the receiver IDoc adapter I have set the "Queue processing" flag.
However, when I run multiple messages through PI, I still get the locking error, implying that I did not get my messages serially processed via qRFC.
Can somebody suggest what I may have missed here?hi Anthony,
>>>1. I have made sure in the interface determination to set the "Maintain Order At Runtime" flag.
this is no necessary
is your IDOC receiver system based on WAS 6.40 or more?
if not you cannot use idocs in queues with XI and setting Queue processing flag
has on effect
all the steps to make IDOC flow use qRFC (in both directions) are described with screenshots in my book:
http://www.sap-press.de/katalog/buecher/titel/gp/titelID-2086?GalileoSession=50249550A39Xd..iZgI
Regards,
Michal Krawczyk -
Use database or MQ to process messages - BizTalk 2009
Hi,
We have large Flat Files 500K records that need to be processed, we are planning to write all the disassembled messages into MQ or database so that BizTalk can consume and process few at a time without getting overloaded. What would be a better
option - loading to MQ or a database?
Thanks in advance!Hi Sappana,
It depends on the requirement .If I look your Scherio I would do with Database approch so that i can be in better Position to track the status of each message picked from DB. Once I will Process the message i can set process flag(any coloumn) in table to
true and if something goes wrong I can track the status as well.
Thanks
Abhishek -
Material Transaction Open Interface Error
Hi,
I'm getting following Error in Cost Manager after running the Transaction Open Interface,
Interface work well to update the stocks, but it returns error Layer Cost Worker Concurrent.
Error1
Bills of Material: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
CMCLCW module: Layer Cost Worker
Current system time is 10-OCT-2012 14:16:32
debug_level = 0
CM_EXTENDED_DEBUG = 2
CSTPLCIN.COST_INV_TXN:CSTPLVCP.interorg (160): ORA-00001: unique constraint (INV.MTL_CST_TXN_COST_DETAILS_U1) violated
Failing Transaction ID is 28227
Start of log messages from FND_FILE
Standard costing org : -1
Interorg transfer send org: (consume layers) ...
84:5
28227:1
Entering get_layers_consumed for transaction 28227 and a required quantity of 2 with a consumption mode of NORMAL
Trying custom layers
There are 0 custom layers
General consumption
Using SQL SELECT inv_layer_id,layer_quantity FROM cst_inv_layers WHERE layer_id = :i AND inv_layer_id <> :j AND NVL(transaction_source_id,-2) <> :k AND layer_quantity > 0 ORDER BY creation_date, inv_layer_id with 1,-1,-1
End of log messages from FND_FILE
No completion options were requested.
Output is not being printed because:
The print option has been disabled for this report.
Deleting output file.
Concurrent request completed
Current system time is 10-OCT-2012 14:16:32
Error2
Bills of Material: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
CMCLCW module: Layer Cost Worker
Current system time is 10-OCT-2012 14:16:32
debug_level = 0
CM_EXTENDED_DEBUG = 2
CSTPLCIN.COST_INV_TXN:CSTPACDP.insert_account (10) ORA-01400: cannot insert NULL into ("INV"."MTL_TRANSACTION_ACCOUNTS"."BASE_TRANSACTION_VALUE")
Failing Transaction ID is 28228
Start of log messages from FND_FILE
Standard costing org : -1
----------l_to_method---------
=5
Interorg transfer receiving org: (create layers) ...
90:5
28228:2
i_txn_id 28228
1 records updated in mclacd for 15005
1 records copied from mclacd for 15005
interorg_cost_txn(..)
transaction_id:28228
org_id:90
i_txn_org_id:90
i_txf_org_id:84
i_txf_txn_id:28227
i_exp_item:0
i_fob_point:0
l_snd_rcv:2
l_from_org:84
l_to_org:90
Sending org distributions
Receiving org distributions
l_intransit:0
Calling Inventory acct
In Inventory_accounts
In insert accounts
l_ussgl_tc :
Payable amount(l_value): acct: 414240
In insert accounts
l_ussgl_tc :
DS - others Exception, sqlcode = -1400
End of log messages from FND_FILE
No completion options were requested.
Output is not being printed because:
The print option has been disabled for this report.
Deleting output file.
Concurrent request completed
Current system time is 10-OCT-2012 14:16:32
My Coding
insert into mtl_transactions_interface
(transaction_type_id, --------------1
transaction_uom, --------------2
transaction_date, --------------3
organization_id, --------------4
transaction_quantity, --------------5
last_update_date, --------------6
last_updated_by, --------------7
creation_date, --------------8
created_by, --------------9
transaction_mode, --------------10
process_flag, --------------11
source_header_id, --------------12
source_line_id, --------------13
source_code, --------------14
transaction_header_id, --------------15
inventory_item_id, --------------16
transaction_interface_id, --------------17
subinventory_code, --------------18
distribution_account_id, --------------19
transaction_cost, --------------20
transaction_reference, --------------21
transfer_organization, --------------22
transfer_subinventory, --------------23
-- transfer_cost, --------------24
primary_quantity, --------------25
lock_flag,
transaction_action_id,
transaction_source_type_id,
dst_segment1,
dst_segment2,
dst_segment3,
dst_segment4,
dst_segment5,
dst_segment6)
values
(v_trx_type_id, --------------1 ------transaction type id
i.uom_code, --------------2 ------transaction_UoM
sysdate, i.creation_date, ------------3 ------trasnsaction date
i.from_organization_id, --------------4 ------org id
nvl(i.quantity_delivered, i.quantity), --------------5 ------quantity
sysdate, --------------6 ------Last update date
-1, --------------7 ------last updated by
sysdate, --------------8 ------creation date
-1, --------------9 ------creation by
3, --------------10 ------transactio mode
1, --------------11 ------process flag
1, --------------12 ------source_header_id
1, --------------13 ------source_line_id
i.mrn_trx_number, --'MRN Interface', --------------14 ------source code
'999999', --------------15 ------transaction header id
v_item_id, --------------16 ------inventory item id
xx_mrn_mtl_trx_int_seq.nextval, --------------17 ------transaction_interface_id
i.from_subinventory_code, --------------18 ------sub inventory
v_code_id, --------------19 ------code compbination
v_item_cost, --------------20 ------cost
'MRN Interface', --------------21 ------reference
i.organization_id, --------------22
i.to_subinventory_code, --------------23
-- (nvl(i.quantity_delivered, i.quantity) * v_item_cost) --------------24
nvl(i.quantity_delivered, i.quantity),
2,
v_trx_action_id,
v_trx_source_type_id,
'01',
'00',
'000',
'141013',
'000000',
'00000');
ThanksCan you get the following for the errored transaction?
SELECT transaction_id txnid, transfer_transaction_id txfrtxnid
, organization_id orgid, transfer_organization_id txfrorgid, subinventory_code subinv
, transfer_subinventory txfrsubinv, cost_group_id cgid
, transfer_cost_group_id txfrcgid , prior_costed_quantity
, transfer_prior_costed_quantity , rcv_transaction_id rcvtxnid
, transaction_action_id txnactid , transaction_source_type_id txnsrctypid
, transaction_type_id txntypid , costed_flag cstdflg
, transaction_group_id , inventory_item_id invitmid
, transaction_source_id wip_entity_id , transaction_cost txncst
, shipment_number shipnum , new_cost , prior_cost
, actual_cost , project_id , transaction_uom txnuom
, transaction_quantity txnqty , primary_quantity priqty , prior_costed_quantity priorqty
, currency_code altcurr , currency_conversion_rate currconvrt , currency_conversion_date currconvdt
, TO_CHAR (mmt.creation_date, 'dd-mm-yyyy hh24:mi:ss') creation_date
, TO_CHAR (mmt.last_update_date, 'dd-mm-yyyy hh24:mi:ss')last_upd_date
, ERROR_CODE errcode
, error_explanation errexpl
FROM mtl_material_transactions mmt
WHERE transaction_id IN (&Trx_Id) -- Error transaction_id
ORDER BY transaction_id DESC -
Is Add_Months allowed in a Fast Formula?
Hi
Im trying to add the following to the carry over fast formula.
: Mid_Month_DDMM = to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM')
But it seems the formula does not like the "Add_months". Im trying to get the formula to work that when an employees continuous_service_date is not the 1st of the Month the carry over will happen at the end of the month.
Thanks
AndrewThe logic is as follows
Every 12 months employees forfiet their leave and carry over any balance.
From the PTO_CARRY_OVER with abit of customisation
IF ISNULL(OverrideHireDate) = 'Y'
THEN
Continuous_Service_Date = Continuous_Service_Date
ELSE
Continuous_Service_Date = OverrideHireDate
Ann_Date_DDMM = to_char(Continuous_Service_Date,'DDMM') /* ----Put this check to make sure 2902 is not concatenated to a non-leap YYYY ------ */
IF Ann_Date_DDMM = '2902' THEN
Anniversary_Date = to_date('0103' || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
ELSE
Anniversary_Date = to_date(Ann_Date_DDMM || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
**Anniversary_Date = to_date('01' || to_char(Anniversary_Date, 'MMYYYY'), 'DDMMYYYY')**
The last line makes sure that everyone no matter when you started has their forfieture date on the 1st of their anniversary month.
I want to us the logic that if your Ann_Date_DDMM does not equal 0101,0102,0103,0104,0105,0106,0107,0108,0109,0110,0111,0112
then your Anniversary date is the end of the anniversay month.
So hence my code of : to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM') that if working will concatinate with to_char(Calculation_Date,'YYYY'),
So for exampble. My anniversay date is the 13-May-2002.
On the 13-May-2013 the process is run to work out my forfieture-carryover for the 14th. But now the company wants me to only forfeit on the 31-May-2013
Calculation_Date = 13-May-2013 but with to_char(Calculation_Date,'YYYY') I get just the 2013 out.
the code to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM') should return (and it does in SQL developer) 3105. Concatinated its 31052013 , that would be my new forfeiture - carry over date.
So would be great to get the add_months working in the formula itself. Else if you can tell me where I can find the code for the seeded Continuous_Service_date then I can do the add_months in the package for the function.
Below is the full Formula:
/* Default Statements */
DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (date)
/* Inputs Are Statements */
INPUTS ARE
Calculation_Date (date)
,Accrual_Term (text)
/* trace=za_set_trace_on('CARRYOVER')*/
/*--------------------------------- Formula Body -------------------------------------*/
/* ------- Check whether the Continuous Service Date was Set or the Hire Date. ------ */
/* ------- Accordingly set the Continuous Service Date. ------ */
IF ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED THEN
Continuous_Service_Date = ACP_SERVICE_START_DATE
ELSE
Continuous_Service_Date = ACP_CONTINUOUS_SERVICE_DATE
OverrideHireDate = KPMG_GET_OVERRIDE_HIRE_DATE(Calculation_Date)
IF ISNULL(OverrideHireDate) = 'Y'
THEN
Continuous_Service_Date = Continuous_Service_Date
ELSE
Continuous_Service_Date = OverrideHireDate
Ann_Date_DDMM = to_char(Continuous_Service_Date,'DDMM') /*Andrew Campbell 30-November-2012*/
/*Mid_Month_DDMM = to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM')*/
/* ----Put this check to make sure 2902 is not concatenated to a non-leap YYYY ------ */
IF Ann_Date_DDMM = '2902' THEN
Anniversary_Date = to_date('0103' || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
ELSE
Anniversary_Date = to_date(Ann_Date_DDMM || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
Anniversary_Date = to_date('01' || to_char(Anniversary_Date, 'MMYYYY'), 'DDMMYYYY')
/* Set Accrual Term to Previous, the requirement is to run CO once per month at the end of the */
/* month for all assgs with Anniversary Dates during that month */
IF Accrual_Term = 'PREVIOUS' THEN
Effective_Date = add_years(add_days(Anniversary_Date, -1), -1)
ELSE
Effective_Date = add_days(Anniversary_Date,-1)
/* For months in later half of the Year and process running for Six Monthly run then reduce */
/* the Effective Date by one year. */
Anniversary_Month = to_char(Anniversary_Date,'MM')
IF (Calculation_Date < Anniversary_Date)
AND ((Anniversary_Month = '07')
OR (Anniversary_Month = '08')
OR (Anniversary_Month = '09')
OR (Anniversary_Month = '10')
OR (Anniversary_Month = '11')
OR (Anniversary_Month = '12')) THEN
Effective_Date = add_years(Effective_Date, -1)
/* Effective_Date = Effective_Date */ /* koos */
/* Calculate Previous Cycle's Start Date,End Date and Six Monthly Anniversary Date in Current Cycle */
Effective_End_Date = Effective_Date
Effective_Start_Date = add_months(Effective_End_Date, -12)
/* Semi_Anniversary_Date = add_months(Effective_End_Date,6) */
Semi_Anniversary_Date = add_months(Effective_End_Date,12) /* Change forfeiture to 12 months after carry over */
/* ------- Calculate the Number of Years completed -------*/
Years_service = floor(months_between(add_days(Effective_date,1), Continuous_Service_Date) / 12)
/* This PROCESS flag is set up so that CO will not run for those employees with eff dates -*/
/* ----------------------------- before calculation_date --------------------------------------*/
IF /* (Calculation_Date >= Effective_Date) */ /* Koos */
(((to_char(Effective_Date,'MMYYYY') = to_char(Calculation_Date,'MMYYYY'))
AND (last_day(Effective_Date) <> Effective_Date ))
OR ((to_char(Anniversary_Date,'MM') = to_char(Calculation_Date,'MM'))
AND (last_day(Effective_Date) = Effective_Date ))) THEN
/* Calculating for Yearly Run */
Process = 'YES'
/* Expiry_Date = add_months(Effective_Date, 6) */
Expiry_Date = add_months(Effective_Date, 12) /* Change forfeiture to 12 months after carry over */
/* After 1 year set the date for calculating for Six Months period */
IF Years_service > 1 THEN
/* Effective_start_Date = add_months(Effective_start_Date,6) */
Effective_start_Date = add_months(Effective_start_Date,12) /* Change forfeiture to 12 months after carry over */
Annual_Cal = 1
ELSE IF /* (Calculation_Date < add_years(Effective_Date,1)) */ /* Koos */
(((to_char(Semi_Anniversary_Date,'MMYYYY') = to_char(Calculation_Date,'MMYYYY'))
AND (last_day(Semi_Anniversary_Date) <> Semi_Anniversary_Date ))
/* OR ((to_char(add_months(Anniversary_Date,6),'MM') = to_char(Calculation_Date,'MM')) */
OR ((to_char(add_months(Anniversary_Date,12),'MM') = to_char(Calculation_Date,'MM')) /* Change forfeiture to 12 months after carry over */
AND (last_day(Semi_Anniversary_Date) = Semi_Anniversary_Date ))) THEN
/* Calculating for Six Monthly Run */
Process = 'YES'
/* Expiry_Date = add_months(Semi_Anniversary_Date,6) */
Expiry_Date = Semi_Anniversary_Date /* Koos */
/* For Semi Annual run set the date for calculation for Six Months */
IF Years_service > 0 THEN
Effective_start_Date = Effective_end_Date
Effective_end_Date = Semi_Anniversary_Date
Annual_Cal = 0
ELSE
/* If neither Annual or Semi Annual Run then Donot process */
Process = 'NO'
Expiry_Date = add_years(Effective_Date, 1)
Annual_Cal = 1
/* --------- Set the Public Variables eg. Maximum Carry Over from the accrual bands ------- */
IF (GET_ACCRUAL_BAND(years_service) = 0) THEN
IF Years_service > 1 then
Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
else
Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
ELSE
Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
/*---------------------- Return Statements --------------------------------------
Effective_date is the last date of an accrual term
Expiry_date is the date by which employees must use carried over PTO or lose it.
/*trace_off = za_set_trace_off*/
RETURN Max_Carryover, Effective_date, Expiry_Date, Process
Thanks -
Database Crashing after successful restarts
Hi Guys,
I am sort stuck in a process where my DB is starting but after a few seconds its starts shutting down all the processes. The system was running perfectly before but after todays restart this is all happening.
the following is the log from the startup to shutdown. Can any one help to figure out what is causing this issue.
This is ORACLE 11G on Enterprise LINUX._
Mon Aug 13 13:12:28 2012
Starting ORACLE instance (normal)
****************** Large Pages Information *****************
Total Shared Global Region in Large Pages = 0 KB (0%)
Large Pages used by this instance: 0 (0 KB)
Large Pages unused system wide = 0 (0 KB) (alloc incr 16 MB)
Large Pages configured system wide = 0 (0 KB)
Large Page size = 2048 KB
RECOMMENDATION:
Total Shared Global Region size is 4098 MB. For optimal performance,
prior to the next instance restart increase the number
of unused Large Pages by atleast 2049 2048 KB Large Pages (4098 MB)
system wide to get 100% of the Shared
Global Region allocated with Large pages
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Shared memory segment for instance monitoring created
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
Autotune of undo retention is turned on.
IMODE=BR
ILAT =28
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production.
ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/db_1
System name: Linux
Node name: OM5000
Release: 2.6.18-308.el5
Version: #1 SMP Fri Jan 27 17:17:51 EST 2012
Machine: x86_64
Using parameter settings in client-side pfile /u01/app/oracle/admin/OML5K/pfile/init.ora on machine OM5000
System parameters with non-default values:
processes = 150
nls_language = "ENGLISH"
nls_territory = "AUSTRALIA"
sga_target = 4G
control_files = "/u01/app/oracle/oradata/OML5K/control01.ctl"
control_files = "/u01/app/oracle/fast_recovery_area/OML5K/control02.ctl"
db_block_size = 8192
compatible = "11.2.0.0.0"
db_recovery_file_dest = "/u01/app/oracle/fast_recovery_area"
db_recovery_file_dest_size= 50000M
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=OML5KXDB)"
audit_file_dest = "/u01/app/oracle/admin/OML5K/adump"
audit_trail = "DB"
db_name = "OML5K"
open_cursors = 300
pga_aggregate_target = 34558M
diagnostic_dest = "/u01/app/oracle"
Mon Aug 13 13:12:28 2012
PMON started with pid=2, OS id=21976
Mon Aug 13 13:12:28 2012
PSP0 started with pid=3, OS id=21978
Mon Aug 13 13:12:29 2012
VKTM started with pid=4, OS id=21980 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Mon Aug 13 13:12:29 2012
GEN0 started with pid=5, OS id=21984
Mon Aug 13 13:12:29 2012
DIAG started with pid=6, OS id=21986
Mon Aug 13 13:12:29 2012
DBRM started with pid=7, OS id=21988
Mon Aug 13 13:12:29 2012
DIA0 started with pid=8, OS id=21990
Mon Aug 13 13:12:29 2012
MMAN started with pid=9, OS id=21992
Mon Aug 13 13:12:29 2012
DBW0 started with pid=10, OS id=21994
Mon Aug 13 13:12:30 2012
DBW1 started with pid=11, OS id=21996
Mon Aug 13 13:12:30 2012
DBW2 started with pid=12, OS id=21998
Mon Aug 13 13:12:30 2012
DBW3 started with pid=13, OS id=22000
Mon Aug 13 13:12:30 2012
LGWR started with pid=14, OS id=22002
Mon Aug 13 13:12:30 2012
CKPT started with pid=15, OS id=22004
Mon Aug 13 13:12:30 2012
SMON started with pid=16, OS id=22006
Mon Aug 13 13:12:30 2012
RECO started with pid=17, OS id=22008
Mon Aug 13 13:12:30 2012
MMON started with pid=18, OS id=22010
Mon Aug 13 13:12:30 2012
MMNL started with pid=19, OS id=22012
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/app/oracle
Mon Aug 13 13:12:30 2012
kcbztek_populate_tbskey: db key in controlfile and datafile 1 is inconsistent..
Full restore complete of datafile 4 to datafile copy /u01/app/oracle/oradata/OML5K/users01.dbf. Elapsed time: 0:00:00
checkpoint is 995547
last deallocation scn is 3
Full restore complete of datafile 3 to datafile copy /u01/app/oracle/oradata/OML5K/undotbs01.dbf. Elapsed time: 0:00:00
checkpoint is 995547
last deallocation scn is 3
Mon Aug 13 13:13:00 2012
Full restore complete of datafile 2 to datafile copy /u01/app/oracle/oradata/OML5K/sysaux01.dbf. Elapsed time: 0:00:30
checkpoint is 995547
last deallocation scn is 995211
Full restore complete of datafile 1 to datafile copy /u01/app/oracle/oradata/OML5K/system01.dbf. Elapsed time: 0:00:38
checkpoint is 995547
last deallocation scn is 993074
Mon Aug 13 13:13:08 2012
Create controlfile reuse set database "OML5K"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
Datafile
'/u01/app/oracle/oradata/OML5K/system01.dbf',
'/u01/app/oracle/oradata/OML5K/sysaux01.dbf',
'/u01/app/oracle/oradata/OML5K/undotbs01.dbf',
'/u01/app/oracle/oradata/OML5K/users01.dbf'
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/OML5K/redo01.log') SIZE 51200K,
GROUP 2 ('/u01/app/oracle/oradata/OML5K/redo02.log') SIZE 51200K,
GROUP 3 ('/u01/app/oracle/oradata/OML5K/redo03.log') SIZE 51200K RESETLOGS
WARNING: Default Temporary Tablespace not specified in CREATE DATABASE command
Default Temporary Tablespace will be necessary for a locally managed database in future release
Mon Aug 13 13:13:08 2012
Successful mount of redo thread 1, with mount id 3547719972
Completed: Create controlfile reuse set database "OML5K"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
Datafile
'/u01/app/oracle/oradata/OML5K/system01.dbf',
'/u01/app/oracle/oradata/OML5K/sysaux01.dbf',
'/u01/app/oracle/oradata/OML5K/undotbs01.dbf',
'/u01/app/oracle/oradata/OML5K/users01.dbf'
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/OML5K/redo01.log') SIZE 51200K,
GROUP 2 ('/u01/app/oracle/oradata/OML5K/redo02.log') SIZE 51200K,
GROUP 3 ('/u01/app/oracle/oradata/OML5K/redo03.log') SIZE 51200K RESETLOGS
Shutting down instance (immediate)
Shutting down instance: further logons disabled
Stopping background process MMNL
Stopping background process MMON
License high water mark = 1
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL
ORA-1109 signalled during: ALTER DATABASE CLOSE NORMAL...
ALTER DATABASE DISMOUNT
Shutting down archive processes
Archiving is disabled
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Mon Aug 13 13:13:11 2012
Stopping background process VKTM
Mon Aug 13 13:13:13 2012
Instance shutdown complete
Mon Aug 13 13:13:13 2012
Starting ORACLE instance (normal)
****************** Large Pages Information *****************
Total Shared Global Region in Large Pages = 0 KB (0%)
Large Pages used by this instance: 0 (0 KB)
Large Pages unused system wide = 0 (0 KB) (alloc incr 16 MB)
Large Pages configured system wide = 0 (0 KB)
Large Page size = 2048 KB
RECOMMENDATION:
Total Shared Global Region size is 4098 MB. For optimal performance,
prior to the next instance restart increase the number
of unused Large Pages by atleast 2049 2048 KB Large Pages (4098 MB)
system wide to get 100% of the Shared
Global Region allocated with Large pages
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
Autotune of undo retention is turned on.
IMODE=BR
ILAT =28
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production.
ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/db_1
System name: Linux
Node name: OM5000
Release: 2.6.18-308.el5
Version: #1 SMP Fri Jan 27 17:17:51 EST 2012
Machine: x86_64
Using parameter settings in client-side pfile /u01/app/oracle/cfgtoollogs/dbca/OML5K/initOML5KTemp.ora on machine OM5000
System parameters with non-default values:
processes = 150
nls_language = "ENGLISH"
nls_territory = "AUSTRALIA"
sga_target = 4G
control_files = "/u01/app/oracle/oradata/OML5K/control01.ctl"
control_files = "/u01/app/oracle/fast_recovery_area/OML5K/control02.ctl"
db_block_size = 8192
compatible = "11.2.0.0.0"
db_recovery_file_dest = "/u01/app/oracle/fast_recovery_area"
db_recovery_file_dest_size= 50000M
norecovery_through_resetlogs= TRUE
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=OML5KXDB)"
audit_file_dest = "/u01/app/oracle/admin/OML5K/adump"
audit_trail = "DB"
db_name = "OML5K"
open_cursors = 300
pga_aggregate_target = 34558M
diagnostic_dest = "/u01/app/oracle"
Mon Aug 13 13:13:14 2012
PMON started with pid=2, OS id=22030
Mon Aug 13 13:13:14 2012
PSP0 started with pid=3, OS id=22032
Mon Aug 13 13:13:15 2012
VKTM started with pid=4, OS id=22034 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Mon Aug 13 13:13:15 2012
GEN0 started with pid=5, OS id=22038
Mon Aug 13 13:13:15 2012
DIAG started with pid=6, OS id=22040
Mon Aug 13 13:13:15 2012
DBRM started with pid=7, OS id=22042
Mon Aug 13 13:13:15 2012
DIA0 started with pid=8, OS id=22044
Mon Aug 13 13:13:15 2012
MMAN started with pid=9, OS id=22046
Mon Aug 13 13:13:15 2012
DBW0 started with pid=10, OS id=22048
Mon Aug 13 13:13:15 2012
DBW1 started with pid=11, OS id=22050
Mon Aug 13 13:13:15 2012
DBW2 started with pid=12, OS id=22052
Mon Aug 13 13:13:15 2012
DBW3 started with pid=13, OS id=22054
Mon Aug 13 13:13:15 2012
LGWR started with pid=14, OS id=22056
Mon Aug 13 13:13:15 2012
CKPT started with pid=15, OS id=22058
Mon Aug 13 13:13:15 2012
SMON started with pid=16, OS id=22060
Mon Aug 13 13:13:15 2012
RECO started with pid=17, OS id=22062
Mon Aug 13 13:13:15 2012
MMON started with pid=18, OS id=22064
Mon Aug 13 13:13:15 2012
MMNL started with pid=19, OS id=22066
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/app/oracle
Mon Aug 13 13:13:15 2012
Create controlfile reuse set database "OML5K"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
Datafile
'/u01/app/oracle/oradata/OML5K/system01.dbf',
'/u01/app/oracle/oradata/OML5K/sysaux01.dbf',
'/u01/app/oracle/oradata/OML5K/undotbs01.dbf',
'/u01/app/oracle/oradata/OML5K/users01.dbf'
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/OML5K/redo01.log') SIZE 51200K,
GROUP 2 ('/u01/app/oracle/oradata/OML5K/redo02.log') SIZE 51200K,
GROUP 3 ('/u01/app/oracle/oradata/OML5K/redo03.log') SIZE 51200K RESETLOGS
WARNING: Default Temporary Tablespace not specified in CREATE DATABASE command
Default Temporary Tablespace will be necessary for a locally managed database in future release
Successful mount of redo thread 1, with mount id 3547724076
Completed: Create controlfile reuse set database "OML5K"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
Datafile
'/u01/app/oracle/oradata/OML5K/system01.dbf',
'/u01/app/oracle/oradata/OML5K/sysaux01.dbf',
'/u01/app/oracle/oradata/OML5K/undotbs01.dbf',
'/u01/app/oracle/oradata/OML5K/users01.dbf'
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/OML5K/redo01.log') SIZE 51200K,
GROUP 2 ('/u01/app/oracle/oradata/OML5K/redo02.log') SIZE 51200K,
GROUP 3 ('/u01/app/oracle/oradata/OML5K/redo03.log') SIZE 51200K RESETLOGS
Stopping background process MMNL
Stopping background process MMON
Starting background process MMON
Starting background process MMNL
Mon Aug 13 13:13:18 2012
MMON started with pid=18, OS id=22077
Mon Aug 13 13:13:18 2012
MMNL started with pid=19, OS id=22079
ALTER SYSTEM enable restricted session;
alter database "OML5K" open resetlogs
RESETLOGS after incomplete recovery UNTIL CHANGE 995547
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/OML5K/redo01.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 1 /u01/app/oracle/oradata/OML5K/redo01.log
Clearing online log 1 of thread 1 sequence number 0
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/OML5K/redo01.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/OML5K/redo01.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Mon Aug 13 13:13:18 2012
Checker run found 1 new persistent data failures
Clearing online redo logfile 1 complete
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/OML5K/redo02.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 2 /u01/app/oracle/oradata/OML5K/redo02.log
Clearing online log 2 of thread 1 sequence number 0
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/OML5K/redo02.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/OML5K/redo02.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 2 complete
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/OML5K/redo03.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 3 /u01/app/oracle/oradata/OML5K/redo03.log
Clearing online log 3 of thread 1 sequence number 0
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/OML5K/redo03.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22071.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/OML5K/redo03.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 3 complete
Online log /u01/app/oracle/oradata/OML5K/redo01.log: Thread 1 Group 1 was previously cleared
Online log /u01/app/oracle/oradata/OML5K/redo02.log: Thread 1 Group 2 was previously cleared
Online log /u01/app/oracle/oradata/OML5K/redo03.log: Thread 1 Group 3 was previously cleared
Setting recovery target incarnation to 2
Assigning activation ID 3547724076 (0xd375f92c)
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u01/app/oracle/oradata/OML5K/redo01.log
Successful open of redo thread 1
SMON: enabling cache recovery
[22071] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:256557774 end:256557834 diff:60 (0 seconds)
Dictionary check beginning
Tablespace 'TEMP' #3 found in data dictionary,
but not in the controlfile. Adding to controlfile.
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
WARNING: The following temporary tablespaces contain no files.
This condition can occur when a backup controlfile has
been restored. It may be necessary to add files to these
tablespaces. That can be done using the SQL statement:
ALTER TABLESPACE <tablespace_name> ADD TEMPFILE
Alternatively, if these temporary tablespaces are no longer
needed, then they can be dropped.
Empty temporary tablespace: TEMP
Database Characterset is US7ASCII
Create Relation IPS_PACKAGE_UNPACK_HISTORY
No Resource Manager plan active
WARNING: Files may exists in db_recovery_file_dest
that are not known to the database. Use the RMAN command
CATALOG RECOVERY AREA to re-catalog any such files.
If files cannot be cataloged, then manually delete them
using OS command.
One of the following events caused this:
1. A backup controlfile was restored.
2. A standby controlfile was restored.
3. The controlfile was re-created.
4. db_recovery_file_dest had previously been enabled and
then disabled.
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Mon Aug 13 13:13:20 2012
QMNC started with pid=24, OS id=22087
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Global Name changed to OML5K
Completed: alter database "OML5K" open resetlogs
alter database rename global_name to "OML5K"
Completed: alter database rename global_name to "OML5K"
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/OML5K/temp01.dbf' SIZE 20480K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
Completed: ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/OML5K/temp01.dbf' SIZE 20480K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
ALTER DATABASE DEFAULT TABLESPACE "USERS"
Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
alter database character set INTERNAL_CONVERT ZHS16GBK
Starting background process CJQ0
Mon Aug 13 13:13:22 2012
CJQ0 started with pid=23, OS id=22089
Mon Aug 13 13:13:23 2012
db_recovery_file_dest_size of 50000 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Mon Aug 13 13:13:27 2012
Thread 1 advanced to log sequence 2 (LGWR switch)
Current log# 2 seq# 2 mem# 0: /u01/app/oracle/oradata/OML5K/redo02.log
Mon Aug 13 13:13:30 2012
Updating character set in controlfile to ZHS16GBK
Synchronizing connection with database character set information
SYS.RULE$ (CONDITION) - CLOB representation altered
SYS.SCHEDULER$_EVENT_LOG (ADDITIONAL_INFO) - CLOB representation altered
SYS.SNAP$ (REL_QUERY) - CLOB representation altered
SYS.SNAP$ (ALIAS_TXT) - CLOB representation altered
SYS.WRI$_ADV_OBJECTS (ATTR4) - CLOB representation altered
SYS.WRI$_ADV_OBJECTS (OTHER) - CLOB representation altered
SYS.WRI$_ADV_DIRECTIVE_META (DATA) - CLOB representation altered
SYS.WRI$_DBU_FEATURE_METADATA (INST_CHK_LOGIC) - CLOB representation altered
SYS.WRI$_DBU_FEATURE_METADATA (USG_DET_LOGIC) - CLOB representation altered
SYS.WRI$_DBU_HWM_METADATA (LOGIC) - CLOB representation altered
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY (EXPRESSION) - CLOB representation altered
Mon Aug 13 13:13:30 2012
Starting background process SMCO
Mon Aug 13 13:13:30 2012
SMCO started with pid=27, OS id=22098
SYS.WRI$_REPT_FILES (SYS_NC00005$) - CLOB representation altered
SYS.SUM$ (SRC_STMT) - CLOB representation altered
SYS.SUM$ (DEST_STMT) - CLOB representation altered
SYS.ATTRIBUTE_TRANSFORMATIONS$ (XSL_TRANSFORMATION) - CLOB representation altered
SYS.METASTYLESHEET (STYLESHEET) - CLOB representation altered
XDB.XDB$RESOURCE (SYS_NC00027$) - CLOB representation altered
XDB.XDB$XDB_READY (DATA) - CLOB representation altered
XDB.XDB$DXPTAB (SYS_NC00006$) - CLOB representation altered
MDSYS.SDO_XML_SCHEMAS (XMLSCHEMA) - CLOB representation altered
Thread 1 advanced to log sequence 3 (LGWR switch)
Current log# 3 seq# 3 mem# 0: /u01/app/oracle/oradata/OML5K/redo03.log
Mon Aug 13 13:13:43 2012
MDSYS.SDO_COORD_OP_PARAM_VALS (PARAM_VALUE_FILE) - CLOB representation altered
MDSYS.SDO_GEOR_XMLSCHEMA_TABLE (XMLSCHEMA) - CLOB representation altered
MDSYS.SDO_STYLES_TABLE (DEFINITION) - CLOB representation altered
SYSMAN.MGMT_IP_ELEM_DEFAULT_PARAMS (VALUE) - CLOB representation altered
SYSMAN.MGMT_IP_REPORT_ELEM_PARAMS (VALUE) - CLOB representation altered
SYSMAN.MGMT_IP_SQL_STATEMENTS (SQL_STATEMENT) - CLOB representation altered
SYSMAN.MGMT_JOB_LARGE_PARAMS (PARAM_VALUE) - CLOB representation altered
SYSMAN.MGMT_SEC_INFO (B64_LOCAL_CA) - CLOB representation altered
SYSMAN.MGMT_SEC_INFO (B64_INTERNET_CA) - CLOB representation altered
APEX_030200.WWV_FLOW_FLASH_CHARTS (CHART_XML) - CLOB representation altered
APEX_030200.WWV_FLOW_FLASH_CHART_SERIES (SERIES_QUERY) - CLOB representation altered
APEX_030200.WWV_FLOW_SHORTCUTS (SHORTCUT) - CLOB representation altered
APEX_030200.WWV_FLOW_STEPS (HELP_TEXT) - CLOB representation altered
APEX_030200.WWV_FLOW_STEPS (HTML_PAGE_HEADER) - CLOB representation altered
APEX_030200.WWV_FLOW_STEP_PROCESSING (PROCESS_SQL_CLOB) - CLOB representation altered
APEX_030200.WWV_FLOW_PAGE_GENERIC_ATTR (ATTRIBUTE_VALUE) - CLOB representation altered
APEX_030200.WWV_FLOW_TEMPLATES (HEADER_TEMPLATE) - CLOB representation altered
APEX_030200.WWV_FLOW_TEMPLATES (FOOTER_TEMPLATE) - CLOB representation altered
APEX_030200.WWV_FLOW_TEMPLATES (BOX) - CLOB representation altered
Mon Aug 13 13:13:54 2012
Thread 1 cannot allocate new log, sequence 4
Checkpoint not complete
Current log# 3 seq# 3 mem# 0: /u01/app/oracle/oradata/OML5K/redo03.log
Mon Aug 13 13:13:57 2012
APEX_030200.WWV_FLOW_PAGE_PLUGS (PLUG_SOURCE) - CLOB representation altered
Thread 1 advanced to log sequence 4 (LGWR switch)
Current log# 1 seq# 4 mem# 0: /u01/app/oracle/oradata/OML5K/redo01.log
APEX_030200.WWV_FLOW_PAGE_PLUGS (CUSTOM_ITEM_LAYOUT) - CLOB representation altered
APEX_030200.WWV_FLOW_PAGE_PLUG_TEMPLATES (TEMPLATE) - CLOB representation altered
APEX_030200.WWV_FLOW_PAGE_PLUG_TEMPLATES (TEMPLATE2) - CLOB representation altered
APEX_030200.WWV_FLOW_PAGE_PLUG_TEMPLATES (TEMPLATE3) - CLOB representation altered
APEX_030200.WWV_FLOW_PROCESSING (PROCESS_SQL_CLOB) - CLOB representation altered
APEX_030200.WWV_FLOW_REGION_REPORT_COLUMN (PK_COL_SOURCE) - CLOB representation altered
APEX_030200.WWV_FLOW_ROW_TEMPLATES (ROW_TEMPLATE1) - CLOB representation altered
APEX_030200.WWV_FLOW_ROW_TEMPLATES (ROW_TEMPLATE2) - CLOB representation altered
APEX_030200.WWV_FLOW_ROW_TEMPLATES (ROW_TEMPLATE3) - CLOB representation altered
APEX_030200.WWV_FLOW_ROW_TEMPLATES (ROW_TEMPLATE4) - CLOB representation altered
APEX_030200.WWV_FLOW_BANNER (BANNER) - CLOB representation altered
APEX_030200.WWV_FLOW_BUTTON_TEMPLATES (TEMPLATE) - CLOB representation altered
APEX_030200.WWV_FLOW_INSTALL (DEINSTALL_SCRIPT) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (LIST_TEMPLATE_CURRENT) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (LIST_TEMPLATE_NONCURRENT) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (SUB_LIST_ITEM_CURRENT) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (SUB_LIST_ITEM_NONCURRENT) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (ITEM_TEMPLATE_CURR_W_CHILD) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (ITEM_TEMPLATE_NONCURR_W_CHILD) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (SUB_TEMPLATE_CURR_W_CHILD) - CLOB representation altered
APEX_030200.WWV_FLOW_LIST_TEMPLATES (SUB_TEMPLATE_NONCURR_W_CHILD) - CLOB representation altered
APEX_030200.WWV_FLOW_WORKSHEETS (SQL_QUERY) - CLOB representation altered
Mon Aug 13 13:14:08 2012
APEX_030200.WWV_FLOW_CUSTOM_AUTH_SETUPS (PAGE_SENTRY_FUNCTION) - CLOB representation altered
APEX_030200.WWV_FLOW_CUSTOM_AUTH_SETUPS (SESS_VERIFY_FUNCTION) - CLOB representation altered
APEX_030200.WWV_FLOW_CUSTOM_AUTH_SETUPS (PRE_AUTH_PROCESS) - CLOB representation altered
APEX_030200.WWV_FLOW_CUSTOM_AUTH_SETUPS (AUTH_FUNCTION) - CLOB representation altered
APEX_030200.WWV_FLOW_CUSTOM_AUTH_SETUPS (POST_AUTH_PROCESS) - CLOB representation altered
Refreshing type attributes with new character set information
Completed: alter database character set INTERNAL_CONVERT ZHS16GBK
Mon Aug 13 13:14:11 2012
ALTER SYSTEM disable restricted session;
Mon Aug 13 13:14:12 2012
Thread 1 advanced to log sequence 5 (LGWR switch)
Current log# 2 seq# 5 mem# 0: /u01/app/oracle/oradata/OML5K/redo02.log
Mon Aug 13 13:14:28 2012
Shutting down instance (immediate)
Stopping background process SMCO
Shutting down instance: further logons disabled
Stopping background process QMNC
Mon Aug 13 13:14:29 2012
Stopping background process CJQ0
Stopping background process MMNL
Stopping background process MMON
License high water mark = 14
Stopping Job queue slave processes, flags = 7
Job queue slave processes stopped
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL
Mon Aug 13 13:14:33 2012
SMON: disabling tx recovery
SMON: disabling cache recovery
Mon Aug 13 13:14:33 2012
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Thread 1 closed at log sequence 5
Successful close of redo thread 1
Completed: ALTER DATABASE CLOSE NORMAL
ALTER DATABASE DISMOUNT
Shutting down archive processes
Archiving is disabled
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Mon Aug 13 13:14:34 2012
Stopping background process VKTM
System State dumped to trace file /u01/app/oracle/diag/rdbms/oml5k/OML5K/trace/OML5K_ora_22163.trc
Mon Aug 13 13:14:36 2012
Instance shutdown complete
Mon Aug 13 13:14:37 2012
Starting ORACLE instance (normal)All the mesages are dated "Aug 13" which is quite a few months ago ! I see no recent messages.
You have two CREATE CONTROLFILE calls and one alter database character set INTERNAL_CONVERT ZHS16GBK call.
Were these part of a Database Creation using DBCA (The Database Creation Assistant) ?
Hemant K Chitale -
Hi all,when i am trying to create the below procedure i am getting error.Can someone suggest where am i doing wrong
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE XXC_MTL_TRANSACTIONS(file_number IN VARCHAR2) IS
2 --process_flag VARCHAR2(2);
3 m1 VARCHAR2(100);
4 --selected_flag VARCHAR2(2);
5 BEGIN
6 IF '&SELECTED_FLAG' = 'Y'
7 THEN
8 INSERT INTO mtl_transactions_interface
9 ( inventory_item_id, -- optional column
10 source_code,
11 source_line_id,
12 source_header_id,
13 process_flag,
14 transaction_mode,
15 last_update_date,
16 last_updated_by,
17 creation_date,
18 created_by,
19 organization_id,
20 transaction_quantity,
21 transaction_uom,
22 transaction_date,
23 transaction_type_id,
24 transaction_cost,
25 subinventory_code,
26 transfer_organization,
27 transfer_subinventory,
28 shipment_number
29 )
30 SELECT
31 lc.inventory_item_id,
32 'DATA COLLECTION', --source code
33 regal.regal_inv_landed_cost_seq.nextval, --source line id
34 regal.regal_inv_landed_cost_seq.nextval, --source header id
35 1, --process flag
36 3, --transaction mode
37 lc.last_update_date, --last update date
38 lc.last_updated_by, --last updated by
39 sysdate, --creation date
40 lc.created_by, --created by
41 lc.organization_id, --organization_id
42 lc.quantity_received , --transaction Quantity
43 msi.primary_uom_code , --transaction UOM
44 sysdate, --transaction date
45 3, --transaction type ID(3 for Direct Org Transfer)
46 lc.landed_cost, --transaction cost
47 'Vessel', -- SUBINVENTORY_CODE
48 82, -- TRANSFER ORGANIZATION
49 'Brooklyn', -- transfer subinventory
50 lc.file_number --shipment number
51 FROM
52 regal.regal_inv_landed_cost_tab lc,
53 mtl_system_items msi
54 WHERE
55 lc.file_number = 'NOV612'
56 AND lc.organization_id = msi.organization_id
57 AND lc.inventory_item_id = msi.inventory_item_id
58 AND process_flag IS NOT NULL;
59 COMMIT;
60 m1:=SQL%ROWCOUNT;
61 dbms_output.put_line(m1 || 'Records inserted'); --testing
62 END IF;
63 UPDATE regal.regal_inv_landed_cost_tab
64 SET process_flag ='Y'
65 WHERE '&SELECTED_FLAG' = 'Y'
66 AND process_flag IS NULL
67* END;
SQL> /
Enter value for selected_flag: Y
old 6: IF '&SELECTED_FLAG' = 'Y'
new 6: IF 'Y' = 'Y'
Enter value for selected_flag: Y
old 65: WHERE '&SELECTED_FLAG' = 'Y'
new 65: WHERE 'Y' = 'Y'
Warning: Procedure created with compilation errors.
SQL> sho error
Errors for PROCEDURE XXC_MTL_TRANSACTIONS:
LINE/COL ERROR
63/3 PL/SQL: SQL Statement ignored
67/5 PL/SQL: ORA-00933: SQL command not properly ended
68/0 PLS-00103: Encountered the symbol "end-of-file" when expecting
one of the following:
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << continue close current delete fetch lock
insert open rollback savepoint set sql execute commit forall
merge pipe purgeThanks in advance!!Update is missing semi-colon:
63 UPDATE regal.regal_inv_landed_cost_tab
64 SET process_flag ='Y'
65 WHERE '&SELECTED_FLAG' = 'Y'
66 AND process_flag IS NULL<font size=4 color=red>;</font>SY. -
PL/SQL Procedure guidelines
I need to load the records from one table and insert and/or update it into different tables based on the column values. If any one has any template or guidelines for doing similar tasks, it would be give me a proper refernce. This is what I came up with based on the reading and other online examples. My concerns are about memory, commit & rollback points and performances. If anyone could point out any potential problems or any better ways of doing it, it would be greatly appreciated. There would be 30-40,000 records per day and this procedure is scheduled to run every evening. Please bear with me for this lengthy post.
--@test_pkg.sql;
--exec test_pkg.load_records(200);
create or replace package test_pkg
is
procedure load_records (fetch_limit in number := 200, log_lvl in number := 4);
procedure new_record (retKey out number);
procedure update_record(recKey in number);
procedure ins_upd_attribute (id1 in number, id2 in char, id3 in number, val in varchar2);
procedure log_msg(msg_type in number := 0, msg in varchar2);
function get_fk (col5 in varchar2) return number;
end test_pkg;
create or replace package body test_pkg
is
cursor test_cur
is
select col1, col2, col3, col4, col5,col6, name, phone, address1, city, state, zip, birthdate,
email, col7,lastdate, process_flag
from table1
where process_flag = 'N' for update of process_flag;
type test_cur_type is table of test_cur%rowtype;
cur_rec test_cur_type;
LOG_OFF number := 0;
LOG_FATAL number := 1;
LOG_ERROR number := 2;
LOG_WARNING number := 3;
LOG_INFO number := 4;
LOG_DEBUG number := 5;
log_level number := LOG_INFO;
i number := 1;
last_change_user number := 261;
last_change_date date; /* Sysdate */
rec_num, new_rec_count, error_record_count, total_record_count number;
start_time, end_time, processing_time number;
procedure load_records (fetch_limit in number := 200, log_lvl in number := 4)
is
begin
log_level := log_lvl;
start_time := dbms_utility.get_time;
log_msg(LOG_INFO, start_time||':test_pkg.load_records procedure started...');
select sysdate into last_change_date from dual;
new_rec_count := 0;
col2_count := 0;
col3_count := 0;
col4_count := 0;
attr_records_added := 0;
attr_records_updated := 0;
error_record_count := 0;
total_record_count := 0;
end_time := 0;
processing_time := 0;
open test_cur;
loop
fetch test_cur bulk collect into cur_rec limit fetch_limit;
for i in 1..cur_rec.count
loop
rec_num := 0;
if ((cur_rec(i).col5 > 0) and
(cur_rec(i).col1 = 'Y') or
(cur_rec(i).col2 = 'Y') or
(cur_rec(i).col3 = 'Y') or
(cur_rec(i).col4 = 'Y'))
then
if cur_rec(i).col1 = 'Y' then
new_record(rec_num);
else
rec_num := get_fk(cur_rec(i).col5);
end if;
log_msg(LOG_DEBUG, 'col5<'||cur_rec(i).col5||'> rec_num<'||rec_num||'>');
if rec_num <= 0 then
log_msg(LOG_INFO, 'Invalid record. rec#<'||cur_rec(i).col5||'> cx<'||rec_num||'>. No matching record found in card table');
else
if cur_rec(i).col2 = 'Y' then
ins_upd_attribute(rec_num, 'C', 191, 'Y');
end if;
if cur_rec(i).col3 = 'Y' then
ins_upd_attribute(rec_num, 'C', 192, 'Y');
end if;
if cur_rec(i).col4 = 'Y' then
ins_upd_attribute(rec_num, 'P', 193, 'Test');
end if;
if cur_rec(i).col6 = 'Y' then
update_record(cur_rec(i).col5);
end if;
end if;
else
log_msg(LOG_INFO, cur_rec(i).col5||' is an invalid record...No options selected.');
error_record_count := error_record_count + 1;
end if;
total_record_count := total_record_count + 1;
end loop;
exit when test_cur%notfound;
end loop;
close test_cur;
commit;
end_time := sys.dbms_utility.get_time;
--processing_time := mod (((end_time - start_time) + power(2,32)), power(2,32));
processing_time := end_time - start_time;
log_msg(LOG_INFO, '*********** Execution Summary ***********');
log_msg(LOG_INFO, ' New record requests: ' || new_rec_count);
log_msg(LOG_INFO, ' Invalid option records: ' || error_record_count);
log_msg(LOG_INFO, ' Total records processed: ' || total_record_count);
log_msg(LOG_INFO, ' Total processing time: ' || processing_time || ' ms');
log_msg(LOG_INFO, '*****************************************');
exception
when others then
log_msg(LOG_INFO, 'Other exceptions occured...');
--loghandler.log(sqlcode, sqlerrm,'load_records');
end load_records;
procedure new_record (retKey out number)
is
key1, key2, key3 number;
begin
retKey := 0;
--log_msg(LOG_INFO, start_time||':test_pkg.new_record procedure started...');
select value into key1 from keyTable where parameter = 'KEY1' for update;
update keyTable set value = key1 + 1 where parameter = 'KEY1';
select value into key2 from keyTable where parameter = 'KEY2' for update;
update keyTable set value = key2 + 1 where parameter = 'KEY2';
select value into key3 from keyTable where parameter = 'KEY3' for update;
update keyTable set value = key3 + 1 where parameter = 'KEY3';
log_msg(LOG_DEBUG, 'rec#<'||cur_rec(i).col4||'> key1<'||key1||'> key2<'||key2||'> key3<'||key3||'>');
insert into table1 (col1, col2, col3, col4, rectype, lastchangedate, lastchangeuserid)
values (key1, key2, key3, cur_rec(i).col4,'Unknown',last_change_date,last_change_user);
log_msg(LOG_DEBUG, 'Table1 record inseted...');
insert into table2 (col1, col2, col3, col4)
values(key2, key3, key1, cur_rec(i).name);
log_msg(LOG_DEBUG, 'Table2 record inseted...');
insert into table3 (col1, col2, col3, phone, addr, postalcode, lastchangedate, lastchangeuserid)
values (key3, key1, key2, cur_rec(i).phone, cur_rec(i).address1, cur_rec(i).zip, last_change_date,last_change_user);
log_msg(LOG_DEBUG, 'Table3 record inseted...');
retKey := key1;
new_rec_count := new_rec_count + 1;
exception
when others then
log_msg(LOG_INFO, 'Other exceptions occured...sqlcode: '||sqlcode||' sqlerrm: '|| sqlerrm);
end new_record;
procedure ins_upd_attribute (id1 in number, id2 in char, id3 in number, val in varchar2) is
record_count number := 0;
begin
log_msg(LOG_DEBUG, start_time||':test_pkg.ins_upd_attribute procedure started...');
select count(1) into record_count from attributeTable where col1 = id1 and col2 = id2 and col3 = id3;
if record_count = 1
then
update attributeTable set value = val where col1 = id1 and col2 = id2 and col3 = id3;
attr_records_updated := attr_records_updated + 1;
else
insert into attributeTable(col1,col2,col3,value ) values(id1,id2,id3,val);
attr_records_added := attr_records_added + 1;
end if;
exception
when others then
log_msg(LOG_INFO, 'Other exceptions occured...sqlcode: '||sqlcode||' sqlerrm: '|| sqlerrm);
end ins_upd_attribute;
procedure update_record (recKey in number) is
id1 number := 0;
begin
log_msg(LOG_DEBUG, start_time||':test_pkg.update_record procedure started...');
select col4 into id1 from table1 where col1 = recKey;
if id1 > 1
then
update tabl3 set phone = cur_rec(i).phone,
addr = cur_rec(i).address1, postalcode =cur_rec(i).zip where id =id1;
end if;
exception
when others then
log_msg(LOG_INFO, 'Other exceptions occured...sqlcode: '||sqlcode||' sqlerrm: '|| sqlerrm);
end update_record;
function get_fk (recKey in varchar2) return number is
rec_num number := 0;
begin
select key4 into rec_num from table1 where col4 = recKey;
return rec_num;
exception
when no_data_found then
log_msg(LOG_INFO, 'No Data found exceptions occured...recKey<'||recKey||'>');
when others then
log_msg(LOG_INFO, 'Other exceptions occured...sqlcode: '||sqlcode||' sqlerrm: '|| sqlerrm);
end get_fk;
procedure log_msg(msg_type in number := 0, msg in varchar2) is
begin
if msg_type <= log_level
then
log_msg(LOG_DEBUG, start_time||':test_pkg.ins_upd_attribute procedure started...');
--loghandler.log(sqlcode, sqlerrm,'load_records')
end if;
exception
when others then
log_msg(LOG_INFO, 'Other exceptions occured...sqlcode: '||sqlcode||' sqlerrm: '|| sqlerrm);
end log_msg;
end test_pkg;
/Thanks for your reply. No. I can not use insert into or merge into options. My scenario is like this.
Read the staging table records where processed_flag is 'N'
if (col1 !='Y' and col2 !='Y' or col3 !='Y' or col4 !='Y') and col5 = 0 then
log this record. goto the next record.
else
if col1 = 'Y' then
rec_key = new_record(rec_num);
else
rec_key = get_fk(col5);
end if;
if col2 = 'Y' then
ins_upd_attribute(rec_key,'C', 191, 'Y');
end if;
if col3 = 'Y' then
ins_upd_attribute(rec_key,'C', 192, 'Y');
end if;
if col4 = 'Y' then
ins_upd_attribute(rec_key,'P', 193, 'Test');
end if;
if col6 = 'Y' then
update_record(col5);
end if;
update the processed flag to 'Y';
end if;
procedure new_record(retKey out number) is
Select the next values for 3 keys from keyTable. update keyTable column values with +1.
Insert new records into table1, table2 and table3
end new_record;
procedure ins_upd_attribute (id1 in number, id2 in char, id3 in number, val in varchar2) is
if a record exists in attributeTable then
update the attributeTable record
else
insert new record into attributeTable.
end if;
end ins_upd_attribute;
function get_fk (recKey in varchar2) return number is
if a record exist in table1 then
return record key
else
return 0;
end if;
end get_fk;
procedure update_record (recKey in number) is
if a record exists in table1 then
update table3 using the key from table1
end if;
end update_record;
Should I commit after processing each record in the staging table or commit after processing all records?
Should I combine all procedures and functions into one large procedure (load_records) or leave it the way it is now? Does any one see any potential problems with my current approach? Any advice will be sincerely appreciated.
Message was edited by:
new2sql -
SQL Server 2005 to Oracle via OLE DB
I've got a project where I need to access several tables in an Oracle (9i) database from SQL Server 2005. I installed the Oracle OLE DB provider and the Oracle 9i client. I can access the tables via the Oracle client without issue. I tried creating a "Linked Server" in SQL 2005 Mgmt Studio. Sometimes I can get it to test the connection successfully, but I can never get it to read anything from the database.
Depending on what configuration I use, (MS OLEDB Provider, or the Oracle OLEDB Provider - varying the in process flag and other values) the errors range from not being able to instantiate the OLEDB provider to the server just returning an result that the table I'm trying to access doesn't exist.
I keep reading in the forums about Transparent Gateways.... Do I have to have a gateway running for this? Shouldn't I be able to access the Oracle tables via OLEDB?
Any help is greatly appreciated. Thanks.
JI finally got everything working by using the ORacle 10x OLEDB client to create a linked server. You also have to set the OLEDB "allow in process" flag to get it going.
With the 10x client and the in process flag, everything worked exactly as expected.
J -
How to get initial entries of sales orders to go into CDHDR/CDPOS
When a sales order is first created and saved, we do not get an entry in CDHDR and/or CDPOS for it.
People have suggested looking at ERDAT and ERZET, but I have found that those entries may be false - especially if a person doesn't press save for a while.
A followup question to this is that when I use SE16N to look at field CHNGIND in table CDPOS, one of the possible values is J. It appears to work just like E does for deletes, but I cannot find a way to turn it on. I have been successful in using SCDO to turn on values for deletes which I needed ( thus turning the D's into E's ). A "J" appears to be an insert with the value of the field.
Is there some transaction in the system which will force the system to log the initial creation and thus assign it a change number ? I have a workaround of using a user exit to create an entry in a table, but I hate to have to do that if I don't have to. And what do I use to get the system to log the individual values on inserts ? It would help immensely if we had the values on the fields when they are inserted as a lot of logic is going towards determining those values.To anyone who reads this thread.
We ended up adding code to userexit_save_document in MV45AFZZ to create records in a custom table with a field that indicates that the entry needs to be processed. It got us around the date issue in the fact that the query looks for unprocessed entries and thus avoids the whole buffering thing. The only fields we had in the table were VBELN, POSNR, and a single character processing flag ( initial if not processed, 'X' if processed ).
There definitely is some kind of buffering going on so that our date/time went by and got missed.
I never did find any answers to my last two questions - if I ever do I will post it here. If anyone else finds out the answers, please post and I will award credit. -
Hi All,
I have a multirow block with three text item columns,which source is a view. I have a column of check box besides this multirow block, so that each check box corresponds to each row in the block.
If the check boxes are checked, then the corresponding row will be processed. I tried to add a virtual column as a process flag when creating the view, but the virtual column cannot be updated, so I cannot check or unchecked the check boxes.
Is there another way to do this?
Thanks in advance!
Regards,
Vanessavanessa,
if the processing is handled by Forms then you could place teh checkbox into the block having teh other columns and unset the database usage in the properties.
Frank
Maybe you are looking for
-
How to disable a field in selection screen based on condition.
Hi, I have 2 radio buttons- p_normd, p_recov and 2 other controls - like text boxes, say tb1 and tb2. and some mandatory fields below. If i choose p_normd, i want one control(tb2) to be disabled and if i choose p_recov, i want the other control(tb1)
-
HELP!! please please please read this
i installed my Ipod Nano on my friends Mac and now i cant get it to install on my comptuer which runs Windows XP!! what do i do please help!!
-
CRio FPGA read 1024000 samples and transfer to RT
Hello, I have a cRIO application and i have to read 1024000 samples, on 3 channels at a sampling rate of 25.6 khz.. My NI 9232 offers the posibility of sampling at such a rate. The problem is that i do not know how to aquire and transfer that amount
-
Re: screen freezing when I try to open a screen in Iexplorer
I have a Satellite P200 duo core with 2GB of memory. Quite often when I try to open a screen in ieplorer the screen freezes and goes white. When I look at the computer performance it tells me the CPU is working at 100% and the physical memory at just
-
I was wondering how I would be able to pass 2 arrays to 1 method? I have array a and array b, which I need to pass to a method that will add them together and return the result in array c. but I just need to know how to pass the two arrays into the m