sqlplus unable to find DB instance - linux

I have a linux server OEL 5.8 in which 8 oracle DB instances are running. 4 Db instances are running on Oracle 10.2.0.4 and other 4 on 11.2.0.3. Initially, all the DB instances were running on 10.2.0.4. I upgraded 4 of them to 11.2.0.3. Now the existing linux server is going to be migrated on new location. Server was cloned to the new server location and I got the exact replica of my old server at new location. I was able to start the Oracle 10g DB instances perfectly fine just changing the hostname in tnsnames.ora and listener.ora. However I am unable to start ORacle 11g instances. sqlplus is unable to find the Db instance. $ORACLE_SID, $ORACLE_HOME and $PATH are set to oracle 11g location in environment variables. Pfile exists in $ORACLE_HOME/dbs. But when I try to connect like 'sqlplus / as sysdba' I am unable to find any idle instnace to start.
flow81 > echo $ORACLE_HOME
/dboracle/orabase/product/11.2.0.3
flow81 > echo $PATH
/dboracle/orabase/product/11.2.0.3/bin
flow81 > echo $ORACLE_SID
flow81
flow81 > sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 19 05:58:01 2017
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected.
SQL>
For DB instances in 10g,
fltr81 > sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Sep 19 06:00:10 2017
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> STARTUP
ORACLE instance started.
Total System Global Area 159383552 bytes
Fixed Size 2082464 bytes
Variable Size 113248608 bytes
Database Buffers 37748736 bytes
Redo Buffers 6303744 bytes
Database mounted.
Database Opened.
My question is why sqlplus is unable to find idle instance in oracle 11g to start them?

There was some configuration issue in /etc/hosts. IP was mapped against some different hostname, hence the issue. After mapping IP to correct Hostname issue got resolved.

Its very simply if your Database is already started up, sqlplus will connect to the instance. If instance is not started up, sqlplus will connect to an idle instance by default. Moreover if you want to connect with a specific instance you have to specify #SID_NAME as follows in the sqlplus command
sqlplus / as sysdba#SID

Related

Not able to Output to Log File Unix sqlplus

I am simply trying to execute the a query using sqlplus, but nothing gets written in the Log file.
sqlplus -s "USERNAME/PASSWORD#hostname:port/SID" <<< $sql > $fileName.txt
The variables are
sql="select count(*) from dual"
fileName=SONU_CODE_CHANGES
But when I run it nothing gets written in fileName.txt, when I execute on command line, I get the records and when I execute it without -S flag, I get the following written in LOG file
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Oct 27 01:56:17 2022
Version 19.16.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Last Successful login time: Thu Oct 27 2022 01:56:00 -04:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
SQL> 2 Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
I am stuck on this problem since a long time, any help is highly appreciated.

I can't connect to ms sql instance - internal

The Platform and Software versions I am using are as follows :
Red Hat Enterprise Linux Server release 7.4 (Maipo)
Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64)
Dec 22 2017 16:13:22
Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on
Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600:) (Hypervisor)
I have searched a lot for answers on Google but haven't found any solution yet. I can't connect to RDS instance having MS SQL instance via Linux.
It shows following errors If I try to :
[ec2-user#ip-~]$ sqlcmd -H mssqldb.xxxxxxxxxxxxxx.com -P 1433
-U userXXXXX -P aXXXXXX
-Q 'SELECT TOP 1 [n] FROM [dbbase2].[dbo].[table_people]'
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server :
Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server :
TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server :
A network-related or instance-specific error has occurred while
establishing a connection to SQL Server. The server is not found
or not accessible. Check if instance name is correct and if SQL
Server is configured to allow remote connections. For more
information see SQL Server Books Online.
[ec2-user#ip- ~]$ Check if instance name is correct and if SQL Server is
configured to allow remote connections.
Could anyone please tell the issue and resolution ?
Thanks.

Segmentation Fault when using isql for ODBC connection to Progress Openedge database 10.2B

OS: Red Hat 4.1.2-54
Linux 2.6.18-92.el5 #1 SMP Tue Jun 10 18:49:47 EDT 2008 i686 i686 i386 GNU/Linux
Progress OpenEdge Database Release 10.2B on Linux 32 bit
ODBC Driver: pgoe1023.so (which was available with the database package)
export LD_LIBRARY_PATH=/usr/dlc/odbc/lib:/usr/dlc/lib
export ODBCINI=/etc/odbc.ini
isql -v Progress
I am receiving "Segmentation fault" error when trying to use ODBC connection to progress database using isql command.
I have followed the required steps mentioned in this article and installed missing library libstdc++-libc6.2-2.so.3 (with yum install compat-libstdc++-296.i386).
How can I fix it?
I do not see any indication in the kbase article, nor in your post, that a db is running and accepting SQL connections. The kbase is assuming "testdb", port 5555 and a user named "sysprogress" (password "sysprogress" too).
Assuming that you have a "testdb" and that you setup the user you also need to start a server to accept SQL connections. For instance:
proserve testdb -m3 -Ma 5 -Mpb 5 -S 5555 -ServerType SQL -minport 9000 -maxport 9100
Before you try to use it with your isql stuff you can test that this is working with Progress' "sqlexp" command:
sqlexp -user sysprogress -password sysprogress -db testdb -S 5555
If that doesn't work then you have not correctly configured the db to accept SQL connections and downstream utilities, like isql, will not work.

Accessing Oracle Wallet using Oracle sqlplus Instant client

I've configured Oracle wallet successfully in my Linux server(Linux 2.6.32-642.4.2.el6.x86_64 GNU/Linux).
When I try to execute the below command using Database connection string, it works perfect.
$/sqlplus /#TESTDB
SQL*Plus: Release 11.2.0.3.0 Production on Tue Oct 18 07:12:49 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option
SQL>
But, when I run the same command using sqlplus Instant Client, it's throwing the below error. Please help me to resolve this.
$ oracle/instantclient/11.1.0.6.0-ml01/.exec/x86-64.linux.2.6/bin/sqlplus /#TESTDB
SQL*Plus: Release 11.1.0.6.0 - Production on Tue Oct 18 07:14:38 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
ERROR:
ORA-12534: TNS:operation not supported
Note:
Any way, When I use the Instant sqlplus client to connect using username and password, it works fine.
/oracle/instantclient/11.1.0.6.0-ml01/.exec/x86-64.linux.2.6/bin/sqlplus USERNAME/PASSWORD#TESTDB
SQL*Plus: Release 11.1.0.6.0 - Production on Tue Oct 18 07:16:46 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option
SQL>
You may have to recreate the wallet using the specific environment. For example, my oracle-11 client wallet doesn't work when I have an oracle-12 environment defined ... and vice versa. Neither of my client configs are instant clients, but I think the 'secure external password' (aka wallet) store is specific to the client.

ORA-01031: insufficient privileges as sysdba for sys (even after giving orapwd command)

I have installed an oracle 11g instance on a linux machine. After doing a DB bounce by issuing shutdown immediate and startup. Not able to login as sys/password#sid as sysdba. Even issued a
orapwd file=orapwsid password=password entries=30 force=y
command, which created a pwd file also.
But still not able to login as sys. I can connect to the DB by scott and other users created but not as a sysdba.
Request you to help me.
I got into same issue but did not know that I have to switch to oracle user to get dba access.
$ cd ORACLE_HOME/xe/bin
$ ls -la oracle
-rwsr-s--x 1 oracle dba 165700472 Aug 28 2011 oracle
$ su oracle
$ sqlplus sys as sysdba
You should be able to login without any issues
Make sure you are a dba!
[bb#limbo] ~/ $ . oraenv
ORACLE_SID = [XE] ? XE
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID bb.
You can set ORACLE_BASE manually if it is required.
[bb#limbo] ~/ $ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 16 19:02:11 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
sys#XE> exit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
[bb#limbo] ~/ $ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 16 19:05:56 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
[bb#limbo] ~/ $ su -c "usermod -G dba bb"
Password:
[bb#limbo] ~/ $ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 16 19:06:29 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
sys#XE>
I managed to resolved this issue by making sure the instance name case sensitive in listener file. Also the orapw file. If the SID are small case, I make sure all related files using the smaller case intance name.
> $ORACLE_HOME/bin/sqlplus as sysdba
this would work if your $ORACLE_HOME is set correctly
to check your $ORACLE_HOME run
> echo $ORACLE_HOME
this will display oracle home path

Resources