Oracle Connection with NetBeans

Este forum é destinado a perguntas relacionadas a Oracle, mas que não se enquadram nos forums acima. Aqui serão tratadas também sobre outras tecnologias da oracle, como o Workflow, BPEL, Spatial, OCS, etc.
Post Reply
marlonpasquali
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 252
Joined: Fri, 06 Feb 2009 3:02 pm
Location: ERECHIM - RS

Galera, I have a little problem. I am trying to set Oracle connection with NetBeans and gives the message:
ORA-12505, TNS: Listener of the NOR Currently Know of Sid Given in Connect Descriptor.

I have in my machine the Oracle Client installed and an TNS configuration to access the PL / SQL.

NetBeans has any own TNS ??? Where should I get the TNS ??

Thanks
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Dude ..

Which connection URL are you using?

Connecting on Oracle Xe?

The SID is wrong ... Use Xe


Answering you ..
NetBeans has no names, who has is your oracle client .. but if you are trying to connect Java in Oracle via jdbc your tns names will not be used because the java jdbc framework will open a connection with your oracle using the driver made available by Oracle

You can find in ..

Select all

$ORACLE_HOME/ora92/network/ADMIN
I hope I have helped
marlonpasquali
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 252
Joined: Fri, 06 Feb 2009 3:02 pm
Location: ERECHIM - RS

Look: We have here Oracle 10g Release 2. My connection is like this:

Select all

jdbc:oracle:thin:@192.168.200.132:1521:NEWPROD
In case, Newprod is the SID I currently use on my TNS to connect to the bank.
Sorry for lack of experience, but start is beginning (rsrsrs)
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

It feels free to ask .. rsrsrs

Select all

  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); 
  Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:<port>:<sid>","<username>","<password>"); 

Your error http://ora-12505.ora-code.com/
How to connect http://www.oracle.com/technology/sample ... _j2ee.html
This error are you having on your machine trying to connect to another that is where the bank is?
Have you ever been able to connect?
Do you have Oracle Client installed on your machine?
marlonpasquali
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 252
Joined: Fri, 06 Feb 2009 3:02 pm
Location: ERECHIM - RS

Yes, the bank is on a server. We use all Oracle's EBS Suite.
On my machine I have the client installed because I use some development tools in PL / SQL and Reports. Connection with the bank operates normally.
Do you have to set up any other NetBeans file ???. The drive I downloaded on the same Oracle website (Classes12.jar).
marlonpasquali
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 252
Joined: Fri, 06 Feb 2009 3:02 pm
Location: ERECHIM - RS

On NetBeans 6.7.1 I do the following:

- New project
- Java
- Java Desktop Application
- Bank application Data
- New database connection
- Oracle Thin (with service ID (SID))

In the Connection Colo:

Select all

jdbc:oracle:thin:@192.168.200.132:1521:NEWPROD
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Good try to see your tnsnames then ..

Are you passing user and password?
Do you connect on this basis for other tools without problem?

I connect this ...
TNSNames

Select all

ABC = 
   (DESCRIPTION = 
      (ADDRESS_LIST = 
         (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) 
      ) 
      (CONNECT_DATA = 
  (SID = ABC) 
      ) 
    )

URL

Select all

jdbc:oracle:thin:@ 127.0.0.1:1521:ABC
Java

Select all

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());    
DriverManager.getConnection(url, user, pass)
Dracozinho
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 1
Joined: Tue, 14 Sep 2010 5:10 pm
Location: Criciuma - SC

Hi, I have a similar problem, I can not connect, as I could not create a new type of connection in the oracle use 10g, I used the sys with password default sysdba, but when I try to connect with netbeans this appears:
0]]]
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER 
Symtompts of the Problem: 
--------------------------- 
Whenever you try to conenct to database by providing SYS user name and password it retuens error. 
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER 
 
Cause of The Problem: 
-------------------- 
This is because of the parameter O7_DICTIONARY_ACCESSIBILITY settings to FALSE. 
 
Access to dictionary objects is restricted to the users with the system privileges SYSDBA and SYSOPER. Connecting as SYSDBA gives a user unrestricted privileges to perform any operation on a database or the objects within a database. Data dictionary objects is under SYS schema and is protected by O7_DICTIONARY_ACCESSIBILITY to FALSE settings. 
 
Workaround Example: 
--------------------- 
1)Try to connect by user sys without sysdba privilege. 
 
SQL> conn sys/a 
ERROR: 
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER 
Warning: You are no longer connected to ORACLE. 
 
2)Connect as sysdba and change O7_DICTIONARY_ACCESSIBILITY 
SQL> conn / as sysdba 
Connected. 
 
SQL> SHOW PARAMETER O7_DICTIONARY_ACCESSIBILITY 
NAME TYPE VALUE 
------------------------------------ ----------- ------------------------------ 
O7_DICTIONARY_ACCESSIBILITY boolean FALSE 
 
SQL> ALTER SYSTEM SET O7_DICTIONARY_ACCESSIBILITY=TRUE scope=spfile; 
System altered. 
 
3)Since O7_DICTIONARY_ACCESSIBILITY is static parameter restart is necessary. 
 
SQL> shutdown immediate; 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 
 
SQL> startup 
ORACLE instance started. 
Total System Global Area 167772160 bytes 
Fixed Size 2019288 bytes 
Variable Size 109051944 bytes 
Database Buffers 50331648 bytes 
Redo Buffers 6369280 bytes 
Database mounted. 
Database opened. 
 
4)Now connect as sys with only password. 
 
SQL> conn sys/a 
Connected. 
 
SQL> show parameter O7_DICTIONARY_ACCESSIBILITY 
NAME TYPE VALUE 
------------------------------------ ----------- ------------------------------ 
O7_DICTIONARY_ACCESSIBILITY boolean TRUE 
 
5)Though you are SYS user but you have not currently have SYSDBA privilege. So, you can't do SYSDBA privilege tasks. 
 
SQL> shutdown immediate; 
ORA-01031: insufficient privileges 
 
SQL> show user 
USER is "SYS" 
 
 
 
Caution: 
----------- 
Oracle Strongly recommends not to use O7_DICTIONARY_ACCESSIBILITY to TRUE. 
 
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest