• 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. Oracle 12c: Unplug/Plug PDB to new CDB using RMAN Active Database Duplication
  2. Archiving Failures with ORA-16038, ORA-19504, ORA-00312
  3. How to list all the named events set for a database
  4. How to relocate the redo log files to a different location on disk
  5. How to Change Timezone Settings on Exadata
  6. What are Command Rules in oracle Database
  7. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL
  8. How to Create the Oracle Password File using orapwd Command
  9. How an SQL query is executed in Oracle Database
  10. Handling Exceptions in PL/SQL

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright