RMAN - Cloning on a Local Host
description
Transcript of RMAN - Cloning on a Local Host
-
4/3/2015 RMANcloningonaLocalHost
http://www.dbaoracle.com/t_rman_78_cloning_local_host.htm 1/8
OracleTipsGotQuestions?KEEPpooldeprecatedin12c12cPosterAvailable!FreeAWRReportAnalysisBEWAREof11gR2UpgradeGotchas!
SearchBCOracleSites
Search
Home
EmailUs
OracleArticles
OracleTraining
OracleTips
OracleForum
ClassCatalog
RemoteDBA
OracleTuning
Emergency911
RACSupport
AppsSupport
Analysis
Design
Implementation
OracleSupport
RMANcloningonaLocalHostExpertOracleTipsbyBurlesonConsulting
March25,2012
RMANCreatingaDuplicateDatabaseonaLocalHost
Note:ItisrecommendedNOTtoclonetheproductiondatabaseonthesameserverorhost.Howeverasapractice,itcanbedoneforanynonproductiondatabases.
Oncetheclonedatabasehasbeencreatedontheremotehost,itispossibletoduplicateadatabasetothelocalhost,too.Forthis,thedatabasenameandlocationofdatabasefilesshouldbedifferent.Moreover,tnsnames.oraandlistener.orafilesshouldbeconfiguredcorrectly.
Inthefollowingexample,thereisoneproductiondatabasecalledtestandthegoalwillbetocloneittothesamehostwiththenameclone_db.Nowgothroughthestepsoftheprocess:
1. Makeacopyofthepasswordfilefortheseconddatabase:
http://www.dba-oracle.com/shadow_oracle_rac.htmhttp://www.dba-oracle.com/oracle_news/http://www.dba-oracle.com/articles.htmhttp://www.dba-oracle.com/bc-catalog.pdfhttp://www.remote-dba.net/http://www.dba-oracle.com/t_11g_release_2_upgrade_performance_gotchas.htmhttp://www.dba-oracle.com/oracle_news/index.htmhttp://burleson-dba.com/SP/http://www.dba-oracle.com/developer/dev_systems_analysis_support_consulting_training.htmhttp://www.dba-oracle.com/training.htmhttp://www.dba-oracle.com/oracle_tuning_consulting.htmhttp://www.dba-oracle.com/http://www.dba-oracle.com/developer/dev_implementation_support_consulting_training.htmhttp://www.rampant-books.com/poster_oracle_database.htmhttp://www.dba-oracle.com/support/http://www.dba-oracle.com/t_got_questions.htmhttp://www.dba-oracle.com/developer/dev_systems_design_support_consulting_training.htmhttp://www.dba-oracle.com/contact_us.htmhttp://www.dba-oracle.com/emergency_oracle_support.htmhttp://www.dba-oracle.com/t_keep_recuycle_pool_deprecated_12c.htmhttp://www.dba-oracle.com/oracle_applications/http://www.dbaforums.org/oracle -
4/3/2015 RMANcloningonaLocalHost
http://www.dbaoracle.com/t_rman_78_cloning_local_host.htm 2/8
SQLTuning
Security
OracleUNIX
OracleLinux
Monitoring
Remotesupport
Remoteplans
Remoteservices
ApplicationServer
Applications
OracleForms
OraclePortal
AppUpgrades
SQLServer
OracleConcepts
SoftwareSupport
RemoteSupport
Development
Implementation
ConsultingStaff
ConsultingPrices
HelpWanted!
OraclePosters
OracleBooks
OracleScripts
Ion
ExcelDB
FS 25$&/ (B+20( GEV RUDSZWHVW 25$&/ (B+20( GEV RUDSZFORQHBGE
2. Configurebothlistener.oraandtnsnames.orafilestoconnecttotheauxiliarydatabase(clone_db)thatisneededtochangethetnsnames.oraandlistener.orafile.Changethesefilesasfollows:
OLVWHQHU RUD 6, B (6& 6, B1$0( FORQHBGE 25$&/ (B+20( X RUDFOH SURGXFW GEB WQVQDPHV RUDFORQHBGE GHVFULSWLRQ DGGUHVV SURWRFRO WFS KRVW ORFDOKRVW ORFDOGRPDLQ SRUW FRQQHFWBGDWD VHUYHU GHGLFDWHG VHUYLFHBQDPH FORQHBGE
Donotforgettoapplychangedparameterstotherunninglistenerbyrunningthefollowingcommand:
OVQUFWO UHORDG
3. Createaparameterfilefortheauxiliary(clone_db)database:
FRPSDWLEOH FRQWUROBI LOHV X RUDFOH FORQHBGE FRQWURO FWO X RUDFOHFORQHBGE FRQWURO FWO X RUDFOH FORQHBGE FRQWURO FWO GEBEORFNBVL] H GEBQDPH FORQHBGE VJDBWDUJHW
Now,createspfilefromthisparameterfile:
H[ SRUW 25$&/ (B6, FORQHBGE FG 25$&/ (B+20( GEV
http://www.remote-dba.net/plans.htmhttp://www.dba-oracle.com/poster.htmhttp://www.ion-dba.com/http://www.rampant-books.com/book_0314_oracle_tuning_pack.htmhttp://www.dba-oracle.com/jobs.htmhttp://www.dba-oracle.com/bp/bp_elec_adv_mon_tuning.htmhttp://www.remote-dba.net/remote_oracle.htmhttp://www.dba-oracle.com/dev_Oracle%20_WebLogic_support_consulting_training.htmhttp://www.dba-oracle.com/unix_oracle_consulting.htmhttp://www.dba-oracle.com/developer/dev_Oracle%20_Portal_support_consulting_training.htmhttp://www.remote-dba.net/remote_oracle.htmhttp://www.dba-oracle.com/oracle_applications/Oracle_11i.htmhttp://www.rampant-books.com/menu_oracle.htmhttp://www.dba-oracle.com/monitoring.htmhttp://www.remote-dba.net/services.htmhttp://www.dba-oracle.com/qualifications.htmhttp://www.dba-oracle.com/t_security_consulting_support.htmhttp://www.dba-oracle.com/concepts/http://www.remote-dba.net/services.htmhttp://www.remote-dba.net/services.htmhttp://www.dba-oracle.com/sql_tuning.htmhttp://www.dba-oracle.com/developer/dev_Oracle%20_Developer_forms_support_consulting_training.htmhttp://www.rampant-books.com/poster_oracle_database.htmhttp://www.dba-oracle.com/consulting_prices.htmhttp://www.dba-oracle.com/developer/s_software_development.htmhttp://www.dba-sql-server.com/http://www.dba-oracle.com/shad_oracle_development.htmhttp://www.remote-dba.net/services.htmhttp://www.dba-oracle.com/t_linux_oracle_consulting_support.htmhttp://www.excel-db.net/http://www.dba-oracle.com/oracle_applications/http://www.dba-oracle.com/shad_oracle_implementation.htm -
DonBurlesonBlog
VTOSOXV DV V\ VGED64/ ! FUHDWHVSI LOH I URP SI LOH SI LOHBFORQHBGE RUD )LOH FUHDWHG64/ !
4. Startuptheauxiliaryinstanceinnomountmode:
H[ SRUW 25$&/ (B6, FORQHBGE VTOSOXV DV V\ VGED64/ !VWDUWXSQRPRXQW
5. BackuptheproductiondatabaseusingRMAN:
H[ SRUW 25$&/ (B6, WHVW UPDQ WDUJHW 50$1! EDFNXS GDWDEDVH SOXV DUFKLYHORJ
6. Duplicatedatabaseusingthefollowingscript.
Now,asthedatabaseisclonedinthesamehost,adifferentlocationfordatafilesofthenewdatabaseneedstobedefined.Here,usesetnewnametodefinethenewlocationinrunblock.Ensurethatthisisdonecorrectlyforeverydatafile!Connecttobothinstancesandrunthefollowingrunblock:
H[ SRUW 25$&/ (B6, WHVW UPDQ WDUJHW V\ V WHVW DX[ LOLDU\ sys/test@clone_dbFRQQHFWHG WR WDUJHW GDWDEDVH 7(67 %, FRQQHFWHG WR DX[ LOLDU\ GDWDEDVH FORQHBGE QRW PRXQWHG50$1! UXQ ^ VHW QHZQDPH I RU GDWDI LOH 72 X RUDFOH FORQHBGE V\ VWHP GEI VHW QHZQDPH I RU GDWDI LOH 72 X RUDFOH FORQHBGE XQGRWEV GEI VHW QHZQDPH I RU GDWDI LOH 72 X RUDFOH FORQHBGE V\ VDX[ GEI
http://www.dba-oracle.com/training.htmmailto:sys/test@clone_dbhttp://donburleson.com/http://www.dba-oracle.com/oracle_health_check.htm -
VHW QHZQDPH I RU GDWDI LOH 72 X RUDFOH FORQHBGE XVHUV GEI VHW QHZQDPH I RU WHPSI LOH 72 X RUDFOH FORQHBGE WHPS GEI GXSOLFDWH WDUJHW GDWDEDVH WR FORQHBGE ORJI LOH X RUDFOH FORQHBGE UHGR ORJ 6, =( 0 X RUDFOH FORQHBGE UHGR ORJ 6, =( 0 X RUDFOH FORQHBGE UHGR ORJ 6, =( 0 GDWDEDVH RSHQHG)LQLVKHG XSOLFDWH E DW (& 50$1!
Iftheexactnumberofthedatafiletospecifyinthesetnewnamefordatafiletocommandisnotknown,thenqueryinthedatabaseasfollows:
64/ ! VHOHFWI LOHBLG I LOHBQDPH )520 GEDBGDWDBI LOHV
Forthesetnewnamefortempfiletocommand,then:
64/ ! VHOHFWI LOHBLG I LOHBQDPHI URPGEDBWHPSBI LOHV
ThedataandtempfilenumberscanalsobefoundbyconnectingtotheproductiondatabasewithRMANclientasfollows:
H[ SRUW 25$&/ (B6, WHVW UPDQ WDUJHW 50$1! VKRZ VFKHPD
Herethefilenumberinformationcanbeseen.Now,connecttotheauxiliaryinstanceandquerydatafilelocations:
-
H[ SRUW 25$&/ (B6, FORQHBGE VTOSOXV DV V\ VGED64/ ! VHOHFWQDPHI URPY GDWDEDVH
1$0( FORQHBGE
64/ ! VHOHFW QDPHI URP Y GDWDI LOH
1$0( X RUDFOH FORQHBGE V\ VWHP GEI X RUDFOH FORQHBGE XQGRWEV GEI X RUDFOH FORQHBGE V\ VDX[ GEI X RUDFOH FORQHBGE XVHUV GEI64/ !
Thisshowsthattheclonedatabaseoftheprimarydatabasetest1wascreatedwithadifferentdatabasename(clone_db)anddifferentdirectorystructure.
GettheComplete
-
OracleBackup&RecoveryDetails
Thelandmarkbook"OracleBackup&Recovery:ExpertsecretsforusingRMANandDataPump"providesrealworldadviceforresolvingthemostdifficultOracleperformanceandrecoveryissues.Buyitfor40%offdirectlyfromthepublisher.
BurlesonistheAmericanTeam
http://www.rampant-books.com/book_1002_rman_backup_recovery.htmhttp://www.rampant-books.com/book_1002_rman_backup_recovery.htmhttp://www.rampant-books.com/book_1002_rman_backup_recovery.htm -
1RWHThisOracledocumentationwascreatedasasupportandOracletrainingreferenceforusebyourDBAperformancetuningconsultingprofessionals.FeelfreetoaskquestionsonourOracleforum.
9HULI\H[SHULHQFHAnyoneconsideringusingtheservicesofanOraclesupportexpertshouldindependentlyinvestigatetheircredentialsandexperience,andnotrelyonadvertisementsandselfproclaimedexpertise.AlllegitimateOracleexpertspublishtheirOraclequalifications.
( UUDWD"OracletechnologyischangingandwestrivetoupdateourBCOraclesupportinformation.Ifyoufindanerrororhaveasuggestionforimprovingourcontent,wewouldappreciateyourfeedback.Justemail:
andincludetheURLforthepage.
BurlesonConsultingTheOracleofDatabaseSupport
http://www.dba-oracle.com/qualifications.htmhttp://dbaforums.org/oracle/index.php?showforum=2 -
2UDFOH3HUIRUPDQFH7XQLQJ
5HPRWH %$6HUYLFHV
Copyright?19962014
AllrightsreservedbyBurleson
Oracle"istheregisteredtrademarkofOracleCorporation.
http://www.dba-oracle.com/oracle_performance_consulting.htmhttp://www.remote-dba.net/http://www.dba-oracle.com/oracle_performance_consulting.htm