{"id":2676,"date":"2021-03-15T08:43:13","date_gmt":"2021-03-15T08:43:13","guid":{"rendered":"https:\/\/swiv.com.br\/taking-backup-of-the-oracle-spfile\/"},"modified":"2026-05-27T20:02:51","modified_gmt":"2026-05-27T19:02:51","slug":"taking-backup-of-the-oracle-spfile","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/03\/15\/taking-backup-of-the-oracle-spfile\/","title":{"rendered":"Taking backup of the Oracle SPFILE"},"content":{"rendered":"\n<p>Aqui n\u00e3o tem muito segredo. Para criar um backupset com o conte\u00fado do spfile:<\/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 SPFILE;\n \nStarting backup at 2021-03-15:05:33:19\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current SPFILE in backup set\nchannel ORA_DISK_1: starting piece 1 at 2021-03-15:05:33:19\nchannel ORA_DISK_1: finished piece 1 at 2021-03-15:05:33:20\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_03_15\/o1_mf_nnsnf_TAG20210315T053319_j4y6yhp9_.bkp tag=TAG20210315T053319 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 2021-03-15:05:33:20\n \nStarting Control File and SPFILE Autobackup at 2021-03-15:05:33:20\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_15\/o1_mf_s_1067232800_j4y6ykdy_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-15:05:33:21\n<\/pre><\/div>\n\n\n<p>Criando o backup como image copy:<\/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 SPFILE FORMAT &#039;\/tmp\/spfile.ora&#039;;\n \nStarting backup at 2021-03-15:05:34:40\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current SPFILE in backup set\nchannel ORA_DISK_1: starting piece 1 at 2021-03-15:05:34:41\nchannel ORA_DISK_1: finished piece 1 at 2021-03-15:05:34:42\npiece handle=\/tmp\/spfile.ora tag=TAG20210315T053440 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 2021-03-15:05:34:42\n \nStarting Control File and SPFILE Autobackup at 2021-03-15:05:34:42\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_15\/o1_mf_s_1067232882_j4y712ts_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-15:05:34:43\nRMAN&gt; host &#039;ls \/tmp\/spfile.ora&#039;;\n \n\/tmp\/spfile.ora\nhost command complete\n<\/pre><\/div>\n\n\n<p>Listando os detalhes dos backups:<\/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 BACKUP OF SPFILE;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n33      Full    96.00K     DISK        00:00:00     2021-03-15:05:33:19\n        BP Key: 33   Status: AVAILABLE  Compressed: NO  Tag: TAG20210315T053319\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_03_15\/o1_mf_nnsnf_TAG20210315T053319_j4y6yhp9_.bkp\n  SPFILE Included: Modification time: 2021-03-15:04:52:58\n  SPFILE db_unique_name: RMANDB\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n34      Full    10.20M     DISK        00:00:01     2021-03-15:05:33:21\n        BP Key: 34   Status: AVAILABLE  Compressed: NO  Tag: TAG20210315T053320\n        Piece Name: \/oracle\/fra\/RMANDB\/autobackup\/2021_03_15\/o1_mf_s_1067232800_j4y6ykdy_.bkp\n  SPFILE Included: Modification time: 2021-03-15:04:52:58\n  SPFILE db_unique_name: RMANDB\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n35      Full    96.00K     DISK        00:00:01     2021-03-15:05:34:41\n        BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20210315T053440\n        Piece Name: \/tmp\/spfile.ora\n  SPFILE Included: Modification time: 2021-03-15:04:52:58\n  SPFILE db_unique_name: RMANDB\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n36      Full    10.20M     DISK        00:00:00     2021-03-15:05:34:42\n        BP Key: 36   Status: AVAILABLE  Compressed: NO  Tag: TAG20210315T053442\n        Piece Name: \/oracle\/fra\/RMANDB\/autobackup\/2021_03_15\/o1_mf_s_1067232882_j4y712ts_.bkp\n  SPFILE Included: Modification time: 2021-03-15:04:52:58\n  SPFILE db_unique_name: RMANDB\n<\/pre><\/div>\n\n\n<p>Limpando arquivos de 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; DELETE BACKUP OF SPFILE;\n \nusing channel ORA_DISK_1\n \nList of Backup Pieces\nBP Key  BS Key  Pc# Cp# Status      Device Type Piece Name\n------- ------- --- --- ----------- ----------- ----------\n33      33      1   1   AVAILABLE   DISK        \/oracle\/fra\/RMANDB\/backupset\/2021_03_15\/o1_mf_nnsnf_TAG20210315T053319_j4y6yhp9_.bkp\n35      35      1   1   AVAILABLE   DISK        \/tmp\/spfile.ora\n \nDo you really want to delete the above objects (enter YES or NO)? YES\ndeleted backup piece\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_03_15\/o1_mf_nnsnf_TAG20210315T053319_j4y6yhp9_.bkp RECID=33 STAMP=1067232799\ndeleted backup piece\nbackup piece handle=\/tmp\/spfile.ora RECID=35 STAMP=1067232881\nDeleted 2 objects\n<\/pre><\/div>\n\n\n<p>Por \u00faltimo, podemos gerar um pfile (arquivo edit\u00e1vel no S.O) usando como refer\u00eancia o SPFILE ou at\u00e9 mesmo os valores que est\u00e3o em mem\u00f3ria:<\/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; CREATE PFILE=&#039;\/oracle\/18.0.0\/product\/dbs\/bss.ora&#039; FROM SPFILE;\n \nStatement processed\n \nRMAN&gt; host &#039;ls \/oracle\/18.0.0\/product\/dbs\/bss.ora&#039;;\n \n\/oracle\/18.0.0\/product\/dbs\/bss.ora\nhost command complete\n \nRMAN&gt; host &#039;cat \/oracle\/18.0.0\/product\/dbs\/bss.ora&#039;;\n \nRMANDB.__data_transfer_cache_size=0\nRMANDB.__db_cache_size=1107296256\nRMANDB.__inmemory_ext_roarea=0\nRMANDB.__inmemory_ext_rwarea=0\nRMANDB.__java_pool_size=16777216\nRMANDB.__large_pool_size=33554432\nRMANDB.__oracle_base=&#039;\/oracle\/18.0.0\/base&#039;#ORACLE_BASE set from environment\nRMANDB.__pga_aggregate_target=536870912\nRMANDB.__sga_target=1610612736\nRMANDB.__shared_io_pool_size=83886080\nRMANDB.__shared_pool_size=352321536\nRMANDB.__streams_pool_size=0\n*.audit_file_dest=&#039;\/oracle\/18.0.0\/base\/admin\/RMANDB\/adump&#039;\n*.audit_trail=&#039;db&#039;\n*.compatible=&#039;18.0.0&#039;\n*.control_file_record_keep_time=90\n*.control_files=&#039;\/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl&#039;,&#039;\/oracle\/fra\/RMANDB\/controlfile\/o1_mf_h8nytrty_.ctl&#039;\n*.db_block_size=8192\n*.db_create_file_dest=&#039;\/oracle\/dados&#039;\n*.db_name=&#039;RMANDB&#039;\n*.db_recovery_file_dest=&#039;\/oracle\/fra&#039;\n*.db_recovery_file_dest_size=2147483648\n*.diagnostic_dest=&#039;\/oracle\/18.0.0\/base&#039;\n*.dispatchers=&#039;(PROTOCOL=TCP) (SERVICE=RMANDBXDB)&#039;\n*.log_archive_dest_1=&#039;LOCATION=\/oracle\/archives&#039;\n*.log_archive_format=&#039;%t_%s_%r.dbf&#039;\n*.nls_date_format=&#039;YYYY-MM-DD:HH24:MI:SS&#039;\n*.nls_language=&#039;AMERICAN&#039;\n*.nls_territory=&#039;AMERICA&#039;\n*.open_cursors=300\n*.pga_aggregate_target=512m\n*.processes=300\n*.remote_login_passwordfile=&#039;EXCLUSIVE&#039;\n*.sga_target=1536m\n*.undo_tablespace=&#039;UNDOTBS1&#039;\nhost command complete\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; CREATE PFILE=&#039;\/oracle\/18.0.0\/product\/dbs\/bss1.ora&#039; FROM MEMORY;\n \nusing target database control file instead of recovery catalog\nStatement processed\n \nRMAN&gt; host &#039;ls \/oracle\/18.0.0\/product\/dbs\/bss1.ora&#039;;\n \n\/oracle\/18.0.0\/product\/dbs\/bss1.ora\nhost command complete\n \nRMAN&gt; host &#039;cat \/oracle\/18.0.0\/product\/dbs\/bss1.ora&#039;;\n \n# Oracle init.ora parameter file generated by instance RMANDB on 03\/15\/2021 05:41:57\n__data_transfer_cache_size=0\n__db_cache_size=1056M\n__inmemory_ext_roarea=0\n__inmemory_ext_rwarea=0\n__java_pool_size=16M\n__large_pool_size=32M\n__oracle_base=&#039;\/oracle\/18.0.0\/base&#039; # ORACLE_BASE set from environment\n__pga_aggregate_target=512M\n__sga_target=1536M\n__shared_io_pool_size=80M\n__shared_pool_size=336M\n__streams_pool_size=0\n_always_anti_join=&#039;CHOOSE&#039;\n_always_semi_join=&#039;CHOOSE&#039;\n_b_tree_bitmap_plans=TRUE\n_bloom_serial_filter=&#039;ON&#039;\n_complex_view_merging=TRUE\n_compression_compatibility=&#039;18.0.0&#039;\n_diag_adr_trace_dest=&#039;\/oracle\/18.0.0\/base\/diag\/rdbms\/rmandb\/RMANDB\/trace&#039;\n_ds_xt_split_count=1\n_eliminate_common_subexpr=TRUE\n_fast_full_scan_enabled=TRUE\n_generalized_pruning_enabled=TRUE\n_gs_anti_semi_join_allowed=TRUE\n_hang_resolution_scope=&#039;OFF&#039; # _hang_resolution_scope updated by kjznhm\n_improved_outerjoin_card=TRUE\n_improved_row_length_enabled=TRUE\n_index_join_enabled=TRUE\n_key_vector_create_pushdown_threshold=20000\n_ksb_restart_policy_times=&#039;0&#039;\n_ksb_restart_policy_times=&#039;60&#039;\n_ksb_restart_policy_times=&#039;120&#039;\n_ksb_restart_policy_times=&#039;240&#039; # internal update to set default\n_left_nested_loops_random=TRUE\n_mv_access_compute_fresh_data=&#039;ON&#039;\n_new_initial_join_orders=TRUE\n_new_sort_cost_estimate=TRUE\n_nlj_batching_enabled=1\n_odci_index_pmo_rebuild=FALSE # domain index pmo rebuild\n_optim_enhance_nnull_detection=TRUE\n_optim_peek_user_binds=TRUE\n_optimizer_ads_use_partial_results=TRUE\n_optimizer_better_inlist_costing=&#039;ALL&#039;\n_optimizer_cbqt_or_expansion=&#039;ON&#039;\n_optimizer_cluster_by_rowid_control=129\n_optimizer_control_shard_qry_processing=65528\n_optimizer_cost_based_transformation=&#039;LINEAR&#039;\n_optimizer_cost_model=&#039;CHOOSE&#039;\n_optimizer_extended_cursor_sharing=&#039;UDO&#039;\n_optimizer_extended_cursor_sharing_rel=&#039;SIMPLE&#039;\n_optimizer_extended_stats_usage_control=192\n_optimizer_join_order_control=3\n_optimizer_max_permutations=2000\n_optimizer_mode_force=TRUE\n_optimizer_native_full_outer_join=&#039;FORCE&#039;\n_optimizer_or_expansion=&#039;DEPTH&#039;\n_optimizer_proc_rate_level=&#039;BASIC&#039;\n_optimizer_system_stats_usage=TRUE\n_optimizer_try_st_before_jppd=TRUE\n_optimizer_use_cbqt_star_transformation=TRUE\n_or_expand_nvl_predicate=TRUE\n_ordered_nested_loop=TRUE\n_parallel_broadcast_enabled=TRUE\n_pivot_implementation_method=&#039;CHOOSE&#039;\n_pred_move_around=TRUE\n_push_join_predicate=TRUE\n_push_join_union_view=TRUE\n_push_join_union_view2=TRUE\n_px_dist_agg_partial_rollup_pushdown=&#039;ADAPTIVE&#039;\n_px_groupby_pushdown=&#039;FORCE&#039;\n_px_partial_rollup_pushdown=&#039;ADAPTIVE&#039;\n_px_shared_hash_join=FALSE\n_px_wif_dfo_declumping=&#039;CHOOSE&#039;\n_sql_model_unfold_forloops=&#039;RUN_TIME&#039;\n_sqltune_category_parsed=&#039;DEFAULT&#039; # parsed sqltune_category\n_subquery_pruning_mv_enabled=FALSE\n_table_scan_cost_plus_one=TRUE\n_union_rewrite_for_gs=&#039;YES_GSET_MVS&#039;\n_unnest_subquery=TRUE\n_use_column_stats_for_function=TRUE\n_xt_sampling_scan_granules=&#039;ON&#039;\naudit_file_dest=&#039;\/oracle\/18.0.0\/base\/admin\/RMANDB\/adump&#039;\naudit_trail=&#039;DB&#039;\ncompatible=&#039;18.0.0&#039;\nconnection_brokers=&#039;((TYPE=DEDICATED)(BROKERS=1))&#039;\nconnection_brokers=&#039;((TYPE=EMON)(BROKERS=1))&#039; # connection_brokers default value\ncontrol_file_record_keep_time=90\ncontrol_files=&#039;\/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl&#039;\ncontrol_files=&#039;\/oracle\/fra\/RMANDB\/controlfile\/o1_mf_h8nytrty_.ctl&#039;\ncore_dump_dest=&#039;\/oracle\/18.0.0\/base\/diag\/rdbms\/rmandb\/RMANDB\/cdump&#039;\ndb_block_size=8192\ndb_create_file_dest=&#039;\/oracle\/dados&#039;\ndb_name=&#039;RMANDB&#039;\ndb_recovery_file_dest=&#039;\/oracle\/fra&#039;\ndb_recovery_file_dest_size=2G\ndiagnostic_dest=&#039;\/oracle\/18.0.0\/base&#039;\ndispatchers=&#039;(PROTOCOL=TCP) (SERVICE=RMANDBXDB)&#039;\nlog_archive_dest_1=&#039;LOCATION=\/oracle\/archives&#039;\nlog_archive_format=&#039;%t_%s_%r.dbf&#039;\nlog_buffer=7588K # log buffer update\nnls_date_format=&#039;YYYY-MM-DD:HH24:MI:SS&#039;\nnls_language=&#039;AMERICAN&#039;\nnls_territory=&#039;AMERICA&#039;\nopen_cursors=300\noptimizer_mode=&#039;ALL_ROWS&#039;\npga_aggregate_target=512M\nplsql_warnings=&#039;DISABLE:ALL&#039; # PL\/SQL warnings at init.ora\nprocesses=300\nquery_rewrite_enabled=&#039;TRUE&#039;\nremote_login_passwordfile=&#039;EXCLUSIVE&#039;\nresult_cache_max_size=7872K\nsga_target=1536M\nundo_tablespace=&#039;UNDOTBS1&#039;\nhost command complete\n \nRMAN&gt;\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>Aqui n\u00e3o tem muito segredo. Para criar um backupset com o conte\u00fado do spfile: Criando o backup como image copy: Listando os detalhes dos backups: Limpando arquivos de backup: Por \u00faltimo, podemos gerar um pfile (arquivo edit\u00e1vel no S.O) usando como refer\u00eancia o SPFILE ou at\u00e9 mesmo os valores que est\u00e3o em mem\u00f3ria: Obs: Este [&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-2676","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\/2676","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=2676"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2676\/revisions"}],"predecessor-version":[{"id":9232,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2676\/revisions\/9232"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}