Note 134592 - Importing the SAPDBA role (sapdba_role.sql)

Version / Date 33 / 2010-09-14
Priority Recommendations/additional info
Category Workaround for missing functionality
Primary Component BC-DB-ORA-DBA Database Administration with Oracle
Secondary Components BC-DB-ORA-CCM CCMS/Database Monitors for Oracle
Summary
Symptom
If database accesses are performed using the database tools BRBACKUP, BRARCHIVE, BRCONNECT, and BRSPACE, the relevant authorizations are missing.

BRBACKUP fails with the following error messages, for example:
BR0051I BRBACKUP 7.00 (20)
BR0055I Start of database backup: bddzbuxf.ant 2009-11-10 10.12.35
BR0280I Time stamp 2009-11-10 10.12.36
BR0301W SQL error -1031 at location BrLicCheck-7
ORA-01031: insufficient privileges
BR0301W SQL error -942 at location BrbDbLogOpen-1
ORA-00942: table or view does not exist
BR0324W Insertion of database log header failed
BR0280I Time stamp 2009-11-10 10.12.37
BR0301E SQL error -1031 at location BrCntrlCopy-1
ORA-01031: insufficient privileges
BR0320E Copying of control file to ... failed
BR0314E Collection of information on database files failed
BR0056I End of database backup: bddzbuxf.ant 2009-11-10 10.12.37
BR0280I Time stamp 2009-11-10 10.12.37
BR0054I BRBACKUP terminated with errors
Other terms
SAPDBA role, BR*Tools
Reason and Prerequisites
1. You did not create the SAPDBA role during an SAP/Oracle upgrade, as outlined in the upgrade instructions.
2. You use one of the tools mentioned above in a lower SAP release and the database authorizations have not been adjusted.
3. The database grants were deleted.
Solution
Download the SQL script for creating the SAPDBA role from the attachment to this note (for Oracle 9i:  sapdba_role_ora9, for Oracle 10g: sapdba_role_ora10, for Oracle 11g: sapdba_role_ora11). Execute this script as follows (sapdba_role.sql in the current directory):

sqlplus /nolog @sapdba_role <SAPSCHEMA_ID>

Where <SAPSCHEMA_ID> is the schema ID of the SAP database user:
- for User SAPR3:      R3
- for User SAP<SID>:   <SID>
- for User SAP<SID>DB: <SID>DB

Sample call for a standard installation with the schema SAPSR3:

sqlplus /nolog @sapdba_role SR3

and with the schema SAPR3:

sqlplus /nolog @sapdba_role R3

The log file sapdba_role.log is created in the current directory.

Note 1:
----------
The schema ID is not to be confused with the schema name. Therefore, the following call is incorrect:
sqlplus /nolog @sapdba_role SAPSR3

Caution 2
----------
For MCOD systems, the script must be executed for all SAP schemas, for example, for ABAP schemas and Java schemas in a database:
sqlplus /nolog @sapdba_role SR3
sqlplus /nolog @sapdba_role SR3DB

Caution 3
----------
Since non-ABAP systems/schemas (a pure SAP J2EE database, for example) do not contain all of the tables mentioned in the SAPDBA role, the log file will contain error messages, for example:
grant ALL on SAPSR3DB.DBAML to sapdba
                      *
ERROR at line 1:
ORA-00942: table or view does not exist

You can ignore these error messages.
Related Notes
1139623Using transaction RZ20 to monitor remote Oracle databases
834917Oracle Database 10g: New database role SAPCONN
717677BRCONNECT call of SAPInst fails with ORA-01017
700548FAQ: Oracle authorizations
662644Composite SAP Note: ORA-00942
662219Add. info. on upgrading to SAP Web AS 6.40 ORACLE
651452DB13: No action log found for this action
437648DB13: External program terminated with exit code 1/2
403704BRCONNECT - Enhanced function for Oracle DBA
400241Problems with ops$ or sapr3 connect to Oracle