In Grid Control adding a database target is pretty straightforward. You go to the home page of the host, on which your database is running, and click on “Targets” tab. Then by clicking on the agent link you come to the agent home page. In “Monitored Targets” section you can add a new database target, or re-configure existing targets. Following the screen prompts and entering correct configurations you are done.
However if you have a Data Guard configuration with primary and standby databases and you want to add them into your Grid Control system as targets, you may encounter ORA-1033 and/or ORA-1017 errors with the standby database. Below screenshot shows the error when clicking “Test Connection” button after entering configurations.
Looking at the configuration we can see we specified database user DBSNMP to connect to the database as Noraml role. Since this is a standby database, i.e. not opened to public, an ORA-1033 happens when trying to connect. Now if we correct it by changing the logging role as SYSDBA, we still get an error of ORA-1017, invalid username/password, as shown below.
This is because user DBSNMP does not have SYSDBA role. Perform following steps to fix this problem.
1) In the primary database grant SYSDBA to user DBSNMP
SQL> grant sysdba to dbsnmp;
2) Verify it does have the role.
SQL> SELECT * FROM v$pwfile_users WHERE sysdba=’TRUE’;
USERNAME SYSDB SYSOP SYSAS
—————————— —– —– —–
SYS TRUE TRUE FALSE
DBSNMP TRUE FALSE FALSE
3) Copy the password file from the primary host to the standby host
4) Come back to Grid Control and click Test Connection button again. This time it does not have any error.