Sunteți pe pagina 1din 11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

NotesOnOracle
byMehmetEser

OracleHASsetupafterHostnameandIPchange
FEBRUARY21,2013
HAS/#COMMENTS)

10COMMENTS(HTTPS://MEHMETESER.WORDPRESS.COM/2013/02/21/RENAMEHOST

Onmylaptop,IhavemyvirtualmachinesfororacleASMandoracleRAC.IclonedoneoftheASMsingleinstancevirtualmachineand
changeditshostnameandIPadresstoanewone.AfterImadethechangethedatabaseandtheasminstancedidnotstart.IlearnedthatI
hadtoreconfiguretheOracleHighAvailabilityServices.Itistrueevenifyouhaveastandaloneinstallation.letsseehowitworks
HowtoReconfigureOracleRestart[ID986740.1]
BEFOREthechangeofhostnameandIP
[oracle@rhel5~]$srvctlconfigasm
ASMhome:/oracle/app/oracle/product/11.2.0/grid
ASMlistener:LISTENER
Spfile:/oracle/app/oracle/product/11.2.0/grid/dbs/spfile+ASM.ora
ASMdiskgroupdiscoverystring:
[oracle@rhel5~]$srvctlconfiglistener
Name:LISTENER
Home:/oracle/app/oracle/product/11.2.0/grid
Endpoints:TCP:1521
[oracle@rhel5~]$srvctlconfigdatabase
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

1/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

TEST11G
[oracle@rhel5~]$srvctlconfigdatabasedTEST11G
Databaseuniquename:TEST11G
Databasename:TEST11G
Oraclehome:/oracle/app/oracle/product/11.2.0/dbhome_1
Oracleuser:oracle
Spfile:+DATA/TEST11G/spfileTEST11G.ora
Domain:
Startoptions:open
Stopoptions:immediate
Databaserole:PRIMARY
Managementpolicy:AUTOMATIC
Databaseinstance:TEST11G
DiskGroups:DATA,FRA
Services:
MAKEthechangeofhostnameandIP
YoucanchengetheIPandthehostnameforaserverusingthecommandguisystemconfignetwork.Alsochangethe/etc/hostsfileforthe
newIPandhostname.
oldIP:192.168.254.128newIP:192.168.254.129
oldhostname:rhel5newhostname:stndby
Afterwereboottheserver,weseethatHASfeaturesarenotfunctioningproperly.Highavailabiltyserviceshastobereconfigured.
[oracle@stndby~]$crsctlcheckhas
CRS4639:CouldnotcontactOracleHighAvailabilityServices
[oracle@stndby~]$srvctlstartasm
PRCR1070:Failedtocheckifresourceora.asmisregistered
Cannotcommunicatewithcrsd
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

2/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

ReconfigureHAS
Goto$GRID_HOME/crs/installdirectoryandruntheroothas.plscriptfordeconfiguration.Ithastoberunbytherootuser.
[root@stndbyinstall]#./roothas.pldeconfigforce
Usingconfigurationparameterfile:./crsconfig_params
CRS4639:CouldnotcontactOracleHighAvailabilityServices
CRS4000:CommandStopfailed,orcompletedwitherrors.
CRS4639:CouldnotcontactOracleHighAvailabilityServices
CRS4000:CommandDeletefailed,orcompletedwitherrors.
CLSU00100:OperatingSystemfunction:opendirfailedwitherrordata:2
CLSU00101:OperatingSystemerrormessage:Nosuchfileordirectory
CLSU00103:errorlocation:scrsearch1
CLSU00104:additionalerrorinformation:cantopenscrhomedirscls_scr_getval
CRS4544:UnabletoconnecttoOHAS
CRS4000:CommandStopfailed,orcompletedwitherrors.
SuccessfullydeconfiguredOracleRestartstack
Goto$GRID_HOME/crs/installdirectoryandruntheroothas.plscriptforreconfiguration.Ithastoberunbytherootuser.
[root@stndbyinstall]#./roothas.pl
Usingconfigurationparameterfile:./crsconfig_params
LOCALADDMODE
CreatingOCRkeysforuser'oracle',privgrp'dba'..
Operationsuccessful.
LOCALONLYMODE
SuccessfullyaccumulatednecessaryOCRkeys.
CreatingOCRkeysforuser'root',privgrp'root'..
Operationsuccessful.
CRS4664:Nodestndbysuccessfullypinned.
AddingClusterwareentriestoinittab

https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

3/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

stndby2013/01/3104:07:34/oracle/app/oracle/product/11.2.0/grid/cdata/stndby/backup_20130131_040734.olr
SuccessfullyconfiguredOracleGridInfrastructureforaStandaloneServer
Nowletschecktheconfiguration.Asyoucansee,hashasbeenenabledbuttheresourcesarenotstarted,ASManddatabasearenot
registeredasaresource.
[oracle@stndby~]$..grid_env
[oracle@stndby~]$crsctlconfighas
CRS4622:OracleHighAvailabilityServicesautostartisenabled.
[oracle@stndby~]$crs_stat
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE
Registerandstarttheresources
[oracle@stndby~]$crsctlstartresource"ora.cssd"
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

4/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

CRS2672:Attemptingtostart'ora.cssd'on'stndby'
CRS2672:Attemptingtostart'ora.diskmon'on'stndby'
CRS2676:Startof'ora.diskmon'on'stndby'succeeded
CRS2676:Startof'ora.cssd'on'stndby'succeeded
[oracle@stndby~]$crs_stat
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE
letsaddthelistenerasaresourcebutbeforewedothatweneedtochangethelisteningIPofthelistener.
before:
[oracle@stndby~]$cat/oracle/app/oracle/product/11.2.0/grid/network/admin/listener.ora
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

5/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

(ADDRESS=(PROTOCOL=TCP)(HOST=rhel5)(PORT=1521))
)
)
after
[oracle@stndby~]$cat/oracle/app/oracle/product/11.2.0/grid/network/admin/listener.ora
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=stndby)(PORT=1521))
)
)
nowwecanaddthelistenerasaresourceandafterthatwecanstartit
[oracle@stndby~]$srvctladdlistenerlLISTENER
[oracle@stndby~]$srvctlstartlistener
[oracle@stndby~]$srvctlstatuslistener
ListenerLISTENERisenabled
ListenerLISTENERisrunningonnode(s):stndby
[oracle@stndby~]$crs_statora.LISTENER.lsnr
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINEonstndby
nowwecanaddtheasmwedonotneedtocreatespfileforasm.wecanusetheonebefore.
[oracle@stndby~]$srvctladdasmlLISTENERp"/oracle/app/oracle/product/11.2.0/grid/dbs/spfile+ASM.ora"
[oracle@stndby~]$srvctlstartasm
[oracle@stndby~]$srvctlstatusasm
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

