Sei sulla pagina 1di 9

Oracle11g Cloning Oracle Home in RAC

Description: BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Beginners G ide !or "racle #B$. The doc ment !oc ses on %loning "racle Home in &$%. 'oin o r pro!essional training program and learn !rom e(perts.

History: Version 0.1

Description Change Initial Dra t

Author Rahul !harma

Publish Date 1"th #un $01%

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1

Cloning Oracle Home in RAC


%loning o! "racle so!tware is an eas) and !ast wa) to achieve standardi*ation across organi*ation where all e!!orts p t on one environment and a!ter testing etc that environment co ld be sed as a so rce o! binaries. $ simple tar ball co ld be shipped to all other servers and then ntar on destination environment as a new home or replace the e(isting oracle home based on availabilit) o! space on destination environment. There co ld be di!!erent sit ations where we co ld se this method in a little bit twisted wa) to achieve desired res lt. Possible scenarios are+ ,ost !iles)stem hosting oracle database so!tware, so either new installation or cloning o! so!tware !rom s rviving nodes in case o! &$% or some other environment in case o! standalone environment. Enterprise wide periodic patching activit) where cloning co ld save a lot o! e!!orts b) - st b ilding an image and clone it across enterprise. B ilding new environments d ring migration databases across o! datacenters .ode edition in &$% also ses cloning techni/ e %loning involves !ollowing simple steps+ Ta0e a bac0 p o! central inventor) on target servers 1 "ptional tho gh recommended2 cd 3 453app tar -*c! oraInventor).tar.g* oraInventor) Ta0e a bac0 p o! necessar) con!ig ration !iles !rom 6"&$%,E7H"8E3dbs 9 6"&$%,E7H"8E3networ03admin !older !rom target server m0dir :p 3tmp3bac0 p7con!ig7!iles3networ0 m0dir :p 3tmp3bac0 p7con!ig7!iles3dbs cd 3 453app3oracle3prod ct355.;.4.<3dbhome75 cp networ03admin3tnsnames.ora ..3tmp3bac0 p7con!ig7!iles3networ03. cp dbs3= 3tmp3bac0 p7con!ig7!iles3dbs3. %reate tarball on so rce server or se e(iting approved tarball !rom so rce environment. %hange director) 1cd2 to parent director) o! so rce "racle Home and se tar -*c! >bac0 p7!ile?.tar.g* >so rce home?E(ample+ cd 3 453app3oracle3prod ct355.;.4.<3 tar -*c! S"@&%E7H"8E.tar.g* S"@&%E7H"8E $nd ship S"@&%E7H"8E.tar.g* to target server where cloning wo ld ta0e place. In case )o want to re se the same "racle Home name and location then )o m st have to detach e(iting oracle home !rom destination server or else cloning wo ld !ail. Stop all instances accessing oracle home i! )o are going to restore new home on same location3name.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 2

