Can I run Alter Session set sql_trace = True in Forms.
Can I run Alter Session set sql_trace = True in Forms.
You could use 'statistics=YES' from command line. If you are using an icon from windows' desktop, then go to properties of that icon and append 'statistics=YES' at the end of TARGET. This basically issues 'ALTER SESSION SET SQL_TRACE TRUE' for the current session.
Can I run Alter Session set sql_trace = True in Forms.
Similar Messages
-
"alter session set sql_trace true" in my pakage is not working
Hi
I have a package with some procedures..in one of my procedure which is executed in the first step i run the :
execute immediate 'alter session set sql_trace true';
this command is executed in debug mode and generate trace file(GOOD) but in running mode i haven't trcce file.
what is wrong in my code ?http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/statements_2013.htm#SQLRF00901 says parameter_name = parameter_value
Regards
Etbin -
Alter system set sql_trace = TRUE error on 9i
returns ORA-02095 specified initialization parameter cannot be modified. I am in sqlplus as system/manager.
So I would need to change it in the init.ora file and restart the server, but on 9 I would need to use CREATE PFILE FROM SPFILE, edit PFILE, and convert it back, and reboot. What am I missing?
Goal is to trace App Server sql statements, so I can't use alter session. And the sys.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION stored procedure doesn't appear to exist.
--Erichttp://download.oracle.com/docs/cd/E11882_01/server.112/e26088/statements_2013.htm#SQLRF00901 says parameter_name = parameter_value
Regards
Etbin -
Ability to perform ALTER SESSION SET SQL TRACE but not all alter clauses
I see that in order to run the ALTER SESSION SET SQL TRACE command, the user should be explicitly granted alter session privilege as the CREATE SESSION privilege alone is not enough. Is there a way to grant the ability to perform ALTER SESSION SET SQL TRACE but not the other clauses such as GUARD, PARALLEL & RESUMABLE?.
Thanks
SathyaIf you are using Oracle 10g and above, you can use DBMS_SESSION.session_trace_enable procedure,
it doesn't require alter session system privilege.
Simple example:
SQL> connect test/test@//192.168.1.2:1521/xe
Connected.
SQL> alter session set tracefile_identifier='my_id';
Session altered.
SQL> alter session set sql_trace = true
2 ;
alter session set sql_trace = true
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> execute dbms_session.session_trace_enable;
PL/SQL procedure successfully completed.
SQL> select * from user_sys_privs;
USERNAME PRIVILEGE ADM
TEST CREATE PROCEDURE NO
TEST CREATE TABLE NO
TEST CREATE SEQUENCE NO
TEST CREATE TRIGGER NO
TEST SELECT ANY DICTIONARY NO
TEST CREATE SYNONYM NO
TEST UNLIMITED TABLESPACE NO
7 rows selected.
SQL> execute dbms_session.session_trace_disable;
PL/SQL procedure successfully completed.
SQL> disconnect
Disconnected from Oracle Database 10g Release 10.2.0.1.0 - Productionand here is result from tkprof:
TKPROF: Release 10.2.0.1.0 - Production on So Paź 23 00:53:07 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: xe_ora_176_my_id.trc
( ---- cut ---- )
select *
from
user_sys_privs
call count cpu elapsed disk query current rows
Parse 1 0.08 0.08 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.01 0.01 0 15 0 7
total 4 0.09 0.09 0 15 0 7
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 61
Rows Row Source Operation
7 HASH GROUP BY (cr=15 pr=0 pw=0 time=11494 us)
7 CONCATENATION (cr=15 pr=0 pw=0 time=4913 us)
0 MERGE JOIN CARTESIAN (cr=4 pr=0 pw=0 time=1169 us)
0 NESTED LOOPS (cr=4 pr=0 pw=0 time=793 us)
0 TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=592 us)
0 INDEX RANGE SCAN I_SYSTEM_PRIVILEGE_MAP (cr=0 pr=0 pw=0 time=0 us)(object id 312)
0 BUFFER SORT (cr=0 pr=0 pw=0 time=0 us)
0 TABLE ACCESS FULL USER$ (cr=0 pr=0 pw=0 time=0 us)
7 NESTED LOOPS (cr=11 pr=0 pw=0 time=3429 us)
9 HASH JOIN (cr=9 pr=0 pw=0 time=2705 us)
9 TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=512 us)
63 TABLE ACCESS FULL USER$ (cr=5 pr=0 pw=0 time=914 us)
7 INDEX RANGE SCAN I_SYSTEM_PRIVILEGE_MAP (cr=2 pr=0 pw=0 time=510 us)(object id 312)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
SQL*Net message from client 2 20.64 20.65
BEGIN dbms_session.session_trace_disable; END;
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.01 0.00 0 0 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 61 -
RMAN-10006: error running SQL statement: alter session set remote_dependenc
Backups are failing with following error
RMAN-00554: initialization of internal recovery manager package failed
RMAN-12001: could not open channel default
RMAN-10008: could not create channel context
RMAN-10002: ORACLE error: ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must be from among MANUAL, AUTO
RMAN-10006: error running SQL statement: alter session set remote_dependencies_mode = signature
Not able to change to signature
SQL> alter session set remote_dependencies_mode=signature;
ERROR:
ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must
be from among MANUAL, AUTO
I dont see MANUAL or AUTO as valid value for this parameter (http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1175.htm#1023124) DB version is 9.2.0
Parameter type
String
Syntax
REMOTE_DEPENDENCIES_MODE = {TIMESTAMP | SIGNATURE}
Default value
TIMESTAMP
Parameter class
Dynamic: ALTER SESSION, ALTER SYSTEM
=======================================
I believe it could be because of following bug
"A PRE-PATCHED ORACLE IMAGE CAN BE INSTALLED IN MEMORY "
Refer: "https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1613505143885559758::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4610411,1,1,1,helvetica"
I appreciate your effort in fixing this issue.
Edited by: user10610722 on Nov 25, 2008 4:37 PMHi:
It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe). -
Execute immediate 'alter session set current_schema = ' failed in PL/SQL
Hi
I am trying to run
EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = TEST ' ;
in a pl/sql block but it is failing.Can anyone update me on this.
CREATE OR REPLACE PROCEDURE test3
IS
A_COUNT NUMBER(15);
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = TEST ' ;
SELECT COUNT(*) INTO A_COUNT FROM (
select id from solutions );
END;
/The user who owns the procedure needs to be granted direct select rights on table test.solutions (not via a role). Still will not help. Look what OP is trying to do. In a stored procedure owned by some user (other than TEST) OP is trying to reference user TEST owned table solution without prefixing it with owner. Something like:
SQL> create table u1.test_tbl(x number);
Table created.
SQL> select * from test_tbl;
select * from test_tbl
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> alter session set current_schema = U1;
Session altered.
SQL> select * from test_tbl;
no rows selected
SQL> However, OP tries to do it in a SP using dynamic SQL to change current schema to test. Such change will occur when SP will be executed, not when is it compiled. At compile time we are still under SP owner's schema and therefore select from solutions implies table solutions owned by SP owner, not by TEST. The only way to make SP compile and work OK is to select from solutions also dynamically:
SQL> select sys_context('userenv','current_schema') from dual
2 /
SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
SCOTT
SQL> CREATE OR REPLACE PROCEDURE test3
2 IS
3 A_COUNT NUMBER(15);
4 BEGIN
5 EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = U1' ;
6 SELECT COUNT(*) INTO A_COUNT FROM (
7 select x from test_tbl );
8 END;
9 /
Warning: Procedure created with compilation errors.
SQL> sho err
Errors for PROCEDURE TEST3:
LINE/COL ERROR
6/1 PL/SQL: SQL Statement ignored
7/15 PL/SQL: ORA-00942: table or view does not exist
SQL> set serveroutput on
SQL> CREATE OR REPLACE PROCEDURE test3
2 IS
3 A_COUNT NUMBER(15);
4 c sys_refcursor;
5 BEGIN
6 EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = U1' ;
7 OPEN C FOR 'SELECT COUNT(*) FROM (select x from test_tbl )';
8 FETCH c INTO A_COUNT;
9 dbms_output.put_line(a_count);
10 CLOSE c;
11 END;
12 /
Procedure created.
SQL> insert into u1.test_tbl select rownum from emp;
14 rows created.
SQL> exec test3
14
PL/SQL procedure successfully completed.
SQL> Obviously, as you noted SP owner must have directly granted select on test3.solutions.
SY. -
Question on alter system set cluster_database = true
11.2.0.2.0 windows 2008
doing a restore to a development RAC I noticed the following. I took the database out of cluster mode on one instance
alter system set cluster_database=false scope=spfile sid='PRD1';
shutdown, start up, do the restore, all good, I go to set cluster_Database=true but had issue instance would only start on one node, I reviewed my notes and found problem was when I set cluster_Database back to true I had typed
alter system set cluster_database=true scope=spfile sid='*';
instead of
alter system set cluster_database=true scope=spfile sid='PRD1';
So issue fixed.
I retested and confirmed '*' wont take. Ive seen many examples of '*' working online and I am sure I have used '*' many times so had just typed it off my head. Anyone explain? probably quotes or something.Any chance there are multiple lines for cluster_database in the spfile ?I had thought maybe this, but confirmed no, it was a fresh build anyway that I was restoring to.
>
- Dump the spfile to a pfile ... edit ... recreate the spfile on all nodes.
>
Im not sure what this will achieve? the spfile is shared on the ASM.
>
As the cluster_database=true is a parameter to enable the RAC configuration. As you typed sid='*' it will try to enable the cluster_database parameter in all the instances(nodes) as it is RAC.
In your case as you did on a single node by specifiying the sid name it will work as it will look only for that sid and enable that particular node.
>
I find this hard to read but I think this misinterprets as well.
Thanks for the contribution. I think Ive found the solution
the asterisk doesnt apparently mean actually "all instances", from here
http://www.comp.dit.ie/btierney/oracle11gdoc/rac.111/b28254/admin.htm#BCEFICEE
and
"Setting SPFILE Parameter Values for Oracle Real Application Clusters"
-- this is a good example of what happened to me
>
*.OPEN_CURSORS=500
prod1.OPEN_CURSORS=1000
Note:
The value before the dot in an SPFILE entry identifies the instance to which the particular parameter value belongs. When an asterisk precedes the dot, the value is applied to all instances that do not have a subsequent, individual value listed in the SPFILE.
For the instance with the Oracle system identifier (SID) prod1, the OPEN_CURSORS parameter is set to 1000 even though it has a database-wide setting of 500. Parameter file entries that have the asterisk (*) wildcard character only affect the instances without an instance-specific entry. This gives you control over parameter settings for instance prod1. These two types of settings can appear in any order in the parameter file.
If another DBA runs the following statement, then Oracle updates the setting on all instances except the instance with SID prod1:
ALTER SYSTEM SET OPEN_CURSORS=1500 sid='*' SCOPE=MEMORY;
>
so when I was on node 1 and ran it for *, I was setting it for all the nodes except the node I was on which holds true from what Ive seen. I'll remember that one. -
Can I run logmnr without setting SUPPLEMENTAL_LOG_DATA_MIN ??
Question is can I run logmnr without setting SUPPLEMENTAL_LOG_DATA_MIN ??
I had a situation where I had to run log miner to undo some changes. I ran the log miner on the database where SUPPLEMENTAL_LOG_DATA_MIN was not set nor the dictionary was specified. I ran the following and was able to get the undo. I am a little confused there, as Oracle doc stats that SUPPLEMENTAL_LOG_DATA_MIN should be set to YES, before you can mine the logs.
These are the commands :
-- set session
ALTER SESSION SET nls_date_format='DD-MM-RRRR hh24:mi:ss';
-- start log minor,change datetime in the below SQL for the time frame
BEGIN
DBMS_LOGMNR.START_LOGMNR(
STARTTIME => '17/07/2012 13:30:00' ,
ENDTIME => '17/07/2012 14:30:00',
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG +
DBMS_LOGMNR.CONTINUOUS_MINE +
DBMS_LOGMNR.COMMITTED_DATA_ONLY +
DBMS_LOGMNR.PRINT_PRETTY_SQL);
END;
-- change table_name to find out undo statements relating to that table
SELECT sql_undo FROM v$logmnr_contents where table_name =upper('machines');
--stop logminor
exec dbms_logmnr.end_logmnr;
Thanks
NirmalIf supplemental logging is not enabled,It would be difficult to identify the user and session information details from V$LOGMNR_CONTENTS views
-
Is it risky to use statement : "alter session set events"
Hi guys,
I am extracting data from cxml documents.
I had to run the following code "EXECUTE IMMEDIATE ('alter session set events ''31156 trace name context forever, level 2'''); " to disable the DTD validation...b4 running any xml extract function on it.
Example:
CREATE OR REPLACE FUNCTION f_test (
p_cxml IN CLOB
RETURN BOOLEAN
AS
l_payload varchar2(100);
l_cXML sys.xmltype := sys.xmltype.createXML(p_cxml);
BEGIN
EXECUTE IMMEDIATE ('alter session set events ''31156 trace name context forever, level 2''');
SELECT EXTRACTVALUE(l_cXML,'/cXML/@payloadID')
INTO l_payload
FROM DUAL;
RETURN TRUE;
DBMS_OUTPUT.PUT_LINE (l_payload);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE (SQLCODE || ' - '||SQLERRM);
RETURN FALSE;
END;
The vlaue of the parameter p_cxml could be
p_cXML clob:=
'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.021/Fulfill.dtd">
<cXML payloadID="[email protected]"
timestamp="2000-10-12T18:39:09-08:00" xml:lang="en-US">
<Request deploymentMode="test">
<OrderRequest>
<OrderRequestHeader orderID="DO1234" orderDate="2000-10-12T18:41:29-08:00"
type="new">
<Total>
<Money currency="USD">187.60</Money>
</Total>
<ShipTo>
<Address>
<Name xml:lang="en">Acme</Name>
<PostalAddress name="default">
<DeliverTo>Joe Smith</DeliverTo>
<DeliverTo>Mailstop M-543</DeliverTo>
<Street>123 Anystreet</Street>
<City>Sunnyvale</City>
<State>CA</State>
<PostalCode>90489</PostalCode>
<Country isoCountryCode="US">United States
</Country>
</PostalAddress>
</Address>
</ShipTo>
</OrderRequestHeader>
</OrderRequest>
</Request>
</cXML>';
It is seems to be working.......................
MY QUESTION IS...
Is there any risk Involved to Using the
EXECUTE IMMEDIATE ('alter session set events ''31156 trace name context forever, level 2'''); statment.
Any Help will be greatly appreciated.
Thanks.Most "set events" are workarounds or needed for Oracle support to do some debugging. Using them is at your own risk, and probably not supported by Oracle if you get into trouble.
-
Insufficient privileges when creating MV with alter session set current_sch
I am getting Insufficient privileges when creating MV with alter session set current_schema=Application schema name. User running the alter session is DBA user. If run as SYSDBA, MV is created successfully. DB Version is 10.2.0.3
I observed similiar issue with regular View also in 9.2.0.6 also.
Any advice is greatly appreciated.
Thanks,
SivaSounds like your management needs a stern lecture on the concept of change management. <g>
I am not debating what you do. I am questioning the logic, or lack thereof, of doing it that way. My recommendation would be to change your procedure to one that:
A. Is more in line with good change management practices.
B. Works. -
While Compile the Package it shows "alter session set plsql_trace=false"
Hi,
My package was working fine and suddenly the status is invalid
so i tried compiling the package that time sql developer got hanged, package also not getting compiled.
i asked DBA to find out the status, they said the following query is running from your machine.
"Alter session set plsql_trace=false". once they kill the session, sql developer got released.
What could be the reason for this?? please help me to resolve this.......
Thanks,
GMost "set events" are workarounds or needed for Oracle support to do some debugging. Using them is at your own risk, and probably not supported by Oracle if you get into trouble.
-
Hi,
our DB in 10g R2 on Win 2003 server has suddenly restarted with this message in alertlog :
ALTER SYSTEM SET awrflush_threshold_metrics=TRUE SCOPE=MEMORY;
I looked for this parameter in oracle documentation, I did not find.
1-what is this parameter for ?
2-How can I see which user connection has altered this parameter ?
Thanks.user522961 wrote:
Hi,
our DB in 10g R2 on Win 2003 server has suddenly restarted with this message in alertlog :
ALTER SYSTEM SET awrflush_threshold_metrics=TRUE SCOPE=MEMORY;
I looked for this parameter in oracle documentation, I did not find.
1-what is this parameter for ?
2-How can I see which user connection has altered this parameter ?
Thanks.I don't think that you should be worried about it as its an undocumented parameter.
http://www.orafaq.com/parms/parm113.htm
Without Auditing, its not possible who changed it(if he really did)?
HTH
Aman.... -
Execute sql command "ALTER SESSION SET..."
How can i execute command "ALTER SESSION SET NLS_DATE_FORMAT ='MM/DD/YYYY'" with JDBC
api.
And by default?
Bye
SteI'm not sure that you want to do this in Java. I would imagine that the NLS_DATE_FORMAT would be set by the Oracle DBA, and shouldn't be changed by a Java app via JDBC.
Besides, when you query the database for a date it's returned as a java.sql.Date, regardless of the settings in the database. Once you have that, you can format it according to your wishes by using java.text.DateFormat and java.text.SimpleDateFormat.
I thought the point was that the JDBC driver took care of ensuring that you got java.sql.Date objects back from queries, regardless of the NSL_DATE_FORMAT setting in the database. -
Alter system or alter session set events
Can we use interchangeably alter session or alter system set events?
Thank you.DBA-ES wrote:
For example this statement
alter session set events '8103 trace name errorstack level 3';
Can it be done at the system level? How to check it?Sure it can be,
SQL*Plus: Release 11.2.0.1.0 Production on Fri Oct 21 15:32:54 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter session set events '8103 trace name errorstack level 3';
Session altered.
SQL> alter system set events '8103 trace name errorstack level 3';
System altered.
SQL>And to check, for the alter system , the statement would be logged in the alert log,
Fri Oct 21 15:31:46 2011
OS Pid: 4656 executed alter system set events '8103 trace name errorstack level 3'
D:\app\aristadba\diag\rdbms\orcl112\orcl112\trace>sqlplus / as sysdbaHTH
Aman.... -
APEX Maps - ALTER SESSION set nls_numeric_characters
How alter session only for nls_numeric_characters in one page. I found problem in apex maps. Not working (marker and Bubles) if I use Polish Application Primary Language
I'm tryied it, but without success
begin
EXECUTE IMMEDIATE 'ALTER SESSION set nls_numeric_characters=". "';
end;
Can you help me ?I do an execute immediate but it doesn't work. Is it something like that?
EXECUTE IMMEDIATE ('alter session set nls_numeric_characters=",."')
Maybe you are looking for
-
Hi, going crazy. Can't get this fixed. Unable to retrieve contact info from synch server. I did re-do synch using one time only replace I-phone info from "contacts" on computer and tried synching after that - no use same error! I saw someone by na
-
Doubt in BDC session method program
hi, I tried to execute this program..i am getting error in the bolded line..can you give suggestions.. REPORT ZPRABA1. TABLES:LFA1. DATA:BEGIN OF IT_ITAB OCCURS 0, LIFNR LIKE LFA1-LIFNR, LAND1 LIKE LFA1-LAND1, NAME1 LIKE LFA1-NAME1, END OF IT_ITAB. D
-
Problems printing a form with Adobe 8 Standard
I created a form using LifeCycle Forms ES and sent it out for use in our company. I have received comments back from Adobe 8 Standard users that when they print the form the form rearranges itself. Has anyone ever run into this issue or know how to
-
Why is my image more pixelated after changing the DPI?
I am creating a magazine for a university project and I have chosen 2 images to be included in one of my articles. I changed the DPI of both images in PhotoShop to 300 DPI and saved them before placing them into my InDesign document but they appear t
-
Please fix Lightroom for Sony A700
The splotchy color noise of the Sony A700 processed in Lightroom (or ACR) needs to be fixed. It has come to the point where nearly any A700 user that participates on a photo forum knows that Lightroom is not a good Raw converter for the A700 at ISO 1