Wednesday, February 21, 2024

ORA-12547: TNS:lost contact Error for sqlplus / as sysdba connection

ORA-12547: TNS:lost contact Error for sqlplus / as sysdba connection

[root@oraclelab2 ~]# ps -ef|grep smon
oracle    3783     1  0 Feb20 ?        00:00:02 ora_smon_TESTDB
root     10847 10705  0 23:46 pts/1    00:00:00 grep --color=auto smon
oracle   30550     1  0 Feb20 ?        00:00:02 asm_smon_+ASM
[root@oraclelab2 ~]# su - oracle
Last login: Tue Feb 20 09:04:15 IST 2024 on pts/1
[oracle@oraclelab2 ~]$ . oraenv
ORACLE_SID = [oracle] ? ^C
[oracle@oraclelab2 ~]$

[oracle@oraclelab2 ~]$ cd /u01/app/oracle/product/19.0.0.0/dbhome_1/
[oracle@oraclelab2 dbhome_1]$ . oraenv
ORACLE_SID = [oracle] ? TESTDB
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0.0/dbhome_1/
The Oracle base has been set to /u01/app/oracle
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$ env |grep ORA
ORACLE_SID=TESTDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1/
[oracle@oraclelab2 dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 21 23:47:17 2024
Version 19.19.0.0.0

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

ERROR:
ORA-12547: TNS:lost contact

Enter user-name: ^C
[oracle@oraclelab2 dbhome_1]$

[oracle@oraclelab2 dbhome_1]$ cat /etc/oratab
#Backup file is  /u01/app/oracle/crsdata/oraclelab2/output/oratab.bak.oraclelab2.oracle line added by Agent
#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+TESTDB:/u01/app/oracle/product/19.0.0.0/dbhome_1:N
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
[oracle@oraclelab2 dbhome_1]$ vi /etc/oratab
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$ cat /etc/oratab
#Backup file is  /u01/app/oracle/crsdata/oraclelab2/output/oratab.bak.oraclelab2.oracle line added by Agent
#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
TESTDB:/u01/app/oracle/product/19.0.0.0/dbhome_1:N
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
[oracle@oraclelab2 dbhome_1]$

[oracle@oraclelab2 dbhome_1]$ . oraenv
ORACLE_SID = [TESTDB] ? TESTDB
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 21 23:49:06 2024
Version 19.19.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
[oracle@oraclelab2 dbhome_1]$

[oracle@oraclelab2 dbhome_1]$ vi /etc/oratab
[oracle@oraclelab2 dbhome_1]$ cat /etc/oratab
#Backup file is  /u01/app/oracle/crsdata/oraclelab2/output/oratab.bak.oraclelab2.oracle line added by Agent
#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
[oracle@oraclelab2 dbhome_1]$

[oracle@oraclelab2 dbhome_1]$ . oraenv
ORACLE_SID = [TESTDB] ? TESTDB
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0.0/dbhome_1/
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$ env |grep ORA
ORACLE_SID=TESTDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1/
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 21 23:50:01 2024
Version 19.19.0.0.0

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

ERROR:
ORA-12547: TNS:lost contact


Enter user-name: ^C
[oracle@oraclelab2 dbhome_1]$
[oracle@oraclelab2 dbhome_1]$ env
XDG_SESSION_ID=73447
HOSTNAME=oraclelab2.localdomain.com
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
OLDPWD=/home/oracle
USER=oracle
LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0.0/dbhome_1//lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
ORACLE_SID=TESTDB
ORACLE_BASE=/u01/app/oracle
MAIL=/var/spool/mail/oracle
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:/u01/app/oracle/product/19.0.0.0/dbhome_1//bin
PWD=/u01/app/oracle/product/19.0.0.0/dbhome_1
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/oracle
LOGNAME=oracle
XDG_DATA_DIRS=/home/oracle/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
LESSOPEN=||/usr/bin/lesspipe.sh %s
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1/
_=/bin/env
[oracle@oraclelab2 dbhome_1]$

[oracle@oraclelab2 dbhome_1]$ export ORACLE_SID=TESTDB
[oracle@oraclelab2 dbhome_1]$ export ORACLE_BASE=/u01/app/oracle
[oracle@oraclelab2 dbhome_1]$ export ORACLE_HOME=$ORACLE_BASE/product/19.0.0.0/dbhome_1
[oracle@oraclelab2 dbhome_1]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[oracle@oraclelab2 dbhome_1]$ export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
[oracle@oraclelab2 dbhome_1]$ export PATH=$PATH:$ORACLE_HOME/bin

[oracle@oraclelab2 dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 21 23:51:51 2024
Version 19.19.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
[oracle@oraclelab2 dbhome_1]$

Regards,
Mallik

No comments:

Post a Comment

Automation Script | Archivelog Generation Hourly Monitoring

1. List out all the running databases and pic one database where we want to monitore the archive log generation from last 1 month. [oracle@o...