Learn for Life!

The more you share the more you get..


Quote by Leonard Nimoy.

I’ve experienced the truth of this a long time ago during my apprenticeship, without being aware of it. You probably remember those days when you had to prepare for an exam, but due to time constraints, you couldn’t look up everything in the books. So my friend and I compiled summaries of the most important things. Not surprisingly, these summaries quickly became very popular in class, and more people asked us if we could share it with them. I remember that back then I was sceptical about this and was asking myself “Why should I give it to them? We put a lot of work in it and they just want to copy that? No way!” At the end of the day, they got it anyway either through my friend or some other way. Eventually, I just said to myself “Oooookaay, give it to everyone who asks,”… Read more

Quote by Leonard Nimoy.

I’ve experienced the truth of this a long time ago during my apprenticeship, without being aware of it. You probably remember those days when you had to prepare for an exam, but due to time constraints, you couldn’t look up everything in the books. So my friend and I compiled summaries of the most important things. Not surprisingly, these summaries quickly became very popular in class, and more people asked us if we could share it with them. I remember that back then I was sceptical about this and was asking myself “Why should I give it to them? We put a lot of work in it and they just want to copy that? No way!” At the end of the day, they got it anyway either through my friend or some other way. Eventually, I just said to myself “Oooookaay, give it to everyone who asks,”…

Read more

Migrate from Oracle to Microsoft (Views) – Part III


Continued from Migrate from Oracle to Microsoft (Views) – Part II here part III with the main focus on very interesting topic testing ;-).
Testing
When I implemented all about 20 views from Oracle to SQL Server, I had to test the performance and not least important, the content of the views if their still contain the same. And how do you do that the easiest way?
Measure performance
For measuring the performance you simply select alls Views with a SELECT COUNT(*) on both databases. Don’t forget to clear the cache before each run.
To generate all the COUNT-Statements I created a little script, just to make life easier right ;-):
 –Generate Queries – Performance Test…
SELECT  v.TABLE_NAME,
		–stuff(c.list,1,1,”) as cols,
		‘PRINT ”’ + v.Table_name + ”’    ‘ +
		‘SELECT ”’+v.Table_name+”’ as Tbl_name, NULL as cnt UNION ALL ‘ +
		‘SELECT ”’+v.Table_name+”’ as Tbl_name, count(*) as cnt FROM [dbo].[‘+v.Table_name +’] ‘–WHERE 1=2 ‘
		+ CHAR(13)+CHAR(10)
		
  FROM INFORMATION_SCHEMA.VIEWS… Read more

Continued from Migrate from Oracle to Microsoft (Views) – Part II here part III with the main focus on very interesting topic testing ;-).
Testing
When I implemented all about 20 views from Oracle to SQL Server, I had to test the performance and not least important, the content of the views if their still contain the same. And how do you do that the easiest way?
Measure performance
For measuring the performance you simply select alls Views with a SELECT COUNT(*) on both databases. Don’t forget to clear the cache before each run.
To generate all the COUNT-Statements I created a little script, just to make life easier right ;-):
–Generate Queries – Performance Test…
SELECT v.TABLE_NAME,
–stuff(c.list,1,1,”) as cols,
‘PRINT ”’ + v.Table_name + ”’ ‘ +
‘SELECT ”’+v.Table_name+”’ as Tbl_name, NULL as cnt UNION ALL ‘ +
‘SELECT ”’+v.Table_name+”’ as Tbl_name, count(*) as cnt FROM [dbo].[‘+v.Table_name +’] ‘–WHERE 1=2 ‘
+ CHAR(13)+CHAR(10)

FROM INFORMATION_SCHEMA.VIEWS…

Read more

Migrate from Oracle to Microsoft (Views) – Part II


Continued from Migrate from Oracle to Microsoft (Views) – Part I here part II with more focus on the performance part.
 Performance issues recursive queries
When it comes to performance I had one big issue with the built-in function SYS_CONNECT_BY_PATH which is used for rekursiv queries in Oracle. This function is well know by the Oracle optimizer which makes this function unbelievable fast and there is no similar function on SQL Server. Even more complex was, that this queries was used on nested views, so the SQL was quite complex.

I started to translate it to an CTE view which is the pendant in SQL server and the answer to recursive queries in SQL Server. But I ended up having big performance issues because the queries where to complex. I had good performance measures on an easy simple query but invinitive response with more complex.

So what’s the solution to that?
Inline User-Defined Functions. Of course it… Read more

Continued from Migrate from Oracle to Microsoft (Views) – Part I here part II with more focus on the performance part.
 Performance issues recursive queries
When it comes to performance I had one big issue with the built-in function SYS_CONNECT_BY_PATH which is used for rekursiv queries in Oracle. This function is well know by the Oracle optimizer which makes this function unbelievable fast and there is no similar function on SQL Server. Even more complex was, that this queries was used on nested views, so the SQL was quite complex.

