Oracle partition size in Mb

by on Mar.17, 2010, under Development

Make connection as system or with user with “DBA” privilege

select partition_name,segment_name,
round(sum(bytes)/1024/1024,2) as Mb
from sys.dba_segments
where 1=1
and segment_name =’SOME_PARTITIONED_TABLE’ –table name
and tablespace_name = ‘USERS’ — tablespace name
and partition_name in (‘P16032010′,’P17032010’)
group by partition_name, segment_name

Comments Off on Oracle partition size in Mb more...

Oracle Timestamp Difference in seconds

by on Dec.23, 2009, under Development

select (TO_NUMBER(TO_CHAR(EndDate,’J’))-TO_NUMBER(TO_CHAR(CreateDate,’J’)))*86400 + (TO_NUMBER(TO_CHAR(EndDate,’SSSSS’))-TO_NUMBER(TO_CHAR(CreateDate,’SSSSS’))) AS “Delta (sec)” from table1

Comments Off on Oracle Timestamp Difference in seconds more...

MSSQL function charindex-at-n-position

by on Dec.17, 2009, under Development

To find the charindex of an expression “_” in n position say 3rd occurancein a given word ‘xx_xxx_xx_xx’
Result : 10
SELECT dbo.fn_charIndex(‘_’,3,’ xx_xxx_xx_xx’)


And the code for creating function:

Create  function dbo.fn_charIndex(@Expression varchar(256),@nPos int,@Word varchar(2000))
returns int
declare @ret int,@strt int
set @ret = 0
set @strt = 0
while not @strt = @npos
select @ret = charindex(@Expression,@Word,@ret+1)
set @strt = @strt +1
return @ret


Source: http://www.calsql.com/2009/10/function-charindex-at-n-position.html

Comments Off on MSSQL function charindex-at-n-position :, more...

Installing Oracle 11g on Ubuntu 8.04 x86

by on Nov.03, 2009, under Development

Инсталация на Oracle 11G no Ubuntu – link:


Comments Off on Installing Oracle 11g on Ubuntu 8.04 x86 more...

MSSQL Dates Difference

by on Sep.09, 2009, under Development

Returns the number of date and time boundaries crossed between two dates

DATEDIFF ( DatePart , StartDate , EndDate )

SET @StartDate =’2007-06-05′
SET @EndDate =’2007-08-05′

SELECT DATEDIFF(Year, @StartDate, @EndDate) AS NewDate
Return Value = 0 Year

SELECT DATEDIFF(quarter, @StartDate, @EndDate) AS NewDate
Return Value = 1 quarter

SELECT DATEDIFF(Month, @StartDate, @EndDate) AS NewDate
Return Value = 2 Month

SELECT DATEDIFF(dayofyear,@StartDate, @EndDate) AS NewDate
Return Value = 61 day

SELECT DATEDIFF(Day, @StartDate, @EndDate) AS NewDate
Return Value = 61 Day

SELECT DATEDIFF(Week, @StartDate, @EndDate) AS NewDate
Return Value = 9 Week

SELECT DATEDIFF(Hour, @StartDate, @EndDate) AS NewDate
Return Value = 1464 Hour

SELECT DATEDIFF(minute, @StartDate, @EndDate) AS NewDate
Return Value = 87840 minute

SELECT DATEDIFF(second, @StartDate, @EndDate) AS NewDate
Return Value = 5270400 second

SET @StartDate =’2007-06-05
SET @EndDate =’2007-06-06

SELECT DATEDIFF(millisecond, @StartDate, @EndDate) AS NewDate
Return Value = 86400000 millisecond

Comments Off on MSSQL Dates Difference : more...

Oracle sites

by on Mar.29, 2009, under Development

Перфектен сайт с обяснения и стъпка по стъпка инсталация и конфигуриране на Oracle ASM и др…
Ето го и сайта Manchev.org

Comments Off on Oracle sites more...

Нов албум е добавен в галерията

by on Mar.07, 2009, under Албуми снимки

Скоро ще добавя още много – нови и стари, първо трябва да ги групирам…

Ето линк …:: ЦъК ТуК ::… ако искаш да разгледаш…

Comments Off on Нов албум е добавен в галерията more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!


All entries, chronologically...