Home » RDBMS Server » Performance Tuning » DBMS_UTILITY (GET_TIME)
DBMS_UTILITY [message #516545] Tue, 19 July 2011 03:47 Go to next message
rakesh1503
Messages: 22
Registered: July 2011
Location: noida
Junior Member
Hi Tom,
when i execute the following statement:
SELECT dbms_utility.get_time FROM DUAL;
It is showing output as : 377528869---i actually can't understand,Please help me. Embarassed
Re: DBMS_UTILITY [message #516546 is a reply to message #516545] Tue, 19 July 2011 03:57 Go to previous messageGo to next message
cookiemonster
Messages: 13958
Registered: September 2008
Location: Rainy Manchester
Senior Member
Have you considered looking in the documentation to see what that function actually does?
Re: DBMS_UTILITY [message #516547 is a reply to message #516546] Tue, 19 July 2011 04:02 Go to previous messageGo to next message
rakesh1503
Messages: 22
Registered: July 2011
Location: noida
Junior Member
Hi Tom,
As i have seen,it actually returns elapsed time in measurement of 100th of second.i want to understand it thoroghly.
Re: DBMS_UTILITY [message #516548 is a reply to message #516547] Tue, 19 July 2011 04:03 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Who is "Tom"?
Re: DBMS_UTILITY [message #516549 is a reply to message #516548] Tue, 19 July 2011 04:05 Go to previous messageGo to next message
cookiemonster
Messages: 13958
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you think I'm Tom Kyte then I'm flattered but no. I'm cookiemonster. Tom Kyte's website is here.
As to your question, what's the problem? The documentation describes exactly what is does. What do you not understand?
Re: DBMS_UTILITY [message #516550 is a reply to message #516548] Tue, 19 July 2011 04:07 Go to previous messageGo to next message
rakesh1503
Messages: 22
Registered: July 2011
Location: noida
Junior Member
Hi Dear,
My apology,Actually i could not recognize the name.
Re: DBMS_UTILITY [message #516552 is a reply to message #516549] Tue, 19 July 2011 04:13 Go to previous messageGo to next message
rakesh1503
Messages: 22
Registered: July 2011
Location: noida
Junior Member
Hi cookiemonster,
The matter,i could not understand, is the output (377528869 the elapsed time - if it is the time taken to execute this statement then this is really a big time,as when i try to execute :
DECLARE
var1 DATE;
var2 VARCHAR2 (20);
var3 NUMBER(12,3);
var4 NUMBER(12,3);
BEGIN
VAR4:=DBMS_UTILITY.get_time;
var1 := :var1;
var2 := TO_CHAR (var1, 'DY');

IF VAR2='MON' THEN
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Monday');
ELSIF VAR2='TUE' THEN
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Tuesday');
ELSIF VAR2='WED' THEN
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Wednesday');
ELSIF VAR2='THU' THEN
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Thursday');
ELSIF VAR2='FRI' THEN
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Friday');
ELSIF VAR2='SAT' THEN
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Saturday');
ELSE
DBMS_OUTPUT.PUT_LINE('The entered date '||var1||' is Sunday');
END IF;
var3 := DBMS_UTILITY.get_time;
DBMS_OUTPUT.put_line ( 'The time taken to execute if statement is '
|| (VAR3-var4)
|| ' seconds'
);
END;
--this code is showing 0 second as elapsed time.this is where my confusion is arising.
Re: DBMS_UTILITY [message #516553 is a reply to message #516552] Tue, 19 July 2011 04:15 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This code seems to be far too simple, so it didn't take any (significant) time. Try with a more complex script.
Re: DBMS_UTILITY [message #516556 is a reply to message #516552] Tue, 19 July 2011 04:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel
Re: DBMS_UTILITY [message #516559 is a reply to message #516556] Tue, 19 July 2011 04:31 Go to previous message
cookiemonster
Messages: 13958
Registered: September 2008
Location: Rainy Manchester
Senior Member
Stick a dbms_lock.sleep(1) in and you'll see a time. In hudredths of seconds, rather than seconds as you state in the output.
Previous Topic: How can i force a sql use index range scan
Next Topic: Performance Tuning SQL Queries
Goto Forum:
  


Current Time: Sun Nov 24 21:49:28 CST 2024