{"id":2704,"date":"2021-03-16T08:24:27","date_gmt":"2021-03-16T08:24:27","guid":{"rendered":"https:\/\/swiv.com.br\/taking-backup-as-oracle-image-copies\/"},"modified":"2026-05-27T20:02:50","modified_gmt":"2026-05-27T19:02:50","slug":"taking-backup-as-oracle-image-copies","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/03\/16\/taking-backup-as-oracle-image-copies\/","title":{"rendered":"Taking backup as Oracle Image Copies"},"content":{"rendered":"\n<p>Realizar o backup utilizando image copy possui algumas vantagens e desvantagens, que devem ser considerados na implementa\u00e7\u00e3o da solu\u00e7\u00e3o de backup do ambiente. O tempo deste m\u00e9todo \u00e9 maior, se comparado com o backupset, al\u00e9m dos arquivos gerados possu\u00edrem maior tamanho (at\u00e9 pelo fato de ter uma c\u00f3pia bit a bit do arquivo de origem). Por\u00e9m, o tempo de restore \u00e9 menor para o image copy, se comparado com o backupset. Neste artigo simples demonstro alguns exemplos do uso dele.<\/p>\n\n\n\n<p>Realizando backup do banco inteiro:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 datafile]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Tue Mar 16 04:23:17 2021\nVersion 18.3.0.0.0\n \nCopyright (c) 1982, 2018, Oracle and\/or its affiliates.  All rights reserved.\n \nconnected to target database: RMANDB (DBID=3825250984)\n \nRMAN&gt; BACKUP AS COPY DATABASE;\n \nStarting backup at 2021-03-16:04:23:28\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=59 device type=DISK\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00001 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_system_j50q7khq_.dbf tag=TAG20210316T042329 RECID=6 STAMP=1067315018\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00003 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_sysaux_j50q80oc_.dbf tag=TAG20210316T042329 RECID=7 STAMP=1067315030\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00004 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_undotbs1_j50q87rb_.dbf tag=TAG20210316T042329 RECID=8 STAMP=1067315034\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00005 name=\/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_ts_corte_j50q8c78_.dbf tag=TAG20210316T042329 RECID=9 STAMP=1067315041\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_users_j50q8lb8_.dbf tag=TAG20210316T042329 RECID=10 STAMP=1067315042\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01\nFinished backup at 2021-03-16:04:24:03\n \nStarting Control File and SPFILE Autobackup at 2021-03-16:04:24:03\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_16\/o1_mf_s_1067315043_j50q8ngz_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-16:04:24:06\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Consultando dados sobre o backup acima com o LIST:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; LIST COPY OF DATABASE;\n \nList of Datafile Copies\n=======================\n \nKey     File S Completion Time     Ckp SCN    Ckp Time            Sparse\n------- ---- - ------------------- ---------- ------------------- ------\n6       1    A 2021-03-16:04:23:38 1828269    2021-03-16:04:23:29 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_system_j50q7khq_.dbf\n        Tag: TAG20210316T042329\n \n7       3    A 2021-03-16:04:23:50 1828274    2021-03-16:04:23:44 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_sysaux_j50q80oc_.dbf\n        Tag: TAG20210316T042329\n \n8       4    A 2021-03-16:04:23:54 1828277    2021-03-16:04:23:51 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_undotbs1_j50q87rb_.dbf\n        Tag: TAG20210316T042329\n \n9       5    A 2021-03-16:04:24:01 1828279    2021-03-16:04:23:55 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_ts_corte_j50q8c78_.dbf\n        Tag: TAG20210316T042329\n \n10      7    A 2021-03-16:04:24:02 1828282    2021-03-16:04:24:02 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_users_j50q8lb8_.dbf\n        Tag: TAG20210316T042329\n \n \nRMAN&gt; host &#039;ls -lthr \/oracle\/fra\/RMANDB\/datafile\/&#039;;\n \ntotal 2.0G\n-rw-r-----. 1 oracle oinstall 861M Mar 16 04:23 o1_mf_system_j50q7khq_.dbf\n-rw-r-----. 1 oracle oinstall 601M Mar 16 04:23 o1_mf_sysaux_j50q80oc_.dbf\n-rw-r-----. 1 oracle oinstall 306M Mar 16 04:23 o1_mf_undotbs1_j50q87rb_.dbf\n-rw-r-----. 1 oracle oinstall 201M Mar 16 04:23 o1_mf_ts_corte_j50q8c78_.dbf\n-rw-r-----. 1 oracle oinstall 5.1M Mar 16 04:24 o1_mf_users_j50q8lb8_.dbf\nhost command complete\n<\/pre><\/div>\n\n\n<p>Limpando arquivos de backup da FRA:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; DELETE COPY OF DATABASE;\n \nreleased channel: ORA_DISK_1\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=59 device type=DISK\nList of Datafile Copies\n=======================\n \nKey     File S Completion Time     Ckp SCN    Ckp Time            Sparse\n------- ---- - ------------------- ---------- ------------------- ------\n6       1    A 2021-03-16:04:23:38 1828269    2021-03-16:04:23:29 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_system_j50q7khq_.dbf\n        Tag: TAG20210316T042329\n \n7       3    A 2021-03-16:04:23:50 1828274    2021-03-16:04:23:44 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_sysaux_j50q80oc_.dbf\n        Tag: TAG20210316T042329\n \n8       4    A 2021-03-16:04:23:54 1828277    2021-03-16:04:23:51 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_undotbs1_j50q87rb_.dbf\n        Tag: TAG20210316T042329\n \n9       5    A 2021-03-16:04:24:01 1828279    2021-03-16:04:23:55 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_ts_corte_j50q8c78_.dbf\n        Tag: TAG20210316T042329\n \n10      7    A 2021-03-16:04:24:02 1828282    2021-03-16:04:24:02 NO\n        Name: \/oracle\/fra\/RMANDB\/datafile\/o1_mf_users_j50q8lb8_.dbf\n        Tag: TAG20210316T042329\n \n \nDo you really want to delete the above objects (enter YES or NO)? YES\ndeleted datafile copy\ndatafile copy file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_system_j50q7khq_.dbf RECID=6 STAMP=1067315018\ndeleted datafile copy\ndatafile copy file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_sysaux_j50q80oc_.dbf RECID=7 STAMP=1067315030\ndeleted datafile copy\ndatafile copy file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_undotbs1_j50q87rb_.dbf RECID=8 STAMP=1067315034\ndeleted datafile copy\ndatafile copy file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_ts_corte_j50q8c78_.dbf RECID=9 STAMP=1067315041\ndeleted datafile copy\ndatafile copy file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_users_j50q8lb8_.dbf RECID=10 STAMP=1067315042\nDeleted 5 objects\n<\/pre><\/div>\n\n\n<p>Utilizando o par\u00e2metro FORMAT durante o backup para apontar ao RMAN o local de destino do backup.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; BACKUP AS COPY TABLESPACE USERS FORMAT &#039;\/oracle\/fra\/RMANDB\/datafile\/users.dbf&#039;;\n \nStarting backup at 2021-03-16:05:08:41\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=131 device type=DISK\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/users.dbf tag=TAG20210316T050842 RECID=11 STAMP=1067317722\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01\nFinished backup at 2021-03-16:05:08:43\n \nStarting Control File and SPFILE Autobackup at 2021-03-16:05:08:43\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_16\/o1_mf_s_1067317723_j50swcxv_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-16:05:08:44\n<\/pre><\/div>\n\n\n<p>Realizando processo de um datafile em espec\u00edfico (tanto pelo seu n\u00famero quanto nome):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; BACKUP AS COPY DATAFILE 7;\n \nStarting backup at 2021-03-16:05:11:55\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_users_j50t2cyv_.dbf tag=TAG20210316T051155 RECID=12 STAMP=1067317916\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01\nFinished backup at 2021-03-16:05:11:56\n \nStarting Control File and SPFILE Autobackup at 2021-03-16:05:11:57\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_16\/o1_mf_s_1067317917_j50t2fjp_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-16:05:11:58\n \nRMAN&gt; BACKUP AS COPY DATAFILE &#039;\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf&#039;;\n \nStarting backup at 2021-03-16:05:12:08\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting datafile copy\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\noutput file name=\/oracle\/fra\/RMANDB\/datafile\/o1_mf_users_j50t2rx0_.dbf tag=TAG20210316T051208 RECID=13 STAMP=1067317928\nchannel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01\nFinished backup at 2021-03-16:05:12:09\n \nStarting Control File and SPFILE Autobackup at 2021-03-16:05:12:10\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_16\/o1_mf_s_1067317930_j50t2thb_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-16:05:12:11\n<\/pre><\/div>\n\n\n<p>Fazendo image copy dos archived redologs:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; BACKUP AS COPY ARCHIVELOG ALL;\n \nStarting backup at 2021-03-16:05:21:57\ncurrent log archived\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting archived log copy\ninput archived log thread=1 sequence=40 RECID=46 STAMP=1067318518\noutput file name=\/oracle\/fra\/RMANDB\/archivelog\/2021_03_16\/o1_mf_1_40_j50to6cq_.arc RECID=47 STAMP=1067318518\nchannel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01\nFinished backup at 2021-03-16:05:21:59\n \nStarting Control File and SPFILE Autobackup at 2021-03-16:05:21:59\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_16\/o1_mf_s_1067318519_j50to7rx_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-16:05:22:00\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Realizar o backup utilizando image copy possui algumas vantagens e desvantagens, que devem ser considerados na implementa\u00e7\u00e3o da solu\u00e7\u00e3o de backup do ambiente. O tempo deste m\u00e9todo \u00e9 maior, se comparado com o backupset, al\u00e9m dos arquivos gerados possu\u00edrem maior tamanho (at\u00e9 pelo fato de ter uma c\u00f3pia bit a bit do arquivo de origem). [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2704","post","type-post","status-publish","format-standard","hentry","category-backup-recovery"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=2704"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2704\/revisions"}],"predecessor-version":[{"id":9230,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2704\/revisions\/9230"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}