您現在的位置是:電腦技術吧?>? 編程技術 ??>??oracleocr作用,oracle刪庫命令??>??正文詳情

oracleocr作用,oracle刪庫命令

堯凌雪2019-12-12 09:22:04 人圍觀
簡介oracle自動備份今天是2014年4月1日。我忙了一整天終于有時間寫點東西了。前一段時間,我寫了如何在RAC中有備份時恢復OCR。今天,我寫了如何在沒有備份的情況下重建OCR和Ooracle備份命令

今天是2014-04-01,忙碌了一天終于有時間寫點東西了。

前段時間寫了RAc中ocr存在備份的情況下如何恢復,今天寫一下在沒有備份情況下如何去重建ocr和olr呢?  最大的悲劇莫過于數據庫壞了備份沒了。

讓我想起了前幾年流行的一句話:最大的悲劇是人活著,錢沒了。

總之備份重于一切。

  情景介紹:  在11G中ocr的asm磁盤組被用戶不小心刪了且所有備份都誤刪,olr呢也損壞了。

至此悲劇重演。

  恢復過程:(其實就是使用root.sh重建ocr的過程,重建之后可能需要重新注冊相關資源如listener or database 實例等!)  1、清空所有節點cluster配置信息:(11G中存在rootcrs.sh腳本,該腳本默認存在于$GRID_HOME/crs/install)。

  注,該腳本需要在root下執行,否則會有錯誤提示? 1 2 3 4 5 6 [[email protected] install]$ ./rootcrs.pl You must be logged in as root to run this script. Log in as root and rerun this script. 2014-04-01 17:08:12: Not running as authorized user Insufficient privileges to execute this script. root or administrative privileges needed to run the script.   了解該腳本的功能可以查看-help。

如升級、回退、重新配置等待? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 [[email protected] install]# ./rootcrs.pl -help Usage: rootcrs.pl [-verbose] [-upgrade [-force] | -patch] [-paramfile parameter-file] [-deconfig [-deinstall] [-keepdg] [-force] [-lastnode]] [-downgrade -oldcrshome old crshome path -version old crs version [-force] [-lastnode]] [-unlock [-crshome path to crs home] [-nocrsstop]] [-init] Options: -verbose Run this script in verbose mode -upgrade Oracle HA is being upgraded from previous version -patch Oracle HA is being upgraded to a patch version -paramfile Complete path of file specifying HA parameter values -lastnode Force the node this script is executing on to be considered as the last node of deconfiguration or downgrade, and perform actions associated with deconfiguring or downgrading the last node -downgrade Downgrade the clusterware -version For use with downgrade; special handling is required if downgrading to 9i. This is the old crs version in the format A.B.C.D.E (e.g 11.1.0.6.0). -deconfig Remove Oracle Clusterware to allow it to be uninstalled or reinstalled -force Force the execution of steps in delete or dwongrade that cannot be verified to be safe -deinstall Reset the permissions on CRS home during de-configuration -keepdg Keep existing diskgroups during de-configuration -unlock Unlock CRS home -crshome Complete path of crs home. Use with unlock option -oldcrshome For use with downgrade. Complete path of the old crs home -nocrsstop used with unlock option to reset permissions on an inactive grid home -init Reset the permissions of all files and directories under CRS home If neither -upgrade nor -patch is supplied, a new install is performed To see the full manpage for this program, execute: perldoc rootcrs.pl [[email protected] install]#   在root下清除所有節點cluster 信息:  節點2:? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 [[email protected] install]$ su Password: [[email protected] install]# ./rootcrs.pl -deconfig -force Using configuration parameter file: ./crsconfig_params Network exists: 1/192.168.4.0/255.255.255.0/eth0, type static VIP exists: /rac-one-vip/192.168.4.113/192.168.4.0/255.255.255.0/eth0, hosting node rac-one VIP exists: /rac-two-vip/192.168.4.114/192.168.4.0/255.255.255.0/eth0, hosting node rac-two GSD exists ONS exists: Local port 6100, remote port 6200, EM port 2016 CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac-one' CRS-2677: Stop of 'ora.registry.acfs' on 'rac-one' succeeded CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac-one' CRS-2673: Attempting to stop 'ora.crsd' on 'rac-one' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac-one' CRS-2673: Attempting to stop 'ora.oc4j' on 'rac-one' CRS-2673: Attempting to stop 'ora.GIDG.dg' on 'rac-one' CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'rac-one' CRS-2677: Stop of 'ora.DATADG.dg' on 'rac-one' succeeded CRS-2677: Stop of 'ora.GIDG.dg' on 'rac-one' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'rac-one' CRS-2677: Stop of 'ora.oc4j' on 'rac-one' succeeded CRS-2672: Attempting to start 'ora.oc4j' on 'rac-two' CRS-2677: Stop of 'ora.asm' on 'rac-one' succeeded CRS-2676: Start of 'ora.oc4j' on 'rac-two' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac-one' has completed CRS-2677: Stop of 'ora.crsd' on 'rac-one' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'rac-one' CRS-2673: Attempting to stop 'ora.ctssd' on 'rac-one' CRS-2673: Attempting to stop 'ora.evmd' on 'rac-one' CRS-2673: Attempting to stop 'ora.asm' on 'rac-one' CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac-one' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac-one' CRS-2677: Stop of 'ora.crf' on 'rac-one' succeeded CRS-2677: Stop of 'ora.evmd' on 'rac-one' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'rac-one' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac-one' succeeded CRS-2677: Stop of 'ora.asm' on 'rac-one' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac-one' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac-one' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac-one' CRS-2677: Stop of 'ora.cssd' on 'rac-one' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac-one' CRS-2677: Stop of 'ora.drivers.acfs' on 'rac-one' succeeded CRS-2677: Stop of 'ora.gipcd' on 'rac-one' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac-one' CRS-2677: Stop of 'ora.gpnpd' on 'rac-one' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac-one' has completed CRS-4133: Oracle High Availability Services has been stopped. Removing Trace File Analyzer Successfully deconfigured Oracle clusterware stack on this node [[email protected] install]#   節點1,因為我的RAC是雙節點的,那么在清除最后一個使用lastnode參數:? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 [[email protected] crs]$ cd install/ [[email protected] install]$ su Password: [[email protected] install]# ./rootcrs.pl -deconfig -force -lastnode Using configuration parameter file: ./crsconfig_params CRS resources for listeners are still configured Network exists: 1/192.168.4.0/255.255.255.0/eth0, type static VIP exists: /rac-two-vip/192.168.4.114/192.168.4.0/255.255.255.0/eth0, hosting node rac-two GSD exists ONS exists: Local port 6100, remote port 6200, EM port 2016 CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac-two' CRS-2677: Stop of 'ora.registry.acfs' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.crsd' on 'rac-two' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac-two' CRS-2673: Attempting to stop 'ora.oc4j' on 'rac-two' CRS-2673: Attempting to stop 'ora.GIDG.dg' on 'rac-two' CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'rac-two' CRS-2677: Stop of 'ora.DATADG.dg' on 'rac-two' succeeded CRS-2677: Stop of 'ora.oc4j' on 'rac-two' succeeded CRS-2677: Stop of 'ora.GIDG.dg' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'rac-two' CRS-2677: Stop of 'ora.asm' on 'rac-two' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac-two' has completed CRS-2677: Stop of 'ora.crsd' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.ctssd' on 'rac-two' CRS-2673: Attempting to stop 'ora.evmd' on 'rac-two' CRS-2673: Attempting to stop 'ora.asm' on 'rac-two' CRS-2677: Stop of 'ora.evmd' on 'rac-two' succeeded CRS-2677: Stop of 'ora.asm' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac-two' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac-two' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac-two' CRS-2677: Stop of 'ora.cssd' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac-two' CRS-2676: Start of 'ora.cssdmonitor' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac-two' CRS-2672: Attempting to start 'ora.diskmon' on 'rac-two' CRS-2676: Start of 'ora.diskmon' on 'rac-two' succeeded CRS-2676: Start of 'ora.cssd' on 'rac-two' succeeded CRS-4611: Successful deletion of voting disk GIDG. ASM de-configuration trace file location: /tmp/asmcadc_clean2014-04-01_05-14-52-PM.log ASM Clean Configuration START ASM Clean Configuration END ASM with SID ASM1 deleted successfully. Check /tmp/asmcadc_clean2014-04-01_05-14-52-PM.log for details. CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac-two' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac-two' CRS-2673: Attempting to stop 'ora.ctssd' on 'rac-two' CRS-2673: Attempting to stop 'ora.asm' on 'rac-two' CRS-2677: Stop of 'ora.mdnsd' on 'rac-two' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac-two' succeeded CRS-2677: Stop of 'ora.asm' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac-two' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac-two' CRS-2677: Stop of 'ora.cssd' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'rac-two' CRS-2677: Stop of 'ora.crf' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac-two' CRS-2677: Stop of 'ora.gipcd' on 'rac-two' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac-two' CRS-2677: Stop of 'ora.gpnpd' on 'rac-two' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac-two' has completed CRS-4133: Oracle High Availability Services has been stopped. Removing Trace File Analyzer Successfully deconfigured Oracle clusterware stack on this node [[email protected] install]#   二、重建ocr和olr,使用root.sh腳本完成重建,其實這就是在安裝RAC中執行的腳本,默認位置為:$GRID_HOME/;  eg:  節點1:? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 [[email protected] grid]# ./root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /u01/app/11.2.0/grid Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of dbhome have not changed. No need to overwrite. The contents of oraenv have not changed. No need to overwrite. The contents of coraenv have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params User ignored Prerequisites during installation Installing Trace File Analyzer CRS-2672: Attempting to start 'ora.mdnsd' on 'rac-two' CRS-2676: Start of 'ora.mdnsd' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac-two' CRS-2676: Start of 'ora.gpnpd' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac-two' CRS-2672: Attempting to start 'ora.gipcd' on 'rac-two' CRS-2676: Start of 'ora.cssdmonitor' on 'rac-two' succeeded CRS-2676: Start of 'ora.gipcd' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac-two' CRS-2672: Attempting to start 'ora.diskmon' on 'rac-two' CRS-2676: Start of 'ora.diskmon' on 'rac-two' succeeded CRS-2676: Start of 'ora.cssd' on 'rac-two' succeeded ASM created and started successfully. Disk Group GIDG created successfully. clscfg: -install mode specified Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Successful addition of voting disk 498646ba39604f86bf697c9748a67697. Successful addition of voting disk 2e1bd16f9e6d4f36bf93550dc8268725. Successful addition of voting disk 3fbd31a0b2634feabfa1115a504cbbe6. Successfully replaced voting disk group with GIDG. CRS-4266: Voting file(s) successfully replaced ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 498646ba39604f86bf697c9748a67697 (/dev/asm-diske) [GIDG] 2. ONLINE 2e1bd16f9e6d4f36bf93550dc8268725 (/dev/asm-diskd) [GIDG] 3. ONLINE 3fbd31a0b2634feabfa1115a504cbbe6 (/dev/asm-diskf) [GIDG] Located 3 voting disk(s). CRS-2672: Attempting to start 'ora.asm' on 'rac-two' CRS-2676: Start of 'ora.asm' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.GIDG.dg' on 'rac-two' CRS-2676: Start of 'ora.GIDG.dg' on 'rac-two' succeeded Preparing packages for installation... cvuqdisk-1.0.9-1 Configure Oracle Grid Infrastructure for a Cluster ... succeeded [[email protected] grid]#   另外注意,如果asm磁盤損壞了那么需要重新修復磁盤,然后會自動重新創建之前的diskgroup.  至此olr和ocr創建成功  節點2:? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [[email protected] grid]# ./root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /u01/app/11.2.0/grid Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of dbhome have not changed. No need to overwrite. The contents of oraenv have not changed. No need to overwrite. The contents of coraenv have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params User ignored Prerequisites during installation Installing Trace File Analyzer OLR initialization - successful Adding Clusterware entries to upstart CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac-two, number 1, and is terminating An active cluster was found during exclusive startup, restarting to join the cluster Preparing packages for installation... cvuqdisk-1.0.9-1 Configure Oracle Grid Infrastructure for a Cluster ... succeeded [[email protected] grid]#   3、檢查資源信息:  現在呢開始使用srvctl和crsctl工具,這是oracle RAC 經常使用的,另外還有一個工具是oifcfg配置網卡信息等。

