sqlplus /nolog
[oracle@wcs ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Sat May 28 18:19:53 2011 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL> conn / as sysdba; Connected to an idle instance. SQL> exit
sqlplus / as sysdba
[oracle@wcs ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat May 28 18:31:25 2011 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>
[oracle@localhost ~]$ sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 5 09:44:13 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: sys as sysdba Enter password:
SQL> conn / as sysdba;
set line 2000 set linesize 2000 set pagesize 100 col ename format a30 col sal format 999,999.999 alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
SQL> @ /home/oracle/your.sql
set pagesize 0 set linesize 80 set term off set feed off set echo off set show off set veri off set head off spool outputfile select * from dba_users; / spool off
Example: Connect to database using Net Service Name and the database net service name is ORCL.
sqlplus myusername/mypassword@ORCL
sqlplus "user/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.4.9)(Port=1521))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME = orcl.example.com)))"