I started to translate it to an CTE view which is the pendant in SQL server and the answer to recursive queries in SQL Server. But I ended up having big performance issues because the queries where to complex. I had good performance measures on an easy simple query but invinitive response with more complex.

So what’s the solution to that?
Inline User-Defined Functions. Of course it…

Read more

Migrate from Oracle to Microsoft (Views) – Part I


Sometimes you have to migrate from an Oracle database to a Microsoft SQL Server. I’m not going into the reason that could be behind. I had different projects where I had to achieve this goal. The issues that I faced is what I would like to share with you.
Different functions
When it comes to rewrite code from Ora-SQL to MS-SQL, in my case it were Oracle Views that had to be transfered to Microsoft Views, then the first thing you figure out is, that there’s not the same built in functions on both sides. For example the well know TO_NUMBER() or TO_CHAR() in Oracle dosen’t exist in Microsoft. So what you do?
Below you see a list of the common functions compared between the two technologies:




Description
Oracle
MS SQL Server


Smallest integer >= n
CEIL
CEILING


Modulus
MOD
%


Truncate number
TRUNC
<none>


Max or min number or string in list
GREATEST,LEAST
<none>


Translate NULL to n
NVL
ISNULL


Return NULL if two values are equal
DECODE
NULLIF


String concatenation
CONCAT(str1,str2)
str1 + str2


Convert ASCII… Read more

Sometimes you have to migrate from an Oracle database to a Microsoft SQL Server. I’m not going into the reason that could be behind. I had different projects where I had to achieve this goal. The issues that I faced is what I would like to share with you.
Different functions
When it comes to rewrite code from Ora-SQL to MS-SQL, in my case it were Oracle Views that had to be transfered to Microsoft Views, then the first thing you figure out is, that there’s not the same built in functions on both sides. For example the well know TO_NUMBER() or TO_CHAR() in Oracle dosen’t exist in Microsoft. So what you do?
Below you see a list of the common functions compared between the two technologies:

Description
Oracle
MS SQL Server

Smallest integer >= n
CEIL
CEILING

Modulus
MOD
%

Truncate number
TRUNC
<none>

Max or min number or string in list
GREATEST,LEAST
<none>

Translate NULL to n
NVL
ISNULL

Return NULL if two values are equal
DECODE
NULLIF

String concatenation
CONCAT(str1,str2)
str1 + str2

Convert ASCII…

Read more

SSAS Cubes – Dynamic generation of partition


There is no easy way to generate partition for SSAS Cubes by default. So you have to do a SSIS-Package  (here is a way you can do it dynamic-cube-partitioning-in-ssas-2008) or write a SQL Script which generates XMLA executables.

As shown in the Statement, you can dynamically generate month partitions. The trick is, to create a linked server, that you can execute XMLA statements with relational T-SQL, so i created a Linked Server first.

Thanks for any advice or improvements in the comment section:
    EXEC master.dbo.sp_addlinkedserver
	      @server = ‘SSAS’
      , @srvproduct = ”
      , @provider = ‘MSOLAP’
     , @datasrc = ‘[DB-NAME]’;

    EXEC master.dbo.sp_serveroption @server=’SSAS’, @optname=’rpc out’, @optvalue=’true’;

  CREATE SCHEMA ssas;


    CREATE PROCEDURE ssas.usp_Execute (
	      @XMLA XML
    )
	AS
	DECLARE… Read more

There is no easy way to generate partition for SSAS Cubes by default. So you have to do a SSIS-Package  (here is a way you can do it dynamic-cube-partitioning-in-ssas-2008) or write a SQL Script which generates XMLA executables.

As shown in the Statement, you can dynamically generate month partitions. The trick is, to create a linked server, that you can execute XMLA statements with relational T-SQL, so i created a Linked Server first.

Thanks for any advice or improvements in the comment section:
EXEC master.dbo.sp_addlinkedserver
@server = ‘SSAS’
, @srvproduct = ”
, @provider = ‘MSOLAP’
, @datasrc = ‘[DB-NAME]’;

EXEC master.dbo.sp_serveroption @server=’SSAS’, @optname=’rpc out’, @optvalue=’true’;

CREATE SCHEMA ssas;

CREATE PROCEDURE ssas.usp_Execute (
@XMLA XML
)
AS
DECLARE…

Read more

The Reality of a developer’s life…


How true these pictures are 🙂 :

http://sharepointspot.blogspot.ch/2013/04/the-reality-of-developers-life.html

When you upload something to the production environment:


When I show my boss that I’ve fixed a bug:
… Read more

How true these pictures are 🙂 :

http://sharepointspot.blogspot.ch/2013/04/the-reality-of-developers-life.html

When you upload something to the production environment:

When I show my boss that I’ve fixed a bug:

Read more

Need any Headphones?


They are not cheap, but they are best! This are the new technology of headphones. They do have an active noice canceling in it. So you will not hear (or almost not) the monotonous sounds of trams, train, flight or even talking from other peoples. If you are traveling a lot or working in a shared room with more than 5 people, you have to buy them, you won’t regret it!!

I have the old one, the Bose QuietComfort 15, but I think the 25 series is even better, but not worser I hope :-).

Try it or ask me in the comment section, I will love to answer your questions.

Link zu Bose – QuietComfort 25bose quietcomfort 15

 … Read more

They are not cheap, but they are best! This are the new technology of headphones. They do have an active noice canceling in it. So you will not hear (or almost not) the monotonous sounds of trams, train, flight or even talking from other peoples. If you are traveling a lot or working in a shared room with more than 5 people, you have to buy them, you won’t regret it!!

I have the old one, the Bose QuietComfort 15, but I think the 25 series is even better, but not worser I hope :-).

Try it or ask me in the comment section, I will love to answer your questions.

Link zu Bose – QuietComfort 25bose quietcomfort 15

 …

Read more

Do you listen to music while working?


If yes, there is one best thing I used for the last time. If you listen to music while you working or study, this makes you focus on the work:

https://www.focusatwill.com/

It is a music player with neuroscience based music channels, which dosen’t disturb you.

Some advertising from their website:

Stop the wrong music.
50% of us play background music while studying, working or inventing. But…it’s the wrong music! Mainstream music lowers comprehension and creates distraction because it is designed to connect with you intellectually and emotionally.

Use the right music!
Focus@will technology delivers various “Attention Amplifying” music channels scientifically designed to engage with your brain’s limbic system. This soothes the easily distracted fight or flight mechanism increasing attention span and general focus.

The science behind this.
We developed this in partnership with leading neuroscientists Dr. Evian Gordon (www.brainresource.com) and Dr. Stephen Sideroff (UCLA Professor of Psychology). Trials show typical 12-15% positive increase in focus biomarker and up to… Read more

If yes, there is one best thing I used for the last time. If you listen to music while you working or study, this makes you focus on the work:

https://www.focusatwill.com/

It is a music player with neuroscience based music channels, which dosen’t disturb you.

Some advertising from their website:

Stop the wrong music.
50% of us play background music while studying, working or inventing. But…it’s the wrong music! Mainstream music lowers comprehension and creates distraction because it is designed to connect with you intellectually and emotionally.

Use the right music!
Focus@will technology delivers various “Attention Amplifying” music channels scientifically designed to engage with your brain’s limbic system. This soothes the easily distracted fight or flight mechanism increasing attention span and general focus.

The science behind this.
We developed this in partnership with leading neuroscientists Dr. Evian Gordon (www.brainresource.com) and Dr. Stephen Sideroff (UCLA Professor of Psychology). Trials show typical 12-15% positive increase in focus biomarker and up to…

Read more

Annoying advertising, what you can do


Recently I was asked what I do against advertising on websites. I was a bit confused at first because I didn’t have that problem the last 2-3 years I think. This is when I started to use Adblockers on my browsers to get rid of this annoying advertising or flashing everywhere on the page what distract you from the essential on the page.

So I recommend to use Adblockers as soon as possible and you will look confused as I when you hear about advertising on web pages the next time because there isn’t anymore.

These are two I use:

	https://adblockplus.org/
	https://getadblock.com/

Or if you want to compare more of them, follow this link on comparitech.com… Read more

Recently I was asked what I do against advertising on websites. I was a bit confused at first because I didn’t have that problem the last 2-3 years I think. This is when I started to use Adblockers on my browsers to get rid of this annoying advertising or flashing everywhere on the page what distract you from the essential on the page.

So I recommend to use Adblockers as soon as possible and you will look confused as I when you hear about advertising on web pages the next time because there isn’t anymore.

These are two I use:

https://adblockplus.org/
https://getadblock.com/

Or if you want to compare more of them, follow this link on comparitech.com…

Read more

ORDER BY Oracle vs. Microsoft SQL


Like you would think ORDER BY is the same in Oracle as in the Microsoft environment, it isn’t. It depends on the Collation of the database. In the following example you see, that two manually added text in Oracle and Microsoft don’t order the same. After I added the Collation for SQL_Latin1_General_CP850_BIN2, it ordered the same.

ORDER BY Oracle:



 

ORDER BY Microsoft – normal and with collation:



 … Read more

Like you would think ORDER BY is the same in Oracle as in the Microsoft environment, it isn’t. It depends on the Collation of the database. In the following example you see, that two manually added text in Oracle and Microsoft don’t order the same. After I added the Collation for SQL_Latin1_General_CP850_BIN2, it ordered the same.

ORDER BY Oracle:

 

ORDER BY Microsoft – normal and with collation:

 …

Read more