Database Access methods and data access methods

Source: Internet
Author: User

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.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.