Home > oracle > vagrant-ubuntu-oracle-xe – ERROR ORA-12162; ORA-12547;

vagrant-ubuntu-oracle-xe – ERROR ORA-12162; ORA-12547;

Problem:
When I tried to connect to vagrant-ubuntu-oracle-xe box I got the following errors

vagrant-ubuntu-oracle-xe$ vagrant up

vagrant-ubuntu-oracle-xe$ sqlplus64 system/manager@//localhost:1521/XE

SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 11 21:50:08 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name: 
Enter password: 
ERROR:
ORA-12162: TNS:net service name is incorrectly specified

Solution:

vagrant-ubuntu-oracle-xe$ vagrant halt
==> default: Attempting graceful shutdown of VM...

vagrant-ubuntu-oracle-xe$ vagrant up

vagrant-ubuntu-oracle-xe$ vagrant ssh

Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 02:23:18 2012 from 10.0.2.2
vagrant@oracle:~$ cat /u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora 
# tnsnames.ora Network Configuration File:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

Added the following to the tnsnames.ora file above (So now I have two entries)
XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )
vagrant@oracle:~$ sqlplus system/manager@//oracle:1521/XE

SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 11 14:11:37 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> quit

vagrant@oracle:~$ exit
logout
Connection to 127.0.0.1 closed.

vagrant-ubuntu-oracle-xe$ sqlplus64 system/manager@//localhost:1521/XE

SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 11 22:11:00 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> quit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Source:
https://github.com/hilverd/vagrant-ubuntu-oracle-xe/issues/19

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: