Dbvisit Standby fails with error SP2-0640
Dbvisit Standby fails with SP2-0640: Not Connected when customising glogin.sql
Applicable Error Code
Standby Version 7
Noticed in Unix but should be Platform independent.
The article explains how to change glogin.sql so that it can work with version7 standby
In version 7, the way Dbvisit Standby connects to the database is:
/** glogin.sql is called here **/
connect / as sysdba
If glogin.sql contains SQL statements, Dbvisit Standby will fail because of SQLs are issued even before dbvisit can make a connection to the database.
As a workaround, we recommend using login.sql instead of glogin.sql to avoid dbvisit standby failure.
They key to make this work is by simply following these steps:
1. Make sure glogin.sql is empty or revert to original content.
[/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/admin]: more glogin.sql -- -- Copyright (c) 1988, 2011, Oracle and/or its affiliates. -- All rights reserved. -- -- NAME -- glogin.sql -- -- DESCRIPTION -- SQL*Plus global login "site profile" file -- -- Add any SQL*Plus commands here that are to be executed when a -- user starts SQL*Plus, or uses the SQL*Plus CONNECT command. -- -- USAGE -- This script is automatically run
2. Modify login.sql to include script. Note: login.sql is usually located at a customised folder (i.e. /home/oracle/sql).
3. Make sure SQLPATH is set.
[/usr/dbvisit/standby]: echo $SQLPATH
4. Run dbvisit command. Make sure this is successful.
[/usr/dbvisit/standby]: ./dbvisit <DDC>
5. Connect to sqlplus and see if changes done to login.sql script works as expected.
oracle@dbvlab01[/usr/dbvisit/standby]: sqlplus '/as sysdba' SQL*Plus: Release 18.104.22.168.0 Production on Sun Feb 21 09:50:44 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 22.214.171.124.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [OPEN] SYS@testdb8>