#etaching "racle Home !rom Inventor) .3r nInstaller -silent -detachHome "&$%,E7H"8EAB3 453app3oracle3prod ct355.;.4.<3dbhome75C "&$%,E7H"8E7.$8EAB#B7H"8EB :local I! we se it witho t D-localB option then it wo ld detach oracle home !or all nodes in cl ster. .3r nInstaller -silent -detachHome "&$%,E7H"8EAB3 453app3oracle3prod ct355.;.4.<3dbhome75C "&$%,E7H"8E7.$8EAB#B7H"8EB Entr) in oracle inventor) be!ore detaching oracle home mas05E cd 3 453app3oraInventor)3%ontentsF8, mas05E grep -i #B7H"8E inventor).(ml >H"8E .$8EAB#B7H"8EB ,"%AB3 453app3oracle3prod ct355.;.4.<3dbhome75C TGPEAB"B I#FABHC? #etach oracle home !rom node 5 mas05E .3r nInstaller -silent -detachHome "&$%,E7H"8EAB3 453app3oracle3prod ct355.;.4.<3dbhome75C "&$%,E7H"8E7.$8EAB#B7H"8EB -local Starting "racle @niversal InstallerI %hec0ing swap space+ m st be greater than J44 8B. $ct al ;HJKJ 8B Passed The inventor) pointer is located at 3etc3oraInst.loc The inventor) is located at 3 453app3oraInventor) L#etachHome was s ccess! l. Entr) in oracle inventor) a!ter detaching oracle home mas05E cd 3 453app3oraInventor)3%ontentsF8, mas05E grep -i #B7H"8E inventor).(ml >H"8E .$8EAB#B7H"8EB ,"%AB3 453app3oracle3prod ct355.;.4.<3dbhome75C TGPEAB"B I#FABHC &E8"ME#ABTB3? $t this stage when i! we tr) to / er) oracle inventor) !rom detached oracle home then we wo ld get error+ mas05E cd 3 453app3oracle3prod ct355.;.4.<3dbhome753"Patch mas05E .3opatch lsinventor) :all Inventor) load !ailedI "Patch cannot load inventor) !or the given "racle Home. Possible ca ses are+ "racle Home dir. path does not e(ist in %entral Inventor) "racle Home is a s)mbolic lin0 "racle Home inventor) is corr pted ,sInventor)Session !ailed+ "racleHomeInventor) gets n ll oracleHomeIn!o "Patch !ailed with error code K< Nhich means that o r c rrent oracle home has no longer been part o! inventor), so we are !ree to remove the binaries and e(tract o r tarball to same or new location. Similarl) we have detached home !rom node ; as well. mas0; E .3r nInstaller -silent -detachHome "&$%,E7H"8EAB3 453app3oracle3prod ct355.;.4.<3dbhome75C "&$%,E7H"8E7.$8EAB#B7H"8EB -local Starting "racle @niversal InstallerI %hec0ing swap space+ m st be greater than J44 8B. $ct al ;HJKJ 8B Passed www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 3

The inventor) pointer is located at 3etc3oraInst.loc The inventor) is located at 3 453app3oraInventor) L#etachHome was s ccess! l. In this case we are cloning to a new location to red ce down time as we want to change the path as well. In case we wo ld have choice to se the e(isting location then we co ld choose to per!orm cloning in rolling !ashion to red ce down time to practicall) E(tract tarball to designated location !or "racle Home. %hange director) 1cd2 to parent director) o! destination "racle Home and se tar -*(! >bac0 p7!ile?.tar.g* and then rename it to the desired name. E(ample+ cd 3 453app3oracle3prod ct355.;.4.<3 tar -*(! S"@&%E7H"8E.tar.g* mv S"@&%E7H"8E mas0 E(ec te clone.pl command to complete the cloning process. In case o! &$% )o need to per!orm this operation on all nodes i! sing :local option or in one shot !or ! ll cl ster. E(ec ting clone.pl command on mas05 node !rom oracle ser mas05E perl 3 453app3oracle3prod ct355.;.4.<3mas03clone3bin3clone.pl "&$%,E7H"8EAB3 453app3oracle3prod ct355.;.4.<3mas0B "&$%,E7H"8E7.$8EABmas07H"8EB "&$%,E7B$SEAB3 453app3oracleB L-"B%,@STE&7."#ESAO mas05,mas0;PBL L"B,"%$,7."#EAmas05CL .3r nInstaller -clone -waitQor%ompletion D"&$%,E7H"8EA3 453app3oracle3prod ct355.;.4.<3mas0B D"&$%,E7H"8E7.$8EAmas07H"8EB D"&$%,E7B$SEA3 453app3oracleB D%,@STE&7."#ESAOmas05,mas0;PB D,"%$,7."#EAmas05C -silent -no%on!ig -nowait Starting "racle @niversal InstallerI %hec0ing swap space+ m st be greater than J44 8B. $ct al ;HJKJ 8B Passed Preparing to la nch "racle @niversal Installer !rom 3tmp3"raInstall;45<-4<-;;755-JR-54P8. Please wait I "racle @niversal Installer, Mersion 55.;.4.<.4 Prod ction %op)right 1%2 5SSS, ;455, "racle. $ll rights reserved. Go can !ind the log o! this install session at+ 3 453app3oraInventor)3logs3clone$ctions;45<-4<-;;755-JR-54P8.log . Per!orming tests to see whether nodes mas05 are available IIIIIIIIIIIIIIIIIIIII 544E #one. Installation in progress 1Qrida), 8arch ;;, ;45< 55+JR+;< P8 IST2 IIIIIIIIIIIIIIIIIIIIIIIIII. KSE #one. Install s ccess! l ,in0ing in progress 1Qrida), 8arch ;;, ;45< 55+JR+<4 P8 IST2 ,in0 s ccess! l Set p in progress 1Qrida), 8arch ;;, ;45< 55+JS+4; P8 IST2 Set p s ccess! l End o! install phases.1Qrida), 8arch ;;, ;45< 55+JS+;J P8 IST2 N$&.I.G+

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 4

The !ollowing con!ig ration scripts need to be e(ec ted as the DrootB ser in each new cl ster node. Each script in the list below is !ollowed b) a list o! nodes. 3 453app3oracle3prod ct355.;.4.<3mas03root.sh T"n nodes mas05 To e(ec te the con!ig ration scripts+ 5. "pen a terminal window ;. ,og in as DrootB <. & n the scripts in each cl ster node The cloning o! mas07H"8E was s ccess! l. Please chec0 L3 453app3oraInventor)3logs3clone$ctions;45<-4<-;;755-JR-54P8.log !or more details. E(ec ting root.sh !rom root session on mas05 UrootVmas05 WXT 3 453app3oracle3prod ct355.;.4.<3mas03root.sh %hec0 3 453app3oracle3prod ct355.;.4.<3mas03install3root7mas0;.lg0.nm07;45<-4<-;<75;-4;-44.log !or the o tp t o! root script UrootVmas05 WXT cat 3 453app3oracle3prod ct355.;.4.<3mas03install3root7mas0;.lg0.nm07;45<-4<-;<75;-4;44.log Per!orming root ser operation !or "racle 55g The !ollowing environment variables are set as+ "&$%,E7"N.E&A oracle "&$%,E7H"8EA 3 453app3oracle3prod ct355.;.4.<3mas0 Entries will be added to the 3etc3oratab !ile as needed b) #atabase %on!ig ration $ssistant when a database is created Qinished r nning generic part o! root script. .ow prod ct-speci!ic root actions will be per!ormed. Qinished prod ct-speci!ic root actions. E(ec ting clone.pl command on mas0; node !rom oracle ser mas05E perl 3 453app3oracle3prod ct355.;.4.<3mas03clone3bin3clone.pl "&$%,E7H"8EAB3 453app3oracle3prod ct355.;.4.<3mas0B "&$%,E7H"8E7.$8EABmas07H"8EB "&$%,E7B$SEAB3 453app3oracleB L-"B%,@STE&7."#ESAOmas05,mas0;PBL L"B,"%$,7."#EAmas0;CL .3r nInstaller -clone -waitQor%ompletion D"&$%,E7H"8EA3 453app3oracle3prod ct355.;.4.<3mas0B D"&$%,E7H"8E7.$8EAmas07H"8EB D"&$%,E7B$SEA3 453app3oracleB D%,@STE&7."#ESAOmas05,mas0;PB D,"%$,7."#EAmas0;C -silent -no%on!ig -nowait Starting "racle @niversal InstallerI %hec0ing swap space+ m st be greater than J44 8B. $ct al ;HJKJ 8B Passed Preparing to la nch "racle @niversal Installer !rom 3tmp3"raInstall;45<-4<-;<75;-4J-45$8. Please wait I "racle @niversal Installer, Mersion 55.;.4.<.4 Prod ction %op)right 1%2 5SSS, ;455, "racle. $ll rights reserved. Go can !ind the log o! this install session at+ 3 453app3oraInventor)3logs3clone$ctions;45<-4<-;<75;-4J-45$8.log . Per!orming tests to see whether nodes mas05 are available IIIIIIIIIIIIIIIIIIIII 544E #one. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 5

