We're here to help!

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

Follow

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

SP2-0640

Affected Versions

Standby Version 7

Affected Platforms

Noticed in Unix but should be Platform independent.

 

Description

 The article explains how to change glogin.sql so that it can work with version7 standby


Solution

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.

Example:

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

Example: 

[/usr/dbvisit/standby]: echo $SQLPATH
/home/oracle/sql

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.

Example:


oracle@dbvlab01[/usr/dbvisit/standby]: sqlplus '/as sysdba' SQL*Plus: Release 11.2.0.4.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 11.2.0.4.0 - 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

Comments