Insert in oracle database issue (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 issue
using System.Data.OracleClient ????
This is the ODP.NET forum.
using Oracle.DataAccess.Client;
and reference something like: C:\Oracle\product\11.1.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll
Assuming your "insert thread" is simply waiting on the next queue entry, why don't you just turn pooling off, open the connection and keep that one connection open?
I am fairly certain the speed issue has nothing to do w/the insert statement vs. stored procedure.
r,
dennis
Similar Messages
-
Stanby database issue : VERY URGENT
we have stanby configured for 9.2.0.4 on AIX 5.2.0.0.Recently we added a new datafile to a tablespace in physical database in the new filesystem. But this path was not reflected in the standby database. NOw what happened is when the standby is put in recover mode it throws error datafile 4 /ora1data/dba/data1.dbf could not be found.
Later we have reflected the same in the standby also, but still we are getting the same error.
We have set standy_file_management=auto
How to go with this
kumaresanIs this a physical or logical standby?
In the case of a physical standby, files added to the primary should be added automatically to the secondary DB.
Perhaps you missed some error message in the standby alert log file. It should tell you what went wrong. -
HI
Oracle database issue in reg to
ora-00607 (internal error occured whilemaking changes to a datablock
ora-600(internal error code agruments 4193, 4997, 4526
while database is shutting down.
oracle 10.2.0.1 upgraded to 10.2.0.3
os Linux eS4
please advise to trouble shoot the issue.
PriyankaOk.. I have experience on this issue.. Post your alert log contents (not all )..
I hoping that anybody had come across with issue so that thy can express their views>>>>>>
This is the not right place to put this post.. To get immediate replies, post it on
General Database Discussions
All the best..
Yusuf -
CATS Issue VERY Urgent..
HI ALL,
BiW PROD is placing CATS data for 2007 in to week 52 2006. Can advise why?
Please advise what would be the error.
Cheers,
SriHi All,
We have a problem for 0CALWEEK in CATS.
FOR 0CALQUARTER
20061 means 1st quarter
20062 means 2ND quarter
20063 means 3RD quarter
20064 means 4TH quarter
FOR 0calweeK:
20061 means 1st WEEK
20062 means 2ND WEEK
20063 means 3RD WEEK
20064 means 4TH WEEK
0CALWEEK is giving problem IN CUBE.
It shows wrongly.
0CALQUARTER 0CAL WEEk
2007 1 2006 52 ( 52 week)
2007 1 2006 52
<b>0CAL WEEk should show 2007 1 instead of 2006 52.</b>
It should show :
0CALQUARTER 0CAL WEEk
2007 1 2007 1 (ist week in 2007)
2007 1 2007 1
we have a routine on 0CAL_week
=====
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
data: employee_md like /bi0/memployee,
employee_wa like /bi0/memployee,
person_md like /bi0/mperson,
PERSON_WA LIKE /BI0/MPERSON.
DATA: G_RECORD_NO LIKE SY-TABIX.
INCLUDE RS_BCT_HR_UPDATE_RULES_GENERAL.
INCLUDE RS_BCT_HR_PAPA_UPDATE_RULES.
$$ end of global - insert your declaration only before this line -
FORM compute_characteristics
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS0CATS_IS_1
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/VZCATST-CALWEEK
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal table "MONITOR", to make monitor entries
data: w_date type d.
data: w_date_check type d.
data: w_numberofdays type p decimals 2.
data: w_numberofweeks type i.
data: w_dayofweek type p.
data: w_first_day_of_sap_calendar type d value '19790101'.
data: check type i.
data: w_year(4) type c.
data: w_weekno(2) type c.
w_date_check = COMM_STRUCTURE-CALDAY.
w_date = w_date_check.
w_date+04(04) = '0101'. " beginning of the year
do.
w_dayofweek = ( ( w_date - w_first_day_of_sap_calendar ) mod 7 ) + 1.
if w_dayofweek = 7. " First sunday(7) of the Current year
exit.
endif.
add 01 to w_date+07(01).
enddo.
w_numberofdays = ( w_date_check - w_date ) + 1.
w_numberofweeks = ceil( w_numberofdays / 7 ).
w_year = w_date_check+0(4).
if w_numberofweeks = 53.
w_numberofweeks = 1.
w_year = w_date_check+0(4) + 1.
endif.
if w_numberofweeks = 0.
w_numberofweeks = 52.
w_year = w_date_check+0(4) - 1.
endif.
w_weekno = w_numberofweeks.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = w_weekno
importing
output = w_weekno.
concatenate w_year w_weekno into RESULT.
result value of the routine
RESULT = .
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
========
This is giving problem from 2007 year only.
We need to check with FI or HR teams , Is there any configuration settings in R/3 side for 0Calweek?
This is production ISSUE. Help me on very Urgent BASIS!!
Thanks & Regards,
Sri. -
How to delete data before insert in oracle database
Hi friends,
I have one scenario.I want to send data from sap to Oracle database.Befor i am inserting data in database table,i want to clean/delete all the records in the table .This interface will run twice in a day.Can any body help me.
SAP-PI-JDBC
Thanks
RaviHi Puneet,
As per u r suggestions,i am using stored procedure.But i am getting following error.
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. MASTERXXXXXX' (structure 'Statement'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'NAME' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)'
I have define below structure.Please check the structure and guide me.
<Statement
Action attribute required
Table
Access
Empname string
Empid string
date date
Type attribute required
EXECUTE----
>Action
Table----
>MASTERXXXXXX
Type----
>char
Please check the above structure andguide me to changes if any requires.
Thanks
Ravi -
Data from oracle to excel very urgent
hi all,
im using servlets for fetching the data from oracle , i want to display the data which i get from orcle in excel sheet. A code snippet regarding this is highly appreciated...
Thanks in advanceJust visit Jakarta's POI API. It is simple. You can create workbooks, cells etc. You can apply styles, insert charts. And its very simple
-
Query Issue(Very Urgent)
Hi,
I have issue with select statement to pull the records from two tables. Here I have two tables one is with Billing Document Items and Service Order Operations.
I have service order as unique field in both tables, When I execute select statement with one service order I got 10 records like
S Ord Oper Billing Document Items
Oper Repair Code Item Oper Repair Code
10 AD01 1 10 AD01
20 AD01 2 20 AD01
30 OT01 3 10 AD01
40 RE01 4 20 AD01
50 RP01 5 20 AD01
6 20 AD01
7 30 OT01
8 40 RE01
9 50 RP01
10 50 RP01
This are the records with same Service order number, and my select statement giving data like
O/P
Service Order = 60001212
OPER ITEM REPAIR TYPE
10 1 AD01
20 1 AD01
10 2 AD01
20 2 AD01
10 3 AD01
20 3 AD01
10 4 AD01
20 4 AD01
10 5 AD01
20 5 AD01
10 6 AD01
20 6 AD01
30 7 OT01
40 8 RE01
50 9 RP01
50 10 RP01
But I need output like this
Item Oper Rep Code
1 10 AD01
2 20 AD01
3 10 AD01
4 20 AD01
5 20 AD01
6 20 AD01
7 30 AD01
8 40 RE01
9 50 RP01
10 50 RP01
Please give me the select statement which gives the above output. I need very urgent please....
Thanks
Robbiehi robert,
The ouput u want is just a little away from the one u r actually getting. it is the two fields OPER and ITEM interchangeably..
U just have to use GROUP BY ITEM..........if u want the desired output with ITEM as first field.
<group-by-clause> → GROUP BY [<column-ref>,*]<column-ref>
if it helps please reward points.
thanks -
Attachment issue --very urgent help required
Hello friends,
1)i have create page and deatal page . requirement is that we have to load required attachments in table region, if not loading required attachments exception will raise. this validation is working fine in create page.
2)same in detail page i loaded required attachments also excepiton is raising.
waht would be cause. i am very new to ADF technology.
very urgent to fix this issue. any one help me out.
Thanks,
vamshi.
Edited by: Krishna Vamshi on Jul 1, 2010 6:14 PMKirshna,
Unfortunately your question is very unclear.
Let me say that if you are asking about OA Framework, you should ask on the OA Framework forum, not here.
also excepiton is raising.It will help if you say what the exception is.
John -
Insert into Oracle Database using C#
Hi Everyone,
I am trying to take data from text box and list box and then insert them to Oracle database:
Text box data:
Oracle = EMPLOYEE_NAME
C# = tbEmployeeName
List box data:
Oracle = EMPLOYEE_GENDER
C# = lbEmployeeGender
Here is my code in C#, can you guys help me with insert statement:
string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "Insert into USER.EMPLOYEE VALUES (tbEmployeeName.Text, lbEmployeeGender.Text)";
int rowsUpdated = cmd.ExecuteNonQuery();
if (rowsUpdated == 0)
MessageBox.Show("Record not inserted");
else
MessageBox.Show("Success!");
conn.Dispose();
Thanks!989630 wrote:
Hi Everyone,
I am trying to take data from text box and list box and then insert them to Oracle database:
Text box data:
Oracle = EMPLOYEE_NAME
C# = tbEmployeeName
List box data:
Oracle = EMPLOYEE_GENDER
C# = lbEmployeeGender
Here is my code in C#, can you guys help me with insert statement:
string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "Insert into USER.EMPLOYEE VALUES (tbEmployeeName.Text, lbEmployeeGender.Text)";
int rowsUpdated = cmd.ExecuteNonQuery();
if (rowsUpdated == 0)
MessageBox.Show("Record not inserted");
else
MessageBox.Show("Success!");
conn.Dispose();
Thanks!Hi,
You'll want to read up on using parameters (also known as bind variables) - these are critical for scalability in an OLTP-type system and helping guard against SQL Injection attacks. There's many sources out there, but here's a link to the Parameter Binding section in the ODP.NET Developer's Guide which is probably a good thing to become familiar with:
http://docs.oracle.com/cd/E11882_01/win.112/e23174/featOraCommand.htm#i1007242
Here's your sample using bind variables:
string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
// Perform insert using parameters (bind variables)
cmd.CommandText = "Insert into USER.EMPLOYEE VALUES (:1, :2)";
// Here's one way to use parameters aka bind variables:
// Create parameters to hold values from front-end
cmd.Parameters.Add(new OracleParameter("1",
OracleDbType.Varchar2,
tbEmployeeName.Text,
ParameterDirection.Input));
cmd.Parameters.Add(new OracleParameter("2",
OracleDbType.Varchar2,
lbEmployeeGender.Text,
ParameterDirection.Input));
int rowsUpdated = cmd.ExecuteNonQuery();
if (rowsUpdated == 0)
MessageBox.Show("Record not inserted");
else
MessageBox.Show("Success!");
conn.Dispose();
// don't forget to perform any clean-up as necessaryNote that I've just typed this into a text editor and not verified, so please excuse any typos you may find.
Also, I've allowed the default of OracleCommand.BindByName=false as I prefer that, though others certainly prefer setting it to "true". See the docs for what this means if you are not sure.
Regards,
Mark -
Controlfile has corrupted and not able to open up the database. Very urgent
Hi All,
I am working on 11gR1 database on linux environment and suddenly the DB went down. I look at the alert log and i am following that guidelines, but i am not able to put the database in mount state and it is thronging error message. Please suggest me in correct way. This is very high priority for me.
I have done below steps.
1.set the environment through . oraenv
2. export ORACLE_SID
3. SQL>startup nomount
ORACLE instance started.
Total System Global Area 4943876096 bytes
Fixed Size 2143944 bytes
Variable Size 2617248056 bytes
Database Buffers 2281701376 bytes
Redo Buffers 42782720 bytes
SQL>alter database mount;
alter database mount
ERROR at line 1:
ORA-00214: control file '/u02/oradata/beacondp/control02.ctl' version 390158 inconsistent with file '/u01/oradata/beacondp/control01.ctl' version 390097
4. SQL>alter system set control_files='/u02/oradata/beacondp/control03.ctl' scope=spfile;
System altered.
SQL>startup restrict
ORA-01081: cannot start already-running ORACLE - shut it down first
5. SQL>alter database mount;
alter database mount
ERROR at line 1:
ORA-00214: control file '/u02/oradata/beacondp/control02.ctl' version 390158 inconsistent with file '/u01/oradata/beacondp/control01.ctl' version 390097
alert log Information:
Thread 1 advanced to log sequence 9261
Current log# 3 seq# 9261 mem# 0: /u02/oradata/beacondp/redo03.log
Tue Sep 13 15:00:14 2011
********************* ATTENTION: ********************
The controlfile header block returned by the OS
has a sequence number that is too old.
The controlfile might be corrupted.
PLEASE DO NOT ATTEMPT TO START UP THE INSTANCE
without following the steps below.
RE-STARTING THE INSTANCE CAN CAUSE SERIOUS DAMAGE
TO THE DATABASE, if the controlfile is truly corrupted.
In order to re-start the instance safely,
please do the following:
(1) Save all copies of the controlfile for later
analysis and contact your OS vendor and Oracle support.
(2) Mount the instance and issue:
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
(3) Unmount the instance.
(4) Use the script in the trace file to
RE-CREATE THE CONTROLFILE and open the database.
Please let me know, how i need to proceed. Major problem is i am not able to put the db in mount state. I have both spfile and pfile.
Thanks in advance.user13162661 wrote:
Thanks Pavan for yoour response, but how can i find, which is good copy of the controlfile?
Now i have 3 controlfiles in spfile or in pfile, Can i directly remove the 1 and 2 controlfiles from pfile and put the 3rd there itself and start the db.
startup pfile='file_path';
Is there any thing i am missing?
Please helpout.
control file '/u02/oradata/beacondp/control02.ctl' version 390158 inconsistent with file '/u01/oradata/beacondp/control01.ctl' version 390097I suspect that control02.ctl is the good one since it has the higher SCN -
Oracle database is very slow and hangs sometime
I am using Oracle 11g on Red hat 5.2 . My RAM is of 6 GB and swap size is 12GB . When I checked the used RAM and Swap area by using $ free -m command it shows that enough free memory (almost 4990 GB and swap space (more than 10GB) is available to use. Then I checked an alert.log file as my database was hanged . It contains error like
1. audit commit delay exceeded oracle
2. unable to spawn jobq slave process oracle
3. maximum number of sessions exceeded
4. could not allocate new resource
My init.ora contains following parameters.
Processes =150
Sessions= 248
Transactions = 220
memory_target = 2400m
sga_max_size = 1500m
sga_target = 0m
So, what steps i should take to stop database hanging and how can i boost slow performance ? Is there any problem with my resource manager and if so then how can i correct it?
Thanks
Tushar LapaniHi,
Please check the query
SELECT username,default_tablespace from dba_users;
Ususally the default tablespace of the user should not be in SYSTEM tablespace. This might cause performance issue. Create a seperate tablespace and alter/assign this user. Also must move all the objects from SYSTEM tablespace to this new tablespace which you created.
For complete details, you can refer the document http://docs.oracle.com/cd/B14117_01/server.101/b10752.pdf -
How to view/edit/delete the user created profile in oracle 9i? Very Urgent
Friends,
I logged in as system in oracle 9i.
SQL> create profile testpro limit
2 idle_time 1;
Profile created.
SQL> alter user scott profile testpro;
User altered.
Then i logged in to sqlplusw as a scott user.
and i waited for 10 mins after that.
sql> select * from cat;
its working......
how come? i have already set a idle time to 1 minute.
Please correct me if im wrong.
Also, how can i view/edit/delete the user created profile.
Thanks & Regards
Sathyguy
Message was edited by:
sathyguyThe resource limits set for a profile are enforced only when you enable resource limitation for the database.
Enabling and Disabling Resource Limits While the Database is Open
ALTER SYSTEM SET RESOURCE_LIMIT = TRUE;
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96521/users.htm#15451
Manu -
Reporting issue (very urgent)
Sr.No Flt.NO ORI- DES Total Flts TS OFF FC KC TS Util FC
1 IT101 BOM-BLR 20 2,680 400 2,280 2,165 230
2 IT103 BOM-BLR 20 3,216 480 2,736 2,322 245
5 IT111 BOM-BLR 24 3,216 480 2,736 2,396 159
Result BOM-BLR 64 9,200 1,360 7,800 6,900 615
6 IT102 BLR-BOM 20 2,680 400 2,280 2,222 140
9 IT110 BLR-BOM 20 3,216 480 2,736 2,543 257
10 IT112 BLR-BOM 24 3,216 480 2,736 2,257 168
Result BLR-BOM 64 9,200 1,360 7,800 7,100 530
Overall Result BOM-BLR-BOM 128 18,400 2,720 15,600
Hi all,
I have the above issue like am working on BI7 reporting and i want a monthly report and the report should be like above.The user want to see the result of each segment in the next row.And after two result rows, one over all result of the two.
When I put a filter in the report then i can see the subresult of single segment but am not able to see the rest of the Segments.It is just showing the filtered segment with the subresult. I want to see all the segments with the subresult and overall result rows.
Can it possible in the report if it is then Plz tell me how to do that.Its urgent
Ensuring points
ThankingI guess ORI-DES is a characteristic. if yes then, Ori-des should come before Flt. NO. and in properties->display, result rows should be 'Always display' to get desire result
-
Modal dialog issue - very urgent
Hi everyone,
i'm working with indesign application under asp.net. I'm using Interop.InDesign.dll. I'm able to open Indesign, but when i try to change UserInteractionLevel, then application returns error "Cannot handle the request because a modal dialog or alert is active." I can't see what modal dialog is opened because, i can't see Indesign window. It is runing in asp.net context.
When i'm opening manually Indesign then none of the modal dialogs is active.
My code:
Type indAppType = Type.GetTypeFromProgID("InDesign.Application");
objInDesign = (InDesign.Application)Activator.CreateInstance(indAppType, true);
objInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;
Do you have any solutuion for it ?
Thanks.
RegardsI have similar issues.
Initially this was caused by the splash dialog that appears the first time a user launches InDesign. Logging in with the credientals used to launch InDesign, and checking the "Dont show again" checkbox cleared it up for me.
Later, I ran into the problem again when InDesign was trying to recover some autosaved files.
This was cleared up by deleting the recovered file information from the accounts AppData folder.
I'm now getting this error again, but so far I dont know why. I have no Idea what modal dialog InDesign is trying to display. How can I tell?
I've got to say, I'm very disapointed with this behavior.
If a programmer sets ScriptPreferences.UserInteractionLevel to InDesign.idUserInteractionLevels.idNeverInteract; this should inform InDesign that its launch is part of an automated process; there is no user available to press anything, and there is likely not a desktop to display anything.
It is far more important for InDesign to respect the ScriptPreferences.UserInteractionLevel than to try and recover documents or display a welcome dialog.
But since we are stuck with this exception, I have the following questions:
Is there a way to programmatically dismiss the splash "Welcome" dialog via script command?
Is there a way to programmatically respond to the dialog that is displayed when InDesign has recovered documents?
Is there a way to programmatically determine what modal dialog is causing the exception? (app.Dialogs is empty)
Thanks! -
Database Rostore - Very Urgent.
Hi guys,
Thanks in advance for help, I'm new to Oracle.
Our clinet has given us the some backup files of its Oracle 8i-
CTL1ORCL.ORA
INIORCL.ORA
LOG1ORCL.ORA
And many .ORA files
1 big .DBF file
I want to restore them.
How to go about it?
1 more question, can we restore them to some higher version of Oracle... 9i/11g?
Can you please explain me it in detail.
I'm also confuse with Defination of Database and Schema in Oracle, I'm basically a sql server dba.
Thanks Again
Regards
Message was edited by:
Mangal9i<<want to restore them.
<<How to go by about it?
what are you trying to do by restore ? Is it a production backup files that you want to restore on a test machine for cloning ? or is it actual recovery of the production db that you are trying to do ?
<< can we restore them to some higher version of Oracle... 9i/11g?>>
no.
<<Can you please explain me it in detail.
You would need to refer the backup and recovery manual or Rama velpuri book on this .
<<I'm also confuse with Defination of Database and Schema in Oracle, I'm basically a saq <<server dba.
Shema : is an user/owner in the database. It may or maynot own database objects (like tables/views/index)
Database : Its your oracle instance (Oracle Memory , Background process) + the database files (in your case CTL1ORCL.ORA ,INIORCL.ORA,LOG1ORCL.ORA , And many .ORA files,1 big .DBF file)
read the concepts manual first few chapters to understand the basics. http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/toc.htm
sbs
Maybe you are looking for
-
My wife and I both have iPhone 5C's. We can sync both phones to the same computer but I cannot download tunes to her iPhone as I am told she needs to set up her own account. Apart from wasting space on the computer surely it must be possible to sync
-
Making Adobe 7.0 as default
Does anyone know how I would make Adobe 7.0 as the default reader instead of 5.0 ?
-
I have a sun Storedge L9 hooked up to a Solaris X86 system and need to update the firmware and moving the loader to a sparc systems isn't feasible at the moment. Is there a Solaris X86 version of tload available i.e. I want to apply the firmware upda
-
How can i get local MAC address?
How can i get local MAC address or desk ID? thanks a lot;
-
Preloader doesnt work after Cacheing -
CS3-AS3 I have an app with a preloader - works fine until the content gets cached, then for some reason wont progress to the next slide - Fullscreen mode is set to full (if that makes a difference). It doesnt seem to happen consistently either. Here