不在 介紹了。

? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 [[email protected] bin]# ./crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online [[email protected] bin]# ./crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.GIDG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.asm ONLINE ONLINE rac-one Started ONLINE ONLINE rac-two Started ora.gsd OFFLINE OFFLINE rac-one OFFLINE OFFLINE rac-two ora.net1.network ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.ons ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.registry.acfs ONLINE ONLINE rac-one ONLINE ONLINE rac-two -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac-one ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac-two ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac-two ora.cvu 1 ONLINE ONLINE rac-two ora.oc4j 1 ONLINE ONLINE rac-two ora.rac-one.vip 1 ONLINE ONLINE rac-one ora.rac-two.vip 1 ONLINE ONLINE rac-two ora.scan1.vip 1 ONLINE ONLINE rac-one ora.scan2.vip 1 ONLINE ONLINE rac-two ora.scan3.vip 1 ONLINE ONLINE rac-two [[email protected] bin]# [[email protected] bin]# su - grid [[email protected] ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 1 17:40:53 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options SQL select name,state from v$asm_diskgroup; NAME STATE ------------------------------ ----------- GIDG MOUNTED DATADG DISMOUNTED SQL alter diskgroup datadg mount; Diskgroup altered. SQL   4、添加資源  可以看到目前啟動的缺少本地監聽和database資源和實例,那么下面開始重新注冊這些信息到ocr中,  注冊listener:  注:使用grid用戶:? 1 2 3 4 5 [[email protected] ~]$ srvctl add listener -l listener PRCN-2061 : Failed to add listener ora.LISTENER.lsnr PRCN-2065 : Port(s) 1521 are not available on the nodes given PRCN-2067 : Port 1521 is not available across node(s) rac-two-vip [[email protected] ~]$   提示1521該端口被ora.rac-two.vip所使用,暫且跳過? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 [[email protected] ~]$ crsctl stop resource ora.rac-two.vip CRS-2673: Attempting to stop 'ora.rac-two.vip' on 'rac-two' CRS-2677: Stop of 'ora.rac-two.vip' on 'rac-two' succeeded [[email protected] ~]$ srvctl add listener -l listener [[email protected] ~]$ crsctl start resource ora.rac-two.vip CRS-2672: Attempting to start 'ora.rac-two.vip' on 'rac-two' CRS-2676: Start of 'ora.rac-two.vip' on 'rac-two' succeeded [[email protected] ~]$ srvctl config listener Name: LISTENER Network: 1, Owner: grid Home: CRS home End points: TCP:1521 [[email protected] ~]$ [[email protected] ~]$ [[email protected] ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE rac-one OFFLINE OFFLINE rac-two ora.GIDG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.LISTENER.lsnr OFFLINE OFFLINE rac-one OFFLINE OFFLINE rac-two ora.asm ONLINE ONLINE rac-one Started ONLINE ONLINE rac-two Started ora.gsd OFFLINE OFFLINE rac-one OFFLINE OFFLINE rac-two ora.net1.network ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.ons ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.registry.acfs ONLINE ONLINE rac-one ONLINE ONLINE rac-two -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac-one ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac-two ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac-two ora.cvu 1 ONLINE ONLINE rac-two ora.oc4j 1 ONLINE ONLINE rac-two ora.rac-one.vip 1 ONLINE ONLINE rac-one ora.rac-two.vip 1 ONLINE ONLINE rac-two ora.scan1.vip 1 ONLINE ONLINE rac-one ora.scan2.vip 1 ONLINE ONLINE rac-two ora.scan3.vip 1 ONLINE ONLINE rac-two [[email protected] ~]$ 至此監聽添加到ocr完畢。

下面開始添加db,注意使用oracle用戶:   繼續添加:? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 [[email protected] ~]$ su - oracle Password: [[email protected] ~]$ srvctl add database -h Adds a database configuration to the Oracle Clusterware. Usage: srvctl add database -d db_unique_name -o oracle_home [-c {RACONENODE | RAC | SINGLE} [-e server_list] [-i inst_name] [-w timeout]] [-m domain_name] [-p spfile] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}] [-s start_options] [-t stop_options] [-n db_name] [-y {AUTOMATIC | MANUAL | NORESTART}] [-g serverpool_list] [-x node_name] [-a diskgroup_list] [-j acfs_path_list] -d db_unique_name Unique name for the database -o oracle_home ORACLE_HOME path -c type Type of database: RAC One Node, RAC, or Single Instance -e server_list Candidate server list for RAC One Node database -i inst_name Instance name prefix for administrator-managed RAC One Node database (default first 12 characters of db_unique_name) -w timeout Online relocation timeout in minutes -x node_name Node name. -x option is specified for single-instance databases -m domain Domain for database. Must be set if database has DB_DOMAIN set. -p spfile Server parameter file path -r role Role of the database (primary, physical_standby, logical_standby, snapshot_standby) -s start_options Startup options for the database. Examples of startup options are OPEN, MOUNT, or 'READ ONLY'. -t stop_options Stop options for the database. Examples of shutdown options are NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT. -n db_name Database name (DB_NAME), if different from the unique name given by the -d option -y dbpolicy Management policy for the database (AUTOMATIC, MANUAL, or NORESTART) -g serverpool_list Comma separated list of database server pool names -a diskgroup_list Comma separated list of disk groups -j acfs_path_list Comma separated list of ACFS paths where database's dependency will be set -h Print usage [[email protected] ~]$ srvctl add database -d Rac -o /u01/app/oracle/product/11.2.0/db_1/ -c RAC [[email protected] ~]$ [[email protected] ~]$ srvctl add instance -h Adds a database instance configuration to the Oracle Clusterware. Usage: srvctl add instance -d db_unique_name -i inst_name -n node_name [-f] -d db_unique_name Unique name for the database -i inst Instance name -n node_name Node name -f Force the add operation even though some resource(s) will be stopped -h Print usage [[email protected] ~]$ srvctl add instance -d Rac -i Rac1 -n rac-two [[email protected] ~]$ srvctl add instance -d Rac -i Rac2 -n rac-one [[email protected] ~]$ [[email protected] ~]$ srvctl config database -d Rac Database unique name: Rac Database name: Oracle home: /u01/app/oracle/product/11.2.0/db_1/ Oracle user: oracle Spfile: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Rac Database instances: Rac2,Rac1 Disk Groups: Mount point paths: Services: Type: RAC Database is administrator managed [[email protected] ~]$   重啟crs。

? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 [[email protected] bin]# ./crsctl start cluster -all CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac-one' CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac-two' CRS-2676: Start of 'ora.cssdmonitor' on 'rac-one' succeeded CRS-2676: Start of 'ora.cssdmonitor' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac-two' CRS-2672: Attempting to start 'ora.cssd' on 'rac-one' CRS-2672: Attempting to start 'ora.diskmon' on 'rac-one' CRS-2672: Attempting to start 'ora.diskmon' on 'rac-two' CRS-2676: Start of 'ora.diskmon' on 'rac-one' succeeded CRS-2676: Start of 'ora.diskmon' on 'rac-two' succeeded CRS-2676: Start of 'ora.cssd' on 'rac-two' succeeded CRS-2676: Start of 'ora.cssd' on 'rac-one' succeeded CRS-2672: Attempting to start 'ora.ctssd' on 'rac-two' CRS-2672: Attempting to start 'ora.ctssd' on 'rac-one' CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac-one' CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac-two' CRS-2676: Start of 'ora.ctssd' on 'rac-one' succeeded CRS-2672: Attempting to start 'ora.evmd' on 'rac-one'CRS-2676: Start of 'ora.ctssd' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.evmd' on 'rac-two' CRS-2676: Start of 'ora.evmd' on 'rac-one' succeeded CRS-2676: Start of 'ora.evmd' on 'rac-two' succeeded CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac-one' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac-one' CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac-two' CRS-2676: Start of 'ora.asm' on 'rac-two' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac-two' CRS-2676: Start of 'ora.crsd' on 'rac-two' succeeded CRS-2676: Start of 'ora.asm' on 'rac-one' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac-one' CRS-2676: Start of 'ora.crsd' on 'rac-one' succeeded   再次查看(等2分鐘):? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 [[email protected] bin]# ./crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.GIDG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.LISTENER.lsnr ONLINE ONLINE rac-one ONLINE INTERMEDIATE rac-two Not All Endpoints R egistered ora.asm ONLINE ONLINE rac-one Started ONLINE ONLINE rac-two Started ora.gsd OFFLINE OFFLINE rac-one OFFLINE OFFLINE rac-two ora.net1.network ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.ons ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.registry.acfs ONLINE ONLINE rac-one ONLINE ONLINE rac-two -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac-one ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac-two ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac-two ora.cvu 1 ONLINE ONLINE rac-two ora.oc4j 1 ONLINE ONLINE rac-two ora.rac-one.vip 1 ONLINE ONLINE rac-one ora.rac-two.vip 1 ONLINE ONLINE rac-two ora.rac.db 1 ONLINE ONLINE rac-two Open 2 ONLINE ONLINE rac-one Open ora.scan1.vip 1 ONLINE ONLINE rac-one ora.scan2.vip 1 ONLINE ONLINE rac-two ora.scan3.vip 1 ONLINE ONLINE rac-two   為什么會存在一個監聽在rac-two上無法注冊呢?  查看該節點監聽:? 1 2 3 4 5 [[email protected] admin]$ ps -ef | grep LISTENER grid 6120 1 0 17:02 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit grid 8511 1 0 18:28 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit grid 11010 1 0 18:42 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit grid 11246 9191 0 18:44 pts/1 00:00:00 grep LISTENER   原來是啟動了兩個,全部停掉再次重啟:? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 [[email protected] admin]$ id uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1100(asmadmin),1200(dba),1300(asmdba),1301(asmoper) [[email protected] admin]$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-APR-2014 18:45:11 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) The command completed successfully [[email protected] admin]$ ps -ef | grep LISTENER grid 6120 1 0 17:02 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit grid 8511 1 0 18:28 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit grid 11452 9191 0 18:45 pts/1 00:00:00 grep LISTENER [[email protected] admin]$ exit logout [[email protected] bin]# kill -9 6120 [[email protected] bin]# ps -ef | grep LISTENER grid 8511 1 0 18:28 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit root 11518 11280 0 18:46 pts/1 00:00:00 grep LISTENER [[email protected] bin]# su - grid [[email protected] ~]$ crsctl status res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.GIDG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.LISTENER.lsnr ONLINE ONLINE rac-one OFFLINE OFFLINE rac-two ora.asm ONLINE ONLINE rac-one Started ONLINE ONLINE rac-two Started ora.gsd OFFLINE OFFLINE rac-one OFFLINE OFFLINE rac-two ora.net1.network ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.ons ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.registry.acfs ONLINE ONLINE rac-one ONLINE ONLINE rac-two -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac-two ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac-one ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac-one ora.cvu 1 ONLINE ONLINE rac-one ora.oc4j 1 ONLINE ONLINE rac-one ora.rac-one.vip 1 ONLINE ONLINE rac-one ora.rac-two.vip 1 ONLINE ONLINE rac-two ora.rac.db 1 ONLINE ONLINE rac-two Open 2 ONLINE ONLINE rac-one Open ora.scan1.vip 1 ONLINE ONLINE rac-two ora.scan2.vip 1 ONLINE ONLINE rac-one ora.scan3.vip 1 ONLINE ONLINE rac-one [[email protected] ~]$ crsctl start resource ora.LISTENER.lsnr CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'rac-two' CRS-2676: Start of 'ora.LISTENER.lsnr' on 'rac-two' succeeded [[email protected] ~]$ [[email protected] ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.GIDG.dg ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.LISTENER.lsnr ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.asm ONLINE ONLINE rac-one Started ONLINE ONLINE rac-two Started ora.gsd OFFLINE OFFLINE rac-one OFFLINE OFFLINE rac-two ora.net1.network ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.ons ONLINE ONLINE rac-one ONLINE ONLINE rac-two ora.registry.acfs ONLINE ONLINE rac-one ONLINE ONLINE rac-two -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac-two ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac-one ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac-one ora.cvu 1 ONLINE ONLINE rac-one ora.oc4j 1 ONLINE ONLINE rac-one ora.rac-one.vip 1 ONLINE ONLINE rac-one ora.rac-two.vip 1 ONLINE ONLINE rac-two ora.rac.db 1 ONLINE ONLINE rac-two Open 2 ONLINE ONLINE rac-one Open ora.scan1.vip 1 ONLINE ONLINE rac-two ora.scan2.vip 1 ONLINE ONLINE rac-one ora.scan3.vip 1 ONLINE ONLINE rac-one [[email protected] ~]$   至此所有問題得到徹底解決。

版權聲明:本文由 堯凌雪 整理編輯。

原標題:oracle rac 啟動順序,oracle分區

轉載注明出處:http://www.dn9ww09s.icu/program/15341.html

文章評論

    共有條評論來說兩句吧...

    用戶名:

    驗證碼:

作者推薦

  • angular8,angular 2

    angular8,angular 2 相關圖片angular框架本文主要介紹了angularjs工具angular smart,它可以自動完成用戶界面,包括使用隔離作用域綁定指令和承諾。為了供您參考,我們最近在論壇中添加了一angular能做什么...

  • 水晶報表 指定數據庫,找不到指定的數據庫

    水晶報表 指定數據庫,找不到指定的數據庫 相關圖片選擇數據庫命令Oracle數據庫如何收集指定SQL的執行計劃和解決過程中的ora-00904錯誤(版權聲明,如果需要轉載原文或翻譯的文章,如果轉載的文章用于個人學習,請注明來查找數據庫的...

  • 表空間管理,表空間的管理方式

    表空間管理,表空間的管理方式 相關圖片oracle表空間使用2。Oracle磁盤管理中最高的邏輯層是表空間。必須在Oracle11g中創建的四個表空間是system、sysaux、temp和undotbs1。2系統:存儲oracle表空間概念...

  • 簡單框架,框架怎么畫

    簡單框架,框架怎么畫 相關圖片框架是什么本文主要介紹一個簡單的JavaScript類框架,有助于初學者理解JS類的創建和繼承。對于那些需要幫助的人,請參閱work in progress JavaSc網頁框架...

  • standby怎么用,in standby

    standby怎么用,in standby 相關圖片standby use準備:確認待機時可以支持對象和語句,以確保主庫中的表行可以唯一標識環境:操作系統:Red Hat Linux Enterprise 5 Oracle:11.2.standby mode...

  • exp備份數據庫,oracle備份恢復

    exp備份數據庫,oracle備份恢復 相關圖片exp備份數據庫命令JMYBJS=(描述=(地址=(協議=TCP)(主機=129.1.9.90)(端口=1521))(連接數據=(服務器=DEDICexp導出文件日期...

  • sqlserver建立觸發器,sqlserver查看觸發器

    sqlserver建立觸發器,sqlserver查看觸發器 相關圖片sql觸發器編寫一。存儲過程1。存儲過程的分類存儲過程是一種數據庫對象,它存儲在數據庫中,應用程序可以通過調用來執行,并允許用戶聲明變量和有條件地執行。具有強大編程功能...

  • 數組刪除元素,數組怎么刪除元素

    數組刪除元素,數組怎么刪除元素 相關圖片數組添加元素本文的例子描述了根據元素值通過jQuery刪除數組元素的方法。與您分享以供參考。具體如下:例如,如果不知道數組中C的下標,就刪除元素C?123var arr=[java數組刪除元素...

  • Java數組,jquery數組

    Java數組,jquery數組 相關圖片js數組怎么實現的一。數組數組的定義是一組按順序排列的值。單個值稱為元素。他們的職位有編號。從0開始,整個數組用方括號表示。Var arr=[12,34,56];上面的代碼表示已數組api...

  • asp網站代碼,html代碼

    asp網站代碼,html代碼 相關圖片jsp代碼%@LANGUAGE=VBSCRIPT CODEPAGE=936%%session(aname)=session(admin_flag)=session.aboasp整站下載...

熱評文章

  • sqlget注入入門,sql注入攻擊教程

    sqlget注入入門,sql注入攻擊教程 相關圖片websql注入攻擊什么是sqlmap?Sqlmap是一個免費的開源工具,用于檢測和利用SQL注入漏洞。它具有很好的特性,即自動處理檢測和利用(數據庫指紋、訪問底層文件系統、命令執sql注入步驟...

  • oracle10gclient,Oracle10g

    oracle10gclient,Oracle10g 相關圖片oracle10g安裝包Oracle 10g RAC[恢復OCR]-查詢OCR狀態:×/Oracle/product/10g/CRS/bin/ocrcheck prot-601:初始化查看oracle10g版本...

  • 標識列的使用,標識列是什么

    標識列的使用,標識列是什么 相關圖片無法更新標識列現在讓我們看一個表:考慮一下如何在數據庫SQL Server中輕松地向該表添加數據?很容易發現,在ID字段中添加這一列數據是規則的,并且可以遵循。這是一個等比自一個...

  • 怎么設置防火墻,防火墻設置在哪

    怎么設置防火墻,防火墻設置在哪 相關圖片系統防火墻在哪里設置甲骨文和防火墻設置訪問windows甲骨文數據庫后的防火墻,僅僅打開固定的TCP端口方式是不夠的。這個問題的根本原因是windows-Oracle數據庫的BT設關閉防火墻...

  • SQL 存儲過程,SQL查看存儲過程

    SQL 存儲過程,SQL查看存儲過程 相關圖片sql建立存儲過程SQL Server中alter過程和create過程的區別:1。AutoPro期望找到現有的存儲過程,而CREATE不是。2。Alter proc保持sql 調用存儲過程...

  • 客戶端編程,猿編程客戶端

    客戶端編程,猿編程客戶端 相關圖片手機編程本文主要針對MVC框架的一些相關使用問題,介紹了JavaScript客戶端應用程序編程的一些建議。作為參考,您可能會注意到,最近一段時間,越來越多的web應用程編程網站...

  • 數據庫存取方法,數據庫的最小存取單位

    數據庫存取方法,數據庫的最小存取單位 相關圖片數據庫中存儲的是什么一、實現思路:當用戶添加或修改圖片時,控制CommonDialog的showopen對話框,將通用對話框的文件名記錄到變量a中,然后使用app.path查找特定文件系統中最小的數據存...

  • 技能競賽小結,培訓小結

    技能競賽小結,培訓小結 相關圖片轉正個人小結本文主要介紹Android開發中一些耗時的操作總結。根據實際開發經驗,總結出六種耗時的編程操作。請注意,您可以參考在Android軟件開發過程中經常遇到的耗時操實訓總結...

  • 如何新建文件夾并保存,新建文件夾怎么建

    如何新建文件夾并保存,新建文件夾怎么建 相關圖片怎么新建文件夾放照片現在我們差不多完成了,讓我們保存新的查詢。在主菜單上,單擊“文件”菜單中的“保存”命令。如果此查詢是第一次存儲的,屏幕上將彈出一個對話框,詢問...

  • 您未被授權查看該網頁,微信取消網頁登錄授權

    您未被授權查看該網頁,微信取消網頁登錄授權 相關圖片微信不能登錄網頁版怎么解決Android授權訪問該網頁。使用WebView顯示由OAuth version 2.apimplicitgrant授權的頁面。不建議對移動終端使用授權碼授權:qq授權管理中心網頁...

關注微信

变脸官网查询