Installation in progress 1Sat rda), 8arch ;<, ;45< 5;+4J+;< $8 IST2 IIIIIIIIIIIIIIIIIIIIIIIIII. KSE #one. Install s ccess! l ,in0ing in progress 1Sat rda), 8arch ;<, ;45< 5;+4J+<4 $8 IST2 ,in0 s ccess! l Set p in progress 1Sat rda), 8arch ;<, ;45< 5;+4Y+4; $8 IST2 Set p s ccess! l End o! install phases.1Sat rda), 8arch ;<, ;45< 5;+4Y+;J $8 IST2 N$&.I.G+ The !ollowing con!ig ration scripts need to be e(ec ted as the DrootB ser in each new cl ster node. Each script in the list below is !ollowed b) a list o! nodes. 3 453app3oracle3prod ct355.;.4.<3mas03root.sh T"n nodes mas0; To e(ec te the con!ig ration scripts+ 5. "pen a terminal window ;. ,og in as DrootB <. & n the scripts in each cl ster node The cloning o! mas07H"8E was s ccess! l. Please chec0 L3 453app3oraInventor)3logs3clone$ctions;45<-4<-;<75;-4J-45$8.log !or more details. E(ec ting root.sh !rom root session on mas05 UrootVmas0; WXT 3 453app3oracle3prod ct355.;.4.<3mas03root.sh %hec0 3 453app3oracle3prod ct355.;.4.<3mas03install3root7mas0;.lg0.nm07;45<-4<-;<745-4;-44.log !or the o tp t o! root script UrootVmas0; WXT cat 3 453app3oracle3prod ct355.;.4.<3mas03install3root7mas0;.lg0.nm07;45<-4<-;<74J-4;44.log Per!orming root ser operation !or "racle 55g The !ollowing environment variables are set as+ "&$%,E7"N.E&A oracle "&$%,E7H"8EA 3 453app3oracle3prod ct355.;.4.<3mas0 Entries will be added to the 3etc3oratab !ile as needed b) #atabase %on!ig ration $ssistant when a database is created Qinished r nning generic part o! root script. .ow prod ct-speci!ic root actions will be per!ormed. Qinished prod ct-speci!ic root actions. Meri!) the integrit) o! inventor) b) / er)ing opatch lsinventor) mas05 E opatch lsinventor) -all7nodes Z egrep -i LappliedZPatch descriptionZnode name .ode .ame + mas05 Patch 5<Y<;YJ< + applied on Qri Qeb 45 ;<+JH+JR %ST ;45< Patch 5;JJ;JKR + applied on Qri Qeb 45 ;<+JH+J; %ST ;45< Patch 5<KH<<JK + applied on Qri Qeb 45 ;<+JH+HR %ST ;45< Patch 5H5YHRHS + applied on Qri Qeb 45 ;<+JH+H< %ST ;45< Patch 5;<5KS;J + applied on Qri Qeb 45 ;<+JH+H4 %ST ;45< Patch 5HKH5K;K + applied on Qri Qeb 45 ;<+JH+<K %ST ;45< Patch 5JRH<;<R + applied on Qri Qeb 45 ;<+JH+<5 %ST ;45< www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 6

Patch 5HR<KH5H + applied on Qri Qeb 45 ;<+JH+;J %ST ;45< Patch 5<Y5JKYK + applied on Qri Qeb 45 ;<+JH+;5 %ST ;45< Patch 5<S4;SY< + applied on Qri Qeb 45 ;<+JH+5Y %ST ;45< Patch 5HKS<<<R + applied on Qri Qeb 45 ;<+JH+55 %ST ;45< Patch 5HYJ<JSR + applied on Qri Qeb 45 ;<+JH+4K %ST ;45< Patch 5HKJKK4S + applied on Qri Qeb 45 ;<+JH+4; %ST ;45< Patch 5<K5HS;Y + applied on Qri Qeb 45 ;<+J<+JY %ST ;45< Patch 5HHSS;S< + applied on Qri Qeb 45 ;<+J<+J; %ST ;45< Patch 5H;;YJSS + applied on Qri Qeb 45 ;<+J<+HY %ST ;45< Patch 5H<4KS5J + applied on Qri Qeb 45 ;<+J;+JR %ST ;45< Patch description+ D[@$&TE&,G #IS\8". P$T%H Q"& EF$#$T$ 1"%T ;45; : 55.;.4.<.552 + 15H<4KS5J2B Patch 5H;KJJK; + applied on Qri Qeb 45 ;<+J;+<5 %ST ;45< Patch description+ D[@$&TE&,G %&S P$T%H Q"& EF$#$T$ 1"%T ;45; : 55.;.4.<.552 + 15H;KJJK;2B Patch 5HHKHKR4 + applied on Qri Qeb 45 ;<+J4+JK %ST ;45< Patch description+ D[@$&TE&,G #$T$B$SE P$T%H Q"& EF$#$T$ 1"%T ;45; : 55.;.4.<.552 + 15HHKHKR42B Patch 5HYKS;S; + applied on Qri Qeb 45 ;<+5<+4S %ST ;45< Patch 5;YHYKHY + applied on Ned ' n ;K 5R+;R+;Y %#T ;45; Patch 5;SRJ5RH + applied on Ned ' n ;K 5R+;K+<; %#T ;45; Patch 5H4;SH;S + applied on Ned ' n ;K 5R+;K+4K %#T ;45; Patch 5<<YJK44 + applied on Ned ' n ;K 5R+;Y+H5 %#T ;45; Patch 5<J4R55J + applied on Ned ' n ;K 5R+;Y+;5 %#T ;45; Patch 5;SKKJ45 + applied on Ned ' n ;K 5R+;J+4Y %#T ;45; Patch 5<H4H5;S + applied on Ned ' n ;K 5R+;H+HS %#T ;45; Patch 5<45H5;R + applied on Ned ' n ;K 5R+;H+;H %#T ;45; Patch 5H4JRRRH + applied on Ned ' n ;K 5R+5S+<5 %#T ;45; .ode .ame + mas0; Patch 5<Y<;YJ< + applied on Sat Qeb 4; 44+5R+54 %ST ;45< Patch 5;JJ;JKR + applied on Sat Qeb 4; 44+5R+4J %ST ;45< Patch 5<KH<<JK + applied on Sat Qeb 4; 44+5R+45 %ST ;45< Patch 5H5YHRHS + applied on Sat Qeb 4; 44+5K+JK %ST ;45< Patch 5;<5KS;J + applied on Sat Qeb 4; 44+5K+JH %ST ;45< Patch 5HKH5K;K + applied on Sat Qeb 4; 44+5K+J4 %ST ;45< Patch 5JRH<;<R + applied on Sat Qeb 4; 44+5K+HJ %ST ;45< Patch 5HR<KH5H + applied on Sat Qeb 4; 44+5K+H4 %ST ;45< Patch 5<Y5JKYK + applied on Sat Qeb 4; 44+5K+<J %ST ;45< Patch 5<S4;SY< + applied on Sat Qeb 4; 44+5K+<4 %ST ;45< Patch 5HKS<<<R + applied on Sat Qeb 4; 44+5K+;J %ST ;45< Patch 5HYJ<JSR + applied on Sat Qeb 4; 44+5K+;4 %ST ;45< Patch 5HKJKK4S + applied on Sat Qeb 4; 44+5K+5J %ST ;45< Patch 5<K5HS;Y + applied on Sat Qeb 4; 44+5K+54 %ST ;45< Patch 5HHSS;S< + applied on Sat Qeb 4; 44+5K+4Y %ST ;45< Patch 5H;;YJSS + applied on Sat Qeb 4; 44+5K+45 %ST ;45< Patch 5H<4KS5J + applied on Sat Qeb 4; 44+5Y+5K %ST ;45<

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 7

Patch description+ D[@$&TE&,G #IS\8". P$T%H Q"& EF$#$T$ 1"%T ;45; : 55.;.4.<.552 + 15H<4KS5J2B Patch 5H;KJJK; + applied on Sat Qeb 4; 44+5J+J4 %ST ;45< Patch description+ D[@$&TE&,G %&S P$T%H Q"& EF$#$T$ 1"%T ;45; : 55.;.4.<.552 + 15H;KJJK;2B Patch 5HHKHKR4 + applied on Sat Qeb 4; 44+5H+5S %ST ;45< Patch description+ D[@$&TE&,G #$T$B$SE P$T%H Q"& EF$#$T$ 1"%T ;45; : 55.;.4.<.552 + 15HHKHKR42B Patch 5HYKS;S; + applied on Qri Qeb 45 ;<+;H+;K %ST ;45< Patch 5;YHYKHY + applied on Ned ' n ;K 5R+;R+;Y %#T ;45; Patch 5;SRJ5RH + applied on Ned ' n ;K 5R+;K+<; %#T ;45; Patch 5H4;SH;S + applied on Ned ' n ;K 5R+;K+4K %#T ;45; Patch 5<<YJK44 + applied on Ned ' n ;K 5R+;Y+H5 %#T ;45; Patch 5<J4R55J + applied on Ned ' n ;K 5R+;Y+;5 %#T ;45; Patch 5;SKKJ45 + applied on Ned ' n ;K 5R+;J+4Y %#T ;45; Patch 5<H4H5;S + applied on Ned ' n ;K 5R+;H+HS %#T ;45; Patch 5<45H5;R + applied on Ned ' n ;K 5R+;H+;H %#T ;45; Patch 5H4JRRRH + applied on Ned ' n ;K 5R+5S+<5 %#T ;45; ] %op) 1or restore in case cloning done on same patch2 the necessar) con!ig ration !iles 1 i.e. tnsnames.ora, s/lnet.ora 9 p!ile pointing to sp!ile etc2 bac0ed p in step ;. cd 3 453app3oracle3prod ct355.;.4.<3dbhome75 cp networ03admin3tnsnames.ora ..3 mas03networ03admin3. cp dbs3= ..3mas03dbs3. ] Stop all database instances i! not alread) stopped in step-H mas05E srvctl stop database :d 8$S\ mas05 E srvctl stat s database -d 8$S\ Instance 8$S\5 is not r nning on node mas05 Instance 8$S\; is not r nning on node mas0; Bac0 p alert log !ile and trim the e(isting one or move it with 7b0p s !!i( so it wo ld eas) to notice alerts and message appeared when db starts with new oracle home. ] $s we cloned "racle Home on new path so need to modi!) 3etc3oratab and and other local environment pro!ile !iles, as now onwards no re!erence with respect to #Bs switching to new home sho ld go to old oracle home. This step was not re/ ired in case we wo ld have cloned "racle Home on same path. ] Qor &$% or "racle &estart, need to modi!) db con!ig ration b) srvctl command so services wo ld be ta0en care b) %&S3"racle &estart. mas05E srvctl con!ig database -d 8$S\Z grep -i L"racle Home "racle home+ 3 453app3oracle3prod ct355.;.4.<3dbhome75 mas05E srvctl modi!) database -d 8$S\ -o 3 453app3oracle3prod ct355.;.4.<3mas0 mas05E srvctl con!ig database -d 8$S\Z grep -i L"racle Home "racle home+ 3 453app3oracle3prod ct355.;.4.<3mas0 ] Start database !rom new home. mas05E srvctl stop database :d 8$S\ mas05 E srvctl stat s database -d 8$S\ Instance 8$S\5 is not r nning on node mas05 Instance 8$S\; is not r nning on node mas0; In case new home has higher patching level then e(ec te respective post patching scripts. ] Meri!) alterlog as oracle home sho ld be listed as soon as instances are started. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 8

mas05E tail :! alert78$S\5.log Z grep -i "&$%,E7H"8E "&$%,E7H"8E A 3 453app3oracle3prod ct355.;.4.<3mas0 mas0;E tail :! alert78$S\;.log Z grep -i "&$%,E7H"8E "&$%,E7H"8E A 3 453app3oracle3prod ct355.;.4.<3mas0 ] %hec0 alert logs !or errors and e(ception. Best practice to do a!ter ever) change even tho gh )o are s re abo t s ccess o! change, to see i! an)thing n s al is coo0ing behind the screen. .ow )o r database is s ccess! ll) switched to new oracle home

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 9

Potrebbero piacerti anche