6/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

ASMisrunningonstndby
FinallywecanaddordatabaseTEST11G
[oracle@stndby~]$srvctladddatabasedTEST11Go/oracle/app/oracle/product/11.2.0/dbhome_1p
+DATA/TEST11G/spfileTEST11G.orarPRIMARYsopentimmediatea"DATA,FRA"
[oracle@stndby~]$srvctlstartdatabasedTEST11G
[oracle@stndby~]$srvctlstatusdatabasedTEST11G
Databaseisrunning.
Aftertheadditionofallresources
[oracle@stndby~]$crs_stat
NAME=ora.DATA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.FRA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.asm
TYPE=ora.asm.type
TARGET=ONLINE
STATE=ONLINEonstndby

https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

7/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINEonstndby
NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.test11g.db
TYPE=ora.database.type
TARGET=ONLINE
STATE=ONLINEonstndby

https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

8/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

About these ads (http://wordpress.com/about-these-ads/)

60%

60%

mint&berryAbrigode
inviernosapphire
109,95 43,95

FILEDUNDERORACLE,ORACLEGRIDINFRASTRUCTURE,RAC

TAGGEDWITHHIGHAVAILABILITYSERVICES,SRVCTL

10ResponsestoOracleHASsetupafterHostnameandIPchange
Sathishkumarsays:
June18,2013at8:29am
Excellentallthestepsperfectlyworked
Sathishkumar
Reply
mehmetesersays:
June25,2013at10:57pm
Youarewelcome
Reply
AnssiKanninensays:
August13,2013at4:35pm
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

9/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

Thissavedmyday!Thankyou!
Reply
sureshkumarsays:
September20,2013at1:43pm
IhadissuewithHASservicestartuponmystandalonserver11gr2,thisisnotmyscenariobutstepyoumentionithelpedmetofixthis
issue.
ThanksalotforyouIndeedcontribution.
Reply
rainiermorillasays:
November13,2013at6:48pm
Thanks,itworksprettywell!
Reply
Johnb486says:
September18,2014at7:04pm
Heyveryniceblog!!Man..Excellent..Amazing..IwillbookmarkyoursiteandtakethefeedsalsoImsatisfiedtofindalotofuseful
inforightherewithinthepost,wedlikedevelopextrastrategiesinthisregard,thanksforsharing.ebfebcdekdda
Reply
MjnAsays:
January7,2015at8:18am
Verynicearticle..Helpedmetoworkoutasimilarsituation.Thanksforpostingitwithaliveexample.Justwonderingifyouhaveany
inputsforsettingupOracleRACandASMonLinuxonawindows8PC.Ijustwantedtohavemyownsetupforlearningpurposes.
Reply
mehmetesersays:
January8,2015at11:58am
youcanusevmwareoranyothervirtualmachinetoestablishthelinuxmachinesonawindows.Thenyoucaninstallandtryon
yourownRACsystem.
Reply
MjnAsays:
https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

10/11

3/2/2015

OracleHASsetupafterHostnameandIPchange|NotesOnOracle

January9,2015at9:06am
Thanksforyourreply.UsingVMWaresoundslikeagoodoption.Wonderingifyouhaveanyleads
orrecommendationforVMWare
mehmetesersays:
January14,2015at11:52am
therearealotofexamplesontheinternetsearchforvmwareinstalloracle112oraclebasehasagoodarticleonit.

CreateafreewebsiteorblogatWordPress.com.
TheEnterpriseTheme.
Follow

FollowNotesOnOracle
BuildawebsitewithWordPress.com

https://mehmeteser.wordpress.com/2013/02/21/renamehosthas/

11/11

S-ar putea să vă placă și