遠端客戶端 訪問 ASM 例項
轉載於:http://blog.csdn.net/tianlesoftware/article/details/5901749
我們可以直接在伺服器器上訪問ASM 例項,只需要指定ASM 例項名,在用sqlplus連線就可以了。 如果我們想從遠端的客戶端訪問ASM 例項,可以參考如下的配置方法。
一.官網的配置說明
This solution cannot be accomplished using Network Manager (GUI)
The solution is to
* Edit the listener.ora on ASM server
* Edit the tnsnames.ora on the client
* Setup your remote login password for your ASM instance on the ASM server
* Set your SYS password using ORAPWD for the ASM instance
* Use the properly formatted connect string to connect with your tool
1) Edit the listener.ora on ASM server
a) Logon to the ASM/Database server
b) Locate your listener.ora (typically located in the $ORACLE_HOME/network/admin)
c) Add a SID_LIST_LISTENER entry for your ASM instance (see example below)
EXAMPLE
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = +ASM)
(ORACLE_HOME = c:/oracle/app/product/11.1.0/db_1)
)
)
d) Stop the listener
lsnrctl stop
e) restart the listener
lsnrctl start
2) Edit the tnsnames.ora on the client
a) Logon to the client machine that will be used to connect to the ASM instance
NOTE: the client machine can also be the ASM/Database server (ie for DBCONTROL)
b) Locate your tnsnames.ora (typically in the $ORACLE_HOME/network/admin)
c) Add an entry (tnsalias) for your ASM instance (see example)
EXAMPLE
ASM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = kbcook-1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID_NAME = +ASM)
(UR=A)
)
)
3) Setup your remote login password for your ASM instance on the ASM server
a) Logon to the ASM/Database server
b) Locate the parameter file for your ASM instance (typically $ORACLE_HOME/dbs/init+ASM.ora [unix] or $ORACLE_HOME/dbs/init+ASM.ora [windows] )
c) Edit the parameter file and add
remote_login_passwordfile = exclusive ... for stand alone ASM setups
remote_login_passwordfile = shared ... for ASM setups that also use Real Application Cluster (RAC)
d) Save the file
NOTE: It may be required that an PFILE be created from an SPFILE in order to be able to edit the file properly ... once the line have been added ... the process can be reversed
For more details Pfile vs SPfile ... may be used
4) Set your SYS password using ORAPWD for the ASM instance
a) Logon to the ASM/Database server
b) Locate your orapw
c) Rename the file to orapw
d) Run orapwd to reset the password (see example below)
EXAMPLE
mv "orapw+ASM" "orapw+ASM.old"
orapwd file=orapw+ASM password=kbcook
5) Use the properly formatted connect string for your tool
Connnect to the ASM instance using the password (#4 above) and the tnsalias (#2 above)
EXAMPLES
C:/oracle/app/product/11.1.0/db_1/BIN/SQLPLUS.EXE "sys/kbcook@asm as sysdba"
sqlplus "sys/kbcook@asm as sysdba"
sqlplus "sys@asm as sysdba" ... then supply the password when prompted
二. 測試
這裡我們已連線ASM 例項1為例,所以只修改這個節點上的ASM 相關配置引數。 如果要配置2個節點,就修改2個節點的LISTENER.ORA檔案。 內容一樣。然後在客戶端監聽tnsnames.ora 檔案裡修改IP地址就可以了。
2.1 伺服器配置
在目錄$ORACLE_HOME/network/admin下,修改ASM例項的LISTENER.ORA檔案,新增紅色部分,然後重啟監聽。
SID_LIST_LISTENER_RAC1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = +ASM) -- ASM 例項名是+ASM1和+ASM2。 但這裡與ASM 例項的service_names 引數一致
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
)
)
重啟監聽:
[oracle@rac1 admin]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-SEP-2010 00:03:08
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle@rac1 admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-SEP-2010 00:03:18
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 23-SEP-2010 00:03:18
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@rac1 admin]$
2.2 修改客戶端的$ORACLE_HOME/network/admin/tnsname.ora 檔案
ASM1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = +ASM) -- 注意這裡寫的是ASM, 而不是ASM1
(UR=A) -- 這個必須加,不然連不上
)
)
2.3 測試一下:
C:/Users/Administrator.DavidDai>tnsping ASM
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 23-9月 -2010 11:28:48
Copyright (c) 1997, 2010, Oracle. All rights reserved.
已使用的引數檔案:
D:/app/Administrator/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
已使用 TNSNAMES 介面卡來解析別名
嘗試連線 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = +ASM) (UR=A)))
OK (0 毫秒)
2.4 客戶端用sqlplus 連線
SQL> conn sys/oracle@ASM as sysdba;
已連線。
SQL> select Instance_name from v$instance;
INSTANCE_NAME
--------------------------------
+ASM1
SQL> show parameter service_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string +ASM
小結:
透過上面實驗,我們發現操作和官網的步驟有出入。 所有文件都是供參考的,具體的情況要具體對待。 只有透過做實驗,才能掌握這些知識。 這也是我一直說,學Oracle 就必須多做實驗。 沒有其他方法。 書上那些東西,也不一定完全正確。 我們學習的過程,就是用實驗去證明那些理論。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29119536/viewspace-1083659/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 從客戶端連線ASM例項客戶端ASM
- mysql例項停止、啟動、配置遠端訪問MySql
- Mqtt websocket javascript 客戶端例項MQQTWebJavaScript客戶端
- mysql賬戶新增遠端訪問MySql
- CouchBase C 客戶端介面呼叫例項客戶端
- ElasticSearch客戶端簡單操作例項Elasticsearch客戶端
- Nacos - 客戶端例項列表獲取客戶端
- BCB 客戶端 tuxedo 開發例項客戶端UX
- 不用安裝oracle客戶端,PL/SQL也能遠端訪問資料庫Oracle客戶端SQL資料庫
- Cisco Secure Client 5.1.6.103 (macOS, Linux, Windows & iOS, Andrord) - 遠端訪問客戶端clientMacLinuxWindowsiOS客戶端
- mysql設定指定ip遠端訪問連線例項MySql
- 客戶端訪問POP3--SMTP客戶端
- BCB 客戶端 tuxedo 開發例項 (轉)客戶端UX
- SHA-256加密簡單例項(客戶端、服務端)加密單例客戶端服務端
- Docker部署mysql並提供客戶端訪問DockerMySql客戶端
- 客戶端 post ,get 訪問伺服器客戶端伺服器
- 叢集例項:配置ISCSI客戶端(LINUX)客戶端Linux
- easyui-table表格客戶端分頁例項UI客戶端
- Redis遠端訪問Redis
- linux遠端客戶端putty,xshell搭建注意事項——《視訊》Linux客戶端
- 限制訪問Oracle客戶端IP方法總結Oracle客戶端
- 如果呼叫遠端遠端url介面為https,且存在客戶端證書驗證,如何在客戶端處理HTTP客戶端
- TeamViewer遠端訪問View
- 用VB編寫OPC客戶端訪問WINCC (轉)客戶端
- 3.1.5.9 啟動遠端例項
- [精華][推薦]CAS SSO單點登入服務端客戶端例項服務端客戶端
- binder通訊例項之c++客戶端與c++服務端C++客戶端服務端
- rabbitmq 新增遠端訪問功能MQ
- 遠端訪問及控制——ssh
- Linux SSH遠端訪問Linux
- PostgreSQL 9.6 配置遠端訪問SQL
- SSH遠端訪問及控制
- bbossaop遠端服務介紹-遠端服務呼叫例項
- C++20協程例項:攜程化的IOCP服務端/客戶端C++服務端客戶端
- PHP-Socket服務端客戶端傳送接收通訊例項詳解PHP服務端客戶端
- JAVA FTP客戶端問題JavaFTP客戶端
- FastDFS-nginx外掛作為FastDFS客戶端訪問ASTNginx客戶端
- EVE-NG初次啟動及WEB客戶端訪問Web客戶端