Tech and travel

Posts

Showing special characters in filename

2007-05-03

Sometimes, especially if your terminal is not set correctly, you accidentally create files that have backspace in their name. To see the full name, you can use the -b option to ls : > ls -b gjdhjd\177\177.txt This file has 2 backspace characters in the name, they are shown as \177. That will give you the full name, which you can use to delete or rename the file. If you want to delete these files, you can use the -i option to ls.

Removing all objects for a user

2007-05-03

From this post, here’s a way to purge all the objects for a user. You can use this if you don’t have SYS access. select 'drop '||object_type||' '|| object_name|| DECODE(OBJECT_TYPE,'TABLE',' CASCADE CONSTRAINTS;',';') from user_objects You should spool this to a file and then run that file. Then to really remove them, use : purge recyclebin; This works on Oracle 10g2.

New Zealand

2007-04-30

I just got back from holiday, here are some pictures.

Auckland

Auckland

Using COLUMN in SQL*Plus

2007-03-19

Here’s something I learned about SQL*Plus today. If you want to create a variable in a script, you can use the COLUMN command. In the following script, 2 variables called HOST_NAME and DATABASE_NAME are created. Their values are filled in when the SELECT statement executes. col host_name new_value HOST_NAME col instance_name new_value DATABASE_NAME SELECT host_name, instance_name FROM v$instance; UPDATE table SET value = '&&HOST_NAME'

Using Oracle with Ruby on Rails

2007-03-14

If you want to use the Ruby Oracle OCI driver with Ruby on Rails, you might run into problems with the configuration. In the database.yml file, the following should be used to specify the host : host: localhost/mydatabase The mydatabase part is the the name of your database. For the adapter ‘oci’ should be specified. The database, username and password fields should be filled in as usual. Thanks to Duane’s Brain for pointing that out.

Copyright (c) 2026 Michel Hollands