mardi 26 juillet 2011

MacOS X Lion and the restore function


I don't know you but I don't like my browser to restore the last opened tabs...
same for preview!

good news, you can revert it.
open the terminal and type:

defaults write ApplePersistenceIgnoreState YES
defaults write ApplePersistenceIgnoreState YES

and that's like before, the "good old time" :-)

dimanche 24 juillet 2011

SQL Server with Oracle linked server


last days I spent a lot of time to establish a link server to Oracle from SQL Server.
I thought that using instant client was enough but I was definitely wrong.
... what to install then for making it working?

I had to search a long time before I saw somewhere on a forum (sorry I lost the link) that we should install this one:
32-bit Oracle Data Access Components (ODAC)
with Oracle Developer Tools for Visual Studio

you can find it here:

now it is easy:

add a tsnnames.ora in the folder ORACLE_HOME\Network\Admin\
and add your server like:

     (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))
   (SERVICE_NAME = myserviceSID)

now you should be able to connect with:

then create an ODBC connection to Oracle, choosing the driver "ORACLE in ../instant client/..."
the name of the ODBC connection will be for instance MY_SERVER_ODBC

then go to SQLServer and add the linked server:

exec sp_addlinkedserver @server='MY_SERVER', 
EXEC sp_addlinkedsrvlogin 
     @rmtsrvname        = 'MY_SERVER'
    ,@useself           = 'False'
    ,@locallogin        = NULL
    ,@rmtuser           = 'ORACLE_USER'
    ,@rmtpassword       = 'ORACLE_PWD'

congratulations, now you should be able to make a select by typing: