Resolve TNSNAMES 2 DBs - database

I'm new to this community and i would like to get some help on configuring 2 databases.
So my problem is:
Need help on understanding what im doing wrong on the TSNAMES.ora
I have 2 DBhomes everything was working fine till last day i had to make some local tests and i executed the following sintax, after restarting services everything is messed up.
ALTER system SET MEMORY_MAX_TARGET = 10 G SCOPE = spfile ;
ALTER system SET MEMORY_TARGET = 8 G SCOPE = spfile ;
Using sqlplus i can only connect to the DB2 and DB1 is not working, it gives me the following error:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
if i tnsping to the db1 it shows me
TNS Ping Utility for 64-bit Windows: Version 12.2.0.1.0 - Production on 30-SEP-2020 15:25:50
Copyright (c) 1997, 2016, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = DEMO)))
OK (0 msec)
If i do a LSNRCTL status it shows me the DBHome2 ora file
LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 30-SEP-2020 15:36:45
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Production
Start Date 30-SEP-2020 15:00:31
Uptime 0 days 0 hr. 36 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\Oracle\product\12.2.0\dbhome_2\network\admin\listener.ora
Listener Log File C:\app\Oracle\diag\tnslsnr\DESKTOP-7O2CVPP\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 2 handler(s) for this service...
Service "cmms" has 1 instance(s).
Instance "cmms", status READY, has 1 handler(s) for this service...
Service "cmmsXDB" has 1 instance(s).
Instance "cmms", status READY, has 1 handler(s) for this service...
The command completed successfully
So i need to see here instance demo as well as status Ready to work i guess.
So it seems to be some resolving problem to get the right folder.
I would like some help if you please.
Thanks for your help in advance.

Related

The listener supports no services - 2 databases on oracle linux 7

