datagard 可以只開啟1521埠麼?

lovehewenyu發表於2012-05-16

Primary database      IP: 192.168.0.11

 

主庫:目前的狀態是我們沒有關閉任何埠,

 

沒有切換的時候,我們沒有發現備庫連線主庫的動作。但是備庫有主庫連線的動作,表明主庫LNS時刻準備著把REDO LOG傳輸給 備庫。

 

[root@mycos-p ~]# netstat -n

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State     

tcp        0      0 127.0.0.1:63270             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:63577             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:13838             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:13840             ESTABLISHED

tcp        0      0 127.0.0.1:61296             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:57266             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:46582             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:3938              127.0.0.1:23364             TIME_WAIT  

tcp        0      0 127.0.0.1:48428             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:42323             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:54262             127.0.0.1:1158              TIME_WAIT  

tcp        0      0 192.168.0.11:22             192.168.0.1:1616            ESTABLISHED

tcp        0      0 127.0.0.1:37173             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:40226             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:30024             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:19767             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:13815             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.11:22             192.168.0.1:4558            ESTABLISHED

tcp        0      0 192.168.0.11:22             192.168.0.1:4303            ESTABLISHED

tcp        0      0 127.0.0.1:13838             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:13840             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.11:22             192.168.0.1:1730            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:13815             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:46579             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:46578             TIME_WAIT  

 

 

standby database  IP:192.168.0.12

 

[root@mycos-s ~]# netstat -n

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State     

tcp        0      0 127.0.0.1:48730             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48750             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48748             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48749             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.12:22             192.168.0.1:1623            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48730             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:45153             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:48749             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48748             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48750             ESTABLISHED

tcp        0      0 127.0.0.1:34507             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:34508             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:25059             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.12:1521           192.168.0.11:35491          ESTABLISHED

tcp        0      0 127.0.0.1:3938              127.0.0.1:46526             TIME_WAIT  

tcp        0      0 192.168.0.12:22             192.168.0.1:4559            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:34508             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:34507             ESTABLISHED

tcp        0      0 192.168.0.12:22             192.168.0.1:1731            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:25059             ESTABLISHED

 

 

 

主庫在切換日誌瞬間

 

我們切換的瞬間有了備庫連線主庫動作,為什麼呢?因為要去主庫檢測API

 

[root@mycos-p ~]# netstat -n

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State     

tcp        0      0 127.0.0.1:1521              127.0.0.1:13838             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:13840             ESTABLISHED

tcp        0      0 127.0.0.1:3938              127.0.0.1:9753              TIME_WAIT  

tcp        0      0 127.0.0.1:60859             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:54801             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:56083             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:33617             TIME_WAIT  

tcp        0      0 192.168.0.11:22             192.168.0.1:1616            ESTABLISHED

tcp        0      0 127.0.0.1:40934             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 192.168.0.11:35491          192.168.0.12:1521           ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:26525             TIME_WAIT  

tcp        0      0 127.0.0.1:6528              127.0.0.1:1158              TIME_WAIT  

tcp        0      0 127.0.0.1:13815             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.11:22             192.168.0.1:4558            ESTABLISHED

tcp        0      0 192.168.0.11:22             192.168.0.1:4303            ESTABLISHED

tcp        0      0 127.0.0.1:13838             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:13840             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.11:22             192.168.0.1:1730            ESTABLISHED

tcp        0      0 127.0.0.1:10308             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:52713             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:13815             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:19195             TIME_WAIT 

 

主庫在切換日誌瞬間

備庫埠情況

 

[root@mycos-s ~]# netstat -n

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State     

tcp        0      0 127.0.0.1:46786             127.0.0.1:1158              TIME_WAIT  

tcp        0      0 127.0.0.1:48730             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48750             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48748             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48749             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.12:22             192.168.0.1:1623            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48730             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48749             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48748             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48750             ESTABLISHED

