Oracle Insert Query
i am writing a Oracle query in which i am inserting a row and the datatypes of columns are String , Integer and Date .
i am fetching values from JTable cell entered by the user .
ny suggestions ?
.
Himanshu_Walia wrote:
i am writing a Oracle query in which i am inserting a row and the datatypes of columns are String , Integer and Date .
i am fetching values from JTable cell entered by the user .
ny suggestions ?
1. Create a design
2. Implement the design in code.
3. Test the code.
Similar Messages
-
Oracle 10g Insert query performs inconsistent as a query vs procedure and p
Database Version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
No error messages....
I am facing a very weird issue that I have a insert statement in a procedure... pretty much
inert
into oracle_Table
SELECT cr.a AS a,
cr.b AS b,
cr.c AS c,
max(d.column_name) as d
FROM "table 1"@Pmo.World Cr,
[email protected] d
WHERE d."a" = cr."column name"
GROUP BY cr.a,
cr.b,
cr.c
@Pmo.World is a database link to a MSSQL...
The problem I am having right now is, every time I run this insert as a query. Everything works as what it should be... However, when I put this insert into a procedure, it inserts nothing...
Simple test Proceudre:
declare
-- Local variables here
i integer;
begin
inert
into oracle_Table
SELECT cr.a AS a,
cr.b AS b,
cr.c AS c,
max(d.column_name) as d
FROM "table 1"@Pmo.World Cr,
[email protected] d
WHERE d."a" = cr."column name"
GROUP BY cr.a,
cr.b,
cr.c
end;
Thinking about character conversion issue I changed the procedure to
inert
into oracle_Table
SELECT to_char(cr.a) AS a,
to_char(cr.b) AS b,
to_char(cr.c) AS c,
max(d.column_name) as d
FROM "table 1"@Pmo.World Cr,
[email protected] d
WHERE d."a" = cr."column name"
GROUP BY cr.a,
cr.b,
cr.c
Then this Inser works in the procedure... however when I revert it back with the original version that doesnt have to_char... it is working still... then I kept it running for few days... since it runs once per day, it was working for the first 2 days and then stopped working the third day... I verified the source table and every time this procedure runs, source tables were not empty...
It is so confusing because if I manually run the insert as a query, it worked every time I ran it... however if I put that into a procedure, it works from time to time..
Any help is highly apprecaited
Edited by: 986006 on Feb 4, 2013 8:51 AM986006 wrote:
Thanks for the hints up... I have updated my post... As I post the test procedure...it is about the exact the same as the insert query... Every time, the insert would actually insert data into the table but every time I run the test procedure, nothing gets inserted in... It sounds unbelievable but it happens... ThanksYou obviously haven't read the FAQ, or at least you haven't bothered doing what it asks. Help us to help you.
Can you recreate the problem with simpler data on your local machine? If so provide create table and insert statements for test data.
Format your code and place between tags.
At the very least post the *exact* SQL or PL/SQL you are trying to run: what you've posted isn't even valid SQL. -
Performance issue with insert query !
Hi ,
I am using dbxml-2.4.16, my node-storage container is loaded with a large document ( 54MB xml ).
My document basically contains around 65k records in the same table ( 65k child nodes for one parent node ). I need to insert more records in to my DB, my insert XQuery is consuming a lot of time ( ~23 sec ) to insert one entry through command-line and around 50sec through code.
My container is indexed with "node-attribute-equality-string". The insert query I used:
insert nodes <NS:sampleEntry mySSIAddress='70011' modifier = 'create'><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
If I modify my query with
into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:sampleTable/NS:sampleEntry[@mySSIAddress='1']
insted of
into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
Time taken reduces only by 8 secs.
I have also tried to use insert "after", "before", "as first", "as last" , but there is no difference in performance.
Is anything wrong with my query, what should be the expected time to insert one record in a DB of 65k records.
Has anybody got any idea regarding this performance issue.
Kindly help me out.
Thanks,
Kapil.Hi George,
Thanks for your reply.
Here is the info you requested,
dbxml> listIndexes
Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
Index: node-attribute-equality-string for node {}:mySSIAddress
2 indexes found.
dbxml> info
Version: Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
Berkeley DB 4.6.21: (September 27, 2007)
Default container name: n_b_i_f_c_a_z.dbxml
Type of default container: NodeContainer
Index Nodes: on
Shell and XmlManager state:
Not transactional
Verbose: on
Query context state: LiveValues,Eager
The insery query with update takes ~32 sec ( shown below )
time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS';insert nodes <NS:sampleEntry mySSIAddress='70000' modifier = 'create' ><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
Time in seconds for command 'query': 32.5002
and the query without the updation part takes ~14 sec ( shown below )
time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
Time in seconds for command 'query': 13.7289
The query :
time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//PMB:sampleTable/PMB:sampleEntry[@mySSIAddress='1000']"
Time in seconds for command 'query': 0.005375
is very fast.
The Updation of the document seems to consume much of the time.
Regards,
Kapil. -
Insert query waiting for in-definite time.
Hi all,
I had a serious problem in my system.
My application gets stuck when trying to insert a huge xml message in a table blob. Usually there is no problem, the insert query goes into wait state just around or after the gather stats running on this table ends.
The table is partitioned one and around 150Gb in size.
I have seen in toad the wait event for this insert query is SQL* net more data from client.
This might be something related to RBS usage of this stuck insert query - in toad the RBS usage start time is same as the end time of gather stats.
But i m unable to figure out why the insert is stuck just after the gather stats ends, i have simulated this issue many times. My oracle version is 9.0.8.
Could somebody help to figure out why this is happening...?My oracle version is 9.0.8.I doubt this is correct.
Post Operating System (OS) name & version for DB server system.
Post results of SELECT * from v$version.
Now CUT the commands & results & PASTE (post) them back here.
ALTER SESSION SET SQL_TRACE=TRUE;
-- invoke the problem SQL here
ALTER SESSION SET SQL_TRACE=FALSE;
now find the trace file within ./udump folder
tkprof <trace_file.trc> trace_results.txt explain=<username>/<password>
post the contents of trace_results.txt back here
when application "gets stuck" run the following SQL from different session
SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess,
id1, id2, lmode, request, type
FROM V$LOCK
WHERE (id1, id2, type) IN
(SELECT id1, id2, type FROM V$LOCK WHERE request>0)
ORDER BY id1, request
/ -
Preventing column to be in insert query when value is null
I'm running DB and have a column defined as GENERATED ALWAYS.
What this means is that I can't use insert into table(col) values (null) because DB2 does not want the column to be part of the insert query at all.
Is there a way to prevent toplink from generating the column when its null?Hi jsutherl,
If I set setIsReadOnly(true) in my session customzier and specify insertable and updateable as false, I get the followine error:
Exception [TOPLINK-46] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: There should be one non-read-only mapping defined for the primary key field [TBL.PERSON.ID].
Descriptor: RelationalDescriptor(com.x.entity.Person--> [DatabaseTable(TBL.PERSON)])
I'm guessing this is because ID is a primary key and its forcing me to have a non-read-only mapping.
But the dillemma is that if I specify a non-read-only mapping than any insert on the table results in Toplink inserting the Java type null for the column which results in the following exception:
Internal Exception: com.ibm.db2.jcc.b.SQLException: A value cannot be specified for column "ID" which is defined as GENERATED ALWAYS.
This is because the field is defined as an IDENTITY in DB2.
Any thoughts? -
Oracle Text query: Escaping characters and specifying progression sequences
How can I combine the escaping of a search string and the specification of progression sequences within an oracle text query
so that in all cases the correct results are delivered (see example below)?
The scenario in which to use this is the following:
+ Database: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
+ Requirement: Hitlist of results ordered by score whereby the different part within
the result list are specified using progression sequences within oracle text query
Example:
create table service_provider (
id number,
name_c varchar(100),
uri_c varchar(255)
insert into service_provider values (1,'ABB Company Mgmt','http://www.abb-company-mgmt.de');
insert into service_provider values (2,'Dr. Abbas Ming','http://www.dr-abbas-ming.de');
insert into service_provider values (3,'SABBATA United','http://www.sabbata-united.de');
insert into service_provider values (4,'ABB','http://www.abb.de');
insert into service_provider values (5,'AND Company Mgmt','http://www.and-company-mgmt.de');
insert into service_provider values (6,'Dr. Andas Ming','http://www.dr-andas-ming.de');
insert into service_provider values (7,'SANDATA United','http://www.sandata-united.de');
insert into service_provider values (8,'AND','http://www.and.de');
Query 1: works correctly in this case
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>abb</seq>' ||
'<seq>abb%</seq>' ||
'<seq>%abb%</seq>' ||
'<seq>fuzzy(abb,1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
delivers
76 4 ABB http://www.abb.de
76 1 ABB Company Mgmt http://www.abb-company-mgmt.de
51 2 Dr. Abbas Ming http://www.dr-abbas-ming.de
26 3 SABBATA United http://www.sabbata-united.de
Query 2: procudes error
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>and</seq>' ||
'<seq>and%</seq>' ||
'<seq>%and%</seq>' ||
'<seq>fuzzy(and,1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
produces ORA-29902, ORA-20000, DRG-50901 because AND is a reserved word in oracle text
So we need escaping ...
Query 3: does not work correctly
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>{abb}</seq>' ||
'<seq>{abb%}</seq>' ||
'<seq>{%abb%}</seq>' ||
'<seq>fuzzy({abb},1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
delivers
76 4 ABB http://www.abb.de
76 1 ABB Company Mgmt http://www.abb-company-mgmt.de
Query 4: does not produce an error, but also does not work correctly
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>{and}</seq>' ||
'<seq>{and%}</seq>' ||
'<seq>{%and%}</seq>' ||
'<seq>fuzzy({and},1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
delivers
76 8 AND http://www.and.de
76 5 AND Company Mgmt http://www.and-company-mgmt.deAnywhere that you just use the word by itself, enclose it in {}, but anywhere that you add % on either side or both don't enclose it in {}. Please see the demonstration below.
SCOTT@10gXE> SELECT * FROM v$version
2 /
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SCOTT@10gXE> create table service_provider
2 (id number,
3 name_c varchar(100),
4 uri_c varchar(255))
5 /
Table created.
SCOTT@10gXE> insert all
2 into service_provider values (1,'ABB Company Mgmt','http://www.abb-company-mgmt.de')
3 into service_provider values (2,'Dr. Abbas Ming','http://www.dr-abbas-ming.de')
4 into service_provider values (3,'SABBATA United','http://www.sabbata-united.de')
5 into service_provider values (4,'ABB','http://www.abb.de')
6 into service_provider values (5,'AND Company Mgmt','http://www.and-company-mgmt.de')
7 into service_provider values (6,'Dr. Andas Ming','http://www.dr-andas-ming.de')
8 into service_provider values (7,'SANDATA United','http://www.sandata-united.de')
9 into service_provider values (8,'AND','http://www.and.de')
10 into service_provider values (9,'EBB','fuzzy test')
11 into service_provider values (10,'OND','fuzzy test')
12 select * from dual
13 /
10 rows created.
SCOTT@10gXE> CREATE INDEX your_index
2 ON service_provider (name_c)
3 INDEXTYPE IS CTXSYS.CONTEXT
4 PARAMETERS ('STOPLIST CTXSYS.EMPTY_STOPLIST')
5 /
Index created.
SCOTT@10gXE> VARIABLE search_string VARCHAR2 (100)
SCOTT@10gXE> EXEC :search_string := 'abb'
PL/SQL procedure successfully completed.
SCOTT@10gXE> COLUMN name_c FORMAT A20 WORD_WRAPPED
SCOTT@10gXE> COLUMN uri_c FORMAT A40
SCOTT@10gXE> select *
2 from (select /*+ FIRST_ROWS */ score(1), this_.*
3 from service_provider this_
4 where CONTAINS
5 (this_.NAME_C ,
6 '<QUERY>
7 <textquery grammar="CONTEXT">
8 <progression>
9 <seq>{' || :search_string || '}</seq>
10 <seq>' || :search_string || '%</seq>
11 <seq>%' || :search_string || '%</seq>
12 <seq>fuzzy({' || :search_string || '},1,100,WEIGHT)</seq>
13 </progression>
14 </textquery>
15 </QUERY>', 1 ) > 0
16 order by score(1) desc, this_.NAME_C)
17 where rownum < 21
18 /
SCORE(1) ID NAME_C URI_C
76 4 ABB http://www.abb.de
76 1 ABB Company Mgmt http://www.abb-company-mgmt.de
51 2 Dr. Abbas Ming http://www.dr-abbas-ming.de
26 3 SABBATA United http://www.sabbata-united.de
4 9 EBB fuzzy test
SCOTT@10gXE> EXEC :search_string := 'and'
PL/SQL procedure successfully completed.
SCOTT@10gXE> /
SCORE(1) ID NAME_C URI_C
76 8 AND http://www.and.de
76 5 AND Company Mgmt http://www.and-company-mgmt.de
51 6 Dr. Andas Ming http://www.dr-andas-ming.de
26 7 SANDATA United http://www.sandata-united.de
5 10 OND fuzzy test
SCOTT@10gXE> -
Hi All,
I encountered a strange problem in oracle PL/SQL.
I have a select query which fetches records from more than one table and it returns n rows lets say 1000 rows.
Note: The tables used in select query have a constant data.At any time i query, it returns the same result.
But when the same select query is used in an insert statement, it inserts less number records, say 300 records instead of 1000 rows.
Note: The destination table does not have any constraints (primary key/not null constraints).
Example
The select query :
SELECT
A.COL1,
A.COL2,
B.COL3,
B.COL2
FROM
TAB1 A
JOIN
TAB2 B
ON (A.COL4 = B.COL4);
The above query returns 1000 rows.
The insert query
INSERT INTO
TAB3
C1,
C2,
C3,
C4
SELECT
A.COL1,
A.COL2,
B.COL3,
B.COL2
FROM
TAB1 A
JOIN
TAB2 B
ON (A.COL4 = B.COL4);
The above insert statement inserts only less rows i.e., 300 instead of 1000.
Can any one help me out to sort this issue.
Thanks in advance.Sorry, I can't replicate the problem. I'm on 10.2.0.4, Windows XP.
SQL> select o.object_id
2 ,o.created
3 ,s.synonym_name
4 ,s.table_name
5 from all_objects o
6 join all_synonyms s
7 on o.object_name = s.synonym_name
8 and o.owner = s.owner
9 ;
20080 rows selected.
SQL> insert into tab3
2 (object_id
3 ,created
4 ,synonym_name
5 ,table_name
6 )
7 select o.object_id
8 ,o.created
9 ,s.synonym_name
10 ,s.table_name
11 from all_objects o
12 join all_synonyms s
13 on o.object_name = s.synonym_name
14 and o.owner = s.owner
15 ;
20080 rows created.
SQL> select count(*) from tab3;
COUNT(*)
20080
SQL> truncate table tab3;
Table truncated.
SQL> create or replace
2 procedure insert_rows as
3 begin
4 insert into tab3
5 (object_id
6 ,created
7 ,synonym_name
8 ,table_name
9 )
10 select o.object_id
11 ,o.created
12 ,s.synonym_name
13 ,s.table_name
14 from all_objects o
15 join all_synonyms s
16 on o.object_name = s.synonym_name
17 and o.owner = s.owner
18 ;
19 commit;
20 end;
21 /
Procedure created.
SQL> exec insert_rows
PL/SQL procedure successfully completed.
SQL> select count(*) from tab3;
COUNT(*)
20080 -
How to retrieve multiple columns using "returning" in the Insert query.
hi,
wanted to know how to retrieve multiple columns using "returning" in the Insert Query.
For retrieving one column we write the query as follows:
Insert into TABLE values(1,2,3,4) returning COLUMN1 into PARAMETER
But can we retrive multiple columns in the same query?
am using oracle 10g and coding in .NETHi,
You can definetely get multiple values from a single query using the 'returning' clause.
Eg : insert into emp (empno, ename, job, deptno) values (7324,'ADAM','MARKETING',30) returning ename, deptno into var1, var2; PN : var1 & var2 to be declared as varchar2 & number respectively.
More insight into the 'RETURNING' clause in this link.
http://www.samoratech.com/PLSQL/swArtPLSQLReturn.htm
Regards,
Bhanu. -
Insert query takes too much time
I have two select clauses as follows:
"select * from employee" This returns me 6000 rows.
& I have next clause as
"select * from employee where userid in(1,2,3,....,3000)"
This returns me 3000 rows.
Now i have to insert the result of above queries into same extended list view of Visual Basic. But the insert for first query takes 11 seconds while second takes 34 sec. We have evaluated this that this time is for insert query & not for select query.
I want to know that even if the Ist query returns 6000 rows it takes lesser time than the second which is
inserting 3000 rows.
We are using Oracle 8.1.7
Thanks in advanceThe first query can do a straight dump of the table. The second select has to compare every userid to a hardcoded list of 3000 numbers. This will take quite a bit longer. Try rewriting it to
select * from employee where userid between 1 and 3000
It will run much faster then the other query. -
Oracle DB Query Generating Invalid Column Index error
Dear All,
Apologies for a question on this rather basic error but I don't understand why i'm experiencing the behaviour described.
The piece of code below connects to a database, runs a query, then attempts to display the contents of the resultset. I understand from other posts on the topic that the query I am executing (INSERT INTO table VALUES (...)) as in the comments below needs to have autocommit disabled to allow me to access the resultset without the transaction closing.
public void runQuery(String query) throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection(database, username, password); con.setAutoCommit(false); Statement st = con.createStatement(); ResultSet rs = st.executeQuery (query); // "select * from user_tables" // "INSERT INTO BH VALUES ('','2.25','Dark Red','Samsonite','4987638762')" while (rs.next()) { System.out.print (rs.getString(1)); // Exception thrown here } con.commit(); st.close(); con.close(); }
I have removed try {} catch {} error handling for clarity.
I am receiving the invalid column index error from the indicated line, which clearly suggest column 1 doesn't exist, however if i run the same query in another tool, something like the following is returned:
Rows Affected
1
The query is being received by the database as the row ends up in the table intact, so I am clearly missing something about how to access the resultset correctly.
I am guessing that I am either misusing/misunderstanding the autocommit option or that the resultset is different to what I am expecting...
Can someone please shed a little light?
Many thanks!
GeorgeOk, I've done a little more digging, and i've come to the conclusion that an INSERT query doesn't return a resultset (or returns an empty one)
Could someone with a little more knowledge confirm this as I've had little luck finding an explicit yes or no from the web!
Many Thanks in advance... -
We have 2 instances of the same program running in parallel. The application inserts data to a database table. one of the instance just hangs when it is trying to insert a query to database i.e. when executing statement.executeUpdate(). We are using a prepared statement to bind all parameter values. Instance 1 keeps running but instance 2 hangs and goes in a waiting state.
Is there any suggestions on how can this issue be investigated. I know a possible reason for hanging could be database lock, but I cannot understand, how it can have a database lock for insert query.
oracle : 9.2.0.7
java : jre 1.4user551224,
Are you running two separate Threads that both use the same database connection?
This issue has been discussed previously in this forum.
Search the forum archives for more details.
It could also be because of a database lock.
Are you trying to insert rows into the same table?
You could try using the FOR UPDATE NOWAIT clause to verify.
Good Luck,
Avi. -
Oracle insert sessions not failover to node1 in 11gr2 suse linux 2 node rac
Hi all,
I already setup a 2 node oracle 11gr2 rac and setup is installaed fine. in baseline testing insert sessions are not failovering to the node1. scenario i do as follows.
Scenario 1 - We ran an insert query in both Nodes and unplugged the Node2 interconnect wires from the server. In which case the Node2 insert session should failover to Node1 without any interruption to the users and the Node2 CRS( Cluster Ready Services) should reboot.
Scenario 2 - We ran the insert queries and unplugged Node 1 interconnections from the server. In this scenario also Node2 CRS should reboot and the insert session should failover to Node2.
please let me know any one have face this issue.
Regards,
Kanchana.Hi,
I already created the TAF service and try to failover it. Node going down and nothing will happen. But the insert query of the client machine will hand and not getting any error. We using VIP for local and remote listner as well. because still not configure the DNS.
Regards,
Kanchana. -
Oracle insert very slow (very urgent)
Hello
I am new to this forum and also new to oracle .... I am woking in a C# 3.5 desktop application
I am Leasing data from socket (1 message per 10 millisecond) and save in queue<T> and then i have a background thread which dequeu the data and perform some calculation and create “insert sql query “ on run time NO STORE PROCEDURE just simple insert query
For example
insert into Product values(0,computer , 125.35);
I pass that insert query to my datalayer which create oracle connection and insert in to a data base. see the code below
using System.Data.OracleClient
class db
OracleConnection conns = null
public static void conn(string dbalias, string userid, string password){
try
string connString = @"server =" + dbalias + ";uid =" + userid + ";password =" + password + ";";
conns = new OracleConnection(connString);
conns.Open();
catch (OracleException e){
Console.WriteLine("Error: " + e);}}
public static void ExecuteCommand(string sqlquery)
try
OracleCommand cmd = new OracleCommand(sqlquery,conns);
cmd.ExecuteNonQuery();
NOW the problem is that inseration in oracle database is very slow please tell me how to solve this issueAdditionally:
How slow? Just one single insert is slow? Or you're doing thousands of inserts that way and they add up to being slow?
If you're doing a bunch of inserts, wrap a bunch of them inside a transaction instead of doing them one by one which will avoid a commit each time as well.
Or use Array binding or Associatve arrays as indicated previously (You'd need to use Oracle's provider for that though ~ ou're using System.Data.OracleClient).
You're using a literal hard coded statement, per your example? Use bind variables.
Also, this forum is for tools that plug in to VS. Problems with ODP.NET code you've written would be more appropriate in the [ODP.NET forum|http://forums.oracle.com/forums/forum.jspa?forumID=146], but that forum deals with problems with Oracle's ODP, not Microsofts (which is in maintenance mode by the way)
Hope it helps,
Greg -
How to increase the performance of an insert query?
Hi,
I am using oracle database for our application where we executes one insert query and need the performance of 300 insert queries to be executed per second.
As of now we are getting only 30/sec.We are not knowing how to tune the database for getting this performance.
we are doing all this though C programming under both linux and solaris environment.
Can u guide me in this issue.
Regards,
vamsi krishnaPerformance tuning issue is not something you can get a straight forward answer for.
You need to look at various aspects of the system to get close to or increase the performance of your application. Tuning just the database might not give you want you want.
So, you need to look at the Application codes, Mermory, Disk IO, etc. Have a look at the Performance Tuning Guide from the Oracle Documentation Library for your Oracle Release and Operating System
http://www.oracle.com/technology/documentation/index.html#previous -
Can i insert doc/pdf/excel file to table using the INSERT query ?
Hi,
can i insert doc or pdf file to table by using INSERT query like we can insert char/numeric values by using INSERT query. But how how can i pass my word file that is placed at some location of my file system ?Is this possible ?EdStevens wrote:
user12222356 wrote:
Hi,
can i insert doc or pdf file to table by using INSERT query like we can insert char/numeric values by using INSERT query. But how how can i pass my word file that is placed at some location of my file system ?Is this possible ?I've never worked with blobs, so don't know if this is the best way or not, but at least it is a starting point.
(Hint: It was the first hit that came up when I googled "how to insert blob into oracle table")
http://arjudba.blogspot.com/2008/06/how-to-insert-blob-dataimage-video-into.html
Did not understood this very first statement:
1)Create Directory Where BLOB resides.
create or replace directory temp as '/oradata2';what is its purpose?
Maybe you are looking for
-
Hi. I'm look for a way to send an Email with an HTML not as an attachment (this I know how to do) but in the email body. The reason is that sometimes we want to allow the user to see the data without having to open their HTML browser. I've searched t
-
Compilation problem in OAS 4.X
When i do the following i get this error. This is one of the examples in OSA 4.X. It may be a classpth problem in NT.Can any body help me. d:\...\myStack>javac ServerStack.java ServerStack.java:16: Package oracle.oas.ejb.* not found in import. import
-
READ TABLE lt_origin_table into lt_target_table WITH KEY user_id= lt_target_table-user_id. This sentense is allowed in function module but can not be written in an OO method , so what can i do ? Now I use 2 loops , Loop at lt_origin_tab
-
How to Retrieve VARIABLE VALUES in an Email Definition Form?
Hi, I have created an email definition. I am getting email notifications on pwd expiry, but I am not able to get the values of the variables that I selected under target & variables part of the form. for eg. I have been getting emails in the followin
-
Lion Time Machine back up to external.
Will TM in Lion wipe out all the files in my external if I use it as a back up disk? The external HDD has Windows NT Filesystem as the format and I use Paragon NTFS write into the disk. I notice that I can select my external as a TM backup now compar