Flow Of Statement Processing?
Apr 18, 2013
SQL Statement Processing Steps:
1. Create a cursor.
2. Parse the statement.
parsing (syntax check, semantic check, privilege check, allocate private sql area, shared pool check (library cache check shared sql area. Here is hard or soft parse)SQL queries submitted to the system first run through the parser, which checks syntax and analyzes semantics. The result of this phase is called a parsed representation of the statement.
This parsed representation is then sent to the optimizer, which handles three main functionality:Transformation, estimation, and execution plan generation.
3. Describe query results.
4. Define query output.
5. Bind variables.
6. Parallelize the statement.
7. Execute the statement.
8. Fetch rows of a query.
9. Close the cursor.
- What stages from the above are included in the 'Query Optimizer Stage'
- Is the parse tree created after doing both syntax check and systematic check as I found notes where they mention it was done before symantic check
- What stages are skipped when doing soft parse vs hard parse
-when mentioned parsed representation, is that the same as parse tree.
I am just trying to understand more the flow of the query processing.
View 1 Replies
ADVERTISEMENT
Oct 6, 2010
I am running one update statement which is running almost one hour still no response.
I would like to know either query is processing or hanging(suppose to finish the update within few minutes).
Is there any way or sql to find either the statement(my update query) is running or hanging.
View 4 Replies
View Related
Jul 9, 2012
explain the flow what exactly is the below function do in detail.
FUNCTION Get_RmtUsr_rec_FUNC (p_MsgType IN VARCHAR2)
RETURN RemoteUser_Rec_Type;FUNCTION Get_RmtUsr_rec_FUNC ( p_MsgType IN VARCHAR2)
RETURN RemoteUser_Rec_Type
IS
[Code]....
View 12 Replies
View Related
Apr 2, 2010
My requirement is ..
SQL> CREATE TABLE EMP (EMPID VARCHAR2(100), U_EMPID VARCHAR2(100));
Table created.
SQL> INSERT INTO EMP VALUES ('DUMMY1','J0001');
1 row created.
SQL> INSERT INTO EMP VALUES ('DUMMY2','J1002');
1 row created.
SQL> INSERT INTO EMP VALUES ('DUMMY3','J1003');
1 row created.
SQL> SELECT * FROM EMP;
EMPID U_EMPID
------------------
DUMMY1 J0001
DUMMY2 J1002
DUMMY3 J1003
in this example empid is dummy empid (which will be issued for contractors), once the contractors are considered to be taken into payroll that u_empid will be updated by HR manually, we need to replace empid with u_empid. then data will become like this.
SQL> SELECT * FROM EMP;
EMPID U_EMPID
---------------------------
DUMMY1 J0001
DUMMY2 J1002
DUMMY3 J1003
J1001 NULL
J1002 NULL
J1003 NULL
now my requirement is there are approximately 60 child tables are there for EMP table, and EMPID is the foreign key for all of them with "on delete cascade" defined on those. Now first i need to create records in all the child tables with actual employee id's (which is u_empid). if the actual id is already exists then just need to update rest of the columns in that table except the EMPID.
Once the records are created with actual empid, then i will issue a delete command to remove dummy employee id's in emp table which will take care of deletion in child tables as well.
I was thinking of two options, one is go with Merge other is write a cursor and handle the update in exception block using when duplicate value on index feature.
View 2 Replies
View Related
Mar 3, 2003
Outside of convoluted loop using the SUBSTR() function, is there an easy way to extract each element from a comma-sepearted list that's passed in to a stored proc?
View 4 Replies
View Related
Nov 26, 2011
I want to make report of processing time for tasks. Every task has several stages and connected with them modification dates. I need calculate total processing time for every task.
In my calculations i have to consider only "working" hours. There is time window table (For example working hours: from 8 a.m to 4 p.m, but can be different thats why i use table with id - different id = different time window). Scripts i used to simulate problem:
create table t (
id number,
s_date date,
e_date date
);
declare
[code]........
table t constrains "working" hours:
12011-04-10 08:00:002011-04-10 16:00:00
12011-04-11 08:00:002011-04-11 16:00:00
...
but could be also
22011-04-10 09:00:002011-04-10 17:00:00
22011-04-11 09:00:002011-04-11 17:00:00
...
table w contains tasks history processing by team (8 hours for tenet, rest time (out of hours defined in table t) of working trough incident should be ignored/omitted in calculations):
12011-04-10 10:00:00
12011-04-11 02:08:16
12011-04-11 16:23:10
22011-04-12 08:12:30
22011-04-13 00:40:15
32011-04-14 09:37:54
32011-04-14 15:54:36
32011-04-15 06:40:44
32011-04-16 09:48:06
32011-04-16 20:06:01
32011-04-18 14:11:29
At the beginning I tried this query, but I don't know how consider/dose time window from table t
select id, change_date,
round( to_number(change_date-lag(change_date) over (partition by id order by change_date))*24*60*60) sec
from w;
12011-04-10 10:00:00
12011-04-11 02:08:1658096 - sholud be 21600 (sum time only for 2011-04-10 16:00:00)
12011-04-11 16:23:1051294 - should be 28800 (sum time only from 2011-04-11 08:00:00 to 2011-04-11 16:00:00)
22011-04-12 08:12:30
22011-04-13 00:40:1559265 - should be 28050 (sum time only from 2011-04-12 08:12:30 to 2011-04-12 16:00:00)
32011-04-14 09:37:54
View 5 Replies
View Related
Oct 16, 2012
I have created a form based on a table and I want to override the processing which inserts/updates the data in the database. I have figured out how to create a new process but I am having trouble referencing the form field data.
If I have a filed call P40_USERNAME how do I reference this in the insert/update statement in the custom process.
View 1 Replies
View Related
Jul 16, 2011
if there is any package provided with DB that would allow me to import XML file and then use XPath to read the data? I need to insert it in proper tables then. I could see packages to create XML files, but I could not see any one to load it from the file. I could see it could be done in Java using XMLDOM, but is there any way of doing this using pure PL/SQL?
View 4 Replies
View Related
Nov 16, 2010
Today, I've got an error:
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Nov 17 09:45:50 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
idle> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/DOISOAT/spfileDOISOAT.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/DOISOAT/spfileDOISOAT.ora
ORA-15077: could not locate ASM instance serving a required diskgroup
idle> exit
SP2-0042: unknown command "exit" - rest of line ignored.
idle> exit
Disconnected
First time, I tried to recreate spfile from pfile, however, it - the errors continued to occur. And I searched in metalink, so, I've got ID 387217.1. I've been beging followed:
1- Check the REQUIRED_RESOURCES was listed by crs_stat -p command, wasn't it? Then, the REQUIRED_RESOURCES did not contain anything
2- Modify by Metalink comment solution:
srvctl modify instance -d <database name> -i <instance name> -s <ASM instance name>
Everything is done, however, I still did not startup database instance. The above error continued, and I force to stop all by crs_stop -all.
View 1 Replies
View Related
Apr 15, 2013
While configuring Data Guard as I have inserted following parameters in SPFILEPRMDB.ora (PRMDB is Primary DB).
*.db_unique_name='PRMDB'
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRMDB,STLDB)'
*.LOG_ARCHIVE_DEST_1='LOCATION=C:oracleproduct10.2.0flash_recovery_areaPRMDBARCHIVELOG VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRMDB'
*.LOG_ARCHIVE_DEST_2='SERVICE=STLDB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STLDB'
[code]....
when I SQL> shutdown immediate; and SQL> Startup;
Oracle gives me following Error
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:ORACLEPRODUCT10.2.0DB_1DATABASE
INITPRMDB.ORA'
When I Restored old spfileprmdb.ora without these parameters then it Starts Up Normally.
View 1 Replies
View Related
Jul 22, 2013
Insert statements from Java are processing very slow i.e 1L records taking 15Mins on every row commit ( Batch insert is not applicable that's why they are committing on every row). - Only 1 index
View 21 Replies
View Related
Aug 2, 2011
I've created a form that is working on the basis of Invoice Processing. There I want to get the sum of all the total of the products * quantity..I'm getting this error
FRM-30425: Summarized database item must reside in a block with Query All Records or Precompute Summaries set to Yes.
Item: TOTAL
Block: SBM_SALES_PRODUCTS
FRM-30085: Unable to adjust form for output.
View 4 Replies
View Related
Feb 25, 2010
I had newly installed oracle 11g database, for testing & learning purpose.
Don't know wht happen to it after successfull installation , I am not able to start database.
Following error is appearing, how to resolve this.
Ora-01078:failure in processing system parameters
I can do only login to idle instance.
View 9 Replies
View Related
Feb 19, 2012
I am learning how to clone database using cold backup.
I have copied all datafile ,redofile and also created control file but I am getting error while inititialisation of my clone(CVM) instance.
SQL> startup nomount pfile=C:ORACLEPRODUCT10.1.0DB_1DATABASEINITCVM.ORA;
LRM-00109: could not open parameter file 'C:ORACLEPRODUCT10.1.0DB_1DATABASE
INITCVM.ORA'
ORA-01078: failure in processing system parameters
but I have copied this file to C:ORACLEPRODUCT10.1.0DB_1DATABASE location but still giving me error.
View 9 Replies
View Related
Oct 4, 2013
db11gxe and apex 4.0 , difference of the processes in these two columns , what is the diff ? the same "Select the category of the process you wish to create:"? there is no difference i can see ?so what is the diff again ?
View 7 Replies
View Related
Apr 28, 2011
I am importing the dump.All the tables are getting imported but when it comes to the part as shown in the error it gets struck there and nothing is showed after.
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
The dumps for which I am doing the import is huge. Its around 46 GB.
select
sl.sid,
sl.serial#,
sl.sofar,
sl.totalwork
from
v$session_longops sl,
v$session s,
dba_datapump_sessions d
where
s.saddr = d.saddr
and s.sid = sl.sid
and s.serial# = sl.serial#
order by start_time;
It showing the lock for two sid's. Should I kill the process and import the dump again? I used below command to import dums
impdp sys/*****@dbname directory=dump_dir dumpfile=prod_dump_%U_200311 SCHEMAS=int_aaa int_bbb int_ccc int_ddd int_eee int_fff
int_ggg int_hhh int_iii int_jjj int_kkk int_lll
View 10 Replies
View Related
Oct 11, 2004
I have a small problem with creating the SPFILE,
These are the commands i had issued :-
1. startup nomount
2. create SPFILE from PFILE ;
Then i got an error :-
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:ORACLEORA92DATABASEINITORCL.ORA'
Ever since this happened i am unable to connect to ORACLE under any schema !
I get the following error : -
SQL> conn scott/tiger
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Warning: You are no longer connected to ORACLE.
WHY DOES THIS HAPPEN AND HOW CAN I OVERCOME IT ?
View 8 Replies
View Related
Dec 6, 2010
I am trying to create standby database on second machine ie. not on my machine. For this i have made added the required parameters in the pfile of the primary database but when I am trying to startup the database using the new pfile I am receiving some errors.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount pfile='E:oracleproduct10.2.0db_1databaseinitden1.ora'
LRM-00101: unknown parameter name 'L0G_ARCHIVE_DEST_2'
ORA-01078: failure in processing system parameters
SQL>
Below are the parameters of my pfile:
*.core_dump_dest='E:oracleproduct10.2.0/admin/den/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='den'
*.db_recovery_file_dest='E:oracleproduct10.2.0/flash_recovery_area'
[code]....
View 10 Replies
View Related
Oct 1, 2013
If I use the conventional path will SQL*Loader process a data file sequentially from top to bottom? I have a file comprised of header and detail records with no value found in the detail records that can be used to relate to the header records. The only option is to derive a header value via a sequence (nextval) and then populate the detail records with the same value pulled from the same sequence (currval). But for this to work SQL*Loader must process the file in the exact same sequence that the data has been written to the data file. I've read through the 11g Oracle® Database Utilities SQL*Loader sections looking for proof that this is what will happen but haven't found this information and I don't want to assume that SQL*Loader will always process the data file records sequentially.
View 9 Replies
View Related
Sep 21, 2012
I have the following code which allows me to disable the "f04" field if pThis is set to 'N'
<script type="text/javascript">
function hide_show_comments(pThis){
//get the curren row index on change
[Code].....
View 9 Replies
View Related
Feb 8, 2011
I successfully created a DB manually with PFILE.
I want the DB to startup with SPFILE at next login.So i fired the below command.
CREATE SPFILE='path/SPFILEPRAGAT.ORA' FROM PFILE='path/file.ora'.
But it shows the error as below:
ORA-01078: failure in processing system parameters
ORA-27040: file create error, unable to create file
OSD-04002: unable to open file
O/S-Error: (os 123) The filename, directory name,or volume label syntax is incorrect.
View 20 Replies
View Related
Mar 8, 2007
I'm using an 'On-Update trigger' to replace the default Form Builder processing for updated records. When I try to change a column in the form I get: ORA- 01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
The on-update doesn't fire. How do I get around this. The block is based on a view.
View 9 Replies
View Related
Aug 10, 2011
HOW to use variable P_TMPLID in following statement
TYPE typ_unrecon IS TABLE OF REC_' || P_TMPLID ||'_UNRECON%ROWTYPE index by binary_integer;
because its throwing error while compiling
and also in statement
FORALL i IN unrecondata.FIRST .. unrecondata.LAST SAVE
EXCEPTIONS
--STRSQL := '';
--STRSQL := ' INSERT INTO REC_' || P_TMPLID ||'_UNRECON VALUES ' || unrecondata(i);
-- EXECUTE IMMEDIATE STRSQL;
INSERT INTO REC_' || P_TMPLID ||'_UNRECON VALUES unrecondata(i);---throwing error on this statement
commit;
--dbms_output.put_line(unrecondata(2).TRANSID);
EXCEPTION
View 2 Replies
View Related
Sep 13, 2013
In the following merge statement in the USINg clause...I am using a select stament of one schema WEDB.But that same select statement should take data from 30 schemeas and then check the condition below condition
ON(source.DNO = target.DNO
AND source.BNO=target.BNO);
I thought that using UNIONALL for select statement of the schemas as below.
SELECT
DNO,
BNO,
c2,
c3,
c4,
c5,
c6,
c7
[code]....
View 5 Replies
View Related
Jan 11, 2012
I am using JDBC to run a few queries from my Java program (multi-threaded one).I am facing an issue where a select statement is blocking a delete statement. From the java code point of view, there are 2 different threads accessing the same tables (whith different DB connection objects).
When the block occurs (which i was able to find out from the java thread dump that there is a lock on oracle), the below is the output:
SQL> SELECT TO_CHAR(sysdate, 'DD-MON-YYYY HH24:MI:SS')
2 || ' User '||s1.username || '@' || s1.machine
3 || ' ( SID= ' || s1.sid || ' ) with the statement: ' || sqlt2.sql_text
||' is blocking the SQL statement on '|| s2.username || '@'
4 5 || s2.machine || ' ( SID=' || s2.sid || ' ) blocked SQL -> '
6 ||sqlt1.sql_text AS blocking_status FROM v$lock l1, v$session s1, v$lock l2 ,
7 v$session s2,v$sql sqlt1, v$sql sqlt2
8 WHERE s1.sid =l1.sid
9 AND s2.sid =l2.sid AND sqlt1.sql_id= s2.sql_id
AND sqlt2.sql_id= s1.prev_sql_id AND l1.BLOCK =1
10 AND l2.request > 0 AND l1.id1 = l2.id1 AND l2.id2 = l2.id2;
[code]...
From the above it can be seen that a select statement is blocking a delete. Unless the select is select for Update, it should not block other statements is not it ?
View 10 Replies
View Related
Feb 6, 2011
I am trying to remodel some data for processing, as unfortunately the original data structure is unsuitable.
My requirements are to recreate the data as a view which can then be query'd directly by the client, and therefore would like to encapsulate all the required transformation within one SQL query.Here is a sample of the table structure i'm faced with:
SQL>
SQL> l
1 create table insane
2 (
3 dept number not null,
4 firstname varchar2(30),
5 surname varchar2(30),
6 city varchar2(30),
[code]....
So, i'd like to be able to turn this on it's head and come out with data that looks something like this (which, for the purpose of this example, is fabricated manually):
SQL> select * from sane
2 /
DEPT_ID PERSON_ID FIRSTNAME
---------- ---------- ------------------------------
SURNAME CITY
------------------------------ ------------------------------
1 30 Peabo
[code]....
View 11 Replies
View Related
Jan 12, 2011
If i inserted the values in table it gets inserting very few rows only.I dont know y it is?
View 15 Replies
View Related
Mar 22, 2013
simply select and works great:
select 'CARAT Issue Open' issue_comment, i.issue_id, i.issue_status, i.issue_title, i.ISSUE_summary ,i.issue_description, i.severity,gcrs.Area_name, gcrs.sector_name,
substr(gcrs.stream_name,1,case when instr(gcrs.stream_name,' (')=0 then 100 else instr(gcrs.stream_name,' (')-1 end) ISSUE_DIVISION,
case when gcrs.STREAM_NAME like 'NON-GT%' THEN 'NON-GT' ELSE gcrs.STREAM_NAME END as ISSUE_DIVISION_2
from table(f_carat_issues_as_of('31/MAR/2013')) i inner join v_gcrs_with_stream gcrs on i.segment_id = gcrs.segment_id
where UPPER(ISSUE_STATUS) like '%OPEN%'
Now I want to callte two columns:ISSUE_DIVISION and ISSUE_DIVISION_2
if they are equal in new columns should be value 1 if are not equal should be 0,how can I do it ?
View 4 Replies
View Related
Jul 17, 2011
I am using Exception when others then body end;
inside the body i can get SQLCODE and SQLERRM but I also need to get the SQL statement that caused the error and I dont know how.
View 39 Replies
View Related
Mar 24, 2009
I have the following query.
sql
Original
- sql Code
SELECT class, COUNT (class)
FROM nv_table
WHERE l_id IN (
SELECT l_id
FROM n_table
WHERE id IN (1234)
GROUP BY class
ORDER BY class
SELECT class, COUNT (class)
FROM nv_table
WHERE l_id IN ( SELECT l_id FROM n_table WHERE id IN (1234)
GROUP BY class
ORDER BY class
It returns two columns: class and the total number of values in that class.
In some cases, there might not be any values under a certain class, so the query won't return anything.
In such a case I want the query to return 0. So what I want to see is:
class:A, COUNT(class):0
I'm trying to use the NVL function here, but either it doesn't work in this context, or it's not the correct syntax the way I'm writing it.
sql
Original
- sql Code
SELECT class, NVL(COUNT (class), 0)
FROM nv_table
WHERE l_id IN (
SELECT l_id
FROM n_table
WHERE id IN (1234)
[Code]....
View 3 Replies
View Related