使用sqlplus連線資料庫

2021-09-12 10:03:35 字數 1207 閱讀 5665

sqlplus sjtu/sjtu@'

(description=(address_list=(address=(protocol=tcp)(host=192.168.0.77)(port=1521)))(connect_data=(service_name=sjtu)))

'

如下圖所示:

如下圖所示:

方法1中的格式是固定的,我們在oralce的安裝目錄搜尋tnsnames.ora.sample即可找到相應格式,如下列**所示:

# this is a sample tnsnames.ora that contains

the net8 parameters that are

# needed

to connect to

an hs agent

dg4odbc

=(description

=(address

=(protocol=tcp)(host=localhost)(port=

1521

)) (connect_data

=(sid=

dg4odbc))

(hs=ok)

)

c:\users\xuwei>sqlplus /

nolog

sql> conn /

assysdba

sql>

select name from v$database

;name

---------

orcl

sql>

select

*from

global_name;

global_name

--------------

orcl

posted @

2011-07-05 21:03

xwdreamer 閱讀(

...)

編輯收藏

使用python連線資料庫

使用python連線資料庫 import pymysql 第一步 連線資料庫 conn pymysql.connect host ip位址 port 埠,user 賬號 passwd 密碼 database 資料庫名 第二步 通過連線拿到游標 cursor conn.cursor try sql s...

使用Spring連線資料庫

資料庫連線是一種關鍵 有限且昂貴的資源,建立和釋放資料庫連線是乙個很耗時的操作,頻繁地進行這樣的操作將占用大量的效能開銷,而使用資料庫連線池可以節省系統許多開銷。資料庫連線池 database connection pooling 在程式初始化時建立一定數量的資料庫連線物件並將其儲存在一塊記憶體區中...

使用C 連線資料庫

windows登入連線字串 string a data source initial catalog qq integrated security true sql登入連線字串 string connstr data source initial catalog yi persist securit...