Query Execution/Elapsed Time and Oracle Data Blocks
Hi,
I have created 3 tables with one column only. As an example Table 1 below:
SQL> create table T1 ( x char(2000));
So 3 tables are created in this way i.e. T1,T2 and T3.
T1 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production) (O.S=Windows).
T2 = I created in a Tablespace with Blocksize 16k.
T3 = I created in a Tablespace with Blocksize 4k. In the same Instance.
Each table has approx. 500 rows (So, table sizes are same in all the cases to test Query execution time ). As these 3 tables are created under different data block sizes so the ALLOCATED no. of data blocks are different in all cases.
T1 = 8k = 256 Blocks = 00:00:04.76 (query execution time/elapsed time)
T2 = 16k=121 Blocks = 00:00:04.64
T3 = 4k = 490 Blocks = 00:00:04.91
Table Access is FULL i.e. I have used select * from table_name; in all 3 cases. No Index nothing.
My Question is why query execution time is nearly the same in all 3 cases because Oracle has to read all the data blocks in each case to fetch the records and there is a much difference in the allocated no. of blocks ???
In 4k block size example, Oracle has to read just 121 blocks and it's taking nearly the same time as it's taking to read 490 blocks???
This is just 1 example of different data blocks. I have around 40 tables in each block size tablespace and the result are nearly the same. It's very strange for me because there is a much difference in the no. of allocated blocks but execution time is almost the same, only difference in milliseconds.
I'll highly appreciate the expert opinions.
Bundle of thanks in advance.
Best Regards,
Hi Chris,
No I'm not using separate databases, it's 8k database with non-standard blocksizes of 16k and 4k.
Actually I wanted to test the Elapsed time of these 3 tables, so for that I tried to create the same size
tables.
And how I equalize these is like I have created one column table with char(2000).
555 MB is the figure I wanted to use for these 3 tables ( no special figure, just to make it bigger than the
RAM used for my db at the db startup to be sure of not retrieving the records from cache).
so row size with overhead is 2006 * 290,000 rows = 581740000(bytes) / 1024 = 568105KB / 1024 = 555MB.
Through this math calculation I thought It will be the total table size. So I Created the same no. of rows in 3 blocksizes.
If it's wrong then what a mes because I was calculating tables sizes in the same way from the last few months.
Can you please explain a little how you found out the tables sizes in different block sizes.Though I understood how you
calculated size in MB from these 3 block sizes
T8K =97177 BLOCKS=759MB *( 97177*8 = 777416KB / 1024 = 759MB )*
T16K=41639 BLOCKS=650MB
BT4K=293656 BLOCKS=1147MB
For me it's new to calculate the size of a table. Can you please tell me then how many rows I can create in each of
these 3 tables to make them equal in MB to test for elapsed time.
Then I'll again run my test and put the results here. Because If I've wrongly calculated table sizes then there is no need to talk about elapsed time. First I must equalize the table sizes properly.
SQL> select sum(bytes)/1024/1024 "Size in MB" from dba_segments> 2 where segment_name = 'T16K';
Size in MB
655
Is above SQL is correct to calculate the size or is it the correct alternative way to your method of calculating the size??
I created the same table again with everything same and the result is :
SQL> select num_rows,blocks from user_tables where table_name = 'T16K';NUM_ROWS BLOCKS
290000 41703
64 more blocks are allocated this time so may be that's y it's showing total size of 655 instead of 650.
Thanks alot for your help.
Best Regards,
KAm
Edited by: kam555 on Nov 20, 2009 5:57 PM
Similar Messages
-
Need advice on ORA-01578: ORACLE data block corrupted
We have a development database server version- 10.2.0.3 with materialized views refresh as complete every morning. Yesterday we had a power failure and the server went down and database was shutdown unexpectedly.
When we restarted the database after the server restarted, we found some of the datablocks got corrupted . Following were the exceptions that we saw in the alert.log.
Errors in file /i01_01/app/oracle/product/10.2.0/db_1/admin/orcl9/bdump/orcl9_smon_7547.trc:
ORA-01578: ORACLE data block corrupted (file # 11, block # 257712)
ORA-01110: data file 11: '/i01_01/app/oracle/product/10.2.0/oradata/orcl9/ts_gen_data_02.dbf'
ORACLE Instance orcl9 (pid = 8) - Error 1578 encountered while recovering transaction (9, 38) on object 54463
I tried the following query to see the segment type.
select owner, segment_name, segment_type from dba_extents where file_id =11 and 257712 between block_id and block_id + blocks - 1;
OWNER
SEGMENT_NAME
SEGMENT_TYPE
VISH
INVENTORY_TXN
TABLE
where " INVENTORY_TXN " is a materialized view that was using the block that got corrupted. I can always recreate the MV by dropping and recreating it. Will it solve the problem???
If not, how can I recover/repair the block.???
Can anyone advice on this. Thanks very much in advance.To recover a corrupted block,the best way out is to use Blockrecover command of RMAN. So you would need RmAN backup to perform the operation.But first ypu you need to ensure that this is a persistent error or not? Is this error is coming repeatedly or just once it happened?
About Blockrecover command,read here,
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmrecov005.htm#BRADV157
HTH
Aman.... -
UTC Date Time and Normal Date Time
Hi All,
1. How UTC date time and Normal date time differs in siebel.
2. If legacy data needed to be loaded into siebel, in siebel few fields are date time and UTC date time fields. what would happen if we load both normal date time and UTC date time without considering them techinically?
3. UTC date time holds any specific format in physical database? If we want to load legacy data to UTC date time format what is the query to manipulate it?
Thankyou
SeanSean,
Please check document below, I believe it has most of the answers to the questions you have:
http://download.oracle.com/docs/cd/E14004_01/books/GlobDep/GlobDepUTC.html
Hope it helps,
Wilson -
Different output of same query in SQL Server and Oracle
I have two tables table1 and table2
--table1 has two columns c1 int and c2 varchar. there are not constraints added in it. it has data as given below
c1 c2
6 d
5 j
102 g
4 g
103 f
3 h
501 j
1 g
601 n
2 m
--table2 has only one column c1 int. there are not constraints added in it. it has data as given below
c1
6
1
4
3
2
now when i run below given query in sql server and oracle it gives me different result
select *
from table1
inner join (SELECT ROW_NUMBER() OVER (order by c1 ASC) AS c1 from table2) table2 on table2.c1=table1.c1
sql server output
c1 c2 c1
1 g 1
2 m 2
3 h 3
4 g 4
5 j 5
oracle output
C1 C2 C1
5 j 5
4 g 4
3 h 3
1 g 1
2 m 2
If you notice the first column in both output. It is sorted in sql server and not in oracle.
Why it is behaving differently in oracle? Is there any way I can solve this in oracle?
Thanks,
JigsIt is NOT behaving "differently" in Oracle; you just haven't specified an order that you expect your results to be in, so you're going to get output in whatever order the database fancies displaying it (ie. no guarenteed order). This is an artifact of how the database chooses to put together the data, and different databases (or even datasets within the same database) can and most likely will behave differently.
Even SQL Server won't guarentee to always get your data in an ordered fashion if you exclude the order by clause, even if you think it has always output the data in an ordered fashion.
Your solution is to add an order by clause, in BOTH databases, to force the order of the output data. -
Hi,
I am running into a data corruption issue.
My database is:
SQL> select banner from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
The following information is written to the alert.log File
alert.log File
Mon Nov 07 17:24:12 2011
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 2
Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
Autotune of undo retention is turned on.
IMODE=BR
ILAT =27
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production.
ORACLE_HOME = /home/oracle/dbhome
System name: Linux
Node name: dbl-ora
Release: 2.6.18-274.3.1.el5 (This is rhel5.7 or CentOs5.7)
Version: #1 SMP Tue Sep 6 20:14:03 EDT 2011
Machine: i686 / vm
Mon Nov 07 19:42:14 2011
Corrupt Block Found
TSN = 0, TSNAME = SYSTEM
RFN = 1, BLK = 52346, RDBA = 4246650
OBJN = 225, OBJD = 225, OBJECT = IDL_UB1$, SUBOBJECT =
SEGMENT OWNER = SYS, SEGMENT TYPE = Table Segment
Errors in file /home/oracle/diag/rdbms/ora11/K/trace/K_ora_5425.trc (incident=11053):
ORA-01578: ORACLE data block corrupted (file # 1, block # 52346)
ORA-01110: data file 1: '/home/oracle/oradata/ora11/system01.dbf'
Incident details in: /home/oracle/diag/rdbms/ora11/K/incident/incdir_11053/K_ora_5425_i11053.trc
I was even able to detect the row that is generating the issue.
In my case the obj# 33573 until 33577 are causing the issue,
though I have no idea what sort of objects are affected.
SQL> select * from idl_ub1$ where obj#=33572;
OBJ# PART VERSION PIECE# LENGTH P
33572 1 0 0 9032 F
SQL> select * from idl_ub1$ where obj#=33573;
ERROR:
ORA-01578: ORACLE data block corrupted (file # 1, block # 52346)
ORA-01110: data file 1: '/home/oracle/oradata/ora11/system01.dbf'
no rows selected
SQL> select * from idl_ub1$ where obj#=33577;
ERROR:
ORA-01578: ORACLE data block corrupted (file # 1, block # 52358)
ORA-01110: data file 1: '/home/oracle/oradata/ora11/system01.dbf'
no rows selected
SQL> select * from idl_ub1$ where obj#=33578;
OBJ# PART VERSION PIECE# LENGTH P
33578 1 0 0 9032 F
Any idea, how to fix this problem without recreating the whole database?
Thanks in advance.
wmager
Edited by: magerxr on Nov 7, 2011 8:27 AMmagerxr wrote:
Thanks again for your quick advise.
Here comes the result of dbv against my system tablespace.
[oracle@dbl-ora ~]$ dbv FILE=/home/oracle/oradata/ora11/system01.dbf
DBVERIFY: Release 11.2.0.3.0 - Production on Mon Nov 7 22:39:11 2011
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - Verification starting : FILE = /home/oracle/oradata/ora11/system01.dbf
Page 52346 is influx - most likely media corrupt
Corrupt block relative dba: 0x0040cc7a (file 1, block 52346)
Fractured block found during dbv:
Data in bad block:
type: 6 format: 2 rdba: 0x0040cc7a
last change scn: 0x0000.0010acfa seq: 0x1 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000000
check value in block header: 0x8fda
computed block checksum: 0xaafbselect owner, segment_type, segment_name from dba_extents
where file_id = 1 and 52346 between block_id and block_id+blocks-1;
>
Page 52347 is marked corrupt
Corrupt block relative dba: 0x0040cc7b (file 1, block 52347)
Bad header found during dbv:
Data in bad block:
type: 1 format: 6 rdba: 0x0000a206
last change scn: 0xacfa.0040cc7b seq: 0x10 flg: 0x00
spare1: 0xfa spare2: 0xac spare3: 0x401
consistency value in tail: 0x00000000
check value in block header: 0x0
block checksum disabled
select owner, segment_type, segment_name from dba_extents
where file_id = 1 and 52347 between block_id and block_id+blocks-1;
Page 52361 is marked corrupt
Corrupt block relative dba: 0x0040cc89 (file 1, block 52361)
Bad header found during dbv:
Data in bad block:
type: 1 format: 6 rdba: 0x0000a206
last change scn: 0xacfb.0040cc89 seq: 0x10 flg: 0x00
spare1: 0xfb spare2: 0xac spare3: 0x401
consistency value in tail: 0x32298500
check value in block header: 0x0
block checksum disabled
select owner, segment_type, segment_name from dba_extents
where file_id = 1 and 52361 between block_id and block_id+blocks-1;
>
>
DBVERIFY - Verification complete
Total Pages Examined : 122880
Total Pages Processed (Data) : 81298
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 22307
Total Pages Failing (Index): 0
Total Pages Processed (Other): 3349
Total Pages Processed (Seg) : 1
Total Pages Failing (Seg) : 0
Total Pages Empty : 15910
Total Pages Marked Corrupt : 16
Total Pages Influx : 1
Total Pages Encrypted : 0
Highest block SCN : 4064615 (0.4064615)post results from 3 SQL above -
Crystal Reports and Oracle Dates
Post Author: Robert
CA Forum: General
Hey Guys, I am experiencing some issues with Crystal Reports Developer XI (SP4) and Oracle Dates. Situation:I have a view setup in oracle database, i use this view to base my reports. Within the view there is a logtime column (to_date(logtime,'DD-MM-YYYY') & to_date(logtime,'DD-MON-YYYY') -: i have used both) When i connect to the database the database expert (view on the left of the screen) displays the logtime column as date time, but when i go to refersh the report with data with the logtime as group 1, i get a whole lot of errors:1: Failed to Retrieve data from Database2: Failed to Retrieve data from Database Details: ORA-01861: Literal does not match format String Database vendor code: 18613: Failed to Retrieve data from Database Details: Failed to execute SQL statement. OCI Call................................... Anybody got any ideas why this is happening, if i use the to_char the report work fine...well it will not sort by date!! Any help, most appreciated.... RobertPost Author: Robert
CA Forum: General
Hello there and thanks for your reply,
I have found the problem, it was not really a problem but a slight misjudgment of the use of the to_date function in oracle!
I should have used to_date in conjunction with to_char
to_date(to_char(logtime,'DD-MM-YYYY'),'DD-MM-YYYY')
Presto
No need fo any formula in crystal to do this....
Thanks again -
ORA-01578: ORACLE data block corrupted (file # 1, block # 53713)
When i tried to export data from db (Oracle 11g, 64bit on Linux)
Im getting following error
About to export specified users ...
. exporting pre-schema procedural objects and actions
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 53713)
ORA-01110: data file 1: '/u02/oradata/RSDB1/system01.dbf'
EXP-00083: The previous problem occurred when calling EXFSYS.DBMS_EXPFIL_DEPASEX P.schema_info_exp
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 55497)
ORA-01110: data file 1: '/u02/oradata/RSDB1/system01.dbf'
EXP-00083: The previous problem occurred when calling SYS.DBMS_CUBE_EXP.schema_i nfo_exp
. exporting foreign function library names for user WB_APP_MANAGER
. exporting PUBLIC type synonyms
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 44638)
ORA-01110: data file 1: '/u02/oradata/RSDB1/system01.dbf'
EXP-00000: Export terminated unsuccessfully
I donot understand how to solve this issue Please help me to solve this issue..
Thanks891620 wrote:
When i tried to export data from db (Oracle 11g, 64bit on Linux)
Im getting following error
About to export specified users ...
. exporting pre-schema procedural objects and actions
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 53713)
ORA-01110: data file 1: '/u02/oradata/RSDB1/system01.dbf'
EXP-00083: The previous problem occurred when calling EXFSYS.DBMS_EXPFIL_DEPASEX P.schema_info_exp
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 55497)
ORA-01110: data file 1: '/u02/oradata/RSDB1/system01.dbf'
EXP-00083: The previous problem occurred when calling SYS.DBMS_CUBE_EXP.schema_i nfo_exp
. exporting foreign function library names for user WB_APP_MANAGER
. exporting PUBLIC type synonyms
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 44638)
ORA-01110: data file 1: '/u02/oradata/RSDB1/system01.dbf'
EXP-00000: Export terminated unsuccessfully
I donot understand how to solve this issue Please help me to solve this issue..
Thanksrun dbv against '/u02/oradata/RSDB1/system01.dbf'
& post results back here
dbv
DBVERIFY: Release 11.2.0.1.0 - Production on Fri Oct 14 20:39:11 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Keyword Description (Default)
FILE File to Verify (NONE)
START Start Block (First Block of File)
END End Block (Last Block of File)
BLOCKSIZE Logical Block Size (8192)
LOGFILE Output Log (NONE)
FEEDBACK Display Progress (0)
PARFILE Parameter File (NONE)
USERID Username/Password (NONE)
SEGMENT_ID Segment ID (tsn.relfile.block) (NONE)
HIGH_SCN Highest Block SCN To Verify (NONE)
(scn_wrap.scn_base OR scn) -
ORA-01578: ORACLE data block corrupted
Dera Guru's,
In SAP i have following error in Oracle Database
SQL error in the database when accessing a table
"Database error text........: "ORA-01578: ORACLE data block corrupted (file #
38, block # 72576) ORA-01110: data file 38:
'K:\ORACLE\D01\SAPDATA4\D01_12\D01.DATA12'"
How can i resolve it.Please guide me...
Thank you for your help and advice....Error: ORA-01578 (ORA-1578)
Text: ORACLE data block corrupted (file # %s, block # %s)
Cause: The data block indicated was corrupted, mostly due to software errors.
Action: Try to restore the segment containing the block indicated. This
may involve dropping the segment and recreating it. If there
is a trace file, report the errors in it to your ORACLE
representative.
Do you already identify the object corrupted ?
What kind of backup do you have ?
Edited by: marcopb on Sep 10, 2012 2:47 PM -
Time and/or Date incorrect after moving/copying/importing
This has been going on for years and has messed up hundreds, maybe more, of the time/date on my photos in Aperture.
If I select my entire photo library (typically preset to 'Date - Ascending') in Aperture, I can find hundreds of photos out of order. When I look at them in 'Info', the time and sometimes date has changed by several hours. I'm not sure if this is an Aperture thing or Mac thing? Over the years I have moved and/or copied photos from smaller HDDs to larger HDDs to eventually a NAS unit and/or from iPhoto to Aperture.
I have made calls to Tech Support, but they have always made me feel as if I made some mistake on my end or I didn't set the time correctly to begin with (now this could be correct with the P&S I share with my girlfriend, but very rarely with my DSLR). But I also explained that it was random (3 to 5 photos in a set).
So today as I was trying to update some of my photos, I came across some photos (and videos) I took last year with my iPhone (my iPhone always has the correct time and date or 99.9%). I originally uploaded these to an old iPhoto library I still have (all the dates and times are correct). These same photos and videos (55 over a 3 day period) were moved to my Aperture library some time ago and 3 of the 55 have the incorrect time by -7 hours (ie. 3:30 pm is now 8:30 am).
Why does this happen?? I have not set any time changes to these photos. If I did, they would all have the wrong time and not just 3 of them would be off.
Is anyone having this issue and if so, was there a way to get the corrcet time/date from the photo hidden deep down in the EXIF? This is driving me crazy.
Here are some screen shots of the same photo in iPhoto and Aperture.
iPhoto 5:28:09 PM - Correct
Aperture 10:28:09 AM - Incorrect -7 hrs
TIA if anyone can help. I just don't have the time to go back and try and change all these photos.
NarvonDF
Thanks for the reply, I will try to post the screenshots again (they still show for me, odd?).
Anyway, this is not a zoning problem. This is a moving or copying problem.
The photos I tried to show from the screen shot I took last year at a concert in Coachella (same time zone as my residence in Redondo Beach). The shots were taken using my iPhone which has GPS and constant updating of Time. All the photos and videos show up correctly in Places (GPS) and all the correct times show in iPhoto.
The issue occurs when the photos are moved to Aperture. Randomly the time has changed to -7 hours on a few photos. This same randomness has occured to hundreds of my photos that I have imported into Aperture over the years. As I said before, Tech Support and everyone else has placed the blame on me within my camera settings or improper importing.
Now that I use my iPhone more often, I have proof that the settings are correct and that Aperture or Finder or ?? within Apple has changed the Time randomly. Also, if I had 'Accidently' opened the 'Time Zone' brick when importing (as suggested by Tech Support), all the photos would have the incorrect time and not just a few random ones.
iPhoto original from iPhone - Time 5:28:09 correct
Aperture photo from iPhoto - Time 10:28:09 incorrect -7 Hrs
Thanks again,
Narvon -
What time the Oracle Data Mining 10g ?
What time the Oracle Data Mining 10g ?
If you are referring to the 10.1 release of the ODM user interface, that should be available in beta form very shortly(a couple weeks) with the final release very soon after that.
-
Select Records between Begin Date/Time and End Date/Time
Hi, I need to select records from table GLPCA where the CPUDT and CPUTM are between a START DATE/TIME and END DATE/TIME.
I have the below logic from an SAP Solution, but it doesn't seem to be working right in my opinion. It is picking up records earlier than the date ranges. Can anyone tell me how I might be able to accomplish this? I'm hoping this is an easy one for the ABAPPERs...
Thanks,
START DATE 20091022
START TIME 125736
END DATE 20091022
END TIME 135044
CPUDT 20091022
CPUTM 100257
SELECT * FROM GLPCA
WHERE ( CPUDT >= STARTDATE AND ( CPUTM >= STARTTIME OR ( CPUDT <= ENDDATE AND CPUTM <= ENDTIME ) ) ).Thank you all! I ended up using the following:
SELECT * FROM GLPCA
WHERE RYEAR IN L_R_RYEAR
AND ( ( CPUDT = STARTDATE AND CPUTM >= STARTTIME ) OR CPUDT > STARTDATE )
AND ( ( CPUDT = ENDDATE AND CPUTM <= ENDTIME ) OR CPUDT < ENDDATE ).
This child was born from the following thread that was found:
update date and time of client record -
Hello all
I was presented this sample 1080 frame and was asked if I can do this if time and GPS metadata were part of the video recording. In other words, how do you burn in this data in the video itself. I have P Pro CS 6 @ home and am a complete novice to video editing. Final product may or may not need this, more curious as to how its done - special camera system or in post processing?
Thanks!If whoever shot the video recorded time of day timecode synced from a GPS receiver that was close to the camera (in your case that looks like it would mean mounted in the helicopter), you can use the time code data to match your GPS metadata to the video. I use an automated process to incorporate the the metadata into the video, but the process is all done with custom software that the CEO of our company wrote. The other people I've seen incorporating GPS metadata into video are also using customized, proprietary processes. If you're adding the data in post, you will have to translate the data into Premiere titles or After Effects text keyframes or something else that you can overlay on the video.
You can also use hardware during your shoot to overlay the GPS data onto the video. I don't use any products that do this, and I don't know how easy they are to find for purchase, but there definitely are people in the geospatial sector who feed video through a GPS-aware piece of video processing hardware that overlays time and position data in real time. In this case you would feed video (most likely through HD-SDI) from your camera to the GPS overlay hardware and then to a recorder.
There certainly aren't any GPS features built into Premiere Pro. If you want to add titles manually, you'll have to match the time code with your GPS data and make a new title each time the GPS info is supposed to update. GPS data is usually some form of table or spreadsheet with time, coordinates, and other positional data, so you can find the correct time in the video and make a title that includes the corresponding coordinates for that time. If you're doing this for more than a few seconds of video, it will be an unreasonably long and tedious process, but it is possible. -
I do not remember the questions my ID, I was wrong several times and now is blocked, what do?
Security questions:
https://discussions.apple.com/thread/4533485?tstart=0 -
Difference between a starting date and time and ending date and time
Hi All,
I need to bring out the difference between a starting data and time and ending date and time. Difference should be in time I mean it should be in hours or minus or seconds.
I am sure there must be a Function module for this, Has anyone of you been in search of this kind of FM, Kindly suggest me. It is urgent.
Thanks
MahenHi,
Check this out.
data : date1 type dats , " System data type for Date (sy-datum)
date2 type dats,
time1 type tims, " System data type for time (sy-timlo)
time2 type tims,
days type i,
scd type i,
t_mt type i.
days = date1 - date2. " Diference in days.
Scd = time1 - time2. " diference in seconds.
t_mt = ( days * 24 * 60 ) + ( scd / 60 ).
total diference in minute
<b>Reward Points & Mark Helpful Answers</b> -
Insert current date and time into Oracle date type field
I have a JDBC current date and time insert into Oracle 9i that almost works. It submits the current date and a fixed time into the Oracle date type field. I am using Tomcat 6.0.20.
For example if I insert the data at 7:24:04 PM on Feb 16, 2010 it will insert as: 16-Feb-2010 12:00:00 AM
The date part works but the time always shows 12:00:00 AM no matter what date or time the data is inserted.
Here is what I have for my JDBC inserts and I also tried something with DateFormat:
PreparedStatement ps; Date mydate = new Date(new java.util.Date().getTime()); //insert statement here.... stmt.setDate(1,mydate);
I also tried:
PreparedStatement ps; java.sql.Timestamp mydate = new java.sql.Timestamp(new java.util.Date().getTime()); SimpleDateFormat fmt = new SimpleDateFormat(.... //insert statement here.... ps.setTimestamp(1,fmt.format(mydate));
Both keep submitting the date into Oracle as 16-Feb-2010 12:00:00 AM
Anyway to get the current date and time? For example if I insert the data at 7:24.04 pm today it should show as 16-Feb-2010 07:24.04 PM in Oracle.sportsMarkr wrote:
Date mydate = new Date(new java.util.Date().getTime());Please see the javadocs for java.sql.Date and note the part that says "...to zero"
[http://java.sun.com/javase/6/docs/api/java/sql/Date.html]
If you want a date and time then use java.sql.Timestamp.
Maybe you are looking for
-
I accidentally deleted the latest backup for my iphone 6 on icloud like a week ago and now I can't backup my phone to icloud at all. When I go into settings, then into icloud, and then into manage my storage it does not give me the option to backup
-
Creation of suspension line items for Subscription orders
hi , I am currently working on IS-Media project. I have a requirement that I need to create a suspension for all the line items available for the subscription orders. I mean I have to create a new line item for all the active line items of a s
-
What's the oldest version of Flash Professional that will run on a Mavericks?
Hi. I have a Mac running OS 10.9.4, Mavericks. I'm wondering if anyone knows which old versions of Adobe Flash Professional will run on Mavericks. I owned Flash years ago - around 1999. I stopped usng it a few years later because that version was for
-
Hi, I am using HP smart web printing and have a problem that German 'Umlaute' Ä Ö Ü ä ö ü are not displayed correctly. Instead they are displayed as some special characters. Is there a way to fix this?
-
Can I make the windows partition be usable in a mac os environment with a program?
...in other words, my imac has 2 partitions, an mac os lion one and a win7 one. i have to hit option at boot up to decide to use either one. Is there a program for mac os that will allow me to run native mac os and at the same time open up my windo