Enable Wallet and Perform Password Less Export and backup
ZOHAIB RIAZ (Cloud DBA )
Oracle DBA | MySQL DBA | PostgreSQL DBA | SQL DBA | AWS (RDS,EC2) DBA | AZURE | GoldenGate | GoldenGate Microservices | Oracle RAC | Oracle Data Guard | MySQL Replication | LINUX
Step 1: Create Oracle Wallet
orapki wallet create -wallet "/u01/app/oracle/admin/wallet" -pwd "password" -auto_login_local
Step 2: Add tns entry in tnsnames.ora file
WALLET123 =
?(DESCRIPTION =
???(ADDRESS_LIST =
?????(ADDRESS = (PROTOCOL = TCP)(HOST = 1.11.1.1)(PORT = 1521))
???)
???(CONNECT_DATA =
?????(SERVICE_NAME = FINANCE)
???)
?)
Step 3: Add Credentials To Wallet for system user. I use system user for export in my shell script.
mkstore -wrl "/u01/app/oracle/admin/wallet" -createCredential WALLET123 system mysystempassword
Note: WALLET123 is the entry in tnsnames.ora file
Step 4: List Existing Credentials in the wallet.
mkstore -wrl "/u01/app/oracle/admin/wallet" -listCredential
Step 5: add entry in the sqlnet.ora file
--add in sqlnet.ora file
SQLNET.WALLET_OVERRIDE = TRUE
SSL_CLIENT_AUTHENTICATION = FALSE
SSL_VERSION = 0
WALLET_LOCATION =
??(SOURCE =
????(METHOD = FILE)
????(METHOD_DATA =
??????(DIRECTORY = /u01/app/oracle/admin/wallet)
????)
??)
Step 6: login using wallet to verify password less login.
Sqlplus /@WALLET123?
Note: wallet is open you did not gave username and password. you only used tns entry name WALLET123.
create or replace directory zohaib_dir as '/u01/app/oracle/zohaib_dir';
Step 7: create shell script and use below command in it.
expdp /@WALLET123?full=Y?directory=zohaib_dir dumpfile=FullExport.dmp?logfile=FullExport.log compression=all encryption_password=MYENCRYPTION_PASSWORD?parallel=3
or use yes so that it do not wait for user input. use it in your shell script.
yes | expdp /@WALLET123?full=Y?directory=zohaib_dir dumpfile=FullExport.dmp?logfile=FullExport.log compression=all encryption_password=MYENCRYPTION_PASSWORD?parallel=3