導航:首頁 > 編程大全 > srvctl注冊資料庫

srvctl注冊資料庫

發布時間:2023-04-28 17:55:06

㈠ 如何修改vip 或者vip 對應的hostname

答:修改vip 或者vip 對應的hostname詳細步驟如下:

在oracle 10g 和 11g 的Clusterware 環境中,客戶端使用vip(Virtual IP)來連接資料庫,客戶端應用程序通過vip訪問對應的節點上的資料庫實例。每個節點都要有一個vip,這些vip是靜態的ip地址,必須與公共網路屬於同一個子網。每一個vip也要對應一個主機名,而且對於客戶端來說,這個主機名應該能夠被解析為VIP.VIP通過DNS,/etc/hosts文件來解析(11GR2 可以使用GNS),在安裝GI軟體時候,會提示為每一個節點填寫對應的VIP和VIP對應的hostname,vip信息會存儲在OCR和HA架構相關的組件中。

通常來說,VIP的修改需要在規定的時間窗口內,cluster 停止服務。然而對於某種情況下,是不需要停機時間,比如只是修改一個節點的vip維護操作只要在那個節點上就可以了,而不必停止整個cluster。

從10.2.0.3 以來,oracle 去除了ASM/DATABSE對vip的依賴關系,這樣對vip的修改可以在不必停止ASM/DATABASE實例的情況下進行,需要做的僅僅是與這個節點連接的客戶端受到影響。

實驗環境:
版本
Clusterware :11.2.0.2
database :11.2.0.1

修改vip的操作步驟:
舊vip:
10.10.10.201 rac1-vip
10.10.10.202 rac2-vip
新vip:
10.250.7.111 rac1-vip
10.250.7.112 rac2-vip

子網 10.250.7.0

掩碼 255.255.255.0
1 確定vip
對於 10g and 11gR1, 以CRS的屬主:
$ srvctl config nodeapps -n -a
比如:
$ srvctl config nodeapps -n racnode1 -a
VIP exists.: /racnode1-vip/101.17.80.184/255.255.254.0/eth1
對於 11gR2, 以Grid 屬主:
$ srvctl config nodeapps -a
grid@rac1:/home/grid>srvctl config nodeapps -a
網路存在: 1/10.250.7.0/255.255.255.0/eth0, 類型 static
VIP 存在: /rac1-vip/10.10.10.201/10.250.7.0/255.255.255.0/eth0, 託管節點 rac1
VIP 存在: /rac2-vip/10.10.10.202/10.250.7.0/255.255.255.0/eth0, 託管節點 rac2
2. 確定VIP的狀態
grid@rac1:/home/grid>crs_stat -t | grep vip
Name Type Target State Host
------------------------------------------------------------
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
grid@rac1:ifconfig -a
.....省略.....
eth0:2 Link encap:Ethernet HWaddr 00:50:56:8F:25:0A
inet addr:10.10.10.201 Bcast:10.250.7.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2400 Memory:d8960000-d8980000
.....省略.....
Stopping Resources
3. 停止nodeapps資源和所有依賴於VIP的資源(如果有計劃的中斷所有服務,則停止ASM/DB 實例)
10g and 11gR1,以CRS的屬主:
$ srvctl stop asm -n
$ srvctl stop instance -d -i
$ srvctl stop nodeapps -n
比如:
$ srvctl stop asm -n racnode1
$ srvctl stop instance -d RACDB -i RACDB1
$ srvctl stop nodeapps -n racnode1
11gR2,以Grid屬主:
$ srvctl stop instance -d -n
$ srvctl stop vip -n -f
grid@rac1:srvctl stop database -d rac -o immediate
PRCD-1027 : 無法檢索資料庫 rac
PRCD-1229 : 嘗試訪問資料庫 rac 的配置時被拒絕, 因為其版本 11.2.0.1.0 不同於程序版本 11.2.0.2.0。請改從 /opt/rac/oracle/11.2.0/dbs 運行程序。
oracle@rac1:/home/oracle>srvctl stop database -d rac -o immediate
grid@rac1:/home/grid>srvctl stop vip -n rac1 -f -v
已成功停止 VIP。
grid@rac1:/home/grid>srvctl stop vip -n rac2 -f -v
已成功停止 VIP。
Note: 在 11GR2版本中,-f選項是必須的,否則會報如下錯誤:
PRCR-1014 : Failed to stop resource ora.rac1.vip
PRCR-1065 : Failed to stop resource ora.rac1.vip
CRS-2529: Unable to act on 'ora.rac1.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
...
grid@rac1:/home/grid>srvctl stop listener -n rac1
PRCC-1017 : LISTENER 已在 rac1 上停止
PRCR-1005 : 資源 ora.LISTENER.lsnr 已停止
grid@rac1:/home/grid>srvctl stop listener -n rac2
PRCC-1017 : LISTENER 已在 rac2 上停止
PRCR-1005 : 資源 ora.LISTENER.lsnr 已停止
為了防止變更未被確認,而asm 或者db 實例的自動啟動,需要將此自動重啟功能暫時禁用。
$ srvctl disable database -d
$ srvctl disable asm -n (對於11.2 版本之前的)
$ srvctl disable nodeapps (使用與 11.2 版本以後的)
而我執行srvctl disable nodeapps命令時遇到如下情況(因為vip服務已經停止了)。不會影響最終的操作。
grid@rac1:/home/grid>srvctl disable nodeapps
PRKO-2409 : GSD 已在節點上禁用: rac1,rac2
PRCR-1071 : 無法注冊或更新 資源 ora.rac1.vip
CRS-0245: User doesn't have enough privilege to perform. the operation
PRCR-1071 : 無法注冊或更新 資源 ora.net1.network
CRS-0245: User doesn't have enough privilege to perform. the operation
4.確認VIP是否已經offline,並且不再綁定到公共網卡上:
grid@rac1:/home/grid>crs_stat -t | grep vip
ora.rac1.vip ora....t1.type OFFLINE OFFLINE
ora.rac2.vip ora....t1.type OFFLINE OFFLINE
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
使用 ifconfig -a
5 修改VIP和對應的屬性值,確保先在OS上做相應的變更 比如/etc/hosts 或者DNS。如果網卡改變了,先確保新的網卡可用。
舊vip:
10.10.10.201 rac1-vip
10.10.10.202 rac2-vip
新vip
10.250.7.111 rac1-vip
10.250.7.112 rac2-vip
子網 10.250.7.0
掩碼 255.255.255.0
6. 修改VIP資源
以root用戶執行如下命令:
[root@rac1 ~]# /opt/11202/11.2.0/grid/bin/srvctl modify nodeapps -n rac1 -A rac1-vip/255.255.255.0/eth0
[root@rac1 ~]# /opt/11202/11.2.0/grid/bin/srvctl modify nodeapps -n rac2 -A rac2-vip/255.255.255.0/eth0