I'm running two 12c R2 databases on linux oracle 7.9
I've installed the first database (CDB) and also a listener and both of them were running fine. Then, I've installed another 12c R2 database (CDB2) on the same system.
These are my instances:
CDB
CDB2
The problem is that if I want to startup only the second database(CDB2), and then the listener, when running lsnrctl status LISTENER it says: The listener supports no services
If I startup the first database after that (CDB), the listener comes to life saying that it supports both of the services (CDB and CDB2).
So, it only support CDB2 if I also startup CDB. If I startup only CDB2, it does not support it.
But, after I started CDB and after listener started supporting both services, if i shutdown CDB, the listener is still supporting CDB2.
So, as a summary:
If i startup CDB2 and then the listener, the listener does not support any services. If I startup CDB after, the listener supports both dbs. If I shutdown CDB after, the listener supports only CDB2 which is what i want in the first place.
First step:
[oracle#oel7 ~]$ ps -ef | grep pmon
oracle 4350 2463 0 20:56 pts/0 00:00:00 grep --color=auto pmon
[oracle#oel7 ~]$ ps -ef | grep tns
root 37 2 0 20:37 ? 00:00:00 [netns]
oracle 4458 2463 0 20:57 pts/0 00:00:00 grep --color=auto tns
[oracle#oel7 ~]$
Starting CDB2 & listener:
[oracle#oel7 ~]$ ps -ef | grep pmon
oracle 2547 1 0 20:41 ? 00:00:00 ora_pmon_CDB2
oracle 4498 2463 0 20:58 pts/0 00:00:00 grep --color=auto pmon
[oracle#oel7 ~]$
[oracle#oel7 ~]$ ps -ef | grep tns
root 37 2 0 20:37 ? 00:00:00 [netns]
oracle 4537 1 0 20:58 ? 00:00:00 /u01/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle 4563 2463 0 20:59 pts/0 00:00:00 grep --color=auto tns
[oracle#oel7 ~]$
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 21-JAN-2021 20:42:01
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/ listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.x ml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
After starting CDB:
[oracle#oel7 dbhome_1]$ ps -ef | grep pmon
oracle 2351 1 0 20:41 ? 00:00:00 ora_pmon_CDB
oracle 2547 1 0 20:41 ? 00:00:00 ora_pmon_CDB2
oracle 4814 2463 0 21:02 pts/0 00:00:00 grep --color=auto pmon
[oracle#oel7 dbhome_1]$
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 21-JAN-2021 20:42:01
Uptime 0 days 0 hr. 0 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/ listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.x ml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oel7.localdomain)(PORT=5500))(Secur ity=(my_wallet_directory=/u01/app/oracle/admin/CDB/xdb_wallet))(Presentation=HTT P)(Session=RAW))
Services Summary...
Service "CDB.localdomain" has 1 instance(s).
Instance "CDB", status READY, has 1 handler(s) for this service...
Service "CDB2" has 1 instance(s).
Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDBXDB.localdomain" has 1 instance(s).
Instance "CDB", status READY, has 1 handler(s) for this service...
Service "b8c025790af43eafe0536f64a8c04644.localdomain" has 1 instance(s).
Instance "CDB", status READY, has 1 handler(s) for this service...
Service "cdbpdb1.localdomain" has 1 instance(s).
Instance "CDB", status READY, has 1 handler(s) for this service...
The command completed successfully
After shutdown of CDB and only CDB2 running:
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 21-JAN-2021 20:58:52
Uptime 0 days 0 hr. 4 min. 55 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "CDB2" has 1 instance(s).
Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
Instance "CDB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle#oel7 dbhome_1]$
And also, even if i stop and start again the listener (having only CDB2 running - closing CDB), it is working as it should be:
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 21-JAN-2021 20:58:52
Uptime 0 days 0 hr. 4 min. 55 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "CDB2" has 1 instance(s).
Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
Instance "CDB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle#oel7 dbhome_1]$
Both database have the same Oracle Home in:/u01/app/oracle/product/12.2.0/dbhome_1
Network files:
[oracle#oel7 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
[oracle#oel7 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_CDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
CDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CDB2)
)
)
CDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CDB.localdomain)
)
)
What is the problem? Why the listener does not support the second database (CDB2) from the first time and I have to startup also the first database (CDB) in order for it to support both of them?
Thanks.
overall i would suggest to create a second listener definition in listener.ora
with the service of cdb2 in it.
so that every database has its own listener with its own services in it.
and define those listener names that you put in listener.ora, in tnsnames.ora file as well like how you tried to define LISTENER_CDB in the tnsnames.
and then you start each listener separately and manually
like "lsnrctl start LISTENER_CDB1"
and "lsnrctal start LISTENER_CDB2"
also "lsnrctl status LISTENER_CDB1" etc..
regarding your current definitions i think the problem may be just that ,
that you defined LISTENER_CDB in tnsnames.ora but in listener.ora you only have LISTENER.
on a side note -
"PMON process wakes up at every 60 seconds and provide information to the listener. If any problem arises and your PMON process fails then it's not possible to register information to listener periodically. In this case you can do 'Manual service registration' using command:
ALTER SYSTEM REGISTER;"
also something to consider as a troubleshooting utility.

PostgreSQL Graphical Installer: The specified service does not exist as an installed service

When trying to install postgreSQL using the graphical windows installer x64 it fails to install this as a Windows Service
>Windows Specific Configuraton
>[14:07:54] Windows Actions (services)
>Starting service "PostgreSQL 9.6 Server"
>Executing sc start "PostgreSQL 9.6 Server"
>Script exit code: 1060
>
>Script output:
> [SC] StartService: OpenService FAILED 1060:
>
>The specified service does not exist as an installed service.
>
>
>Script stderr:
> Program ended with an error exit code
>
>Error running sc start "PostgreSQL 9.6 Server": Program ended with an error >exit code
>Problem running post-install step. Installation may not complete correctly
> Error running sc start "PostgreSQL 9.6 Server": Program ended with an error >exit code
How do I correct this, and why did it happen?
You can try to install the service manually, using
pg_ctl register [-N servicename] [-U username] [-P password] [-D datadir] [-S a[uto] | d[emand] ] [-w] [-t seconds] [-s] [-o options]
According to PostgreSQL documentation on pg_ctl:
register mode allows you to register a system service on Microsoft Windows. The -S option allows selection of service start type, either "auto" (start service automatically on system startup) or "demand" (start service on demand).
If pg_ctl cannot register the service, it will most probably give a proper error message, pointing you in the proper direction (incorrect datadir, insufficient privileges for username to access and write to datadir, etc.)
The "standard" servicename used by the Graphical Installer (at least with the EnterpriseDB one) is: postgresql-x64-9.6 for PostgreSQL 64-bit version 9.6.*.

Moved Oracle 11.2 XE Database Directory, Connected to Idle Instance

So I will start off by stating I have moved the regular install location of Oracle 11.2 XE to a logical volume (/oracle) I had created on my RHEL 6.6 server. After shutting down both the database and the Oracle listener, I performed...
$ cp -R /u01/app/* /oracle
$ rm -rf /u01/app/oracl
$ ln -s /oracle/oracle /u01/app/oracle
Then restarted the listener and the database. Now when I attempt to run the following as the user 'oracle' I get a message...
$ sqlplus
Enter user-name: sys / as sysdba
Enter password: ****
Connected to idle instance.
Further, when I attempt a startup I get an error.
> startup
ORA-45301: XE Edition single instance violation error
I have attempted the solutions found here to no avail.
Here is the output for my listener controller:
bash-4.1$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAR-2015 10:26:25
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 10-MAR-2015 10:25:57
Uptime 0 days 0 hr. 0 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dev/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
I'm really quite lost as to what to attempt next. I know I could just reinstall and keep the directory in its proper location but I need it to be in it's own logical volume.
EDIT
Some further information to help clarify my system...
bash-4.1$ env | grep ORA
ORACLE_SID=XE
ORACLE_BASE=/oracle/oracle
ORACLE_HOME=/oracle/oracle/product/11.2.0/xe
bash-4.1$ env | grep TNS
TNS_ADMIN=/oracle/oracle/product/11.2.0/xe/network/admin
bash-4.1$ ps -aux | grep pmon
oracle 2431 0.0 0.2 1265956 16652 ? Ss 11:43 0:00 xe_pmon_XE
FURTHER EDIT
Attempting to sign in to sqlplus using the SYSTEM user returned an error:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
FURTHER EDIT
Output of the ipcs command
bash-4.1$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0xc0a59444 32768 oracle 660 4096 0
------ Semaphore Arrays --------
key semid owner perms nsems
0xd4a9963c 229378 oracle 660 104
0x884d8f34 491523 oracle 660 104
------ Message Queues --------
key msqid owner perms used-bytes messages
Check output of ipcs command and try to delete all shared memory segments/semaphores owned by Oracle.
When Oracle starts it uses two strings ORACLE_SID(uppercase) and ORACLE_HOME, hashes these two strings and uses this hash value a key for shmget call. So even if you append slash / to ORACLE_HOME everything is different from Oracle's perspective - even if the disk path is the same.
So I think you moved ORACLE_HOME into some other location, but the old value was preserved somewhere and now Oracle thinks that you are trying to start multiple instances.
EDITED: I'm not sure about XE, but regular Oracle editions are shipped as a bunch of .o object files. These files are linked during installation, but you can also re-link Oracle anytime. Check the script $ORACLE_HOME/bin/relink if the old ORACLE_HOME is hardcoded in it. And then try to re-link all libraries by executing relink all. Also note that Oracle uses link option -Wl,-rpath=..., so some Oracle binaries have library search patch compiled in them.
For Standard/Enterprise edition it is not problem to copy binaries into different Oracle home.
Check in /u01/app/oracle/product/11.2.0/xe/dbs/ if you have renamed your XE database or attempted to create a new one, you must be sure there is only one database known by xe. It's limited to one instance.
/etc/init.d/oracle-xe stop
cd /u01/app/oracle/product/11.2.0/xe/dbs/
rename any unused pwfile and spfile to .old
/etc/init.d/oracle-xe start
Issue was a wrong entry in tsnnames.ora (I had added a line that shouldn't of been there) and as well the permissions for my /oracle directory were incorrect. Thank you to everyone who tried to help, it was greatly appreciated.

oracle database running but not listening

I installed a 11.2020 11g EE Oracle Database
SQL> select * from v$version
2 ;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Initially, everything is good and it listens on port 1521 until I shut down the server.
After restarting, I start the database by running startup
SQL> startup
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2226912 bytes
Variable Size 1342178592 bytes
Database Buffers 251658240 bytes
Redo Buffers 7348224 bytes
Database mounted.
Database opened.
However, the database does not listen and I am unable to connect to the instance.
I can find it in processes but not under the netstat.
# ps -ef | grep pmon
ocsgapp 12005 1 0 08:42 ? 00:00:00 ora_pmon_orcl
root 12615 12596 0 09:05 pts/1 00:00:00 grep pmon
# netstat -an | grep 1521
#
I haven't changed anything since installation and the content of listener.ora is as the following
# cat /home/ocsgapp/app/ocsgapp/product/11.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /home/ocsgapp/app/ocsgapp/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = freeze.dev.unico.com.au)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /home/ocsgapp/app/ocsgapp
I tried to reinstall the whole database and it was listening on 1521 after installation. However, it failed to recover after another shutdown. Does anyone have idea why the db is running but fail to listen on a 1521?
The database does not listen for incoming connection requests from clients. That is the job of a separate process, the listener. It appears that you haven't set your listener to start up when the server restarts. If that's the case, you'd need to start the listener
./lsnrctl start
If you're not sure whether the listener is running
./lsnrctl status

OUI JD Edwards EnterpiriseOne Standalone Installation

I am trying to install JDE EnterpiriseOne on a virtual machine running win7, i followed the instructions in this video :
JDE 9.1 stanalone instalation toturial
I installed "EnterpiriseOne Database Engine" of course after installing oracle client, but i cannot continue to install the "EnterpiriseOne E910 Standalone client"...
it seems to be a problem with the oracle universal Universal installer finding a running Database, i checked the listener services and found that they are running...
typed the command (lsnrctl status) in cmd, and got the following:
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 27-JUL-2013 18:38
:12
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.119.128)(PORT=15
21)))
TNS-12535: TNS:operation timed out
TNS-12560: TNS:protocol adapter error
TNS-00505: Operation timed out
64-bit Windows Error: 60: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 27-JUL-2013 17:14:33
Uptime 0 days 1 hr. 24 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File c:\Oracle\E1Local\network\admin\listener.ora
Listener Log File c:\oracle\diag\tnslsnr\WIN-I3MMKFMQE20\listener\alert\
log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.119.128)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
PLZ anyone what can i do to complete the instalation???
On your tnsnames.ora and listener.ora try to change the HOST value for 127.0.0.1. Then restart the database and the listener services.
Instead of 127.0.0.1 change it to hostname. It worked fine for me after changing this to hostname.

Resources