This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> ; | |
1 select | |
2 rownum as n, | |
3 quantity | |
4 from | |
5 ( | |
6 select | |
7 ob.order_book_id, | |
8 v.quantity | |
9 from order_book ob |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- execute immediate q'[ALTER SESSION SET EVENTS 'immediate trace name errorstack level 3']'; | |
--if you only need to write a short message to the trace log, you can execute the following command: | |
execute immediate q'[ | |
alter session set events 'immediate trace("Something is wrong here...")' | |
]'; | |
-- or | |
dbms_adr.write_trace(trace_data => 'alarm alarm!'); | |
dbms_adr_app.write_trace(trace_data => 'alarm alarm!'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> alter session set events 'sql_trace {callstack: fprefix atb} errorstack(1)'; | |
Session altered. | |
SQL> begin execute immediate 'alter table dd add b int';end; | |
2 / | |
PL/SQL procedure successfully completed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> explain plan for select/*+ inline(@"SEL$3") */ * from test_view_with_union_all where num1 = 1; | |
Explained. | |
SQL> @xplan +outline | |
P_FORMAT | |
------------------------ | |
typical +outline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,CASE | |
WHEN "A111" . "ANALYZETIME" IS NULL | |
THEN NULL WHEN ( | |
"SYS" . "DBMS_STATS_INTERNAL" . "GET_TAB_SHARE_TYPE_VIEW" ( | |
"A112" . "FLAGS" | |
,"A111" . "PROPERTY" | |
) = 1 | |
OR "SYS" . "DBMS_STATS_INTERNAL" . "GET_TAB_SHARE_TYPE_VIEW" ( | |
"A112" . "FLAGS" | |
,"A111" . "PROPERTY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
o.owner | |
,o.object_name | |
,o.object_type | |
,o.temporary | |
,so.* | |
,bh.* | |
from dba_objects o, SYS.X$KTSSO so | |
,v$bh bh | |
where so.ktssoobjn=o.object_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> alter session set events '1843 trace name MODIFIED_PARAMETERS'; | |
Session altered. | |
SQL> select * from dual where systimestamp>'2023-55-01 00:00:00'; | |
select * from dual where systimestamp>'2023-55-01 00:00:00' | |
* | |
ERROR at line 1: | |
ORA-01843: not a valid month |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select jt.* | |
from json_table( | |
bfilename('DATA_PUMP_DIR', 'D_20221122.txt'), | |
'$[*]' | |
Columns( | |
N int, | |
Nested path '$.cData[*]' | |
columns( | |
cCode varchar2(5) path '$.cCode[*]' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> set echo on | |
SQL> @tests/partial/test1.sql | |
SQL> drop table t_partial; | |
Table dropped. | |
SQL> create table t_partial ( | |
2 dt date, | |
3 spkey varchar2(1), | |
4 val int, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--drop table t2 purge; | |
create table t2 ( | |
pkey int not null, | |
val int, | |
padding varchar2(100) | |
) | |
partition by range(pkey) ( | |
partition p1_on values less than (2), | |
partition p2_on values less than (3), | |
partition p3_off values less than (4) indexing off, |