Note 1: 對於windows平台,如果網卡名稱有空格,必須使用 ""
比如:
> srvctl modify nodeapps -n racnode1 -A 110.11.70.11/255.255.255.0/"Local Area Connection 1
Note 2: 從 11.2 開始,VIP依賴於network資源(ora.net1.network),OCR 僅僅只是記錄VIP 的hostname或者vip 的ip地址。vip的網路屬性比如子網和掩碼是記錄在network資源里的。
From 11.2.0.2起 , 可以使用srvctl modify network 命令修改網路資源信息
grid@rac1:/home/grid>srvctl modify network -h
修改 Oracle Clusterware 中的網路配置。
用法: srvctl modify network [-k ] [-S /[/if1[|if2...]]] [-w ] [-v]
-k 網路編號 (默認編號為 1)
-S //[if1[|if2...]] 網路的 NET 地址說明
-w 網路類型 (static, dhcp, mixed)
-h 輸出用法
-v 詳細輸出
以root用戶:
# srvctl modify network -k 1 -S 110.11.70.0/255.255.255.0/eth2
7. 確認變更:
grid@rac1:/home/grid>srvctl config nodeapps -a
網路存在: 1/10.250.7.0/255.255.255.0/eth0, 類型 static
VIP 存在: /rac1-vip/10.250.7.111/10.250.7.0/255.255.255.0/eth0, 託管節點 rac1
VIP 存在: /rac2-vip/10.250.7.112/10.250.7.0/255.255.255.0/eth0, 託管節點 rac2

8. 重新啟動nodeapps資源和相關依賴資源
grid@rac1:/home/grid>srvctl enable nodeapps
PRKO-2415 : VIP 已在節點上啟用: rac1,rac2
PRKO-2416 : 網路資源已啟用。
oracle@rac1:/home/oracle>srvctl enable database -d rac
grid@rac1:/home/grid>
grid@rac1:/home/grid>srvctl start listener -n rac2
grid@rac1:/home/grid>srvctl start listener -n rac1
grid@rac1:/home/grid>
oracle@rac1:/home/oracle>
oracle@rac1:/home/oracle>srvctl start database -d rac
grid@rac1:/home/grid>
9. 查看新的VIP的狀態
grid@rac1:/home/grid>crs_stat -t | grep vip
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
grid@rac1:/home/grid>
grid@rac1:/home/grid>
grid@rac1:/home/grid>/sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:8F:25:0A
inet addr:10.250.7.225 Bcast:10.250.7.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe8f:250a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:560742 errors:0 dropped:0 overruns:0 frame.:0
TX packets:1472284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:56118003 (53.5 MiB) TX bytes:126169027 (120.3 MiB)
Base address:0x2400 Memory:d8960000-d8980000

