SQL Plus backend process
Suppose I execute a query from SQL Plus.
Now this query takes long amount of time to execute. If I close the SQL Plus session does it also terminiate the process on the Oracle server.
If not than in this case, if want to terminate the query processing what shall I do?
Thanks in advance,
Raja.
if you close sqlplus it doesn't necessarily terminate the backend process immediately.
you should use the ALTER SYSTEM KILL command (it's documented in the manuals)
Similar Messages
-
Hi
Im Trying to include run a sql script thru Process flow.
Am giving the connection specification as
/oracle/oracle10/bin/sqlplus schema_name/password@DB
followed by the copy command...
While executing am getting the error as
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Can anyone help on this?
Regards
Elayou cannot put the copy command (or any commands) after the user/pass
make a sql script with your copy command
run_copy.sql:
copy...
exit
[eof]
sqlplus user/pass@db @RUN_COPY -
Maximum length of SQL*Plus Command?
I'm typing a long query into SQL*Plus (Linux, version 9.2.0.1... yes, I know it's ancient).
If I run this query, all works fine:
select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$')
else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
'UPDATEMYAUDITING_TABLESETTEST_DETAILS='''||GRANTEE||'''WHEREMYAUDIT_REFNO=''A.F
update myauditing_table set test_details='AUDIT_TRAIL is set to: DB' where myaud
it_refno='A.FE';(In other words, is SQL that generates other SQL: if AUDIT_TRAIL is set to something interesting, tell me who has access to the AUD$ table. And it's working fine... the agg_concat function mentioned is simply Tom Kyte's stragg function under another name, as lifted word-for-word from http://www.sqlsnippets.com/en/topic-11591.html)
Now this is what happens if I take out the linebreak after the mention of AUD$, so that the command is submitted as one single line of code:
SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.The error message indicates that the text has been 'split' at the 'AUDIT_TRAIL is set to...' bit, so that "s set to" is being treated as a new command, which is of course syntactically invalid. There is definitely no other change in text between the two versions, apart from the removal of a carriage return before the "else" statement.
Possibly a coincidence, but the first "s" in "s set to" appears at position 258 in the entire text... close to a possible 255 or 256 character limit, perhaps?
The same problem happens whether I run the command as a script (@mysql.sql) or typed in directly into a client SQL*Plus session. Is there some inherent limit to the length of commands that SQL*Plus can process in this version? My code runs fine on 10g and 11g databases/clients, whether it's on one line or two. Anyone know of a bug in 9i regarding this? And if there's a workaround (other than the obvious one of upgrading, of course!)As mentioned, it's choking at the 258th character, not the 240th. Also, it's a SELECT statement, not a COPY command (one relates to the database, the other is an internal SQL*Plus feature). And someone else also kindly pointed out that SQL*Plus has a command limit length (i.e., database-related commands) of 2500 characters. So I don't think that's the issue.
I can be a bit more specific about this one now, though. I've a sequence of Solaris boxes running 9.2.0.1 up, and the results are that 9.2.0.1 is affected; and it's a problem for 9.2.0.7:
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for Solaris: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.And...
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
PL/SQL Release 9.2.0.7.0 - Production
CORE 9.2.0.7.0 Production
TNS for Solaris: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - Production
SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.But in 10.2.0.1, the problem disappears.
I am not sure, but it is perhaps related to metalink note 285913.1, since we did get some ORA-00600: internal error code, arguments: [qernsRowP], [1] errors in the alert log with a slightly different version of the above query. Changing the query obviously alters the test, though, so it may be completely unrelated.
Either way, I think it's definitely a version-specific SQL*Plus bug (though it would be nice if any other 9i owners out there could try it and report back!)
Anyway, the workaround is simply to submit the command on two separate lines, wherever possible. And of course... to upgrade. -
SQL*Plus Change to File While Being Run
Anyone,
Once you execute a file run in SQL*Plus does the entire file get cached by SQLPlus? (i.e. @C:\temp\myfile.sql)
If I change the file C:\temp\myfile.sql while the session is running (long runing script) will it take effect or not?
I was able to open the file make a change and save but not sure if SQLPlus will pick up my change when it gets to the point in the script where I made the change. Since it was already running.
Thanks,
MillerThat is a very bad idea to begin with.
If you made a change at the location that has not yet reached by the SQL*Plus script processing, you could see those changes (again depending upon where and how you do them).
But in most circumstances, the results will be unpredictable (most likely with error messages) since you cannot control what part of the script the SQL*Plus application is currently executing at the moment you decide to make change to the script.
For example, I started with this script:
REM --- Script start ---
prompt "Waiting ..."
begin
dbms_lock.sleep(20) ;
end ;
begin
dbms_output.put_line('This is text') ;
end ;
prompt "Finished..."
REM --- Script end ----And run this within SQL*Plus. While the PL/SQL block was waiting on the sleep call, I removed the first line of the script (the one that starts with the prompt statement) and saved it. Below is the output from this run:
SQL> @test
"Waiting ..."
PL/SQL procedure successfully completed.
SP2-0734: unknown command beginning "ut_line('T..." - rest of line ignored.
SP2-0042: unknown command "end " - rest of line ignored.
PL/SQL procedure successfully completed.
"Finished..."
SQL>I would not consider this as a successful completion of the script.
At this point, you are probably playing with probability and taking chances.
Message was edited by:
Kamal Kishore -
How to start/stop process flow from sql*plus?
Hi,
i know how to start a process flow via sqlplus_exec_template.sql, but i cannot find any information on how to stop (and rollback) a working flow from sql*plus. Any help would be appreciated.
Greetings
Christoph
Message was edited by:
ctrierweilerHi,
I've had a go.
How should I interpret the results of list_requests:
owner_owr@ORKDEV01> @list_requests
====================
DEPLOYMENTS
====================
Audit ID Status Name Date Owner
2706 READY Deployment Fri Nov 11-NOV-05 10:49:59 OWNER_OWR
11 10:46:37 CET 2
005
====================
DEPLOYMENT UNITS
====================
Audit ID Status Name Date Owner
2707 READY Unit0 11-NOV-05 10:49:59 OWNER_OWR
====================
EXECUTIONS
====================
Er zijn geen rijen geselecteerd.
owner_owr@ORKDEV01>
Whilst a process flow is executing the last query will list executions, all of which have status BUSY:
owner_owr@ORKDEV01> @list_requests
====================
DEPLOYMENTS
====================
Audit ID Status Name Date Owner
2706 READY Deployment Fri Nov 11-NOV-05 10:49:59 OWNER_OWR
11 10:46:37 CET 2
005
====================
DEPLOYMENT UNITS
====================
Audit ID Status Name Date Owner
2707 READY Unit0 11-NOV-05 10:49:59 OWNER_OWR
====================
EXECUTIONS
====================
Audit ID Status Name Date Owner
394512 BUSY PF_ONB01 04-MEI-06 09:11:12 OWNER_OWX
395328 BUSY ONB:FULL_PREPARE 04-MEI-06 09:11:55 OWNER_OWR
395324 BUSY PF_ONB01:ONB 04-MEI-06 09:11:55 OWNER_OWR
owner_owr@ORKDEV01>
As an aside, I will attempt to get rid of the READY deployment and deployment unit using deactive_deployment.sql
Now, if I attempt to use deactivate_execution.sql on any of the executions with status BUSY I get:
owner_owr@ORKDEV01> @deactivate_execution
Voer waarde voor 1 in: 396136
declare
FOUT in regel 1:
.ORA-20003: The object is not in a valid state for the requested operation
ORA-06512: at "OWNER_OWR.WB_RTI_EXCEPTIONS", line 94
ORA-06512: at "OWNER_OWR.WB_RTI_EXECUTION", line 774
ORA-06512: at "OWNER_OWR.WB_RT_EXECUTION", line 90
ORA-06512: at line 4
owner_owr@ORKDEV01>
So all the seems to remain is to use abort_exec_request.sql
This does the job, but the script itself hangs.
I think it has to do with the l_stream_id not being checked again after the initial IF. I think it should probably be part of the loop condition as it is again reset in the do_acks inside the loop.
Cheers & thanks,
Colin -
SQL PLUS acitvity in process flow
I looked at other threads and did exactly the same but I am getting a error. Any ideas.
I created a variable as counter.
In sqlplus activity Paramter List I did not do anything. for result code I did the binding as counter which is my variable.In script I put in the below code.
VARIABLE COUNTER_PPAL NUMBER;
DECLARE
BEGIN
SELECT COUNT(*) INTO :COUNTER_PPAL FROM TEMP_TABLE
END;
EXIT :COUNTER_PPAL
The error I am getting is
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 25 08:30:15 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Session altered.
END;
ERROR at line 4:
ORA-06550: line 4, column 4:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
SP2-0670: Internal number conversion failed
Usage: { EXIT | QUIT } [ SUCCESS | FAILURE | WARNING | n |
<variable> | :<bindvariable> ] [ COMMIT | ROLLBACK ]
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining optionsI was missign a semi colon after my select statement.
-
Can we use xml Publisher reporting for sql* Plus in EBS
Hello All,
The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format.
So is it possible to use the xml reporting and make the output as Excel from the word template we design from MSword as we do for rdf(I have done few reports created in rdf to xml publisher reports in EBS and stand alone as well.).
Do the same procedure will suit for Sql*Plus reports tooo or Is there any work around to achieve this.
Thanks and Regards
Balaji.Hi
Thanks for the reply..
I tried to do the follwoing
1. changed the output to xml in the conc. prog.
2. ran the same report but i am getting the follwoing error in the output file
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource
Other reports which are using the Oracle Reports(rdf) as source, i am able to generated the xml as expected....
So my question is whether we can use sql* reports executable and generate xml in the conc.prog.
if any one has used the sql*reports for xml publisher reporting... please let me know, so that if its possible i will check my sql needs some validation or tuning...
thanks in advance
Balaji. -
Hi
We have a big problem, We can't create internal orders, when I run the CREATE INTERNAL ORDER, it finish with ERROR:
Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 134980682.
Review your concurrent request log and/or report output file for more detailed information.
this is the log:
+---------------------------------------------------------------------------+
Purchasing: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
POCISO module: Create Internal Orders
+---------------------------------------------------------------------------+
Current system time is 26-JUL-2013 09:21:09
+---------------------------------------------------------------------------+
+-----------------------------
| Starting concurrent program execution...
+-----------------------------
+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
Begin create internal sales order
Updating Req Headers
14 Reqs selected for processing
Top of Fetch Loop
Source Operating Unit: 82
Selecting Currency Code
Currency Code : MXP
Selecting Order Type
Order Type ID:1001
Selecting Price List from Order Type
Deliver To Location Id: 196
Inserting Header : 3908784
Getting the customer id
Getting the customer id: 15334
Unhandled Exception : ORA-01403: no data found
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+
Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 134980682.
Review your concurrent request log and/or report output file for more detailed information.
+---------------------------------------------------------------------------+
Executing request completion options...
Output file size:
78
Output is not being printed because:
The print option has been disabled for this report.
Finished executing request completion options.
+---------------------------------------------------------------------------+
Concurrent request completed
Current system time is 26-JUL-2013 09:21:14
+---------------------------------------------------------------------------+
Some suggestion for resolve it??
Thanks & Regards.In the document 294932.1 Section 4 there are no pre-installation patches or update for OS RedHat LinuxAS4.
When I type echo $LD_ASSUME_KERNEL it doesn't display any value so do I need to set the LD_Assume_Kernal value manually.
If yes, please let me know the path and command to set the kernel value.
Thanks
Amith -
Connect via SQL*Plus taking more time in Oracle 11 than in 10
Oracle Version
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Productioncurrently migrating from
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - ProductionOS is AIX 5.3 for Oracle 10 and AIX 6.1 for Oracle 11.
We are currently in the process of migrating some applications from Oracle 10 to 11. Our admins have setup a new development system for us with an Oracle 11 instance. Regarding performance the new system behaves more or less the same than our old, e.g. when executing SQLs we notice hardly any performance differences and those we find are slightly in favour of the new system.
But now we discovered that the time it takes to establish a database connection via SQL*Plus is longer on the Oracle 11 system. Running the following code
sqlplus -s user/pw@database <<END
quit
ENDa thousand times takes ~60s under Oracle 10 but ~140s under Oracle 11. This may not seem much but we are running a test framework consisting of a bunch of shell scripts where several thousand connections are openend via SQL*Plus to execute some SQLs, so that even this small time difference results in rather huge difference in total runtime. The SQLs themself require roughly the same time in both databases, as already mentioned above they are in fact slightly faster in Oracle 11.
To analyze the time difference I ran a trace for the connect with the following parameters in sqlnet.ora
TRACE_LEVEL_CLIENT=4
TRACE_UNIQUE_CLIENT=ONand found out that there is a time difference of about 70ms during the connect handshake:
Oracle 10
[22-MAR-2013 12:13:09:595] nscon: doing connect handshake...
[22-MAR-2013 12:13:09:595] nscon: sending NSPTCN packet
[22-MAR-2013 12:13:09:621] nscon: got NSPTRS packet
[22-MAR-2013 12:13:09:621] nscon: sending NSPTCN packetOracle 11
(1) [22-MAR-2013 12:15:26:812] nscon: doing connect handshake...
(1) [22-MAR-2013 12:15:26:812] nscon: sending NSPTCN packet
(1) [22-MAR-2013 12:15:26:906] nscon: got NSPTRS packet
(1) [22-MAR-2013 12:15:26:906] nscon: sending NSPTCN packetUnder Oracle 10 there are 26ms between sending the NSPTCN packet and getting the NSPTRS packet, whereas under Oracle 11 this takes 94ms. I ran the trace again, this time with
TRACE_LEVEL_CLIENT=16and got the following results for the critical interval:
Oracle 10:
[22-MAR-2013 13:17:37:638] nscon: sending NSPTCN packet
[22-MAR-2013 13:17:37:638] nspsend: entry
[22-MAR-2013 13:17:37:638] nspsend: plen=218, type=1
[22-MAR-2013 13:17:37:638] nttwr: entry
[22-MAR-2013 13:17:37:638] nttwr: socket 9 had bytes written=218
[22-MAR-2013 13:17:37:638] nttwr: exit
[22-MAR-2013 13:17:37:638] nspsend: packet dump
<<packet dump removed>>
[22-MAR-2013 13:17:37:638] nspsend: 218 bytes to transport
[22-MAR-2013 13:17:37:638] nspsend: normal exit
[22-MAR-2013 13:17:37:638] nscon: exit (0)
[22-MAR-2013 13:17:37:638] nsdo: nsctxrnk=0
[22-MAR-2013 13:17:37:638] nsdo: normal exit
[22-MAR-2013 13:17:37:638] nsdo: entry
[22-MAR-2013 13:17:37:638] nsdo: cid=0, opcode=68, *bl=512, *what=9, uflgs=0x0, cflgs=0x3
[22-MAR-2013 13:17:37:638] nsdo: rank=64, nsctxrnk=0
[22-MAR-2013 13:17:37:638] nsdo: nsctx: state=2, flg=0x4005, mvd=0
[22-MAR-2013 13:17:37:638] nsdo: gtn=10, gtc=10, ptn=10, ptc=2011
[22-MAR-2013 13:17:37:638] nscon: entry
[22-MAR-2013 13:17:37:638] nscon: recving a packet
[22-MAR-2013 13:17:37:638] nsprecv: entry
[22-MAR-2013 13:17:37:638] nsprecv: reading from transport...
[22-MAR-2013 13:17:37:638] nttrd: entry
[22-MAR-2013 13:17:37:665] nttrd: socket 9 had bytes read=8
[22-MAR-2013 13:17:37:665] nttrd: exit
[22-MAR-2013 13:17:37:665] nsprecv: 8 bytes from transport
[22-MAR-2013 13:17:37:665] nsprecv: tlen=8, plen=8, type=11
[22-MAR-2013 13:17:37:665] nsprecv: packet dump
[22-MAR-2013 13:17:37:665] nsprecv: 00 08 00 00 0B 00 00 00 |........|
[22-MAR-2013 13:17:37:665] nsprecv: normal exit
[22-MAR-2013 13:17:37:665] nscon: got NSPTRS packetOracle 11
(1) [22-MAR-2013 13:33:40:504] nscon: sending NSPTCN packet
(1) [22-MAR-2013 13:33:40:504] nspsend: entry
(1) [22-MAR-2013 13:33:40:504] nspsend: plen=205, type=1
(1) [22-MAR-2013 13:33:40:504] nttwr: entry
(1) [22-MAR-2013 13:33:40:504] nttwr: socket 8 had bytes written=205
(1) [22-MAR-2013 13:33:40:504] nttwr: exit
(1) [22-MAR-2013 13:33:40:504] nspsend: packet dump
<<packet dump removed>>
(1) [22-MAR-2013 13:33:40:505] nspsend: 205 bytes to transport
(1) [22-MAR-2013 13:33:40:505] nspsend: normal exit
(1) [22-MAR-2013 13:33:40:505] nscon: exit (0)
(1) [22-MAR-2013 13:33:40:505] snsbitts_ts: entry
(1) [22-MAR-2013 13:33:40:505] snsbitts_ts: acquired the bit
(1) [22-MAR-2013 13:33:40:505] snsbitts_ts: normal exit
(1) [22-MAR-2013 13:33:40:505] nsdo: nsctxrnk=0
(1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: entry
(1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: normal exit
(1) [22-MAR-2013 13:33:40:505] nsdo: normal exit
(1) [22-MAR-2013 13:33:40:505] nsdo: entry
(1) [22-MAR-2013 13:33:40:505] nsdo: cid=0, opcode=68, *bl=2048, *what=9, uflgs=0x0, cflgs=0x3
(1) [22-MAR-2013 13:33:40:505] snsbitts_ts: entry
(1) [22-MAR-2013 13:33:40:505] snsbitts_ts: acquired the bit
(1) [22-MAR-2013 13:33:40:505] snsbitts_ts: normal exit
(1) [22-MAR-2013 13:33:40:505] nsdo: rank=64, nsctxrnk=0
(1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: entry
(1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: normal exit
(1) [22-MAR-2013 13:33:40:505] nsdo: nsctx: state=2, flg=0x4005, mvd=0
(1) [22-MAR-2013 13:33:40:505] nsdo: gtn=10, gtc=10, ptn=10, ptc=8155
(1) [22-MAR-2013 13:33:40:505] nscon: entry
(1) [22-MAR-2013 13:33:40:505] nscon: recving a packet
(1) [22-MAR-2013 13:33:40:505] nsprecv: entry
(1) [22-MAR-2013 13:33:40:505] nsprecv: reading from transport...
(1) [22-MAR-2013 13:33:40:505] nttrd: entry
(1) [22-MAR-2013 13:33:40:618] nttrd: socket 8 had bytes read=8
(1) [22-MAR-2013 13:33:40:618] nttrd: exit
(1) [22-MAR-2013 13:33:40:618] nsprecv: 8 bytes from transport
(1) [22-MAR-2013 13:33:40:618] nsprecv: tlen=8, plen=8, type=11
(1) [22-MAR-2013 13:33:40:618] nsprecv: packet dump
(1) [22-MAR-2013 13:33:40:618] nsprecv: 00 08 00 00 0B 00 00 00 |........|
(1) [22-MAR-2013 13:33:40:618] nsprecv: normal exit
(1) [22-MAR-2013 13:33:40:618] nscon: got NSPTRS packetAny ideas what could be the reason for this time difference? Something in our network configuration or something else?With local connections - I do not think a TCP packet send from an IP to the same IP, leaves the interface as an actual wire protocol/signal. If I'm correct, then running local connection tests will be mostly useless in checking the actual network infrastructure.
Tests 3 and 4 should be showing the same connection times as the same physical network infrastructure is used - only the direction is reversed in the tests.
I would assume that port settings on the switches and interface settings on the routers treat packets equally in both directions between 2 servers. But this could in part explain the problem if this is not the case. In a case of a router for example, the 1st test's ingress interface is the egress interface of the 2nd test (and vice versa). Configurations can differ substantially between interfaces on the same router. Likewise if there is a firewall - as different rule sets are applied in each test and these rule sets could differ.
So I would not be too quick to state that this is definitely not a network problem. But I agree that based on the small percentage difference (assuming comparable tests), it does not look like a network issue.
The next step is to determine what the delay is between the listener accepting the client connection, and the connection being serviced by a dedicated server process.
This will require listener tracing - tracing the time from when the listener accepted the connection (and parsed the TNS connection string), to handing off the connection to the dedicated server process.
As a comparison test, you can also test shared server connections. Dispatcher processes (of the db instance) register themselves with the listener. The shared server client hand off is thus done to an existing server process - no need for the Listener to make a kernel call to load and initialise an executable image.
Shared connections are typically faster than dedicated connections in this respect.
If there is a major time difference, then it means some kind of issue with the listener dealing with dedicated servers as oppose to dispatcher hand off's. As both connections would have had very similar network transit time - which means the connection time difference is related directly to dealing with a dedicated server connection request and hand off.
You can also substitute the oracle executable with a wrapper - and troubleshoot the actual dedicated server startup. I've only done this with Oracle XE 10.2 though and with local IPC connections. Unsure how robust this will be for testing purposes via TCP using 11g. -
Is the SQL * Plus Worksheet included in the Oracle 10g Express Edition?
Hello All,
I need to install Oracle 10g for a SQL class that I will be taking this year. I will be installing it in my laptop (Pentium 4, 1GB RAM). I was told by the Professor that I needed to have the SQL*Plus Worksheet. I would like to know which version of Oracle do I need to install, and If it includes the SQL*Plus Worksheet.
This is my first time working & installing Oracle, so I would appreciate if anyone could guide me thru this process.
Thanks a lot,
EdNo, it is not included.
However, the same functionality, and more, is in Oracle SQL Developer - also available free and download-able from the same area as Oracle Express Edition.
Ask your prof why he want Worksheet. If it's only for the ability to scroll and correct previous SQL (eg: easier time correcting mistakes), and loading scripts, ask if SQL Developer would be allowed. It's much superior and allows you to use XE, which will not sink your laptop like the EE version will. -
AUTOTRACE stats different in SQL Developer vs SQL Plus
Using SQL Developer 3.2.20.09, database is 11.2 on Linux. I'd like to know why I get different stats when using AUTOTRACE in SQL Developer vs SQL Plus. If I do the following in SQL Developer and in SQL Plus I get a very different set of stats:
set autotrace on
select * from emp;
set autotrace off
I run this with "run worksheet" in SQL Developer and I see this set of stats:
Statistics
4 user calls
0 physical read total multi block requests
0 physical read total bytes
0 cell physical IO interconnect bytes
0 commit cleanout failures: block lost
0 IMU commits
0 IMU Flushes
0 IMU contention
0 IMU bind flushes
0 IMU mbu flush
I do the same in SQL Plus and I see these stats:
Statistics
0 recursive calls
0 db block gets
7 consistent gets
0 physical reads
0 redo size
1722 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
14 rows processed
A very different set of stats. The stats in shown in SQL Plus seem to be much more useful to performance optimization over the one shown in SQL Developer. Why the different set of stats for each? Thanks.Cross-referencing to another recent thread on this topic:
Re: set autotrace on statistics in sqldeveloper (oracle 11g) is wrong -
Unable to connect to an instance using EM but connecting fine with SQL*Plus
Good morning,
I followed these steps (from the 2 Day DBA document):
1. I created a template (including database) from an instance named "orcl" using DBCA, before proceeding to create the template, DBCA informed me that the instance would be shutdown, I told it to proceed.
2. The template was created successfully.
3. I am now unable to log into the orcl instance using EM, yet I can log into that instance without any problems using SQL*Plus.
The Question: Why am I not able to connect to the instance using EM ? and what do I need to do to correct this problem ?
Thank you very much for your help,
John.
PS: in case it may be helpful, the listener, tnsnames and Sqlnet files follow:
# listener.ora Network Configuration File: E:\Oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\Oracle\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
ADR_BASE_LISTENER = E:\Oracle
# tnsnames.ora Network Configuration File: E:\Oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
DBCA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbca.localsite.com)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.localsite.com)
# sqlnet.ora Network Configuration File: E:\Oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)Hi Chinar,
What you suggested solved the problem.
I am grateful for your help but, please, the next time you suggest a process that takes over an hour to complete, let me know beforehand.
thank you for your help, I do appreciate it.
John.
PS: here are the result of the process:
0 07:57 [Oracle] [17G] [608M] E:\Temp>emca -deconfig dbcontrol db -repos drop
STARTED EMCA at Aug 15, 2010 7:58:21 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:
Password for SYS user: abc123
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 15, 2010 7:59:37 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at E:\Oracle\cfgtoollogs\emca\orcl\emca_201
0_08_15_07_58_21.log.
Aug 15, 2010 7:59:38 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be p
erformed.
Aug 15, 2010 7:59:38 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 15, 2010 8:06:59 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 15, 2010 8:07:17 AM
0 08:09 [Oracle] [17G] [355M] E:\Temp>emca -config dbcontrol db -repos create
STARTED EMCA at Aug 15, 2010 8:09:23 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orcl
Listener port number: 1521
Listener ORACLE_HOME [ E:\Oracle\product\11.2.0\dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user: Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
You have specified the following settings
Database ORACLE_HOME ................ E:\Oracle\product\11.2.0\dbhome_1
Local hostname ................ 192.168.3.134
Listener ORACLE_HOME ................ E:\Oracle\product\11.2.0\dbhome_1
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 15, 2010 8:10:51 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at E:\Oracle\cfgtoollogs\emca\orcl\emca_201
0_08_15_08_09_23.log.
Aug 15, 2010 8:11:10 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 15, 2010 8:43:41 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Aug 15, 2010 8:44:09 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepos
itory
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 15, 2010 8:47:39 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Aug 15, 2010 8:48:31 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareL
ib
INFO: Software library configured successfully.
Aug 15, 2010 8:48:31 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibra
ry
INFO: Deploying Provisioning archives ...
Aug 15, 2010 8:53:19 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibra
ry
INFO: Provisioning archives deployed successfully.
Aug 15, 2010 8:53:34 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 15, 2010 8:54:22 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 15, 2010 8:54:38 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 15, 2010 9:12:50 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 15, 2010 9:13:09 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://192.168.3.134:5501/em <<<<
<<<<<<<
Aug 15, 2010 9:14:22 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode wherein Enterprise Manager
data will be encrypted. The encryption key has been placed in the file: E:/Orac
le/product/11.2.0/dbhome_1/192.168.3.134_orcl/sysman/config/emkey.ora. Please
ensure this file is backed up as the encrypted data will become unusable if this
file is lost.
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 15, 2010 9:14:22 AM
0 09:14 [Oracle] [17G] [603M] E:\Temp> -
NEW FEATURE:AUTOTRACE IN SQL*PLUS 3.3(EXECUTION PLAN)
제품 : SQL*PLUS
작성날짜 : 2003-10-07
NEW FEATURE:AUTOTRACE IN SQL*PLUS 3.3
======================================
Autotrace는 SQL*Plus 3.3부터 지원하는 New feature로서 기존에는 init.ora에
SQL_TRACE=TRUE를 setting 후 얻어진 trace file을 TKPROF란 utility를
이용하여 SQL 문의 수행 경로, 각종 통계 정보를 얻었다.
그러나, SQL*Plus 3.3부터는 이것을 간단히 처리할 수 있는 방법을 제공한다.
1. SQL*Plus를 실행하여 scott user로 접속한 후, plan table을 생성한다.
#sqlplus scott/tiger
SQL>@$ORACLE_HOME/rdbms/admin/utlxplan
2. 다음에 sys user에서 PLUSTRACE란 ROLE을 만든다.
SVRMGR>connect internal;
SVRMGR>create role plustrace;
SVRMGR>grant select on v_$sesstat to plustrace;
SVRMGR>grant select on v_$statname to plustrace;
SVRMGR>grant select on v_$session to plustrace;
SVRMGR>grant plustrace to dba with admin option;
SVRMGR>grant plustrace to scott;
비고) 위의 grant 문은 client에 SQL*Plus 3.3이 install되어 있는 경우
C:ORAWIN95\PLUS33\PLUSTRCE.SQL이라는 script에 기록되어 있다.
다음과 같이 실행해 주면 된다.
1> connect sys/manager
2> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
3> grant plustrace to scott;
3. 다음에는 scott user로 connect하여 작업한다.
#sqlplus scott/tiger
SQL>set autotrace on
SQL>select * from emp;
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 TABLE ACCESS (FULL) OF 'EMP'
Statistics
389 recursive calls
5 db block gets
53 consistent gets
12 physical reads
0 redo size
1049 bytes sent via SQL*Net to client
239 bytes received via SQL*Net from client
4 SQL*Net round-trips to/from client
0 sorts (memory)
0 sorts (disk)
13 rows processed
4. 참고로 set autotrace에는 여러가지 option을 부여해 작업할 수도 있다.
예)set autotrace on => Explain plan and statistics.
set autotrace on explain => Explain plan only.
set autotrace traceonly => select된 결과는 빼고 trace만 display
시킴.
set autotrace on statistics=> sql statement execution statistics.
5. 서버 버젼과 상관없다.
Server가 7.2 version 이하일지라도 clinet에 SQL*Plus 3.3이 install되어
있으면 client에서 sqlplus 3.3을 구동시켜 server에 접속하여 위와 같이
작업하면 무리없이 작업이 가능하다.
Reference Documents
<Note:43214.1>Hi Roman,
I don't have an Oracle 9.2 database readily available, but it works fine on 10g XE. Please note 3.1 is not certified with 9i:
http://www.oracle.com/technetwork/developer-tools/sql-developer/certification-096745.html
Regards,
Gary
SQL Developer Team -
How to return a value from sql plus activity
Hi,
I want to return a value from sqlplus activity to a processflow variable.
SQL PLUS activity has a property :"RESULT_CODE", whenever i run the process flow this value is always reurned as 0.
in sqlplus activity i have written some pl/sql block....
for example
begin
end;
exit
i want to do something like
begin
if v=100 then
return 1
else
return 0;
end if;
end;
exit
can some please tell me how can i return value from this pl/sql block to proessflow.
Regards,
RD_RBStable ==> function
input param from table to function. ==> input mapping paramter to store the output from the mapping.
Will this now work. -
I have an unusual problem in SQL PLUS. When the SQL statement is a DML things go fine - no problem, BUT when the SQL statement is a DDL (like creating a database object )the process hangs. Things get more interesting ... if I open another SQL PLUS session and check out, I find that the DDL has done its task. But the first SQL session (where I issued the DDL) is still hanging. If anyone has any idea please do let me know. Any help would be very useful
Thanks
MustafaThe dot is used as like concatenation operator in sqlplus. If you need to add characters to the end of the variabel, you use a dot. If you need to add .chars then you need two dots.
With a dot
SQL> SELECT 'Say &something.not' FROM dual;
Enter value for something: something
old 1: SELECT 'Say &something.not' FROM dual
new 1: SELECT 'Say somethingnot' FROM dual
'SAYSOMETHINGNOT
Say somethingnotand without
SQL> SELECT 'Say &somethingnot' FROM dual;
Enter value for somethingnot: something
old 1: SELECT 'Say &somethingnot' FROM dual
new 1: SELECT 'Say something' FROM dual
'SAYSOMETHING
Say somethingTTFN
John
Maybe you are looking for
-
Hello All, Please don't mind my question if I have violated the purpose of the forum and if so then I am really sorry. I have been working in Oracle Database Administration since almost 3.4 years. I have mostly worked on Dev-Test Platforms where we m
-
Where I can maintain Text symbols and Selection texts?
Hi there, I need to maintain Text symbols and Selection texts of a program manually, but I can't find the tabs of Text symbols and Selection texts. My SAP is ECC6.0. Please help me with that... Thanks a lot, Bing
-
Why wont my brand new macbook pro boot to an external disk?
why wont my brand new macbook pro boot to an external disk? I have the 10.7.4 on both. The MBP came with it so I installed it onto the hard drive i have been using the same way with an older macbook pro but the new MBP does not see the startup disk
-
Trying to get a Excel generation program to work with Office 2010 - and I have issues with Active X nodes - see attachment. I have read similar posts, but not sure how to solve this issue. Thanks Attachments: Broken Excel.JPG 120 KB
-
Older versions of Nano & Shuffle
My question: We have an older version of Shuffle purchased last summer and a new Nano (brand new, but it is an older model...the black 1GB model). The computer they are using is only 192MB RAM so they are using iTunes version 6.0.5.....since the newe