We're here to help!

Dbvisit Standby fails with SP2-0640: Not Connected when customising glogin.sql


Read our docs Dbvisit Standby fails with error SP2-0640

Problem Details

Problem Statement

Dbvisit Standby fails with SP2-0640: Not Connected when customising glogin.sql

Applicable Error Code


Affected Versions

encountered in v7 and v8

Affected Platforms

Noticed in Unix.



 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:

sqlplus /nolog

/** 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.

Steps Performed

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.
--   glogin.sql
--   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.
--   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 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 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [OPEN] SYS@testdb8>
Have more questions? Submit a request