Wednesday, June 13, 2018

ZDLRA configuration parameters

https://docs.oracle.com/cd/E88198_01/AMAGD/amagd_views.htm#AMAGD1437
The documentation says that rasys.RA_SERVER is the place of setting for RA.
Look:



But the actual settings treasury is rasys.CONFIG !

SQL> select * from config ;

NAME                   VALUE
------------------------------------------------------------------------------------------------
_aggressive_delete           YES
_alg_over_alloc            125
_alloc_increment           4294967296
_api_lock_wait_seconds           30
_baseline_cap               14
_biot_bytes_to_sample           1073741824
_biot_coalesce_threshold       40
_biot_shrinking_threshold      10
_biot_slaves               16
_build                   21-05-2018 10:10:32 ZDLRA_12.2.1.1.1.201803_LINUX.X64_RELEASE
_busy_interrupt_max           50000
_busywork_inhibit_time           .003472222222222222222222222222222222222222
_c2t_optimization           ON
_check_files_parallelism       8
_check_sbtsched_days           .0208333333333333333333333333333333333334
_chunk_cache               512
_chunkno_alloc               1024
_compress               YES
_crosscheck_throttle           5
_db_stats_refresh_days           .006944444444444444444444444444444444444445
_dbfs_time_out_days           .003472222222222222222222222222222222222222
_dead_schedulers_days           .000694444444444444444444444444444444444445
_debug_error               4026629350
_debug_when               0
_def_contfilesize           2t
_def_min_alloc               4194304
_default_poll_frequency_days   .0416666666666666666666666666666666666667
_defer_delete               NO
_disable_virtual_sections      0
_ds_reconcile_dbgflgs           0
_dumper_dfile_ext           .txt
_dumper_dp_ext               .dmp
_dumper_dplog_ext           .log
_dumper_inhibit_days           1
_dumper_last_dump_timestamp    01-06-17 17:46:00
_dumper_params               NODATAPUMP,NOBLOCKS,NOCHUNKS
_enable_populate_rsr_key       1
_expire_files_days           1
_expire_msec_files_days_max    1
_fragmentation               10
_histogram_cycle_slots           2920
_histogram_goal_percentile     .95
_histogram_slot_days           .1250000000000000000000000000000000000001
_histogram_window_slots        240
_history_long_retain_days      547.5
_history_partition_days        1
_history_prune_days           .1250000000000000000000000000000000000001
_history_retention           30
_history_short_retain_days     30
_incident_alert_threshold      10
_incident_dump_threshold       20
_incident_merge_limit_days     30
_initial_freespace_ratio       .05
_instance_check_delay           .006944444444444444444444444444444444444445
_interrupt_max               300
_interrupt_wait            20
_last_check_files           08-JUN-2018 18:39:30
_last_incarnation           1
_lock_refused_wait           5
_max_sbt_failures           15
_max_sched_cleanup_days        .0104166666666666666666666666666666666667
_max_sort_blocks           1048576
_max_task_restarts           10
_min_freespace_ratio           .01
_min_sessions_for_busywork     4
_no_purge_session_count        2
_nzdl_is_alive_days           .006944444444444444444444444444444444444445
_obsolete_sbt_days           1
_optimize_space_limit           .1
_ordering_wait_timeout_days    2
_orphan_file_delete_days       -7
_orphan_file_wait_days           .003472222222222222222222222222222222222225
_piece_affinity            YES
_plans_maintained           5
_polling_del_files_check_days  1
_polling_timeout_days           .0625000000000000000000000000000000000001
_preallocation_retention_days  .0416666666666666666666666666666666666667
_purge_autoshrink           .1
_purge_df_delmove_boost        .5
_purge_df_low_priority           .75
_purge_opt_free            4
_purge_opt_pct               .5
_purge_threshold           .9
_purge_wait               15
_purging_reserve           419430400
_quiesce_session_wait_days     .003472222222222222222222222222222222222222
_quiesce_wait               15
_ra_pool_freespace_threshold   .01
_ra_pool_full_free_count       10
_read_bufs               1024
_rebuild_index_tmo_days        .0416666666666666666666666666666666666667
_rebuild_limit               1
_reconcile_check_days           .003472222222222222222222222222222222222225
_reconcile_disable_obj_send
_reconcile_err_retry_cnt       5
_reconcile_force_fixed           NO
_reconcile_force_update        0
_reconcile_fxml_read           0
_reconcile_fxml_write           0
_reconcile_http_retry_cnt      0
_reconcile_long_delay_days     1
_reconcile_short_delay_days    .0416666666666666666666666666666666666667
_reconcile_upsert_insert       1
_reconcile_upsert_only           0
_reconcile_upsert_update       1
_reconcile_validate_data       1
_reconcile_wait_timeout_days   1
_reconstruct_header           0
_recovery_appliance_state      ON
_replication_max_streams       64
_replication_min_streams       4
_replication_stall_list
_replication_streams_per_node  4
_resilver_flags            0
_resource_wait_relax_rate      1.5
_resource_wait_task_limit      99999
_resource_wait_timeout_days    .0104166666666666666666666666666666666667
_restricted_session_count      5
_resumable_timeout           0
_rm_incomplete_files_days      .006944444444444444444444444444444444444445
_rroptimize_max_logranges      3
_run_purge_df_short_wait       30
_run_purge_df_wait           600
_sbt_library_home           ?/lib
_sched_icd_wait            300
_sched_lifetime_days           1
_sched_max_locktime           300
_sched_run_wait            5
_sched_sleep_wait           5
_scheduling_wait           5
_servlet_debug_flags           0
_servlet_read_timeout_secs     120
_servlet_wait_seconds           512
_servlet_write_timeout_secs    120
_session_count               24
_spare_asm_disks           2
_stall_when               OFF
_stats_retention_days           7
_storage_maintenance_days      .0416666666666666666666666666666666666667
_task_execution_limit_days     1
_task_execution_warning_days   .3333333333333333333333333333333333333333
_task_maintenance_days           .003472222222222222222222222222222222222225
_task_retry_wait_seconds       60
_throttle_max_channels           1000
_throttle_max_single_chan_req  128
_throttle_sbt_active_hours     12
_throttle_threshold_channels   872
_throttle_wait_aft_apprvl_secs 300
_throttle_wait_for_crash_secs  1800
_throttle_wait_repeat_req_secs 300
_timer_loop_sleep_seconds      15
_timer_wait_loop           60
_tmp_pre_comp_sbt           0
_trace_file_days           .125
_trim_factor               2
_v1pool_key               0
_waitfordbfs               /raacfs/raadmin/DONOTDELETE/rep_dbfs_present.txt
check_files_days           7
compatible               080004
crosscheck_db_days           1
network_chunksize           134217728
optimize_chunks_days           7
percent_late_for_warning       100
validate_db_days           7

