Search This Blog

Total Pageviews

Tuesday 1 February 2011

Connect to SQL*Plus with no TNSnames




Oracle's easy connect naming method. EZCONNECT 


sqlplus [user]/[password]@//[database_host]:[port]/[service_name] 

service_name=SID

In order to be prompted for a password while using the EZCONNECT naming adapter, use the following syntax:

sqlplus username@\"[hostname]:[port]/[service name]\"

example: sqlplus system@\"netfl-unix1:1521/v10.us.oracle.com\" 


If you performed a "typical" Oracle database server installation, the default service name for the instance will be ORCL. Use the following easy connect syntax to connect to that instance:




SQL> select NAME from v$database; 

NAME
---------
ORCL


database DEV01

sqlplus scott/tiger@apt-lnxtst-01/orcl
if port no is default i.e. 1521 then there is no need for port

sqlplus scott/tiger@BIGSERVER:1616/DEV01


oracle@apt-lnxtst-01:~> 


sqlplus scott/tiger@192.168.2.232/orcl

sqlplus scott/tiger@apt-lnxtst-01/orcl


sqlplus scott/tiger@192.168.2.232:1521/orcl


sqlplus scott/tiger@192.168.2.232:1521/orcl


=================

**************
sqlplus anuj@'(DESCRIPTION_LIST=(LOAD_BALANCE=off)(FAILOVER=on)(DESCRIPTION=(ENABLE=broken)(ADDRESS=(PROTOCOL=TCP)(HOST=***-scan.****)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=arac))))'

SQL*Plus: Release 12.2.0.1.0 Production on Fri Dec 17 01:40:14 2021

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

Enter password:
ERROR:
ORA-28002: the password will expire within 7 days


Last Successful login time: Sat Oct 23 2021 07:48:12 -05:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

primary:anuj@******** sqlplus>


**************



sqlplus /@"(DESCRIPTION=(FAILOVER=ON)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.211.106.64)(PORT=1521)))(CONNECT_DATA=(SID=orcl)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=5)(DELAY=10))))"

3 comments:

Anuj Singh said...



sqlplus 'sys/sys@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.85.132)(Port=1521))(CONNECT_DATA=(SID=vihaan))) as sysdba'

Anuj Singh said...




-bash-3.2$ sqlplus 'sys/sys123@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.0.16)(Port=1521))(CONNECT_DATA=(SID=vihaan))) as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 29 10:49:16 2013

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

Connected to an idle instance.


sqlplus 'sys/sys@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.0.16)(Port=1521))(CONNECT_DATA=(SID=vihaan))) as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 29 10:46:56 2013

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

Connected to an idle instance.



-bash-3.2$ sqlplus 'sys/sys123@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.0.16)(Port=1521))(CONNECT_DATA=(SID=vihaan))) as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 29 10:49:52 2013

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

ERROR:
ORA-01017: invalid username/password; logon denied

Anuj Singh said...

Oracle Easy Connect

sqlplus myusername/password@HostName/ORCL

Oracle DBA

anuj blog Archive