Pretty Printer for Oracle TNS entries? - oracle

I've got some TNS entries formatted as single long lines. Any pretty printers available? Here's an example of what I've currently got.
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = trac403-vip.pixar.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = tmpltest) (INSTANCE_NAME = tmpltest3)))

Here you go :)
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = trac403-vip.pixar.com)(PORT = 1521)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = tmpltest)
(INSTANCE_NAME = tmpltest3)
)
)

Related

Can't connect to oracle database with Oracle SQL Developer

When I try to connect I get error:
I disabled firewall, started the OracleServiceXE, but still get error.
When I use command lsnrctl status, I get:
lsnrctl start:
My tnsnames.ora file looks like that:
# tnsnames.ora Network Configuration File: C:\app\Coi\product\18.0.0\dbhomeXE\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.0)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
LISTENER_XE =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.8)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)

Two oracle databases on one IP

What I have:
1) Oracle 11R1 services on Local system
2) Oracle 12c services on other account
TNS listener run from oracle 11R1 (but also I've create one for 12c)
As a first solution I try
A12c =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1531))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = A12c.1.1.1)
)
)
B11R1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = B11R1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1531))
)
)
With this configuration I could connect to 11r1 (also on 1531 port !) but nt to 12c. When I setup two listener situation was same. When I run with 12c listener I could not connect to any databases.
Will be grateful for any suggestions.
Thank you

How can I write TNS strings in tnsnames.ora file when I have 2 Unix machines set up with the same DB instance name?

I have 2 servers X and Y. both the servers are set up with the Oracle DB instances with the name Z.
I need to have these inforamtions in the same tnsnames.ora file. How can I do this?
Something like this:
<DB_X> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = <hostnameX>)(Port = <port>))
)
(CONNECT_DATA =
(SERVICE_NAME = <Z>)
)
)
<DB_Y> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = <hostnameY>)(Port = <port>))
)
(CONNECT_DATA =
(SERVICE_NAME = <Z>)
)
)

Network adapter Could Not Established The Connection IN SQL Developer

I am trying connect the oracle database using SQL Developer tools but It showing me:
IO ERRORS: Network adapter Could Not Established The Connection
I Started the OracleXETNSListner service from service.msc: it's running.
I also used the lsnrctl start command, which couldn't start the listener either.
And one more thing: I used sqlplus command prompt: it works fine (also gets connected database)
Thanks in advance...
this is my Tnsname.ora file
my tnsname file located at C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\tnsnames.ora
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = HP-PC)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

Need to Add Oracle Listener for Second NIC

I am currently running Oracle 11g on a Windows 2012 Environment.
I recently added another NIC to allow for failover, however I am not sure as to what to do with my listener.ora file and my tnsnames.ora file. Could someone offer guidance? For reference, the current IP I am using is 192.168.0.52 and the IP of the second NIC that I would like to add has the IP of 192.168.0.53.
Below is my listener.ora file:
# listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Administrator
Below is my tnsnames.ora file:
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
Thanks for all your help!
Well, you can specify multiple ADDRESS entries in the listener.ora:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.53)(PORT = 1521))
)
)
And in tnsnames.ora:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.53)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
When I specify multiple addresses for listener, it listens on all interfaces listed. And when at least one address in tnsnames can be connected to -- it connects. I have 11g available for testing both on the client-side and on the server-side. I checked the documentation (Multiple Address Lists in tnsnames.ora) and it states that parameter (FAILOVER=on) can be specified in tnsnames.ora explicitly.

Resources