164 rows selected.




Saturday, June 9, 2018

How to do the backup on the ZDLRA without backup module ?

The documentation say we need to download the backup module from http://www.oracle.com/technetwork/database/availability/oracle-zdlra-backup-module-2279224.html :

https://docs.oracle.com/cd/E88198_01/AMPDB/config_pdb.htm#AMPDB944

Backup module require java on database server. And the first question appeared when our client said: "we have no java on our IBM AIX". For this client we found a solution taking the java from ORACLE_HOME/OPatch. ORACLE_HOME has many javas (find /u01 -name java) and we proved in practice that java 8 from ORACLE_HOME well suite to install backup module.



The backup module ra_install.jar make 3 things:
- download fresh libra.so from internet and put it to $OH/lib
- make config file
- make wallet

The libra.so:
As you may know the libra.so reside in $OH/lib from 12.1 version. So, if you have at least 12.1 then you don't need to copy libra.so. If you'd like to take fresh copy you may download this file from Oracle and manually copy to $OH/lib. Look note 2219812.1 ZDLRA: Where to download new sbt library (libra.so module)


The config file
you may use or may not use this file (i ommit it in my configuration).
Look how to use it in ALLOCATE CHANNEL clause:

Two syntax of ALLOCATE CHANNEL(two working examples). The first line contain config file, but 2nd line not. I highlighted differences in bold:



allocate CHANNEL ch1 DEVICE TYPE 'SBT_TAPE' 
PARMS 'SBT_LIBRARY=/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libra.so, 
SBT_PARMS=(RA_CLIENT_CONFIG_FILE=/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/radb11204.ora)' 
;
 

ALLOCATE CHANNEL ch1 DEVICE TYPE  sbt_tape  
PARMS='SBT_LIBRARY=/u01/app/oracle/product/12.2.0.1/dbhome_1/lib/libra.so, 
ENV=(RA_WALLET=LOCATION=file:/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/ra_wallet/ CREDENTIAL_ALIAS=z01ingest-scan:1521/zdlra:dedicated)
;



The wallet:
And finally we need to create the wallet. Example:

$ mkdir $ORACLE_HOME/dbs/zdlra  
$ mkstore -wrl /u01/app/oracle/product/12.2.0/dbhome_1/dbs/zdlra -create   
$ mkstore -wrl /u01/app/oracle/product/12.2.0/dbhome_1/dbs/zdlra -createCredential "zdlra" "fd" "welcome1"

zdlra - is connect descriptor in tnsnames.ora
fd - is owner of virtual catalog, created with racli
welcome1 - is password to virtual catalog

Check the credentials in the wallet:

$ mkstore -wrl /u01/app/oracle/product/12.2.0/dbhome_1/dbs/zdlra -listCredential
Oracle Secret Store Tool : Version 12.2.0.1.0


Enter wallet password: 
List credential (index: connect_string username)
1: zdlra fd

The screenshot how i did it:



Next step is to add some lines in sqlnet.ora to point to wallet:

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SQLNET.WALLET_OVERRIDE = true
WALLET_LOCATION=
(SOURCE=(METHOD=file)
 (METHOD_DATA=
  (DIRECTORY=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/zdlra)
 )
)


And we're ready to backup our database to ZDLRA:

RUN  {
ALLOCATE CHANNEL ch01 DEVICE TYPE sbt_tape PARMS='SBT_LIBRARY=/u01/app/oracle/product/12.2.0/dbhome_1/lib/libra.so,
ENV=(RA_WALLET=LOCATION=file:/u01/app/oracle/product/12.2.0/dbhome_1/dbs/zdlra CREDENTIAL_ALIAS=zdlra)'
FORMAT '%I_%T_%p_%u_%c';
backup incremental level 1 database tag 'B_FD';
plus archivelog tag 'A_$OWNER' delete all input;
}







Summary: 
In order to do the backup on ZDLRA you have to create the wallet. This is the only obligatory step if your database is of version 12.1 or higher. You may to refresh $OH/lib/libra.so but this is optional
If your database is of version 11.2 or lower, then you need to download and put the libra.so into $OH/lib directory.

Does DEALLOCATE UNUSED or SHRINK SPACE will free space occupied by LOB segment?

Lets check how it works. My env is DB 19.20@Linux-x64 1) I created the table with 4 LOB columns of 4 different LOB types: BASICFILE BLOB, BA...