eth0:1 Link encap:Ethernet HWaddr 00:50:56:8F:25:0A
inet addr:10.250.7.210 Bcast:10.250.7.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2400 Memory:d8960000-d8980000

eth0:2 Link encap:Ethernet HWaddr 00:50:56:8F:25:0A
inet addr:10.250.7.111 Bcast:10.250.7.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2400 Memory:d8960000-d8980000

eth1 Link encap:Ethernet HWaddr 00:50:56:8F:6F:49
inet addr:10.10.10.101 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe8f:6f49/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6842717 errors:0 dropped:0 overruns:0 frame.:0
TX packets:4120949 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4798726508 (4.4 GiB) TX bytes:1472194319 (1.3 GiB)
Base address:0x2440 Memory:d8980000-d89a0000
eth1:1 Link encap:Ethernet HWaddr 00:50:56:8F:6F:49
inet addr:169.254.51.141 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2440 Memory:d8980000-d89a0000
grid@rac1:/home/grid>

對於11gR2,只是修改vip的hostname 而不修改其ip地址和vip的其他屬性不變:
1.修改VIP 使其指向另一個可用的 hostname,比如rac1
# srvctl modify nodeapps -n racnode1 -A rac2-vip/255.255.255.0/eth2
2.修改 VIP 指定新的hostname
# srvctl modify nodeapps -n racnode1 -A rac1-nvip/255.255.255.0/eth2
3. 確定 USR_ORA_VIP 的值:
# crsctl stat res ora.rac1.vip

㈡ srvctl 工具都有哪些功能

oracle 12c:新特性-RAC資料庫的增強
What-if命令評估
通激猜過srvctl使用新的What-if命令評估選項,現在可以確定運行此命令所造成的影響。這一新添加到srvctl的命令,可以在沒有實際執行或是不對當前系統做任何改變的情況下模擬此命令。這在想要對一個已存在的系統進行更改卻對結果不確定的時候特別有用。這樣,伍喚此命令就會明橘型提供進行變更的效果。而–eval 選項也可以通過crsctl 命令來使用來源:CUUG官網。
例如,如果你想要知道停止一個特定資料庫會發生什麼,那麼你就可以使用以下示例:
$ ./srvctl stop database –d MYDB –eval
$ ./crsctl eval modify resource -attr 「value」
srvctl的改進
對於srvctl命令還有一些新增功能。以下演示了如何用這些新增功能停止或啟動集群上的資料庫或實例資源。
srvctl start database|instance –startoption NOMOUNT|MOUNT|OPEN

㈢ 如何用srvctl命令添加ASM amp;DATABASE&LISTENER 注冊信息

1.模擬刪除ASM & DATABASE 注冊信息
刪除前請確認這些資源已經是STOP 狀態
[oracle@vmrehl4n1 ~]$ srvctl remove database -d myrac
Remove the database myrac? (y/[n]) y
[oracle@vmrehl4n1 ~]$ srvctl remove asm -n vmrehl4n1 -i +ASM1
[oracle@vmrehl4n1 ~拍搏]$ srvctl remove asm -n vmrehl4n2 -i +ASM2

2.添加ASM & DATABASE 注冊信息
[oracle@vmrehl4n1 ~]$ srvctl add database -d myrac -o /app/oracle/茄旦proct/10.2.0/db_1
[oracle@vmrehl4n1 ~]$ srvctl add instance -d myrac -i myrac1 -n vmrehl4n1
[oracle@vmrehl4n1 ~]$ srvctl add instance -d myrac -i myrac2 -n vmrehl4n2
[oracle@vmrehl4n1 ~]$ srvctl add asm -n vmrehl4n1 -i +ASM1 -o /app/oracle/proct/10.2.0/db_1
[oracle@vmrehl4n1 ~]$ srvctl add asm -n vmrehl4n2 -i +ASM2 -o /app/oracle/proct/10.2.0/db_1
查看[oracle@vmrehl4n2 admin]$ crs_stat -p ora.myrac.myrac1.inst
顯示的此行
REQUIRED_RESOURCES=ora.vmrehl4n1.vip ora.vmrehl4n1.ASM1.asm
如果沒有ora.vmrehl4n1.ASM1.asm
需要繼續運行以下命令,否則襲納祥CRS自動啟動時不能啟動DATABASE:
[oracle@vmrehl4n1 ~]$ srvctl modify instance -d myrac -i myrac1 -s +ASM1
[oracle@vmrehl4n1 ~]$ srvctl modify instance -d myrac -i myrac2 -s +ASM2

㈣ oracle 怎麼進入mgmtdb

1 MGMTDB 說明
在Oracle 12.1.0.1的Grid Infrastructure 的安裝中,可以選擇是否安裝Grid Infrastructure Management Repository (GIMR) 資料庫:MGMTDB. 如下圖:
\
在Grid Infrastructure 12.1.0.2 中,已經沒有改選項,MIMR 資料庫已經變成了強制選項。
在Oracle 12c 中Management Database 用來存儲Cluster HealthMonitor(CHM/OS,ora.crf) ,Oracle Database QoS Management,Rapid Home Provisioning和其他的數據。
ManagementRepository 是受12c Clusterware 管理的一個單實例,在Cluster 啟動的時會啟動MGMTDG並在其中一個節點上運行,並受GI 管理,如果運行MGMTDG的節點宕機了,GI 會自動把MGMTDB 轉移到其他的節點上。
默認情況,MGMTDB 資料庫的數據文件存放在共享的設備,如OCR/Voting 的磁碟組中,但後期可蔽雹以移動位置。
在12.1.0.1 中,GIMR 是可選的,如果在安裝GI的時候,沒有選擇Management Database 資料庫,那麼所有依賴的特性,如ClusterHealth Monitor (CHM/OS) 就會被禁用。
當然,在12.1.0.2 中,可以忽略這個問題,因為是強制安裝GIMR了。
另外,對於MGMT 資料庫,在目前的版本中,也不需要手工對其進行備份。
2 MGMTDB 基本操作
2.1 查看Management DB 相關的資源:[root@rac1 ~]# crsctl stat res -t
Name Target State Server Statedetails
Local Resources
……
ora.MGMTLSNR
1 ONLINE ONLINE rac2 169.254.142.79 192.168.57.6,STABLE
ora.mgmtdb
1 ONLINE ONLINE rac2 Open,STABLE
……
[root@rac1 ~]#
使用crsctl 命令可以看到ora.mgmtdb和ora.MGMTLSNR。
在操作系統層薯碰面,也可以查看到有2個對應的進程:
[root@rac2 ~]# ps -ef| grep pmon_-MGMTDB
grid 7452 1 0 14:59 ? 00:00:00 mdb_pmon_-MGMTDBroot 7756 7727 0 15:02 pts/4 00:00:00 grep pmon_-MGMTDB[root@rac2 ~]# ps -ef| grep MGMTLSNR
grid 7411 1 014:58 ? 00:00:00/u01/gridsoft/12.1.0/bin/tnslsnr MGMTLSNR -no_crs_notify -inheritroot 7758 7727 0 15:02 pts/4 00:00:00 grep MGMTLSNR[root@rac2 ~]#
2.2 啟動和關閉MGMT
正常情況下,MGMTDB 會在GI 啟動的時候,會自動啟動,但也可以手工管理,直接使用srvctl 操作即可:
Usage: srvctl start mgmtdb[-startoption <start_option>] [-node <node_name>]
2.3 查看Management Database 的log 和trace 文件一般數並談情況下,是不需要查看MGMT DB的trace的,如果要查看,用如下命令:
[grid@rac2 _mgmtdb]$ pwd
/u01/gridbase/diag/rdbms/_mgmtdb
[grid@rac2 _mgmtdb]$ ls
i_1.mif -MGMTDB
[grid@rac2 _mgmtdb]$
進入$ORACLE_BASE下的trace目錄。但是進入-MGMTDB時,要注意,不能直接cd:
[grid@rac2 _mgmtdb]$ cd -MGMTDB
-bash: cd: -M: invalid option
cd: usage: cd [-L|-P] [dir]
[grid@rac2 _mgmtdb]$
必須使用./-MGMTDB,如:
[grid@rac2 _mgmtdb]$ cd ./-MGMTDB
[grid@rac2 -MGMTDB]$ ls
alert hm incpkg lck metadata metadata_pv sweepcmp incident ir log metadata_dgif stage trace[grid@rac2 -MGMTDB]$
[grid@rac2 trace]$ pwd
/u01/gridbase/diag/rdbms/_mgmtdb/-MGMTDB/trace[grid@rac2 trace]$ ls
alert_-MGMTDB.log -MGMTDB_ckpt_4772.trm -MGMTDB_lgwr_7475.trc -MGMTDB_m001_10288.trm -MGMTDB_ora_10486.trc -MGMTDB_p001_5645.trmcdmp_20140807064254 -MGMTDB_ckpt_7477.trc -MGMTDB_lgwr_7475.trm -MGMTDB_m001_10330.trc -MGMTDB_ora_10486.trm -MGMTDB_p001_7523.trccdmp_20141208110548 -MGMTDB_ckpt_7477.trm -MGMTDB_m000_10101.trc -MGMTDB_m001_10330.trm -MGMTDB_ora_10830.trc -MGMTDB_p001_7523.trmcdmp_20141208110550 -MGMTDB_dbrm_4764.trc -MGMTDB_m000_10101.trm -MGMTDB_m001_8055.trc -MGMTDB_ora_10830.trm -MGMTDB_rbal_10460.trccdmp_20141208110553 -MGMTDB_dbrm_4764.trm -MGMTDB_m000_10202.trc -MGMTDB_m001_8055.trm -MGMTDB_ora_3770.trc -MGMTDB_rbal_10460.trmcdmp_20141208110555 -MGMTDB_dbrm_7469.trc -MGMTDB_m000_10202.trm -MGMTDB_mark_10484.trc -MGMTDB_ora_3770.trm -MGMTDB_rbal_4782.trcMGMT DB 的日誌和trace 都在這個里。
3 MGMTDB是帶一個PDB的CDB資料庫
前面說了,MGMTDB 是一個實例,實際上,MGMTDB是帶一個PDB的CDB庫,我們可以使用GI的命令直接去操作MGMTDB 對應的PDB。
--查看MGMTDB當前節點:
[grid@rac2 /]$ oclumon manage -get masterMaster = rac1
--查看狀態:
[grid@rac2 /]$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node rac2
--查看配置信息:
[grid@rac2 /]$ srvctl config mgmtdb
Database unique name: _mgmtdb
Database name:
Oracle home: /u01/gridsoft/12.1.0
Oracle user: grid
Spfile:+OCR_VOTING/_mgmtdb/spfile-MGMTDB.oraPassword file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: -MGMTDB
Type: Management
--連接MGMTDB實例
[grid@rac2 /]$ export ORACLE_SID=-MGMTDB
[grid@rac2 /]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Proction onMon Dec 8 15:24:37 2014Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise EditionRelease 12.1.0.1.0 - 64bit ProctionWith the Partitioning, Automatic StorageManagement and Advanced Analytics optionsSQL> select file_name fromdba_data_files union select member file_name from V$logfile;FILE_NAME
+OCR_VOTING/_MGMTDB/DATAFILE/sysaux.258.854939615+OCR_VOTING/_MGMTDB/DATAFILE/sysgridhomedata.261.854939891+OCR_VOTING/_MGMTDB/DATAFILE/sysmgmtdata.260.854939737+OCR_VOTING/_MGMTDB/DATAFILE/system.259.854939661+OCR_VOTING/_MGMTDB/DATAFILE/undotbs1.257.854939605+OCR_VOTING/_MGMTDB/ONLINELOG/group_1.263.854940051+OCR_VOTING/_MGMTDB/ONLINELOG/group_2.264.854940053+OCR_VOTING/_MGMTDB/ONLINELOG/group_3.265.8549400578 rows selected.
這里查詢的是MGMTDB的路徑,也可以直接用如下命令查詢:
[grid@rac2 /]$ oclumon manage -get reppathCHM Repository Path =+OCR_VOTING/_MGMTDB/DATAFILE/sysmgmtdata.260.854939737[grid@rac2 /]$
--查詢MGMTDB用戶:
SQL> select username,account_status fromdba_users where username like 'CH%';USERNAME ACCOUNT_STATUS
------------- ----------------
CHM OPEN
CHA OPEN

㈤ 如何關閉資料庫的asm實例進程

在oracle資料庫中關閉asm的實例進程的方法:
1、Shut down all ASM instances on all nodes. To shut down an ASM instance, enter the following command, where node is the name of the node where the ASM instance is running:
$ oracle_home/bin/srvctl stop asm -n node

㈥ 10gRAC系列之使用srvctl管理RAC資料庫

srvctl即Server Control 是一個命令行工具 用以管理Oracle的RAC環境 srvctl在Oracle i中引入 Oracle g對其功能進行了大大增強

在命令行下 使用 h參碧頃數可以察看srvctl支持的命令及參數:

bash $ srvctl hUsage: srvctl [ V] Usage: srvctl add a *** n i o [ p ]Usage: srvctl config databaseUsage: srvctl config database d [ a] [ t]Usage: srvctl config service d [ s ] [ a] [ S ]Usage: srvctl config nodeapps n [ a] [ g] [ o] [ s] [ l]Usage: srvctl config a *** n Usage: srvctl config listener n Usage: srvctl disable database d

常用的命令主要如下: 使用srvctl status查看資料庫梁慧棗及實例狀態查看資料庫的狀態

bash $ srvctl status database d eygle Instance eygle is running on node db rac Instance eygle is running on node db rac

查看資料庫實例的狀態

bash $ srvctl status instance d eygle i eygle eygle Instance eygle is running on node db rac Instance eygle is running on node db rac

使用srvctl stop停止資料庫或實例停止實例使用srvctl stop instance命令:

bash $ srvctl stop instance PRKO : Invalid mand line syntaxbash $ srvctl stop instance hUsage: srvctl stop instance d i [ o ] [ c | q] d Unique name for the database i Comma separated instance names o Options to shutdown mand (e g normal transactional immediate or abort) c Connect string (default: / as sysdba) q Query connect string from standard input h Print usage

橡拆在命令行發出如下命令

bash $ srvctl stop instance d eygle i eygle

在該節點的警告日誌文件中就可以看到如下關閉信息:

Thu Dec : : Shutting down instance: further logons disabledThu Dec : : Stopping background process QMNCThu Dec : : Stopping background process CJQ Thu Dec : : Stopping background process MMNLThu Dec : : Stopping background process MMONThu Dec : : Shutting down instance (immediate)License high water mark = Thu Dec : : Stopping Job queue slave processesThu Dec : : Job queue slave processes stoppedThu Dec : : PMON failed to acquire latch see PMON mpThu Dec : : ALTER DATABASE CLOSE NORMALThu Dec : : SMON: disabling tx recoverySMON: disabling cache recoveryThu Dec : : Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThread closed at log sequence Successful close of redo thread Thu Dec : : Completed: ALTER DATABASE CLOSE NORMALThu Dec : : ALTER DATABASE DISMOUNTCompleted: ALTER DATABASE DISMOUNTARCH: Archival disabled e to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeARCH: Archival disabled e to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThu Dec : : freeing rdom

停止資料庫使用srvctl stop database命令

bash $ srvctl stop database hUsage: srvctl stop database d [ o ] [ c | q] d Unique name for the database o Options to shutdown mand (e g normal transactional immediate or abort) c Connect string (default: / as sysdba) q Query connect string from standard input h Print usage

發出如下命令後 資料庫停止:

bash $ srvctl stop database d eygle

日誌文件記錄如下過程:

Thu Dec : : Shutting down instance: further logons disabledThu Dec : : Stopping background process CJQ Thu Dec : : Stopping background process QMNCThu Dec : : Stopping background process MMNLThu Dec : : Stopping background process MMONThu Dec : : Shutting down instance (immediate)License high water mark = Thu Dec : : Stopping Job queue slave processesThu Dec : : Job queue slave processes stoppedThu Dec : : PMON failed to acquire latch see PMON mpPMON failed to acquire latch see PMON mpPMON failed to acquire latch see PMON mpThu Dec : : PMON failed to acquire latch see PMON mpThu Dec : : ALTER DATABASE CLOSE NORMALThu Dec : : SMON: disabling tx recoverySMON: disabling cache recoveryThu Dec : : Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThread closed at log sequence Successful close of redo thread Thu Dec : : Completed: ALTER DATABASE CLOSE NORMALThu Dec : : ALTER DATABASE DISMOUNTCompleted: ALTER DATABASE DISMOUNTARCH: Archival disabled e to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeARCH: Archival disabled e to shutdown: Shutting down archive processesArchiving is disabledArchive process shutdown avoided: activeThu Dec : : freeing rdom

使用srvctl start命令啟動資料庫或實例使用srvctl start database可以啟動資料庫的所有實例:

bash $ srvctl start database d eygle

在第一個節點 警告日誌記錄了如下啟動過程

