Database Connection Using SQLPLUS Without tnsnames.ora from Command Line

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Here is the method to connect to the oracle database using sqlplus without configuring the TNSNAMES from the OS prompt. 

Syntax: 
sqlplus username/password@Host_name:Listener_port/database_Service_name 

Where you must know the username and password for the database. You can use following options to find out the hostname, Listener port and database service name

advertisements
 
SQL> select host_name from v$instance;

HOST_NAME
------------------------------
ora01test.bcndualgate.net

SQL> show parameter service

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- -------
service_names                        string                           TEST

$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 23-MAR-2017 05:35:27
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora01test.bcndualgate.net)(PORT=1521)))
$ sqlplus sthomas/tiger123@ora01test.bcndualgate.net:1521/TEST

SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 23 05:37:01 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show user

USER is "STHOMAS"

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer