• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ORA-12547: TNS:lost Contact (Oracle 12c2)

by admin

The Problem

While connecting the database as sysdba, we are getting below error:

sqlplus /as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed May 10 00:40:31 2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

ERROR:
ORA-12547: TNS:lost contact

The version of Oracle database used here is 12.2.0.1.0.

The Solution

The solution is quite simple here. The OS variable ORACLE_BASE was not set specifically here. Just set this variable into the bash profile of oracle user in Linux and you are good to go.

Add ORACLE_BASE variable permanently

To add the ORACLE_BASE environment varibale permanently, edit the bash_profile for oracle user and export the variable in that file.

$ vi ~/.bash_profile
export ORACLE_BASE=[your oracle base here]

You can either logout or login again for the changes to take effect or run the bash profile in the same session.

$ . ~/.bash_profile

Add ORACLE_BASE variable temporarily on command line

To add the ORACLE_BASE varibale teporarily on command line, use the below command:

$ export ORACLE_BASE=[your oracle base here]

The above settings are temporary and will go away when you log out and log in back.

Verify

To verify if you have set the environment varibale correct, use the Linux command env:

$ env | grep ORACLE_BASE

Or you can simple echo the variable on command line:

$ echo $ORACLE_BASE

Filed Under: oracle, oracle 12c

Some more articles you might also be interested in …

  1. What are Lexical Units in a PL/SQL Block
  2. How to Check if a table is Indexed in Oracle
  3. ASM Fast Mirror Resync Feature – Example To Simulate Transient Disk Failure And Restore Disk
  4. Oracle Interview Questions – oratab file
  5. How to move ASM spfile from External Redundancy To Normal Redundancy in version 12.1.0.2 and above
  6. Beginners Guide to Flash Recovery Area in Oracle Database
  7. How to drop and recreate TEMP Tablespace in Oracle
  8. How to set the db_file_name_convert and log_file_name_convert parameters
  9. Oracle SQL Script to Report Tablespace Free and Fragmentation
  10. Adding Users to Oracle Passwordfile (Oracle Passwordfile Authentication)

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright