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.

No comments:

Post a Comment

cellcli -e list diskmap

The interesting LIST DISKMAP command in the storage cells links all views to hard disks: PCI bus address as Name 252:5, OS name (/dev/sdh,...