Tom Kyte

Subscribe to Tom Kyte feed Tom Kyte
These are the most recently asked questions on Ask Tom
Updated: 9 hours 48 min ago

Inner join vs Where

Wed, 2016-07-06 14:46
What is the best practice use "Inner Join" o "Where" Example Example A select DISTINCT(ET.DESCRIPTION) FROM EVENTTYPE ET INNER JOIN EVENTDCO E ON E.EVENTTYPEID = ET.EVENTTYPEID INNER JOIN CONTEXTOPERATION CTX ON E.OPERATIONPK ...
Categories: DBA Blogs

ora-01008, what is the bind variable's name?

Tue, 2016-07-05 20:26
Good time of day, Tom! I run several SQL via DBMS_sql package. Each of that SQL has a set of bind variables. Is there any feature to get a list of variables' names for given SQL? For instance. I wonder to get a list of ':v_name',':p_result' ...
Categories: DBA Blogs

Generate tree paths for hierarchy

Tue, 2016-07-05 20:26
Hello , I have one question which are asked into interview ,To make a tree when user insert a node into table its path get automatically reflected into table Table: Tree ---------------------- node(int) parentNode(int) path(...
Categories: DBA Blogs

LEAST AND GREATEST functions

Tue, 2016-07-05 20:26
Hello, I am trying to use the below SQL : SELECT least ( DECODE (:VAR1, 9999, NULL, :VAR1), DECODE (:VAR2,9999, NULL,:VAR2) ) FROM DUAL; VAR1 & VAR2 need to be NUMBERs (not varchar) the above SQL seems to work for all numbers exce...
Categories: DBA Blogs

trigger

Tue, 2016-07-05 20:26
Hi, my table is with fist name , last name , status. Now the thing is I want to change the status to "APPROVED" as soon as I made the entry in last name, if last name column is empty status should be default lets say "PENDING". I tried it u...
Categories: DBA Blogs

High Soft Parsing

Tue, 2016-07-05 02:06
Hi Tom, We are experiencing high Soft parsing in our databases , though we have enabled session cached cursors and all our SQL/PL SQL blocks using bind variables. We are using Pro C as a host language interact with the back end database. Load...
Categories: DBA Blogs

Can we do a CTAS (Create table as) without the NOT NULL constraints?

Tue, 2016-07-05 02:06
Can we do a CTAS (Create table as) and create the new table without the NOT NULL constraints? select * from v$version; Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE ...
Categories: DBA Blogs

Format the Number for display

Tue, 2016-07-05 02:06
<code>Hello Guru, Q1) I need to display numbers from a database in a specific format. Table Tn (n number(6,3)); The format is 999.999 SQL> insert into tn values( 123.123) ; 1 row created. SQL> insert into tn values(0) ; 1 row created. SQL...
Categories: DBA Blogs

NOLOGGING

Tue, 2016-07-05 02:06
Hi, We have a problem, each day our DR setup is getting about 300 GB of data. We have found this is due to the huge amount of archive logs being written. We have certain bulk operations that are taking place, most of which are from bulk deletes or...
Categories: DBA Blogs

Retreive userid who has taken training more than once

Tue, 2016-07-05 02:06
Hi Tom, I have 2 tables user and training User Userid Username Trainingid 1 A 1 2 B 2 3 C 2 4 D 3 5 E 2 Training Trainingid trainername userid countoftrainings Date 1 X 1 2 ...
Categories: DBA Blogs

oracle text with order by clause

Mon, 2016-07-04 07:46
Dir Sir: I am developing an anti-plagiarism system, I am using Oracle text to search for my text. my corpus contains more than 30 million of records. I want to check my document against this corpus. I want to fetch the highest score only, not all...
Categories: DBA Blogs

Can be differentiate cascade delete or statement(delete from query) inside the table trigger

Mon, 2016-07-04 07:46
Hi Tom, i have question about cascade delete, How its work internally and how to differentiate that row by delete from delete statement on child table or row deleted by a cascade delete. because i am facing problem and try to solve Mutating error...
Categories: DBA Blogs

Partitioning Questions

Mon, 2016-07-04 07:46
Hello I would like to post a question related to which partitioning I can go for based on the below scenario. I have 2 tables named table1 and table2. Both the tables are having customer I'd and user id column. The hierarchy is multiple users...
Categories: DBA Blogs

the maximum number of logical operators(AND/OR) can be used in where clause

Mon, 2016-07-04 07:46
Hi Tom, How many maximum number of logical operators(either AND/OR) are allowed in where clause in select statement. eg select * from employees where first_name = 'abc' or first_name = 'cde' or first_name = 'def' or .... .... .......
Categories: DBA Blogs

Composite partition

Mon, 2016-07-04 07:46
Hi Team, We have a requirement to use composite partition for few partition from the list of partition. Please consider below create team where in we are using composite partition using 2 columns RELATED_CLOSED_REQ_STAMP and Request_Id. Main parti...
Categories: DBA Blogs

when to use bitmap or b tree index?

Mon, 2016-07-04 07:46
when to use bitmap or b*tree index? And which one is best for containing 1 Milion rows in a single table contain child-parent relationship?
Categories: DBA Blogs

Using existing exception names

Mon, 2016-07-04 07:46
You have define an exception type and named it as invalid_number on execution,your plsql code raises exception invalid_number internally.In this case what should you do in order to handle this kind of situation. 1..Exception when invalid_number. 2....
Categories: DBA Blogs

expdp from physical standby database

Sun, 2016-07-03 13:46
Have a good day I am trying to export using expdp from the standbay server to offload the load from the production So I follow Oracle Doc ID : 1356592.1 but I get the follwing error Export: Release 11.2.0.4.0 - Production on Sat Jul 2 18...
Categories: DBA Blogs

How do instead-of-triggers work

Sun, 2016-07-03 13:46
1)After updating on complex view by using instead of trigger which table will affect first and why.
Categories: DBA Blogs

impdp parallel

Sun, 2016-07-03 13:46
Dear TOM when i impdp a db user with parallel parameter,does it really create the indexes with the parallel degree which i specified? thank you.
Categories: DBA Blogs

Pages