Showing posts with label RMAN Backup using a Wallet for Authentication. Show all posts
Showing posts with label RMAN Backup using a Wallet for Authentication. Show all posts

Saturday, February 2, 2008

RMAN Backup using a Wallet for Authentication

RMAN Backup using a Wallet for Authentication

Ever want to not have passwords in you RMAN backup scripts?
Oracle Wallet will provide a way to connect to the RMAN repository without having to create a way to script in a password.

1. setup password files that allow and disallow logging in with SYSDBA (This is optional and only if you want to be able to control remote login as sysdba)

a. cd $ORACLE_HOME/dbs
b. export ORACLE_SID=rman
c. orapwd file=orapwdbname.nosysdba password= nosysdba=y
d. orapwd file=orapwdbname.sysdba password= nosysdba=n


2. Add processes to enable sysdba for backup and disable when backup is complete (optional only if you want to control when remote sysdba connections are allowed)
a. enable sysdba logins
cp –p orapwdbname.sysdba orapwdbname

b. disable sysdba logins
cp –p orapwdbname.nosysdba orapwdbname

* For our example we will assume that we will have it on and it is left on, but this will give the option to allow and disallow sysdba connections as needed.


3. Avoid having to pass username and password at the command line.
a. add TNS Alias to tnsnames.ora file for RMANSYS connections

RMANSYS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman)
)
)

b. Create Wallet
cd $ORACLE_HOME/network/admin
mkstore –wrl $ORACLE_HOME/network/admin –create

* Enter password for wallet (will have to be entered 2 times for confirmation)
* Creates 2 files ewallet.p12 and cwallet.sso

c. Create credential for Wallet
mkstore -wrl $ORACLE_HOME/network/admin –createCredential rmansys rman

* should see something like Create credential oracle.security.client.connect_string1

d. Edit sqlnet.ora
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = <$ORACLE_HOME*>/network/admin)))

SQLNET.WALLET_OVERRIDE = TRUE
SSL_CLIENT_AUTHENTICATION = FALSE
SSL_VERSION = 0


* Must put in path for $ORACLE_HOME

e. Restart the database listener
lsnrctl stop
lsnrctl start

4. Now you can use the wallet credentials to login as sys.
sqlplus /@RMANSYS

export ORACLE_SID=trn01
rman target=/ catalog=/@rmansys