{"id":8796,"date":"2023-01-10T18:20:21","date_gmt":"2023-01-10T21:20:21","guid":{"rendered":"https:\/\/swiv.com.br\/?p=8796"},"modified":"2026-05-27T20:02:29","modified_gmt":"2026-05-27T19:02:29","slug":"does-database-writer-write-to-datafiles-in-backup-mode","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2023\/01\/10\/does-database-writer-write-to-datafiles-in-backup-mode\/","title":{"rendered":"Does Database Writer write to datafiles in Backup Mode?"},"content":{"rendered":"\n<p>Impressionante perceber que quanto mais estudamos, mais vemos que nada sabemos, e os tantos gaps de conhecimento que deixamos pelo caminho. Este foi meu caso ao me deparar com a pergunta do t\u00edtulo, na obra do Darl Kuhn (Linux and Solaris Recipes for Oracle DBAs). Diante disso, decidi reproduzir o assunto em laborat\u00f3rio pr\u00f3prio, para fortalecer o conceito, mas os cr\u00e9ditos devem ficar com o Darl que criou o procedimento de teste.<\/p>\n\n\n\n<p>Primeiro, vamos validar se nosso datafile possui o conte\u00fado &#8220;SWIV&#8221;:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$\n&#x5B;oracle@oel8 ~]$ strings \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf | grep -i SWIV\n&#x5B;oracle@oel8 ~]$\n<\/pre><\/div>\n\n\n<p>Vemos que n\u00e3o h\u00e1 este conte\u00fado. Ent\u00e3o vamos criar uma tabela de testes na tablespace USERS:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$ sqlplus \/ as sysdba\n\nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Jan 10 18:12:52 2023\nVersion 18.13.0.0.0\n\nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n\n\nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n\nSQL&gt; CREATE TABLE TABELA (CONTEUDO VARCHAR2(20)) TABLESPACE USERS;\n\nTable created.\n\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Colocando a tablespace em modo backup:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER TABLESPACE USERS BEGIN BACKUP;\n\nTablespace altered.\n\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Inserindo o conte\u00fado &#8220;SWIV&#8221; em nossa tabela de teste:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; INSERT INTO TABELA (CONTEUDO) VALUES (&#039;SWIV&#039;);\n\n1 row created.\n\nSQL&gt; COMMIT;\n\nCommit complete.\n\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Garantindo que os blocos em mem\u00f3ria sejam persistidos em disco:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER SYSTEM CHECKPOINT;\n\nSystem altered.\n\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Validando o datafile, temos a nossa resposta: Sim, ainda h\u00e1 escrita no datafile mesmo a tablespace permanecendo em Begin Backup:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$ strings \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf | grep -i SWIV\nSWIV\n&#x5B;oracle@oel8 ~]$\n&#x5B;oracle@oel8 ~]$\n<\/pre><\/div>\n\n\n<p>Mudando status da tablespace ap\u00f3s o teste:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER TABLESPACE USERS END BACKUP;\n\nTablespace altered.\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Impressionante perceber que quanto mais estudamos, mais vemos que nada sabemos, e os tantos gaps de conhecimento que deixamos pelo caminho. Este foi meu caso ao me deparar com a pergunta do t\u00edtulo, na obra do Darl Kuhn (Linux and Solaris Recipes for Oracle DBAs). Diante disso, decidi reproduzir o assunto em laborat\u00f3rio pr\u00f3prio, para [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-8796","post","type-post","status-publish","format-standard","hentry","category-administration","category-backup-recovery"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8796","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=8796"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8796\/revisions"}],"predecessor-version":[{"id":9024,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8796\/revisions\/9024"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=8796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=8796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=8796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}