Wrong function extract

Very interesting “Feature” which I was shown in oracle is the function “extract hour from timestamp”, it appears that Oracle will provide an hour which is wrong:

Solution This behavior is somehow normal however, since the function: extract (hour from current_timestamp) is supposed to return you the hour in UTC format, excluding the timezone, therefore if the hour is 18:00 and the timezone is +02:00 it will return you 16:00, instead of 18:00. There are 2 ways how to negate this:

Use the current_scn:

Use the sum of the UPC hour and the time zone:

Object exists but cannot be replaced

There is a strange phenomena on Oracle, when you try to re-create a procedure which points to a synonym. For example, if you have a schema, which has a synonym pointing to a procedure of other schema and you try to create a new procedure under this user with the same name as the existing procedure you get:

Even though I specify the “OR REPLACE” clause, Oracle still fail. That was very mind itching problem. So let's see who has what:

So the ACTUAL package is owned by 3RD SCHEMA :) and the others are synonyms. So we have to just add the it to the correct schema: