Monthly Archives: February 2007

Always search before coding

This is a annoying, even if it take 5mn to code thing like that :

(defun my-dired-rm-rf()
  "Rm -rf directories"
  (interactive)
  (let ((sel (selected-window)))
	(dolist (curFile (dired-get-marked-files))
	  (if (yes-or-no-p (concat "Do you want to remove \"" (file-name-nondirectory curFile) "\" ? "))
		  (progn
			(shell-command (concat "rm -rvf " curFile) 
"*Removing Directories*")
			(kill-buffer "*Removing Directories*")
			(select-window sel)
			(revert-buffer)
			)
		))
	))

you discover after a litlle while that if you have did a lilt bit of searching before, you will have discovered a variable call `dired-recursive-deletes` that would do the thing in a much better way.

Import Export to different tablespace names with Oracle 9i

Renaming Oracle Database is a pain, coming from OpenSource DB like
MySQL or PostGres where we do that all the time i did not think that
Oracle have to be such a pain.

My only way i can find.

– If i have the tablespace named tablesp1 and owned by the
user user1, and i want to import it to another tablespace
called tablesp2 in an another Oracle 9i tablespace with the user
name user2.

  • I import the tablesp1 in an Oracle 10 (if you are lucky to have
    one).
  • Make sure i create the user2 in the Oracle10 DB.
  • I connect as DBA access and i rename the tablespace with :
    [code lang="sql"]
    ALTER TABLESPACE tablesp1 RENAME TO tablesp2
    ALTER TABLESPACE tablesp2 OWNER TO user2
    [/code]

  • Export the Oracle10 tablespace with Oracle 9 exp.
    Sometime sometime you may encounter that famous error

    "EXP-00003 : no storage definition found for segment .....". 
    

    So you have have to
    do this as well.

  • That’s it. The dump should be under tablespace name tablesp2 with
    owner user2.

SVN Diff against changes in the remote repository.

A useful svn wrapper scripts. Get a diff of your local repostitory against the upstream repository changes. I wonder why it is not builtins though like a svn status -u but for dif.

#!/bin/bash

IFS="
"
for line in `svn status -u`;do
    [[ $line != "   "* ]] && continue
    rev=`echo $line|awk '{print $2}'`
    ff=`echo $line|awk '{print $3}'`
    svn diff -r${rev}:HEAD $ff
done