Oracle Updation
Hi All,
I have one query regarding Oracle software updation from Oracle 9i to Oracle 10. The question is that what is the name of the process which being executed to know that what are the parameters we want to update. My interviewer asked me this question..I was unaware with this.. I will be really thankful...
Regards
Gursimran Singh Sra
hi,
usually while upgrading manually, we used to spool the output of utlu101i.sql file and make the changes accordingly.. it specifies the changes like
Set the DB_DOMAIN parameter properly.
Make sure memory parameters have at least the minimum size required for upgrade:
SHARED_POOL_SIZE (96MB for 32-bit platforms, 144MB for 64-bit), PGA_AGGREGATE_
TARGET (24MB), JAVA_POOL_SIZE (48MB), and LARGE_POOL_SIZE (8MB).
or else use DBUA to upgrade.
regards,
Deepak
Similar Messages
-
Hi All,
I wanted to have Batch execute in my java method.
There are few requirements of that
1. The data has to be inserted in 2 tables
2. The data has to be deleted from 2 tables
3. I have to use Statement for delete as the query uses in clause.
I have gone through http://web.umr.edu/~ora9i/java.901/a90211/oraperf.htm for Oracle Updating batches.As per the details given in above link, I have few doubts
1.Can I use 2 or more different Prepared Statements in same Batch?
For Example:
//Creating a prepared statement for first table
ps = conn.prepareStatement(INSERT_INTO_TABLE1);
((OraclePreparedStatement)ps).setExecuteBatch (30);
ps.setInt(1, 23);
ps.setString(2, "Sales");
ps.setString(3, "USA");
ps.executeUpdate(); //JDBC queues this for later execution
ps.setInt(1, 24);
ps.setString(2, "Blue Sky");
ps.setString(3, "Montana");
ps.executeUpdate(); //JDBC queues this for later execution
ps.setInt(1, 25);
ps.setString(2, "Applications");
ps.setString(3, "India");
ps.executeUpdate(); //The queue size equals the batch value of 3
//JDBC sends the requests to the database
ps.setInt(1, 26);
ps.setString(2, "HR");
ps.setString(3, "Mongolia");
ps.executeUpdate(); //JDBC queues this for later execution
//Creating a prepared statement for second table
ps = conn.prepareStatement(INSERT_INTO_TABLE2);
((OraclePreparedStatement)ps).setExecuteBatch (30);
ps.setInt(1, 23);
ps.setString(2, "Sales");
ps.setString(3, "USA");
ps.setInt(4,1);
ps.executeUpdate(); //JDBC queues this for later execution
ps.setInt(1, 24);
ps.setString(2, "Blue Sky");
ps.setString(3, "Montana");
ps.setInt(4,1);
ps.executeUpdate(); //JDBC queues this for later execution
ps.setInt(1, 25);
ps.setString(2, "Applications");
ps.setString(3, "India");
ps.setInt(4,1);
ps.executeUpdate(); //The queue size equals the batch value of 3
//JDBC sends the requests to the database
ps.setInt(1, 26);
ps.setString(2, "HR");
ps.setString(3, "Mongolia");
ps.executeUpdate(); //JDBC queues this for later execution
//Atlast calling send batch
((OraclePreparedStatement)ps).sendBatch();
2.Can I use the Oracle Updating Batches for Normal Statements? Can any one elaborate following points
Do not mix standard update batching syntax with Oracle update batching syntax in the same application. The JDBC driver will throw an exception when you mix these syntaxes
As per above statement, we cant have both type of updating in a method or in the whole application. Can any one elaborate this point, how its possible as every time we have to open a new connection object?
If we cant make use of both type of batching, then how to implement the Oracle Updating Batches for simple Statements.
The Oracle implementation of standard update batching does not implement true batching for generic statements and callable statements. Although Oracle JDBC supports the use of standard batching syntax for Statement and CallableStatement objects, you will see performance improvement for only PreparedStatement objects.
3. If first case is possible & if we can use the Oracle Updating Batches for simple Statements, then can we have all the statements in one Batch?
the query if run from PL/SQL will be like this and in same sequence
delete from table1 where country in ('USA','GERMANY')// multiple statement of this type
delete from table2 where country in ('USA','INDIA'))// multiple statement of this type
insert into table1 values(1,'SALES','USA'))// multiple statement of this type
insert into table2 values(1,'SALES,'Australia','1')// multiple statement of this typeDear Robert Richardson,
Unfortunately you can only access the Batch/Serial object by an document object.
If you want to update a Batch fields, then you need to get the document object first, then get its batch object as
Documents > Document_Lines > BatchNumbers.
Another thought is to update the field value by UI API when open the OIBT form if possible.
Best Regards
Jane Jing
SAP Business One Forums team -
Can you force a Oracle Update Statement to use a specific database thread?
We are attempting to write a Oracle Update Statement to update a value on all records in a single column. We are updating a column with a value found in a history table. Simple enough. We do it all the time. It works but we are having contention issue with users on the system using the main database threads and updating the same table at the same time. So what is happening is the update uses up all the available database threads and then the users just get timeouts and can't update. What we are trying to determine is can I write it to force the update statement to use a specific thread on the database when it is running?
Here is the current update statement
UPDATE
TASK_DATA TSK
SET
dttSTATUS_WORK_IN_PROGRESS_TIM =
SELECT
HIS.T5
FROM
H2839 HIS
WHERE
TSK.REQUEST_ID = HIS.ENTRYID
AND
HIS.T5 IS NOT NULL
AND
TSK.dttSTATUS_WORK_IN_PROGRESS_TIM IS NULL
Edited by: user11307503 on Oct 21, 2009 3:47 PMthe update uses up all the available database threads and then the users just get timeouts and can't updateI'm not convinced that you're got a clear picture of how Oracle works and what is going on here.
You're updating TASK_DATA, the whole table.
Writers don't block readers - that's a key principle of Oracle.
But if all the other users are trying to update a row or rows in TASK_DATA at the same time as your other process is updating all rows in the table, then there's going to be contention.
This is not about "using up all available database threads" - that's nonsense.
This is (probably) about sessions trying to update rows that your other process has locked.
1. Get a clear picture of what the sessions are waiting on - it's probably TX locks.
2. How many rows are you updating with this update on TASK_DATA?
3. How long does it take? How often do you do it? Is there no quieter time when you can do it? -
OIM New Modules without effecting Oracle Updates
If we add new menu's, jsp's and configurations in xlWebApp.war, will it not get effected when oracle pushes a new update or patch? Even any data changed in files like xlDefaultAdmin.properties and after we put them in jboss, as we are putting them in server directly, it should get effected when oracle releases update.
Can anyone suggest if we need to follow any best practise that makes it unaffected?Any custom code written to existing standard page will obviously be overwritten with the new oracle update/patch on that specific page. You either need to keep your custom code separate from the standard oracle code or you need not apply the patch/update.
-
Oracle update with Web Service
I have a windows service running on IIS5 on a 2000 box. It
runs every two hours and pulls information from an Oracle
9i table. I package this information into an xml Docmument
and use the httpwebrequest to send it to web service
running on another machine. When the windows service
receives a successful send to the other machine it updates
the oracle table. On the second server meanwhile the web
service there takes the xml that was send and updates a
SQL7 table. It records a successfull or failed update to
the sql table and packages up the results(xml) and sends
them back to a web service running on the first machine.
This web service then takes the xml it recieves and
Updates the original Oracle table with a success or
failure. In my code I call the executenonquery and find
that 1 row was updated in the oracle table. I close the
connection and open a new one and pull out the field I
updated and email that result to myself. It shows that the
field was updated. However when I look in the Oracle table
through TOAD, or Quest Central the Table is not updated to
what it should be. The first update from the windows
service worked but the second update from the web service
does not work.
I have used the oledb provider that comes with .net, the microsoft .net provider for Oralce and ODP.NET from Oracle. I have
written the code in the web service to run as a
transaction and as just a straight sql statement. I have
written it to call a stored procedure in Oracle that will
update the table with a commit in the stored procedure. In
all cases my code tells me that the update was successful.
A trace running on Oracle shows my code executing with no
errors. Yet in all cases the Oracle table does not update.
I have since written a second windows service that runs 15
minutes after the first one runs and pulls values from a
temp table and does the updates this way THIS WORKS.
I just want to know why the web service could not update
the table directly. I think that this might be a bug in
either the .net environment or in Oracle. I'm sure both
Microsoft and Oracle will blame each others products but
it would be nice to know why this is happening.
If any other developers run into this problem be warned I
worked on it for three weeks and wrote my code 10 ways to
Sunday and it would not work.
Happy coding people.Let me understand this correctly. You are trying to update a column value twice. First update goes through but second does not and you don't get any error for the second update. If this is the scenario, it is not supposed to work.
Here is the reason. A column can be updated using Dataset only if the original column value in the database has not been changed. This is to avoid the dirty writes. Since the original value has not been changed for the first update, the column value is actually updated in the database. However, for the second update, since the original column value was changed by the first update, second update does not update the column value. -
Hi, I have updated my Oracle 10g (running on Windows XP) from version 10.2.0.1 to 10.2.0.3 and now I am trying to execute the patch: 6430171that solves several bugs.
The problem is that when I run the Opatch application I get the following error:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd %ORACLE_HOME%\opatch
C:\oracle\product\10.2.0\db_1\OPatch>opatch apply C:\GTech10\p6430171_10203_WINN
T\6430171
Invoking OPatch 10.2.0.3.4
Oracle Interim Patch Installer version 10.2.0.3.4
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : C:\oracle\product\10.2.0\db_1
Central Inventory : C:\Program Files\Oracle\Inventory
from : n/a
OPatch version : 10.2.0.3.4
OUI version : 10.2.0.3.0
OUI location : C:\oracle\product\10.2.0\db_1\oui
Log file location : C:\oracle\product\10.2.0\db_1\cfgtoollogs\opatch\opatch2008-
04-25_17-31-16PM.log
ApplySession applying interim patch '6430171' to OH 'C:\oracle\product\10.2.0\db
_1'
Interim patch 6430171 is a superset of the patch(es) [ 5556081 5557962 ] in OH
C:\oracle\product\10.2.0\db_1
OPatch will rollback the subset patches and apply the given patch.
Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following files are active :
C:\oracle\product\10.2.0\db_1\bin\oci.dll
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveF
ilesAndExecutables" failed.
System intact, OPatch will not attempt to restore the system
The following warnings have occurred during OPatch execution:
1) OUI-67078:Interim patch 6430171 is a superset of the patch(es) [ 5556081 555
7962 ] in OH C:\oracle\product\10.2.0\db_1
OPatch failed with error code = 74
C:\oracle\product\10.2.0\db_1\OPatch>Currently there is no database installed on my system and the Oracle Listener is not running, so I don't know what process is using the oci.dll.
I tryed to delete it but I couldn't which confirms that the dll is really in use by something.
Can anyone help me?
Thanks,
Komyg
PS: I have also updated Opatch with the patch: 4898608user9103264 wrote:
in my case it was COM+ System Application locking the oci.dll fileI'm really curious, because I've seen this kind of thing before. You just registered on the forum today, and your very first (and so far only) post is a reply to a message that is over two years old. Not that there is any wrong with that, but I'm just trying to imagine what a brand new member is doing to even find such old threads. I know when I first joined I certainly didn't spend time on archeological expeditions! ;-) -
Migrating from Sybase to Oracle - update() function
In sybase i have an update function that let me know when an specific column id updated after and update statement, does Oracle have something similar??
thanks.Hello <Please Supply Your Name>,
Is this a system function or a user defined function?
Without knowing the full details of what the Sybase "update" function is, there are 3 areas which might be worth investigating.
1) Indentity columns and @@IDENTITY.
Identity columns in Sybase are auto increment columns used mostly for ID's.
@@IDENTITY is a global variable which holds the last updated/inserted identity value in the session your in.
SQL Developer Migration Workbench can automatically migrate both of these.
Identity column are converted to use an Oracle trigger and sequence.
@@IDENTITY is replicated in a sqlserver_utilities package variable. (The identity trigger updates the value).
2) Triggers
If you are not using an identity column in Sybase. But would still like to "catch" a value being updated in your table, you should use a BEFORE/AFTER UPDATE trigger.
You could save this value to a package variable if you wish (much like how we emulate the @@IDENTITY column above).
3) Update Returning Clause
This clause returns the result of an update statement.
http://www.samoratech.com/PLSQL/swArtPLSQLReturn.htm
I hope this helps
Dermot. -
I have a PRE-UPDATE trigger used for cascade updates which warns users how many tables they will be effecting when they make their changes.
DECLARE
v_seq_num NUMBER;
v_tab_num NUMBER;
v_old_mfcode VARCHAR2(8);
v_new_mfcode VARCHAR2(8);
BEGIN
v_old_mfcode := get_item_property('DD_MATFUEL.MFCODE',database_value);
v_new_mfcode := :DD_MATFUEL.MFCODE;
if v_old_mfcode <> v_new_mfcode then
SELECT COUNT(*)
INTO v_seq_num
FROM DD_MATFUELSEQ
WHERE MFCODE = v_old_mfcode;
SELECT COUNT(*)
INTO v_tab_num
FROM DD_TAB_MFCOLLAPSE
WHERE MFCODE = v_old_mfcode;
msg_confirm ('Warning...', v_old_mfcode || ' will be updated to ' || v_new_mfcode || ' on the following tables...'||chr(10) ||
'DD_MATFUELSEQ ' || v_seq_num || ' instances' || chr(10) ||
'DD_TAB_MFCOLLAPSE ' || v_tab_num || ' instances');
end if;
END;---------------------------------------------------------------------------
On the msg_confirm() they have an option for yes or cancel. I was wondering if there was a hidden oracle forms update flag that gets assigned to rows when something has been changed. Since cancel does a rollback it is stopping all the ones they already clicked 'yes' for to rollback as well. I was hoping I could maybe put this in a loop with a commit after each check instead of using a PRE-UPDATE trigger. Any help would be appreicated.
Thanks
Message was edited by:
YacheraYou can create your own hidden non-base-table flag in the record, and set it depending on which button of your alert the user presses.
Then, in the on-update trigger, if they want to proceed, you can issue an Update_Record; statement, or bypass the Update_Record;
Either way, be sure to clear the flag in the on-update trigger.
But I would do all this checking in the when-validate-record trigger, or even sooner, in the On-Lock trigger, so it is processed sooner.
If you use when-validate-record, they will get the message as soon as they leave the record and navigate to the next. If they wish to cancel updating that row, you should set all the values back to their original (use Get_Item_Property(...,Database_Value), and set the record status back to Query_Status.
But even better would be in the On-Lock trigger. Check the counts and issue the alert BEFORE you issue the standard Lock_Record; command. If they want to cancel changes, all you need to do is issue a Raise Form_trigger_failure; and Forms will change the data back to original values. If they want to proceed with changes, then issue the Lock_Record; command.
Doing either of the above will prevent Forms from even trying to update the row when the user wants to save, and visually, the user can see their changes were backed out. -
Using Oracle Update in a JSP page
Hi,
I am working on a web application that allows the user to select data that is pulled from an Oracle table into a JSP page. I want to allow the user to make changes to the table inside the browser and have those change write back to the Oracle table.
Any sample code, resources, direction, etc. would be very helpful.http://www.sitepoint.com/article/java-6-steps-mvc-web-apps
-
Xml to Oracle (Update more than one row)
Hi,
I want to update more than one row in table from .xml file. My xml file is as follows:
<ROOT>
<PROFILE PROFILEMASTER_PKEY="54" DB_MSTR_PKEY="2" PROFILE_NAME="Bhushans" DELIMETER="~" PRE_PROCESSOR="1" POST_PROCESSOR="10" PRE_PROCESSOR_TYPE="1" POST_PROCESSOR_TYPE="2" GROUPID="2" />
<PROFILEDETAILS PROFILEMASTER_PKEY="54" TARGET_SOURCE_TABLE="FM_FEEDVALIDATION_LU" COLUMN_NAME="FEEDVALIDATION_ID" DATA_TYPE="NUMBER" DATA_SIZE="22" START_POSITION="12" END_POSITION="22" COLUMNORDER="1" PROFILEDETAILS_PKEY="399"/>
<PROFILEDETAILS PROFILEMASTER_PKEY="54" TARGET_SOURCE_TABLE="FM_FEEDVALIDATION_LU" COLUMN_NAME="CHANGE_TYPE" DATA_TYPE="VARCHAR2" DATA_SIZE="1" START_POSITION="12" END_POSITION="144" COLUMNORDER="5" PROFILEDETAILS_PKEY="403"/>
<OPTIONS PROFILEMASTER_PKEY ="54" LDR_SYNTX_DTLS_PKEY ="19" OPTIONVALUE="@" PROFILE_CFILE_PKEY="337" />
<OPTIONS PROFILEMASTER_PKEY ="54" LDR_SYNTX_DTLS_PKEY ="19" OPTIONVALUE="~" PROFILE_CFILE_PKEY="336" />
</ROOT>
To update according to xml file, I have written following procedure. My procedure updates the table if u r updating 1 row. If you try to update more than 1 row, I mean .xml file contains more than 1 row then my procedure doesn't work. Please help to solve this problem.
Procedure:
create or replace procedure fm_prc_xml_dup_up
as
f utl_file.file_type;
s varchar2(2000);
v varchar2(3000);
xml XMLType;
v_pmpk number;
v_sdtl_pk number;
chng_typ VARCHAR2(20);
type r1 is ref cursor;
rcur r1;
v1 varchar2(120);
v2 number;
begin
f := utl_file.fopen('CITI', 'S.XML', 'R');
loop
utl_file.get_line(f, s);
v := v || ' ' || s;
end loop;
exception
when no_data_found then
utl_file.fclose(f);
xml := xmltype(v);
SELECT extract(xml, 'ROOT/CHANGE/@CHANGETYPE').getstringval()
INTO CHNG_TYP
FROM DUAL;
UPDATE FM_PROFILEMAST
set db_mstr_pkey = extract(xml, 'ROOT/PROFILE/@DB_MSTR_PKEY').getnumberval(),
profile_name = extract(xml, 'ROOT/PROFILE/@PROFILE_NAME').getstringval(),
file_type = extract(xml, 'ROOT/PROFILE/@FILE_TYPE').getstringval(),
delimiter = extract(xml, 'ROOT/PROFILE/@DELIMETER').getstringval(),
pre_processor = extract(xml, 'ROOT/PROFILE/@PRE_PROCESSOR').getstringval(),
post_processor = extract(xml, 'ROOT/PROFILE/@POST_PROCESSOR').getstringval(),
pre_processor_type = extract(xml, 'ROOT/PROFILE/@PRE_PROCESSOR_TYPE').getstringval(),
post_processor_type = extract(xml, 'ROOT/PROFILE/@POST_PROCESSOR_TYPE').getstringval(),
groupid = extract(xml, 'ROOT/PROFILE/@GROUPID').getstringval(),
change_type = 'U',
change_by = chng_typ,
change_dt = default,
active_flag = default
WHERE profilemaster_pkey = extract(xml, 'ROOT/PROFILE/@PROFILEMASTER_PKEY').getnumberval();
UPDATE FM_PROFILEDET
SET target_source_table = extract(xml, 'ROOT/PROFILEDETAILS/@TARGET_SOURCE_TABLE').getstringval(),
column_name = extract(xml, 'ROOT/PROFILEDETAILS/@COLUMN_NAME').getstringval(),
data_type = extract(xml, 'ROOT/PROFILEDETAILS/@DATA_TYPE').getstringval(),
data_size = extract(xml, 'ROOT/PROFILEDETAILS/@DATA_SIZE').getnumberval(),
start_position = extract(xml, 'ROOT/PROFILEDETAILS/@START_POSITION').getnumberval(),
end_position = extract(xml, 'ROOT/PROFILEDETAILS/@END_POSITION').getnumberval(),
change_by = chng_typ,
change_dt = default,
columnorder = extract(xml, 'ROOT/PROFILEDETAILS/@COLUMNORDER').getstringval(),
column_format = extract(xml, 'ROOT/PROFILEDETAILS/@COLUMN_FORMAT').getstringval(),
nullable = extract(xml, 'ROOT/PROFILEDETAILS/@NULLABLE').getstringval(),
change_type ='U',
active_flag = default
WHERE profiledetails_pkey = extract(xml, 'ROOT/PROFILEDETAILS/@PROFILEDETAILS_PKEY').getstringval();
UPDATE FM_PROFILE_CFILE
SET profilemaster_pkey = extract(xml, 'ROOT/PROFILE/@PROFILEMASTER_PKEY').getnumberval(),
ldr_syntx_dtls_pkey = extract(xml, 'ROOT/OPTIONS/@LDR_SYNTX_DTLS_PKEY').getstringval(),
val = extract(xml, 'ROOT/OPTIONS/@OPTIONVALUE').getstringval(),
change_by = chng_typ,
change_dt = default,
sub_line_seq = extract(xml, 'ROOT/OPTIONS/@SUB_LINE_SEQ').getstringval(),
change_type = 'U',
active_flag = default
where profile_cfile_pkey = extract(xml, 'ROOT/OPTIONS/@PROFILE_CFILE_PKEY').getnumberval();
END;Hi Bhushan,
one where clause is missing in the main update.
update fm_profiledet
set (....)
=(select ....)
where id in (select your profiledetails_pkey from the xml). <--this where clause were missing.
if xml extracting is too slow(xml very large) then you can create a procedure where exract your data from the xml and then update rows in for loop.
something like this
create procedure up_xmls(p_xml xmltype) is
cursor cur_xml(p_xml xmltype) is
select ......<--here you extract your xml
begin
for r_row in cur_xml(p_xml) loop
update fm_profiledet set target_source_table=r_row.target_source_table
where profiledetails_pkey=r_row.profiledetails_pkey;
end loop;
end;this should work:
SQL> drop table fm_profiledet;
Table dropped.
SQL> create table fm_profiledet(
2 profiledetails_pkey number
3 ,target_source_table varchar2(100)
4 ,column_name varchar2(100)
5 ,data_type varchar2(100)
6 ,data_size number
7 ,start_position number
8 ,change_type varchar2(100)
9 )
10 /
Table created.
SQL>
SQL>
SQL> insert into fm_profiledet
2 values(399,'test','test1','test2',1,2,'A')
3 /
1 row created.
SQL>
SQL>
SQL> insert into fm_profiledet
2 values(403,'test3','test4','test5',3,4,'B')
3 /
1 row created.
SQL> insert into fm_profiledet
2 values(443,'test3','test4','test5',3,7,'B')
3 /
1 row created.
SQL>
SQL>
SQL> select * from fm_profiledet;
PROFILEDETAILS_PKEY TARGET_SOU COLUMN_NAM DATA_TYPE DATA_SIZE START_POSITION CHANGE_TYP
399 test test1 test2 1 2 A
403 test3 test4 test5 3 4 B
443 test3 test4 test5 3 7 B
SQL>
SQL> create or replace directory xmldir as '/home/ants';
Directory created.
SQL>
SQL>
SQL>
SQL> update fm_profiledet fm
2 set (target_source_table,column_name, data_type, data_size, start_position,change_type)
3 =(
4 select target_source_table
5 , column_name
6 , data_type
7 , data_size
8 , start_position
9 , change_type
10 from(
11 select
12 extractValue(value(x),'/PROFILEDETAILS/@PROFILEDETAILS_PKEY') profiledetails_pkey
13 , extractValue(value(x),'/PROFILEDETAILS/@TARGET_SOURCE_TABLE') target_source_table
14 , extractValue(value(x),'/PROFILEDETAILS/@COLUMN_NAME') column_name
15 , extractValue(value(x),'/PROFILEDETAILS/@DATA_TYPE') data_type
16 , extractValue(value(x),'/PROFILEDETAILS/@DATA_SIZE') data_size
17 , extractValue(value(x),'/PROFILEDETAILS/@START_POSITION') start_position
18 ,'U' change_type
19 from
20 table(xmlsequence(extract(xmltype(bfilename('XMLDIR','prof.xml')
21 ,nls_charset_id('AL32UTF8'))
22 , '/ROOT/PROFILEDETAILS'))) x
23 ) s
24 where s.profiledetails_pkey=fm.profiledetails_pkey)
25 where
26 fm.profiledetails_pkey in (select
27 extractValue(value(x),'/PROFILEDETAILS/@PROFILEDETAILS_PKEY') profiledetails_pkey
28 from
29 table(xmlsequence(extract(xmltype(bfilename('XMLDIR','prof.xml')
30 ,nls_charset_id('AL32UTF8'))
31 , '/ROOT/PROFILEDETAILS'))) x
32 );
2 rows updated.
SQL>
SQL>
SQL> select * from fm_profiledet;
PROFILEDETAILS_PKEY TARGET_SOU COLUMN_NAM DATA_TYPE DATA_SIZE START_POSITION CHANGE_TYP
399 FM_FEEDVAL FEEDVALIDA NUMBER 22 12 U
IDATION_LU TION_ID
403 FM_FEEDVAL CHANGE_TYP VARCHAR2 1 12 U
IDATION_LU E
443 test3 test4 test5 3 7 B
SQL> spool off;Ants
Message was edited by:
Ants Hindpere -
Doubt in Using Oracle Update Statement
Master Table
Id -- Value
1--'Me'
2--'U'
Table_1
Id ValueMaster_Id
1--'Test'-- 1
2--'Testing'--1
3--'New'--2
Table_2
Id -- table_1_id -- size
1--1--1
2--1--2
3--1--2
4--1--2
5--1--5
30000000-1-7
30000001-2-5
30000002-2-4
30000002-2-7
30000004-2-7
60000000-2-5
There are nearly 3crore records for each id from table1 in the table2.
Now i want to get the sum of the size as per the table1id from the table2 and to update it in the
other table for each master Id.
For this i define the cursor and put it in a normal PL/SQL Block... But it seems to take much more time.
Can anyone suggest me how can i do this.
Thanks,
SymonTry with this --
UPDATE TABLE_DATA B
SET DATA_COUNT = (
SELECT COUNT(table2_id)
FROM TABLE_1,TABLE_2
WHERE TABLE2.TABLE_1_ID = TABLE1.ID
AND TABLE1.MASTER_ID = B.MASTER_ID
GROUP BY TABLE1.MASTER_ID),
DATA_US = (SELECT SUM(vSIZE)
FROM TABLE_1,TABLE_2
WHERE TABLE2.TABLE_1_ID = TABLE1.ID
AND TABLE1.MASTER_ID = B.MASTER_ID
GROUP BY TABLE1.MASTER_ID)
WHERE MASTER_ID in (SELECT DISTINCT MASTER_ID
FROM TABLE_1);N.B.: Not Tested....
Regards.
Satyaki De. -
Oracle UPDATE syntax with JOIN and WHERE clause
I need to update one of my tables, and can't seem to get the syntax right. I've tried a 4 different approaches, but not having any luck. Any help would be greatly appreciated.
Attempt #1: Error: SQL command not properly ended
UPDATE TESTDTA.F4941
SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM
FROM TESTDTA.F4941
INNER JOIN TESTDTA.F4981
ON TESTDTA.F4941.RSSHPN = TESTDTA.F4981.FHSHPN
WHERE TESTDTA.F4941.RSSHPN = 647143
AND TESTDTA.F4941.RSDSTN = 0
AND TESTDTA.F4941.RSADDJ > 110365
AND TESTDTA.F4981.FHCGC1 = 'DIS';
Attempt #2: Error report: SQL Error: ORA-00904: "TESTDTA"."F4981"."FHUOM": invalid identifier 00904. 00000 - "%s: invalid identifier"
UPDATE (SELECT TESTDTA.F4941
FROM TESTDTA.F4941
INNER JOIN TESTDTA.F4981
ON TESTDTA.F4941.RSSHPN = TESTDTA.F4981.FHSHPN
WHERE TESTDTA.F4941.RSSHPN = 647143
AND TESTDTA.F4941.RSDSTN = 0
AND TESTDTA.F4941.RSADDJ > 110365
AND TESTDTA.F4981.FHCGC1 = 'DIS')
SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM
Attempt #3: Error report: SQL Error: ORA-00904: "TESTDTA"."F4941": invalid identifier 00904. 00000 - "%s: invalid identifier"
UPDATE (SELECT *
FROM TESTDTA.F4941
INNER JOIN TESTDTA.F4981
ON TESTDTA.F4941.RSSHPN = TESTDTA.F4981.FHSHPN
WHERE TESTDTA.F4941.RSSHPN = 647143
AND TESTDTA.F4941.RSDSTN = 0
AND TESTDTA.F4941.RSADDJ > 110365
AND TESTDTA.F4981.FHCGC1 = 'DIS')
SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM;
Attempt #4: Error: ORA-00925: missing INTO keyword 00925. 00000 - "missing INTO keyword"
MERGE TESTDTA.F4941
USING TESTDTA.F4981
ON (TESTDTA.F4941.RSSHPN = TESTDTA.F4981.FHSHPN
AND TESTDTA.F4941.RSSHPN = 647143
AND TESTDTA.F4941.RSDSTN = 0
AND TESTDTA.F4941.RSADDJ > 110365
AND TESTDTA.F4981.FHCGC1 = 'DIS'
WHEN MATCHED THEN
UPDATE SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ
,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM;thank you for the attempt, but I get this error trying your method...
Error report:
SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table
01779. 00000 - "cannot modify a column which maps to a non key-preserved table"
*Cause: An attempt was made to insert or update columns of a join view which
map to a non-key-preserved table.
*Action: Modify the underlying base tables directly.
as for the background of what I'm trying to...
I have 2 tables, one that has shipments with no miles (F4941 / Routing Steps), and another that does have miles (F4981 / Freight Audit History).
I want to update the miles & UnitOfMeasure columns for all shipments in the F4941 that currently have 0 miles with the miles found in the F4981 which are connected by Shipment number. Here's my same script, with simpler naming.
UPDATE RoutingSteps
SET RoutingSteps.Miles=FreightAuditHistory.Miles,RoutingSteps.UnitOfMeasure=FreightAuditHistory.UnitOfMeasure
FROM RoutingSteps
INNER JOIN FreightAuditHistory
ON RoutingSteps.ShipmentNumber = FreightAuditHistory.ShipmentNumber
WHERE RoutingSteps.ShipmentNumber = 647143
AND RoutingSteps.Miles = 0
AND RoutingSteps.ShipmentDate > 110365
AND FreightAuditHistory.Category = 'DIS';
hope this helps visualize my intent -
Hi all
Soon I must perform an upgrade of Oracle 10.2.0.2. up to 10.2.0.4 on microsoft windows 2003 R2 64 bit. Befor this I only installed single oracla servers.
This cluster server has also the Oracl failsafe monitor installed.
What I see is that the Oracle softeware is installed on each node on a local volume (drive E:)
Is there some doc explaining what to do? or
1 - must I run the universal installar on every node or just once
2 - how to use the opatch apply, must this be done on every node? or just once
Please has some one some hints
henkhi Shavali
As I'm new to this, were can I find this MOS Doc 223709 ? Normaly I only work with SAP docs.
please respond
Thanks for your rapid response
henk -
Deploy Java and Oracle updates using SCCM 2007 Software Updates
Hi Team,
I am using SCCM 2007 to deploy software updates on all my servers. Now i want deploy updates fro third party tools like Adobe, Java etc..Please suggest me on how to deploy these updates using SCCM.
I am looking for other simple solution than SCUP 2011. Please suggest.
Thanks
SivaHi,
SCUP 2011 would be the way to do it or a package/program. There are commercial software solutions that plugins to configuration Manager like Secunia
http://secunia.com/vulnerability_scanning/corporate/sc2012_plugin/ ,Solarwinds
http://www.solarwinds.com/patch-manager.aspx and Shavlik
http://www.shavlik.com/products/scupdates/ that offer a subscription of updates for these products for a cost of course.
Regards,
Jörgen
-- My System Center blog ccmexec.com -- Twitter
@ccmexec -
ASP syntax for Oracle update with parameters
I am trying to do update on aspx page (not with code behind). I can perform update without parameters but I get ORA-0136 illegal variable name/number when I try to use a parameter in where clause. I added the parameter with tag - <asp:Parameter>
ASPX page is below.
The issue is the UPDATE for last Gridview (Gridview3). If I put a literal in the WHERE clause (i.e., "...WHERE ITEMNUM = '0001'"", then the update works. So, it appears the issue is how I code the parameter.
Thanks...
==============================================
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="OraWeb1.WebForm4" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
vendor quote status
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
<br />
<br />
<asp:Label ID="Label2" runat="server"></asp:Label>
<br />
<br />
</div>
<div>
rfqvendordetail
<asp:GridView ID="GridView1" runat="server" Width="681px" DataSourceID="RFQVendorDetail" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
<AlternatingRowStyle BackColor="#DCDCDC" />
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#0000A9" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#000065" />
</asp:GridView>
<asp:SqlDataSource ID="RFQVendorDetail" runat="server" ConnectionString="<%$ ConnectionStrings:OraContracts %>" ProviderName="<%$ ConnectionStrings:OraContracts.ProviderName %>" SelectCommand="SELECT "ITEMNUM", "MFRNUM", "DESCRIPTION", "UOM", "QTY", "UNITPRICE", "TOTALPRICE" FROM "RFQVENDORDETAILS" WHERE (("VENDORID" = :VENDORID) AND ("RFQID" = :RFQID))">
<SelectParameters>
<asp:SessionParameter Name="VENDORID" SessionField="vendorid" Type="String" />
<asp:SessionParameter Name="RFQID" SessionField="RFQID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<br />
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="testrows" Width="526px">
<AlternatingRowStyle BackColor="#DCDCDC" />
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#0000A9" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#000065" />
<Columns>
<asp:BoundField DataField="RFQID" HeaderText="RFQID" SortExpression="RFQID" />
<asp:BoundField DataField="ITEMNUM" HeaderText="ITEMNUM" SortExpression="ITEMNUM" />
<asp:BoundField DataField="QTY" HeaderText="QTY" SortExpression="QTY" />
<asp:BoundField DataField="UOM" HeaderText="UOM" SortExpression="UOM" />
<asp:TemplateField HeaderText="UNITPRICE" SortExpression="UNITPRICE">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("UNITPRICE") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("UNITPRICE") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="testrows" runat="server" ConnectionString="<%$ ConnectionStrings:OraContracts %>" ProviderName="<%$ ConnectionStrings:OraContracts.ProviderName %>" SelectCommand="select rfqid,itemnum,qty,uom,unitprice from rfqvendordetails WHERE (("VENDORID" = :VENDORID) AND ("RFQID" = :RFQID))">
<SelectParameters>
<asp:SessionParameter Name="VENDORID" SessionField="vendorid" Type="String" />
<asp:SessionParameter Name="RFQID" SessionField="RFQID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<br />
<asp:GridView ID="GridView3" runat="server" DataSourceID="testupd" Width="425px" AutoGenerateColumns="False">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="RFQDETAILID" HeaderText="RFQDETAILID" SortExpression="RFQDETAILID" />
<asp:BoundField DataField="ITEMNUM" HeaderText="ITEMNUM" SortExpression="ITEMNUM" />
<asp:BoundField DataField="DESCRIPTION" HeaderText="DESCRIPTION" SortExpression="DESCRIPTION" />
<asp:BoundField DataField="QTY" HeaderText="QTY" SortExpression="QTY" />
<asp:BoundField DataField="UOM" HeaderText="UOM" SortExpression="UOM" />
<asp:BoundField DataField="UNITPRICE" HeaderText="UNITPRICE" SortExpression="UNITPRICE" />
<asp:BoundField DataField="TOTALPRICE" HeaderText="TOTALPRICE" SortExpression="TOTALPRICE" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="testupd" runat="server" ConnectionString="<%$ ConnectionStrings:OraContracts %>" ProviderName="<%$ ConnectionStrings:OraContracts.ProviderName %>" SelectCommand="SELECT "RFQDETAILID", "ITEMNUM", "DESCRIPTION", "QTY", "UOM", "UNITPRICE", "TOTALPRICE" FROM "RFQVENDORDETAILS" WHERE (("VENDORID" = :VENDORID) AND ("RFQID" = :RFQID))" UpdateCommand="UPDATE CONTRACTS.RFQVENDORDETAILS SET DESCRIPTION = 'Test Desc2' WHERE ITEMNUM = :ITEMNUM">
<SelectParameters>
<asp:SessionParameter Name="VENDORID" SessionField="vendorid" Type="String" />
<asp:SessionParameter Name="RFQID" SessionField="RFQID" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="ITEMNUM" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
<br />
<br />
</div>
<div>
vendor comments</div>
</form>
</body>
</html>
==============================================
Maybe you are looking for
-
HT201272 in app purchase of touristeye did not download - how do I fix this.
Purchased Touristeye Pro from the App. never downloaded. now what ?
-
How to restore iPod when it doesn't appear in the Source List?
About 6 months ago I stupidly wiped my iPod Nano (5th Gen) and reformatted it as fat32. I assumed that when I formatted it back to Mac OS Journaled it would work normally as an iPod again but it doesn't. When it is plugged into my Mac running 10.5.8,
-
Where can I buy a new HardDrive for my PowerBook G4?
I took my PowerBook into the apple store today and the guy did a little test and it came up that my HardDrive is failing to load or something, haha! But because PowerBook's are pretty old now they don't support it anymore. So the big question is: WHE
-
A question about subclasses of visibility
Hello, I read a book named Learning Java it say "as you override methods in a subclass, the overriding method must be at least as visible as the overridden method.While it is possible to take a private method and override it with a public method in a
-
I am trying to count the number of rows in a table and group the results by ID... select ID , COUNT(*) from table1 where date between 01/01/2009 and 01/02/2009 group by id It works fine, except for IDs I have which have no data during the time period