配置SSH的對等性傳送ORACLE錯位的歸檔日誌檔案
在所有節點配置SSH的對等性
在安裝Oracle Real Application clusters之前,必須先配置所有節點的SSH對等性。
因為在安裝過程種Oracle Universal Installer使用ssh和scp命令執行遠端命令
執行及copy的工作,還可以用來傳送錯位的歸檔日誌檔案。
下面是具體的步驟:
以下步驟在所有節點上執行
以oracle使用者登陸
# su – oracle
==========================================================
在兩個節點的oracle主目錄分別建立.ssh目錄,並賦予許可權。
==========================================================
# mkdir /opt/oracle/.ssh
# chmod 755 /opt/oracle/.ssh
在svr2節點上配置:
[oracle@svr2 .ssh]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/opt/oracle/.ssh/id_rsa):回車
Enter passphrase (empty for no passphrase):回車
Enter same passphrase again:回車
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
0f:bc:e2:f2:d2:ad:46:1b:c5:65:f7:9e:61:52:51:29
[oracle@svr2 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/opt/oracle/.ssh/id_dsa): 回車
Enter passphrase (empty for no passphrase):回車
Enter same passphrase again:回車
Your identification has been saved in id_dsa.
Your public key has been saved in id_dsa.pub.
The key fingerprint is:
8b:1a:87:f9:de:9f:90:77:db:46:47:bb:4b:40:cf:b8
[oracle@svr2 .ssh]$>/opt/oracle/.ssh/authorized_keys
[oracle@svr2 .ssh]$ touch /opt/oracle/.ssh/authorized_keys
[oracle@svr2 .ssh]$ ls -lt
總用量 20
-rw-r--r-- 1 oracle dba 0 4月 24 08:36 authorized_keys
-rw------- 1 oracle dba 668 4月 24 08:34 id_dsa
-rw-r--r-- 1 oracle dba 601 4月 24 08:34 id_dsa.pub
-rw------- 1 oracle dba 887 4月 24 08:33 id_rsa
-rw-r--r-- 1 oracle dba 221 4月 24 08:33 id_rsa.pub
drwxr-xr-x 2 oracle dba 4096 4月 15 18:07 bak
[oracle@svr2 .ssh]$ uname -n
svr2
[oracle@svr2 .ssh]$ ssh svr2 cat /opt/oracle/.ssh/id_dsa.pub>>/opt/oracle/.ssh/authorized_keys
[oracle@svr2 .ssh]$ ssh svr2 cat /opt/oracle/.ssh/id_rsa.pub>>/opt/oracle/.ssh/authorized_keys
[oracle@svr2 .ssh]$ ssh svr1 cat /opt/oracle/.ssh/id_dsa.pub>>/opt/oracle/.ssh/authorized_keys
[oracle@svr2 .ssh]$ ssh svr1 cat /opt/oracle/.ssh/id_rsa.pub>>/opt/oracle/.ssh/authorized_keys
==========================================================
Accept the default location for the key file.
Enter and confirm a pass phrase that is different from the oracle user’s password. phrase
密碼處直接回車即可
PS:如果提示是否連線選擇yes,密碼輸入oracle使用者的密碼
==========================================================
[oracle@svr2 .ssh]$ chmod 644 /opt/oracle/.ssh/authorized_keys
==========================================================
防止X11轉發造成的安裝失敗,建立~ /.ssh/config,並加入如下內容。
==========================================================
[oracle@svr2 .ssh]$ vi config
Host *
ForwardX11 no
==========================================================
測試svr2如下顯示正常
==========================================================
[root@svr2 root]# su - oracle
[oracle@svr2 oracle]$ exec /usr/bin/ssh-agent $SHELL
[oracle@svr2 oracle]$ ssh svr1 date
Thu Apr 24 08:47:15 CST 2008
[oracle@svr2 oracle]$ ssh svr2 date
Thu Apr 24 08:47:29 CST 2008
對另一節點svr1如上述步驟配置
==========================================================
利用SSH進行檔案傳遞
==========================================================
對錯位的歸檔日誌可以利用SCP來傳遞
crontab -l
0 10,16,22 * * * /sh/rcp.sh >>/sh/rcp_arch.log 2>&1|echo "`date`.../arch/ARC_0002* sent to svr2's archivelog ok..." >>/sh/rcp_arch.log
==========================================================
/sh/rcp.sh內容如下:
==========================================================
[oracle@svr1 sh]$ more rcp.sh
gdbase=/opt/oracle/arch
for bd in `if test -f /opt/oracle/arch/ARC_0001*;then ls /opt/oracle/arch/ARC_0001*;else echo;fi`;do
scp $bd svr2:/opt/oracle/arch/
if test $? -eq 0;then
rm $bd
fi
done
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/216109/viewspace-1002920/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle歸檔日誌Oracle
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 歸檔oracle alert日誌Oracle
- Oracle歸檔日誌清理Oracle
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- oracle 刪除過期的歸檔日誌Oracle
- 在Oracle中,如何定時刪除歸檔日誌檔案?Oracle
- Oracle歸檔日誌所在目錄時間不對&&Oracle叢集日誌時間顯示錯誤Oracle
- oracle11G歸檔日誌管理Oracle
- oracle dg 歸檔日誌恢復情況Oracle
- 【SQL】Oracle 歸檔日誌暴增原因分析SQLOracle
- Oracle歸檔日誌暴增排查優化Oracle優化
- 歸檔日誌挖掘
- PostgreSQL 歸檔日誌SQL
- 【Oracle】如何修改資料檔案和日誌檔案的路徑Oracle
- java專案日誌配置檔案Java
- MySQL InnoDB日誌檔案配置MySql
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- Oracle設定多個歸檔路徑生成多份歸檔日誌,Rman備份時也只備份其中的一份歸檔日誌Oracle
- Oracle DataGuard歸檔日誌丟失處理方法Oracle
- oracle資料庫歸檔日誌量陡增分析Oracle資料庫
- 14. 日誌歸檔
- nginx日誌配置檔案說明Nginx
- 對歸檔模式下CLEAR 未歸檔日誌後恢復資料庫的一點看法模式資料庫
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- 批量註冊歸檔日誌
- PostgreSQL的xlog/Wal歸檔及日誌清理SQL
- 錯誤碼[-718]:收集到的歸檔日誌不連續
- CURL 傳送檔案
- 配置rman來自動刪除應用過的歸檔日誌
- mysqlbinlog 處理二進位制日誌檔案的工具MySql
- Linux伺服器上傳檔案傳送檔案Linux伺服器
- 咦?Oracle歸檔檔案存哪了?Oracle
- DG歸檔日誌缺失恢復
- ArgoWorkflow教程(四)---Workflow & 日誌歸檔Go
- logminer異機挖掘歸檔日誌
- 探究MySQL中的日誌檔案MySql