000035448 - ORA-01940 error when running AVDB_Import_AVUSER.sh in RSA Identity Governance and Lifecycle

Document created by RSA Customer Support Employee on Aug 11, 2017Last modified by RSA Customer Support Employee on Aug 14, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000035448
Applies ToRSA Product Set: Identity Governance and Lifecycle
RSA Version/Condition: 6.9.1, 7.0.1, 7.0.2
IssueThe AVDB_Import_AVUSER.sh is a script that is used for restoring the database for an RSA appliance.
The procedure for using the script is documented in the online help under Administration > Managing the Appliance > Restoring the Database for an RSA Appliance.
However, when running the script, the following error may be encountered.
Dropping the user "avuser"..
DECLARE
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
ORA-06512: at line 8
Database is not running.
Database is running.
 drop a user that is currently connected
ORA-06512: at line 8

It should be noted that the script calls Drop_User.sql, and this is where the DROP USER SQL statement is actually issued.
CauseThe Oracle description for the error is as follows.
ORA-01940: cannot drop a user that is currently connected 
Cause: Attempt was made to drop a user that is currently logged in. 
Action: Make sure user is logged off, then repeat command.

The error occurs when the avuser is still logged in to the database.
 
ResolutionUse the -f option when running the AVDB_Import_AVUSER.sh script.  Using -f forces the import by terminating any existing sessions.  For example: 
cd /home/oracle/database/DBA/AVDB/scripts
AVDB_Import_AVUSER.sh -f Export_AVDB_avuser2011-10-21-17-16-00.dmp
WorkaroundAlternately, the error can be overcome by connecting to the database as SYSDBA and manually dropping the avuser.
# sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup restrict;
SQL> drop user AVUSER cascade
SQL> shutdown immediate
SQL> startup

Once the user has been dropped, the AVDB_Import_AVUSER.sh script can then be run without the -f option.

Attachments

    Outcomes