I write solutions to the problems I can't find much about elsewhere on the Web, also some code/script snippets that are absolutely awesome and make my life easier. Will be glad if someone finds these posts interesting and helpful!

Showing posts with label Oracle DB. Show all posts
Showing posts with label Oracle DB. Show all posts

Monday, May 3, 2010

Oracle database schema data removal

In my previous post I mentioned a script I used to drop everything from the schema, and I thought it could come handy to someone, hence here it is:

This script has been extensively tested on Oracle 10g for all kind of editions and seems to work awesomely!
Beware, this WILL REMOVE EVERYTHING FROM THE DATABASE SCHEMA FOR USER YOU HAVE CONNECTED AS; that is if you connect as sysdba, it will most likely make the database useless.

Service management in Windows

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services in Registy Editor (regedit.exe under WINDOWS\system32), there lookup the service by name. Properties appear on the right of the tree.
One property that can be surely needed at some point is the location of the executable of a service. That’s the property ImagePath.
Whoever has set up an Oracle Database instance knows what I’m talking about here The story behind that, is that I made the mistake to run the script which drops everything from my scheme, whilst I had connected as sysdba Yeah, I know.. stupid. Well, not the first time Anyways, the thing is that during second set up, Oracle DB seems to highly dislike the previous instance and does not alter all the services correctly (oh, I just hope that it wasn’t left intentionally, because that would mean, the developers aren’t human beings). E.g. the OracleCSService (something to do with clustering) doesn’t shut down correctly and consequentially during the second set up the path doesn’t change. Here I had to change the ImagePath for it at the location HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OracleCSService. As simple as that.
The truth be told, I still haven’t figured out how to properly set up a fresh instance after removing the previous. Sounds like a story for another post.

P.S. After quite a research I found a great post about a complete removal of the previous installation. Find it here. I tried the method described like a hundred times already and it seems to work perfectly.