Database Access methods and data access methods
This part is very basic, but if you are not clear about it, it will affect your future study.
SQL> select * from v $ version where rownum = 1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
1. sqlplus username/password @ net_service_name (this is accessed through the network)
C: \ Users \ Administrator> sqlplus hr/hr @ 55
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 01:14:04 2015
Copyright (c) 1982,201 0, Oracle. All rights reserved.
Connect:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
========================================================== ====================== C: \ Users \ Administrator> sqlplus
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 01:16:47 2015
Copyright (c) 1982,201 0, Oracle. All rights reserved.
Enter the User name: hr @ 55
Enter the password:
Connect:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
From Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Open
========================================================== ======================================
C: \ Users \ Administrator> sqlplus/nolog
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 01:17:17 2015
Copyright (c) 1982,201 0, Oracle. All rights reserved.
SQL> conn hr/hr @ 55
Connected.
Of course, you can also use EZCONNECT to connect to the database (easy connect ):
CONNECT username/password @ host [: port]/service_name [/instance_name]
CONNECT username/password @ [//] host [: port]/service_name
If the connection fails, check the client \ network \ admin \ sqlnet. ora:
SQL> select * from v $ version where rownum = 1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
Add EZCONNECT:
NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
The following example does not add EZCONNECT:
The server \ network \ admin \ sqlnet is removed through simulation. NAMES in ora. the client can still use EZCONNECT to connect to DIRECTORY_PATH. I am not very clear about this. I hope some friends can share it with me.
2.
[Oracle @ localhost ~] $ Sqlplus hr/hr
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 02:12:05 2015
Copyright (c) 1982,200 9, Oracle. All rights reserved.
Connect:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
3.
[Oracle @ localhost ~] $ Sqlplus sys/manager as sysdba
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 02:12:49 2015
Copyright (c) 1982,200 9, Oracle. All rights reserved.
Connect:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
4.
[Oracle @ localhost ~] $ Sqlplus
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 02:13:45 2015
Copyright (c) 1982,200 9, Oracle. All rights reserved.
Enter the User name: hr
Enter the password:
Connect:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
5.
[Oracle @ localhost ~] $ Sqlplus/nolog
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 02:15:09 2015
Copyright (c) 1982,200 9, Oracle. All rights reserved.
SQL> connect hr/hr
Connected.
SQL> exit
From Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options disconnected
[Oracle @ localhost ~] $ Sqlplus/nolog
SQL * Plus: Release 11.2.0.1.0 Production on Sunday May 17 02:15:40 2015
Copyright (c) 1982,200 9, Oracle. All rights reserved.
SQL> connect sys/manager as sysdba
Connected.
This method starts sqlplus and connects to the database through connect.
6. tools provided by oracle or third-party tools:
SQL developer, pl/SQL developer, toad, spotlight .......
If you know how to connect to the database through the network, this is very simple.
These methods are briefly described above, but they are not listed in detail, for example:
HOSTNAME, LDAP, NIS, and other methods. If you are interested, you can experiment on your own.