訪問資料庫的幾種方法
這部分很基礎,但是如果搞不清楚,對以後的學習會有影響。
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 (這是透過網路訪問)
C:\Users\Administrator>sqlplus hr/hr@55
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 01:14:04 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 01:16:47 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
請輸入使用者名稱: hr@55
輸入口令:
連線到:
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
從 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 /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 01:17:17 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> conn hr/hr@55
已連線。
當然也可以過EZCONNECT連線資料庫(easy connect):
CONNECT username/password@host[:port]/service_name[/instance_name]
CONNECT username/password@[//]host[:port]/service_name
假如你連線沒有成功檢查一下客戶端\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
新增EZCONNECT:
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)
下面模擬不新增EZCONNECT:
透過模擬去除伺服器端 \network\admin\sqlnet.ora中 NAMES.DIRECTORY_PATH的引數EZCONNECT,客戶端任然可以透過EZCO連線,這一點我不是太清楚,希望有朋友可以分享一下。
2.
[oracle@localhost ~]$ sqlplus hr/hr
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 02:12:05 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
連線到:
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 星期日 5月 17 02:12:49 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
連線到:
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 星期日 5月 17 02:13:45 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
請輸入使用者名稱: hr
輸入口令:
連線到:
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 星期日 5月 17 02:15:09 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect hr/hr
已連線。
SQL> exit
從 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 斷開
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 02:15:40 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect sys/manager as sysdba
已連線。
此種方法是啟動了sqlplus,然後透過connect連線上了資料庫.
6.透過oracle提供的工具或第三方工具:
sql developer ,pl/sql developer,toad,spotlight.......
如果透過網路連線資料庫掌握了,這都是非常簡單的了。
以上比較簡潔的介紹了這些方法,但是並沒有羅列全部,比如還有:
HOSTNAME,LDAP,NIS等方法,感興趣可以自行實驗。
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 (這是透過網路訪問)
C:\Users\Administrator>sqlplus hr/hr@55
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 01:14:04 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
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>sqlplusSQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 01:16:47 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
請輸入使用者名稱: hr@55
輸入口令:
連線到:
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
從 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 /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 01:17:17 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> conn hr/hr@55
已連線。
當然也可以過EZCONNECT連線資料庫(easy connect):
CONNECT username/password@host[:port]/service_name[/instance_name]
CONNECT username/password@[//]host[:port]/service_name
假如你連線沒有成功檢查一下客戶端\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
新增EZCONNECT:
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)
下面模擬不新增EZCONNECT:
透過模擬去除伺服器端 \network\admin\sqlnet.ora中 NAMES.DIRECTORY_PATH的引數EZCONNECT,客戶端任然可以透過EZCO連線,這一點我不是太清楚,希望有朋友可以分享一下。
2.
[oracle@localhost ~]$ sqlplus hr/hr
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 02:12:05 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
連線到:
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 星期日 5月 17 02:12:49 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
連線到:
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 星期日 5月 17 02:13:45 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
請輸入使用者名稱: hr
輸入口令:
連線到:
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 星期日 5月 17 02:15:09 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect hr/hr
已連線。
SQL> exit
從 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 斷開
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 02:15:40 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect sys/manager as sysdba
已連線。
6.透過oracle提供的工具或第三方工具:
sql developer ,pl/sql developer,toad,spotlight.......
如果透過網路連線資料庫掌握了,這都是非常簡單的了。
以上比較簡潔的介紹了這些方法,但是並沒有羅列全部,比如還有:
HOSTNAME,LDAP,NIS等方法,感興趣可以自行實驗。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29876893/viewspace-1658103/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 訪問HyperSQL資料庫的方法SQL資料庫
- 幾種常見的資料庫連線方法資料庫
- php連線mysql資料庫的幾種方法PHPMySql資料庫
- mysql資料庫連表查詢的幾種方法MySql資料庫
- sqlplus連線資料庫的幾種方法SQL資料庫
- J2EE中幾種物件導向的資料庫對映訪問策略:物件資料庫
- 【方法】如何限定IP訪問Oracle資料庫Oracle資料庫
- 大資料分析的幾種方法大資料
- Linux禁止某個IP地址訪問的幾種方法Linux
- 使用Visual Basic訪問資料庫幾個注意的問題 (轉)資料庫
- oracle 索引訪問的幾種方式Oracle索引
- excel檔案中的資料匯入Oracle資料庫的幾種方法ExcelOracle資料庫
- 多個人訪問實體Bean,這個Bean訪問幾次資料庫啊?Bean資料庫
- jboss訪問資料庫的問題資料庫
- c#訪問oracle幾種方法(轉載)_data accessC#Oracle
- iOS 資料持久化的幾種方法iOS持久化
- JDBC資料庫訪問JDBC資料庫
- Spring框架訪問資料庫的兩種方式的小案例Spring框架資料庫
- 資料庫連線的方法種種資料庫
- 幾種常用資料庫比較資料庫
- Excel快速錄入資料的幾種方法Excel
- MySql資料庫備份的幾種方式MySql資料庫
- 資料庫SQL調優的幾種方式資料庫SQL
- mybatis連線資料庫的幾種方式MyBatis資料庫
- 幾種場景的資料庫恢復資料庫
- Oracle資料庫訪問控制Oracle資料庫
- 異構資料庫訪問資料庫
- JDBC訪問資料庫的步驟JDBC資料庫
- 遠端資料庫的訪問 (轉)資料庫
- Java Spring中同時訪問多種不同資料庫JavaSpring資料庫
- GUI應用程式該以何種方式訪問資料庫?GUI資料庫
- 64位下安裝plsql dev訪問資料庫方法SQLdev資料庫
- JS資料型別判斷的幾種方法JS資料型別
- 瀏覽器儲存資料的幾種方法瀏覽器
- oracle 刪除重複資料的幾種方法Oracle
- 幾種主要的oracle資料庫問題發生後資料恢復的成功概率分析Oracle資料庫資料恢復
- 外網訪問MySQL資料庫MySql資料庫
- Oracle資料庫限制訪問IPOracle資料庫