encrypted rman backup tips

4
Oracle Tips Got Questions? KEEP pool deprecated in 12c 12c Poster Available! Free AWR Report Analysis BEWARE of 11gR2 Upgrade Gotchas! Search BC Oracle Sites Search Home Email Us Oracle Articles Oracle Training Oracle Tips Oracle Forum Class Catalog Remote DBA Oracle Tuning Emergency 911 RAC Support Apps Support Analysis Design Implementation Oracle Support SQL Tuning Security Oracle UNIX Oracle Linux Monitoring Remote support Remote plans Remote services Application Server Applications Oracle Forms Oracle Portal App Upgrades SQL Server Oracle Concepts Software Support Remote Support Development Implementation Consulting Staff Consulting Prices Help Wanted! Oracle Posters Encrypted RMAN Backup Tips Expert Oracle Tips by Burleson Consulting March 25, 2012 Creating Encrypted RMAN Backups and Recovery It is very simple to restore the database created by RMAN using simple commands. If someone has stolen the backup of the database, they can easily restore it and steal all our data, too. To prevent that from happening, encrypt the backup that has been made. By querying the v$rman_encryption_algorithms view, a list of RMAN encryption algorithms can be obtained: SQL> select algorithm_id, algorithm_name, algorithm_description, is_default from v$rman_encryption_algorithms; ALGORITHM_ID ALGORITHM_NAME ALGORITHM_DESCRIPTION IS_DEFAULT 1 AES128 AES 128bit key YES 2 AES192 AES 192bit key NO 3 AES256 AES 256bit key NO SQL> There are three forms of encryption in Oracle 10g: transparent, password and dual mode. To use transparent mode encryption, Oracle Encryption Wallet should be used. To use password mode, a password should be provide by the DBA which will be used in encryption. By using dual mode encryption, both above mentioned modes will be used. In the following example, we will show how to use password mode to encrypt our backup. Use the set encryption on command and the password using the identified by command, and encrypt the backup that is taken in this session. Use the only keyword at the end to use only password encryption. If the keyword only is missed, RMAN uses dual mode encryption and demands the presence of Oracle Encryption Wallet, too. RMAN> set encryption on identified by 'test' only; Backup the users tablespace: RMAN> backup tablespace users; Now try to restore it: RMAN> restore tablespace users; ORA19913: unable to decrypt backup ORA28365: wallet is not open As this shows, it is impossible to restore already encrypted backup without using the password. In this situation, if someone has stolen our backup, they will not be able to restore it and steal our data, too, without providing the correct password. Now provide the password and restore the backup: ��

Upload: theahmadkhan

Post on 18-Aug-2015

236 views

Category:

Documents


3 download

DESCRIPTION

Encrypted RMAN Backup Tips

TRANSCRIPT

OracleTipsGotQuestions?KEEPpooldeprecatedin12c12cPosterAvailable!FreeAWRReportAnalysisBEWAREof11gR2UpgradeGotchas!SearchBCOracleSitesSearchHomeEmailUsOracleArticlesOracleTrainingOracleTipsOracleForumClassCatalogRemoteDBAOracleTuningEmergency911RACSupportAppsSupportAnalysisDesignImplementationOracleSupportSQLTuningSecurityOracleUNIXOracleLinuxMonitoringRemotesupportRemoteplansRemoteservicesApplicationServerApplicationsOracleFormsOraclePortalAppUpgradesSQLServerOracleConceptsSoftwareSupportRemoteSupportDevelopmentImplementationConsultingStaffConsultingPricesHelpWanted!OraclePostersEncryptedRMANBackupTipsExpertOracleTipsbyBurlesonConsultingMarch25,2012CreatingEncryptedRMANBackupsandRecoveryItisverysimpletorestorethedatabasecreatedbyRMANusingsimplecommands.Ifsomeonehasstolenthebackupofthedatabase,theycaneasilyrestoreitandstealallourdata,too.Topreventthatfromhappening,encryptthebackupthathasbeenmade.Byqueryingthev$rman_encryption_algorithmsview,alistofRMANencryptionalgorithmscanbeobtained:SQL>selectalgorithm_id,algorithm_name,algorithm_description,is_defaultfromv$rman_encryption_algorithmsALGORITHM_IDALGORITHM_NAMEALGORITHM_DESCRIPTIONIS_DEFAULT1AES128AES128bitkeyYES2AES192AES192bitkeyNO3AES256AES256bitkeyNOSQL>TherearethreeformsofencryptioninOracle10g:transparent,passwordanddualmode.Tousetransparentmodeencryption,OracleEncryptionWalletshouldbeused.Tousepasswordmode,apasswordshouldbeprovidebytheDBAwhichwillbeusedinencryption.Byusingdualmodeencryption,bothabovementionedmodeswillbeused.Inthefollowingexample,wewillshowhowtousepasswordmodetoencryptourbackup.Usethesetencryptiononcommandandthepasswordusingtheidentifiedbycommand,andencryptthebackupthatistakeninthissession.Usetheonlykeywordattheendtouseonlypasswordencryption.Ifthekeywordonlyismissed,RMANusesdualmodeencryptionanddemandsthepresenceofOracleEncryptionWallet,too.RMAN>setencryptiononidentifiedby'test'onlyBackuptheuserstablespace:RMAN>backuptablespaceusersNowtrytorestoreit:RMAN>restoretablespaceusersORA19913:unabletodecryptbackupORA28365:walletisnotopenAsthisshows,itisimpossibletorestorealreadyencryptedbackupwithoutusingthepassword.Inthissituation,ifsomeonehasstolenourbackup,theywillnotbeabletorestoreitandstealourdata,too,withoutprovidingthecorrectpassword.Nowprovidethepasswordandrestorethebackup:OracleBooksOracleScriptsIonExcelDBDonBurlesonBlogRMAN>setdecryptionidentifiedby'test'RMAN>restoretablespaceusersUsingthepassword,tablespaceisrestoredsuccessfully.Ifweprovideawrongpassword,itwillnotrestorethebackup:RMAN>setdecryptionidentifiedby'wrong'#wrongpasswordRMAN>restoretablespaceusersORA19913:unabletodecryptbackupORA28365:walletisnotopenRMAN>Bydefault,RMANusestheAES128bitkeyalgorithmforencryption.Thealgorithmcanbeeasilychangedusingtheconfigureencryptionalgorithmcommandasfollows:RMAN>showencryptionalgorithmRMANconfigurationparametersare:configureencryptionalgorithm'AES128'#defaultRMAN>configureencryptionalgorithm'AES256'newRMANconfigurationparameters:configureencryptionalgorithm'AES256'newRMANconfigurationparametersaresuccessfullystoredRMAN>showencryptionalgorithmRMANconfigurationparametersare:configureencryptionalgorithm'AES256'Again,anytimethisconfigurationiscleared,theencryptionalgorithmcanbereturnedtoitsdefaultvalueasfollows:RMAN>configureencryptionalgorithmclearoldRMANconfigurationparameters:configureencryptionalgorithm'AES256'RMANconfigurationparametersaresuccessfullyresettodefaultvalueRMAN>showencryptionalgorithmRMANconfigurationparametersare:configureencryptionalgorithm'AES128'#defaultRMAN>TouseOracleEncryptionWallet,weneedtoconfigureRMANtoperformanencryptedbackupofanytablespaceorwholedatabaseautomatically.Forthis,usetheconfigureencryptionforcommand.Inthefollowingexample,weconfigureRMANtocreateanencryptedbackupofthedatabase,andexcludeuserstablespacefromencryption:RMAN>showallRMANconfigurationparametersare:configureencryptionfordatabaseoff#defaultconfigureencryptionalgorithm'AES128'#defaultRMAN>configureencryptionfordatabaseonnewRMANconfigurationparameters:configureencryptionfordatabaseonnewRMANconfigurationparametersaresuccessfullystoredRMAN>configureencryptionfortablespaceusersofftablespaceuserswillnotbeencryptedinfuturebackupsetsnewRMANconfigurationparametersaresuccessfullystoredRMAN>showallRMANconfigurationparametersare:configureencryptionfordatabaseonconfigureencryptionalgorithm'AES128'#defaultconfigureencryptionfortablespace'users'offToreturnbacktodefaultvalue,cleartheencryptionconfigurationparameter:RMAN>configureencryptionfordatabaseclearoldRMANconfigurationparameters:configureencryptionfordatabaseonRMANconfigurationparametersaresuccessfullyresettodefaultvalueRMAN>configureencryptionfortablespaceuserscleartablespaceuserswilldefaulttodatabaseencryptionconfigurationoldRMANconfigurationparametersaresuccessfullydeletedRMAN>showallRMANconfigurationparametersare:configureencryptionfordatabaseoff#defaultGettheCompleteOracleBackup&RecoveryDetailsThelandmarkbook"OracleBackup&Recovery:ExpertsecretsforusingRMANandDataPump"providesrealworldadviceforresolvingthemostdifficultOracleperformanceandrecoveryissues.Buyitfor40%offdirectlyfromthepublisher.BurlesonistheAmericanTeamNote:ThisOracledocumentationwascreatedasasupportandOracletrainingreferenceforusebyourDBAperformancetuningconsultingprofessionals.FeelfreetoaskquestionsonourOracleforum.Verifyexperience!AnyoneconsideringusingtheservicesofanOraclesupportexpertshouldindependentlyinvestigatetheircredentialsandexperience,andnotrelyonadvertisementsandselfproclaimedexpertise.AlllegitimateOracleexpertspublishtheirOraclequalifications.Errata?OracletechnologyischangingandwestrivetoupdateourBCOraclesupportinformation.Ifyoufindanerrororhaveasuggestionforimprovingourcontent,wewouldappreciateyourfeedback.Justemail:andincludetheURLforthepage. BurlesonConsultingTheOracleofDatabaseSupportOraclePerformanceTuningRemoteDBAServicesCopyright?19962014AllrightsreservedbyBurlesonOracle?istheregisteredtrademarkofOracleCorporation.