Thu Dec : : Starting ORACLE instance (normal)LICENSE_MAX_SESSION = LICENSE_SESSIONS_WARNING = Interface type bge configured from OCR for use as a cluster interconnectInterface type bge configured from OCR for use as a cluster interconnectInterface type bge configured from OCR for use as a public interfacePicked latch free SCN scheme Using LOG_ARCHIVE_DEST_ parameter default value as /opt/oracle/proct/ /db/dbs/archAutotune of undo retention is turned on LICENSE_MAX_USERS = SYS auditing is disabledksdpec: called for event prior to event group initializationStarting up ORACLE RDBMS Version: System parameters with non default values:processes = __shared_pool_size = __large_pool_size = __java_pool_size = __streams_pool_size = spfile = /dev/vx/rdsk/xxfdg/spfilesga_target = control_files = /dev/vx/rdsk/xxfdg/ctlfile /dev/vx/rdsk/xxfdg/ctlfile db_block_size = __db_cache_size = patible = db_file_multiblock_read_count= cluster_database = TRUEcluster_database_instances= thread = instance_number = undo_management = AUTOundo_tablespace = UNDOTBS remote_login_passwordfile= EXCLUSIVEdb_domain = remote_listener = LISTENERS_EYGLEjob_queue_processes = background_mp_dest = /opt/oracle/admin/eygle/bmpuser_mp_dest = /opt/oracle/admin/eygle/umpcore_mp_dest = /opt/oracle/admin/eygle/cmpaudit_file_dest = /opt/oracle/admin/eygle/ampdb_name = eygleopen_cursors = pga_aggregate_target = Cluster munication is configured to use the following interface(s) for this instance Thu Dec : : cluster interconnect IPC version:Oracle UDP/IPIPC Vendor proto DIAG started with pid= OS id= PMON started with pid= OS id= PSP started with pid= OS id= LMON started with pid= OS id= Thu Dec : : WARNING: Failed to set buffer limit on IPC interconnect socketOracle requires that the SocketReceive buffer size be tunable upto MBPlease make sure the kernel parameterwhich limits SO_RCVBUF value set byapplications is atleast MBLMD started with pid= OS id= LMS started with pid= OS id= LMS started with pid= OS id= MMAN started with pid= OS id= DBW started with pid= OS id= LGWR started with pid= OS id= CKPT started with pid= OS id= SMON started with pid= OS id= RECO started with pid= OS id= CJQ started with pid= OS id= MMON started with pid= OS id= MMNL started with pid= OS id= Thu Dec : : lmon registered with NM instance id (internal mem no )Thu Dec : : Reconfiguration started (old inc new inc )List of nodes: Global Resource Directory frozen* allocate domain invalid = TRUE Communication channels reestablishedMaster broadcasted resource hash value bitmapsNon local Process blocks cleaned outThu Dec : : LMS : GCS shadows cancelled closedThu Dec : : LMS : GCS shadows cancelled closedSet master node info Submitted all remote enqueue requestsDwn cvts replayed VALBLKs biousAll grantable enqueues grantedThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : Submitted all GCS remote cache requestsFix write in gcs resourcesReconfiguration pleteLCK started with pid= OS id= Thu Dec : : ALTER DATABASE MOUNTThu Dec : : This instance was first to mountSetting recovery target incarnation to Thu Dec : : Successful mount of redo thread with mount id Thu Dec : : Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)Completed: ALTER DATABASE MOUNTThu Dec : : ALTER DATABASE OPENThis instance was first to openPicked broadcast on mit scheme to generate SCNsThu Dec : : Thread advanced to log sequence Thread opened at log sequence Current log# seq# mem# : /dev/vx/rdsk/xxfdg/redo Successful open of redo thread Thu Dec : : MTTR advisory is disabled because FAST_START_MTTR_TARGET is not setThu Dec : : SMON: enabling cache recoveryThu Dec : : Instance recovery: looking for dead threadsInstance recovery: lock domain invalid but no dead threadsThu Dec : : Successfully onlined Undo Tablespace Thu Dec : : SMON: enabling tx recoveryThu Dec : : Database Characterset is ZHS GBKreplication_dependency_tracking turned off (no async multimaster replication found)Starting background process QMNCQMNC started with pid= OS id= Thu Dec : : Completed: ALTER DATABASE OPEN

節點 記錄了如下啟動過程:

Thu Dec : : Starting ORACLE instance (normal)LICENSE_MAX_SESSION = LICENSE_SESSIONS_WARNING = Interface type bge configured from OCR for use as a cluster interconnectInterface type bge configured from OCR for use as a cluster interconnectInterface type bge configured from OCR for use as a public interfacePicked latch free SCN scheme Using LOG_ARCHIVE_DEST_ parameter default value as /opt/oracle/proct/ /db/dbs/archAutotune of undo retention is turned on LICENSE_MAX_USERS = SYS auditing is disabledksdpec: called for event prior to event group initializationStarting up ORACLE RDBMS Version: System parameters with non default values:processes = __shared_pool_size = __large_pool_size = __java_pool_size = __streams_pool_size = spfile = /dev/vx/rdsk/xxfdg/spfilesga_target = control_files = /dev/vx/rdsk/xxfdg/ctlfile /dev/vx/rdsk/xxfdg/ctlfile db_block_size = __db_cache_size = patible = db_file_multiblock_read_count= cluster_database = TRUEcluster_database_instances= thread = instance_number = undo_management = AUTOundo_tablespace = UNDOTBS remote_login_passwordfile= EXCLUSIVEdb_domain = remote_listener = LISTENERS_EYGLEjob_queue_processes = background_mp_dest = /opt/oracle/admin/eygle/bmpuser_mp_dest = /opt/oracle/admin/eygle/umpcore_mp_dest = /opt/oracle/admin/eygle/cmpaudit_file_dest = /opt/oracle/admin/eygle/ampdb_name = eygleopen_cursors = pga_aggregate_target = Cluster munication is configured to use the following interface(s) for this instance Thu Dec : : cluster interconnect IPC version:Oracle UDP/IPIPC Vendor proto PMON started with pid= OS id= DIAG started with pid= OS id= PSP started with pid= OS id= LMON started with pid= OS id= Thu Dec : : WARNING: Failed to set buffer limit on IPC interconnect socketOracle requires that the SocketReceive buffer size be tunable upto MBPlease make sure the kernel parameterwhich limits SO_RCVBUF value set byapplications is atleast MBLMD started with pid= OS id= LMS started with pid= OS id= LMS started with pid= OS id= MMAN started with pid= OS id= DBW started with pid= OS id= LGWR started with pid= OS id= CKPT started with pid= OS id= SMON started with pid= OS id= RECO started with pid= OS id= CJQ started with pid= OS id= MMON started with pid= OS id= MMNL started with pid= OS id= Thu Dec : : lmon registered with NM instance id (internal mem no )Thu Dec : : Reconfiguration started (old inc new inc )List of nodes: Global Resource Directory frozen* allocate domain invalid = TRUE Communication channels reestablishedMaster broadcasted resource hash value bitmapsNon local Process blocks cleaned outThu Dec : : LMS : GCS shadows cancelled closedThu Dec : : LMS : GCS shadows cancelled closedSet master node info Submitted all remote enqueue requestsDwn cvts replayed VALBLKs biousAll grantable enqueues grantedPost SMON to start st pass IRThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : LMS : GCS shadows traversed replayedThu Dec : : Submitted all GCS remote cache requestsPost SMON to start st pass IRFix write in gcs resourcesReconfiguration pleteLCK started with pid= OS id= Thu Dec : : ALTER DATABASE MOUNTThu Dec : : Setting recovery target incarnation to Thu Dec : : Successful mount of redo thread with mount id Thu Dec : : Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)Completed: ALTER DATABASE MOUNTThu Dec : : ALTER DATABASE OPENPicked broadcast on mit scheme to generate SCNsThu Dec : : Thread opened at log sequence Current log# seq# mem# : /dev/vx/rdsk/xxfdg/redo Successful open of redo thread Thu Dec : : MTTR advisory is disabled because FAST_START_MTTR_TARGET is not setThu Dec : : SMON: enabling cache recoveryThu Dec : : Successfully onlined Undo Tablespace Thu Dec : : SMON: enabling tx recoveryThu Dec : : Database Characterset is ZHS GBKreplication_dependency_tracking turned off (no async multimaster replication found)Starting background process QMNCQMNC started with pid= OS id= Thu Dec : : Completed: ALTER DATABASE OPEN
lishixin/Article/program/Oracle/201311/18569

㈦ 如何用SRVCTL在SQLPLUS中啟動資料庫失敗問題

sqlplus / as sysdba
startup
這些命令在linux下是好用的
但是在windows下只要啟動了喊裂oracle服務,資料庫就已經被啟動了,即使你使用shutdown關閉資料庫後你要想再重新啟動oracle必須先關閉win服務在啟動才可以,使用startup是不可以的枝知。

windows裡面已經把東西都集成到服務裡面了,你不啟動服務oracle無法使用鄭搭閉,啟動服務oracle也啟動了,這就是windows的毛病。

閱讀全文

與srvctl注冊資料庫相關的資料

熱點內容
英雄聯盟保存回放在哪個文件夾 瀏覽:693
微信賣盜版 瀏覽:190
編程適合什麼人群學習 瀏覽:479
安卓使資料庫中的一列相加 瀏覽:184
ppt聲音文件在哪裡 瀏覽:325
vs2010折疊代碼快捷鍵 瀏覽:531
flyme系統升級關閉 瀏覽:628
米家app電視如何添加 瀏覽:353
程序員死後網站怎麼處理 瀏覽:667
數控編程方向怎麼寫 瀏覽:591
win10怎麼找到寫字板 瀏覽:756
陰陽師安卓獨立版本 瀏覽:395
無法復制u盤內的文件錯誤 瀏覽:737
u盤裝系統不是iso文件 瀏覽:181
vivoy18l刷安卓44 瀏覽:853
wifi和數據哪個好 瀏覽:695
哪裡適合孩子學習編程 瀏覽:773
miui8桌面文件夾 瀏覽:18
哪些文件值得收藏 瀏覽:549
linux查看幾兆網卡 瀏覽:386

友情鏈接