Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

11 March 2013

How to reinstall Oracle XE

Solution based on Oracle XE 11g (it should works for 10g too)
For  Windows

First this is offical guide:
http://docs.oracle.com/cd/B25329_01/doc/install.102/b25143/toc.htm#CIHDDHJD

Good uninstall Guide can be found here:
http://www.oracle-base.com/articles/misc/manual-oracle-uninstall.php

Optional useful tools:
  • CCleaner (or any software for clean registry and clean).
  • Unlocker (or any software to kill process,that use files)

In the past I've had many problems uninstalling all Oracle prodcts from Windows systems. Here's my last resort method:

  • Uninstall all Oracle components using the Oracle Universal Installer (OUI).
  • Run regedit.exe and delete the HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE key. This contains registry entires for all Oracle products.
  • Delete any references to Oracle services left behind in the following part of the registry (HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Ora*). It should be pretty obvious which ones relate to Oracle.
  • Reboot your machine.
  • Delete the "C:\Oracle" directory, or whatever directory is your ORACLE_BASE.
  • Delete the "C:\Program Files\Oracle" directory.
  • Empty the contents of your "C:\temp" directory.
  • Empty your recycle bin.
Installation process is much more complicated as simple next>next>...>finish will end up with troubles.

Follow installation instructions here (but read ONE IMPORTANT NOTE)
http://blog.mclaughlinsoftware.com/2011/09/13/oracle-11g-xe-install/


ONE IMPORTANT NOTE:
You need write down full path as is written on message as full path copied from explorer will not work
The installer is unable to instantiate the file C:\Users\HAPPYUS~1\AppData\Local\Temp\{216DEE42-A1B3-8002-48A2-4A22AE14981}\KEY_XE.reg. The file does not appear to exist

 C:\Users\HappyUser\AppData\Local\Temp\{216DEE42-A1B3-8002-48A2-4A22AE14981}\KEY_XE.reg.

HAPPYUS~1 is OKHappyUser is WRONG!


In 75% .It should works,but in some cases it will fails for various bizarre reasons that are beyond my understanding and I didn't find any solution online yet.I hope ,I will not need to deal with this process to often as it is a nightmare experience.

Sources:
http://docs.oracle.com/cd/B25329_01/doc/install.102/b25143/toc.htm
http://blog.mclaughlinsoftware.com/2011/09/13/oracle-11g-xe-install/

27 February 2013

How to check which port is in use by Oracle ?

so ... step by step solution ....

  • login to sql as admin* 
  • type: SELECT dbms_xdb.gethttpport FROM dual;
  • (you will see which port is used)

(To check is server is running For windows:
run command line (cmd) and type:
netstat -na | findstr :8080 -- to check is server is running

INFO: 8080 or port number displayed as result of 
SELECT dbms_xdb.gethttpport FROM dual;


* 2 ways
1)
from command line
type: sqlplus / as sysdba
type your password

2)
from oracle's command line
(C:\oraclexe\app\oracle\product\11.2.0\server\bin\sqlplus.exe /nolog
type: connect
type: system
type: your password

C:\oraclexe\app\oracle\product\11.2.0  this can vary depends on your instalation path and version of oracle

How to run get started, if normal link doesn't work.

Solution for Windows folks as Unix people knows everything anyway,so they don't need this,

Assuming ,that everything works*

*  for example : if links doesn't work after your restart computer,then this solution will not help,because you get into big troubles and you are quite likely doomed.

link looks like:
http://localhost:8080/apex/f?p=4950

Oracle somethings do not set port during install and then you will see weird link like
http://localhost: %HTTPPORT% /apex/f?p=4950

if you see %HTTPPORT% ,then simply  swap  with 8080 and try again.


If doesn't work ,then this general structure

http://[localhost]:[port]/apex/f?p=4950

  [localhost] - name of your computer , localhost(usually) or ip address (127.0.0.1 or check using normal command line and type:  ipconfig  (IPv4 Address shows your ip ).

  [port] - by default is 8080,but if you changed ,then you need find port.
HOW?

login to sql (using sqlplus from command line or oracle's command line)
SELECT dbms_xdb.gethttpport FROM dual;

it will display which port is used.

f?p=4950   This is optional, you don't really need this,but i added as it is in orginal link. ( http://localhost:8080/apex  or  http://127.0.0.1:8080/apex will works too) 


if link still doesn't work,then run normal command line (cmd) and type:
netstat -na | findstr :8080

8080 or  other port number depends on result of  SELECT dbms_xdb.gethttpport FROM dual; 

if you see:
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING
TCP [::]:8080 [::]:0 LISTENING

then localhost, port are incorrect or you made a typo.
if you don't see,then you have problem with database.(it can be a lots of reasons).


1 March 2012

how to solve problem with "RA-20102: Application collection PLSQL_OBJECT_SOURCE does not exist "?

how to solve problem with RA-20102: Application collection PLSQL_OBJECT_SOURCE does not exist ?

It many reason, why this error appear.Most people discribe this "It appears for no reasons and diseapear somehow". I was this unluckly person to enjoying lots of swearing on how Oracle Database Express Edition is a crap and etc.
Anyway, if you see above problem i found that problem appear because:

If you edit sql file in STS(Eclipse) ,then make sure that your connection profile is set to Oracle_10 (or similar) [it cause problems many time,because STS for fun ,changes this connection profile randomly every single time when i open sql file in STS.]

Another problem that cause above error was problem with ... encoding... in my case it works with ANSI only.(When i uploaded script(UTF-8) and choose UTF-8 (i had above error message or upsidedown question mark as first character)

It solve my problems ....

 Btw.  After IE(web browser) and Eclipse(IDE) ... Oracle(DB) should be proud ,because I join them to my list of mortal enemies in software development.

24 February 2012

How to select name of all tables from oracle database ?

To get list  of name of tables in yoru database (as current user) run below script:

SELECT table_name
FROM user_tables

It will works if you have granted access to do that.

Useful resource for additional info can be found here:
 http://stackoverflow.com/questions/205736/oracle-get-list-of-all-tables

18 May 2011

How to reverse engineering your oracle database with Oracle SQL Developer Data Modeler

Based on solution for version 3.0.0.665

Let's say that you trying to reverse  engineering your database and you looking through menu and you cannot find anything that will suggest that " connection to your database " and you thinking that.
What to do ?
If you fancy reverse engineering you need:

1) go File/Import/Data Dictionary*

2)Press Add.
3)and then you just need feel your connection details
4)press connection test to be damn sure that everything is aright (and fix issue if you have any)
5)and then press OK and then Next>
6)choose your schema/database and press Next>
6)choose your table(s) in database and have fun ;)

*Data dictionary ??? Someone who was response for GUI in this program should stop eat magic mushoom and imagine that is odd word dictionary.