Wednesday, May 17, 2017

sysbackup to user to perform the rman backup

The user trying to perform backup should have sysbackup permission under oracle 12.

But we need to setup few things to get it working. We assume that we are going to use username backup_user to create backups. Below are the steps we need to do in order for it to work.

1. Create new password file.
2. Grant sysbackup to backup_user;
3. Make sure rman backup connect has as sysbackup when connecting to target.

Create New Password File:

$ orapwd file=orapwbase sysbackup=y force=y
Enter password for SYS: <<<< Enter OLD / NEW SYS password >>>>
Enter password for SYSBACKUP: <<<< Enter SYSBACKUP password >>>>


SQL> grant sysbackup to backup_user;

$ rman
RMAN> connect target 'backup_user/<password>@base_prod as sysbackup'     <<<<------------    Mandatory
connected to target database: TESTDB (DBID=123456789)
RMAN>


That's it !!!

This way we are only granting the permissions which are required.

RMAN-06820: WARNING: failed to archive current log at primary database

Trying to backup the database but getting an error

RMAN-06820: WARNING: failed to archive current log at primary database

When looked deeper in by looking at the rman logs, it was noticed that I was getting an invalid username and password.

RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-01017: invalid username/password; logon denied
ORA-17629: Cannot connect to the remote database server


Reason:

This happens because the user trying to perform the backup which is rman in this case does not have sysdba permission

Because of lacking sysdba permission this user does not have entry in password file and can be checked under

select * from v$pwfile_users;


Solution:

It is simple, just grant sysdba to rman and it will fix the issue.

Please note that I know we should grant sysbackup to rman rather than sysdba

It is addressed in another post.