tcp        0      0 127.0.0.1:34507             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:34508             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:25059             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.12:1521           192.168.0.11:35491          ESTABLISHED

tcp        0      0 192.168.0.12:22             192.168.0.1:4559            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:34508             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:34507             ESTABLISHED

tcp        0      0 192.168.0.12:22             192.168.0.1:1731            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:25059             ESTABLISHED

tcp        0      0 192.168.0.12:1521           192.168.0.16:25320          ESTABLISHED

 

 

埠總結:首先 主庫,備庫 必須開啟1521 埠,通訊。  同時 主庫又開啟了35491埠。現在測試一下這個埠是不是,不變化的呢。 我們重啟主庫。

 

看下我們重啟之後的狀態:很明顯 主庫,備庫開啟了 1521埠外,又開啟了 13445,13444 2個埠。

 

[root@mycos-p ~]# netstat -n

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State     

tcp        0      0 127.0.0.1:35794             127.0.0.1:1158              TIME_WAIT   

tcp        0      0 127.0.0.1:1521              127.0.0.1:14623             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:45362             TIME_WAIT  

tcp        0      0 192.168.0.11:22             192.168.0.1:1616            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:16223             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:25189             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:24678             TIME_WAIT  

tcp        0      0 127.0.0.1:38595             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38598             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:38596             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38597             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38606             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38607             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38604             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38605             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38610             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38611             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38608             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38609             127.0.0.1:1521              TIME_WAIT  

tcp        0      0 127.0.0.1:38614             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:38618             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:3938              127.0.0.1:43906             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:3749              TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:19627             TIME_WAIT  

tcp        0      0 192.168.0.11:13445          192.168.0.12:1521           ESTABLISHED

tcp        0      0 192.168.0.11:13444          192.168.0.12:1521           ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:38598             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:38593             TIME_WAIT  

tcp        0      0 192.168.0.11:22             192.168.0.1:4303            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:38594             TIME_WAIT  

tcp        0      0 192.168.0.11:22             192.168.0.1:1730            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:38603             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:38602             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:38614             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:58322             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:38619             TIME_WAIT  

tcp        0      0 127.0.0.1:1521              127.0.0.1:38618             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:4835              TIME_WAIT

 

 

 

[root@mycos-s ~]# netstat -n

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State     

tcp        0      0 127.0.0.1:48730             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48750             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48748             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:48749             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.12:22             192.168.0.1:1623            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48730             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48749             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48748             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:48750             ESTABLISHED

tcp        0      0 127.0.0.1:34507             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:34508             127.0.0.1:1521              ESTABLISHED

tcp        0      0 192.168.0.12:1521           192.168.0.11:13444          ESTABLISHED

tcp        0      0 192.168.0.12:1521           192.168.0.11:13445          ESTABLISHED

tcp        0      0 127.0.0.1:25059             127.0.0.1:1521              ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:34508             ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:34507             ESTABLISHED

tcp        0    132 192.168.0.12:22             192.168.0.1:1731            ESTABLISHED

tcp        0      0 127.0.0.1:1521              127.0.0.1:25059             ESTABLISHED

tcp        0      0 192.168.0.12:1521           192.168.0.16:25320          ESTABLISHED

tcp        0      0 127.0.0.1:3938              127.0.0.1:4350              TIME_WAIT 

 

 

總結:通過我們對埠的追蹤,可以發現如果我們主庫,備庫只開1521埠是遠遠不夠的,而且主庫會隨機的開啟埠,所以只開啟1521埠,是不能保持DG通訊的。我們這裡只是簡單的測試了一下重新主庫,就開啟了1521埠以外的埠。所以如果是業務DG 還是開啟所有埠比較好,安全層次的去上層做吧,不要在伺服器埠這裡想辦法了,至少我們DG開啟1521埠是不合適的。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-729888/,如需轉載,請註明出處,否則將追究法律責任。

相關文章