... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2005-02-17

Eclipse and Java Remote Debugging

To enable Java remote debugging on the Sun JVM, use the command line:

java ... -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=6666,suspend=n

In Eclipse, go to the Debug launch configuration screen and create a new "Remote Java Application" configuration that uses the address specified in the -Xrunjdwp argument.  Once you are finished debugging, click on the 'disconnect' button in the Debug view.

2005-02-11

NTFS

To create an NTFS hard link from the command line:

fsutil hardlink create new-file.txt old-file.txt

2005-02-07

Oracle Dates

Oracle seems to think that SYSDATE is some strange species of date.  If you try a statement like this:

select case when some_flag=1 then sysdate else some_date end from some_table;

Then Oracle will complain with 'ORA-00932: inconsistent datatypes'. The workaround is to use cast(sysdate as date).

2005-02-04

Oracle

Here is an Oracle SQL statement that generates a DDL script to recreate all of the existing indexes:

select
  case when c.column_position=1
    then 'CREATE'||case when I.UNIQUENESS='UNIQUE' then ' UNIQUE' else '' end
        ||' INDEX '||I.INDEX_NAME||' ON '||I.TABLE_OWNER||'.'||I.TABLE_NAME||' ('
    else '' end,
  c.column_name,
  case when c.column_position <> all(
        select max(column_position) from user_ind_columns where index_name=i.index_name )
    then ', '
    else ');' end
from user_indexes i
, user_ind_columns c
where (c.index_name=i.index_name)

Oracle Plan Tool (ASP)

I created the Oracle plan tool, an ASP page that can be used to view Oracle SQL execution plans.

Blog Archive