Tuesday, June 28, 2011

Oracle SQL Developer to Connect to Sybase

Tried SQL Developer to access a Sybase database for the first time today. All  I had to do was go to Tools | Preferences | Third Party JDBC Drivers and add my jTDS driver. After that just configured a connection to use this driver and I was in. This worked fine for qerying data and viewing stored procedures, etc. I was not able to edit the stored procedures with a stored procedure editor.

Sunday, June 19, 2011

Moving Oracle TEMP tablespace

Instead of moving it is much quicker (especially if your TEMP tablespace is large) to create a scratch TEMP tablespace, set the scratch as the default, and then recreate the TEMP tablespace. You will need to drop the original TEMP tablespace, but the creation of the TEMP datafile is instantaneous. once you have the new TEMP tablespace created you can set it back as the default tablespace and then drop your scratch temp tablespace.

Wednesday, June 15, 2011

You can attach just the MDF file in SQL Server to move a database

Moving a database in SQL Server can be done by:

  1. Offlining the database
  2. Copying the MDF file
  3. Attaching the datafile at the new server
You do this by  calling the sp_attach_single_file_db procedure

i.e.
exec sp_attach_single_file_db @dbname='MY_DB', @physname='H:\SQL2\MY_DB.mdf'

SQL Server will automatically create a new logfile