Home > .NET, Oracle, Vs2013 > Oracle development notes

Oracle development notes

2015/04/02

After many years (Oracle 8..) i’m back to develop on Oracle (using Microsoft Windows). So, after some problem, here a little quick guide for starting with the current versions (April 2015). Before of all, must be installed the java JDK, the 64 bit package jdk-8u40-windows-x64.exe or 32 (jdk-8u40-windows-i586.exe) depending from your system. Then must be installed , as already written in this post, the ODAC component: in this page for the 64 bit version (is recommended the version with installer, not the Xcopy version) ; the 32 bit version here. The main product for the developer is Oracle SQL Developer from here. The Oracle SQL Developer is installed by default in c:\app, the folder c:\app\client\<your_windows_user_name>\product\12.1.0\client_1\Network\Admin is the default place where to place the tnsnames.ora file, needed for the Oracle connections. We have 2 servers, one for development and the other is the official database:

VJSVIL =
  (DESCRIPTION =
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = 10.86.13.xxx )
          (Port = 1521)
        )
    (CONNECT_DATA = (SID = VJSVIL)
    )
  )

VJ4SAP =
  (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = srv-vrj)(PORT = 1521))
     (CONNECT_DATA =
       (SERVER = DEDICATED)
       (SERVICE_NAME = XE)
     )
   )

Note that the development entry is using the IP , instead for the official database is used the hostname. If must be used the hostname for some reason (as in this case) could be useful to map the hostname to the ip in C:\Windows\System32\drivers\etc\hosts, in our case:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#        127.0.0.1       localhost
#        ::1             localhost
10.86.13.xxx        srv-vrj

In order to work, it must be verified that the 1521 port is opened in the firewalls. Launching SQLDeveloper there are 2 problems that you can encounter. The first is the language , for example the software is working in French or Italian and in the preferences menu there is nothing for the language. The language setting in English is done by adding the line AddVMOption -Duser.language=en In the file <path where you unzipped SQL developer>\sqldeveloper\bin\sqldeveloper.conf; another strange problem could be the error ORA-01882: timezone region not found.
This is resolved by adding in sqldeveloper.conf AddVMOption -Duser.timezone=CET.
In SQL Developer we can add a connection selecting the TNS item: 02-04-2015 15-51-19 And we can expand and see the list of tables, views, etc. below the connection name node. 02-04-2015 16-15-14

Advertisements
Categories: .NET, Oracle, Vs2013
%d bloggers like this: