ORA-12547: TNS:lost contact - oracle-xe

I downloaded a docker container with oraclexe 11g on Ubuntu 14.
Everything worked as expected, i created tables, insert data, etc and then i commit the container, generating a new image(same oracle image, but with my tables and data).
Problem:
I canĀ“t connect to my database in my newly created image, either local or remote.
Any tips on that error?
Oracle image:
https://hub.docker.com/r/sath89/oracle-xe-11g/
**sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri May 6 20:13:43 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact**
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = e68b846e86b8)(PORT = 1521))
)
)
tnsnames.ora
# tnsnames.ora Network Configuration File:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = e68b846e86b8)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 06-MAY-2016 20:11:55
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 06-MAY-2016 20:11:22
Uptime 0 days 0 hr. 0 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/11.2.0/xe/log/diag/tnslsnr/e68b846e86b8/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=e68b846e86b8)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE" has 1 instance(s).
Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
lsnrctl services
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 06-MAY-2016 20:12:34
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "XE" has 1 instance(s).
Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully

The problem is with the dockerfile mounting the oracle data folder
VOLUME "/u01/app/oracle"
When i commit my container, this folder is not saved into my new image, generating the errors to start the db.

Related

Remote connection to oracle database running on a docker container from outside the docker's host machine

I have been recently trying to set up an Oracle Database Server 12c R2 using its official docker images from this website, and I've successfully run a container from that image and connected to the database both from the inside of the container and its outside (from the docker host machine).
The docker host machine is a VPS (ubuntu 16.04), and I have telnet to the IP/PORT of the database from my laptop (centos 7), but I'm not able to connect to the database using sqlplus command. The tnsnames.ora file is something like this:
ORCLCDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 217.182.235.26)(PORT = 32756)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCLCDB.localdomain)))
ORCLPDB1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 217.182.230.21)(PORT = 32756)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCLPDB1.localdomain)))
and the listener.ora is like this:
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 217.182.235.26)(PORT = 32756)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))
DIAG_ADR_ENABLED = off
SSL_VERSION = 1.0
and the command that I'm using to connect from my local machine is:
sqlplus64 UI_TEST/ut#217.182.235.26:32756/ORCLCDB.localdomain
But I get ORA-12537: TNS:connection closed
What is the problem?
What am I missing?
There can be various possible reasons for the error you are observing. Can you check if any of these solutions lands you to success.
Also worth checking if you can map a host port to dockerised listener port, therein making a tunneling mechanism to get your connections passed in.

msmtp TLS timeout

I've looked through the list of possible solutions, but I don't see this problem, here it is.
I had been using smtp for years for my crontab entry to provide status updates via email. Then it quit this week, and I was unable to fix it. Then I saw that it had become orphaned, and the suggestion was to move to msmtp. So I downloaded and installed it on my Ubuntu 18.10 system.
I'm trying to send email to my myaccount#gmail.com account.
It appears that I'm communicating properly with the gmail smtp server, as the debug below show. But it always gets a TLS Timeout.
I also don't understand why I have multiple EHLO entries. My system does not have a DNS domain name, so that I'm not sure what to put here; localhost seems to be working OK. Also, my Thunderbird emailer is working correctly with gmail.
Here's the debug output:
echo "Hello there" | msmtp --debug myaccount#gmail.com >/tmp/msmtpOut.txt
ignoring system configuration file /etc/msmtprc: No such file or directory
loaded user configuration file /home/myhome/.msmtprc
falling back to default account
using account default from /home/myhome/.msmtprc
host = smtp.gmail.com
port = 587
proxy host = (not set)
proxy port = 0
timeout = off
protocol = smtp
domain = localhost
auth = choose
user = myaccount
password = *
passwordeval = (not set)
ntlmdomain = (not set)
tls = on
tls_starttls = on
tls_trust_file = /etc/ssl/certs/ca-certificates.crt
tls_crl_file = (not set)
tls_fingerprint = (not set)
tls_key_file = (not set)
tls_cert_file = (not set)
tls_certcheck = on
tls_min_dh_prime_bits = (not set)
tls_priorities = (not set)
auto_from = off
maildomain = (not set)
from = myaccount#gmail.com
add_missing_from_header = on
dsn_notify = (not set)
dsn_return = (not set)
logfile = (not set)
syslog = (not set)
aliases = (not set)
reading recipients from the command line
<-- 220 smtp.gmail.com ESMTP 4sm116524ywc.22 - gsmtp
--> EHLO localhost
<-- 250-smtp.gmail.com at your service, [71.56.87.81]
<-- 250-SIZE 35882577
<-- 250-8BITMIME
<-- 250-STARTTLS
<-- 250-ENHANCEDSTATUSCODES
<-- 250-PIPELINING
<-- 250-CHUNKING
<-- 250 SMTPUTF8
--> STARTTLS
<-- 220 2.0.0 Ready to start TLS
TLS certificate information:
Owner:
Common Name: smtp.gmail.com
Organization: Google LLC
Locality: Mountain View
State or Province: California
Country: US
Issuer:
Common Name: Google Internet Authority G3
Organization: Google Trust Services
Country: US
Validity:
Activation time: Tue 21 May 2019 04:48:45 PM EDT
Expiration time: Tue 13 Aug 2019 04:32:00 PM EDT
Fingerprints:
SHA256: C7:78:B6:D6:4E:3E:2B:2F:08:6D:A4:84:E6:1D:87:8E:A1:DF:54:D2:AB:79:AC:A6:BB:50:E5:5D:EC:B4:20:4C
SHA1 (deprecated): 39:C5:E5:40:64:37:17:25:17:7F:E8:BA:20:F4:70:F4:FE:22:70:22
--> EHLO localhost
msmtp: cannot read from TLS connection: the operation timed out
msmtp: could not send mail (account default from /home/myhome/.msmtprc)
Build msmtp using --with-tls=openssl to solve the problem.
As regards as the EHLO command sent twice the RFC3207 states:
The server MUST discard any knowledge
obtained from the client, such as the argument to the EHLO command,
which was not obtained from the TLS negotiation itself. The client
MUST discard any knowledge obtained from the server, such as the list
of SMTP service extensions, which was not obtained from the TLS
negotiation itself. The client SHOULD send an EHLO command as the
first command after a successful TLS negotiation.
So that is the normal behaviour.

Oracle TNS error with Ruby on Rails Rake command

I am trying to use the Ruby on Rails Rake command to migrate to an Oracle database. My database.yml file contains the following:
development:
adapter: oracle
database: album_development
sid: orc1
username: system
password: root
On my PC I have set ORACLE_SID=orcl.
When I run Rake,migrate, I get the following error:
rake aborted!
The driver encountered an error: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
Can you tell me if I need to modify my listener.ora file to get this to work? My listener.ora file is as follows:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Lenovo-PC)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
The output of the lsnrctl Status command is as follows:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production
Start Date 21-APR-2016 11:14:15
Uptime 0 days 0 hr. 7 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\Lenovo-PC\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lenovo-PC)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lenovo-PC)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
Can anyone help / make a suggestion?
firstly you can check the database is accessible by using the TNSPING command
e.g: TNSPING xe
could it be you have used a one rather than an L sid: orc1 should be sid: orcl perhaps ?
Kevin,
Thanks for your help. I changed my database.yml to:
development:
adapter: oracle
database: xe
username: system
password: root
This allowed me to connect to the database. I now have another problem, but I think I can tackle that one. Kind regards, Sean

Windows Installer (MSI 5.0) fails with ERROR 1939 during "MsiConfigureServices" action

When trying to install a setup package using the new MSI 5.0 features of Windows Service Configuration (using Tables: MsiServiceConfig / MsiServiceConfigFailureActions)
the service config fails and results in a rollback.
The service itself is installed along with the same package under "LocalSystem" account.
Regarding MSDN, these feature does have some limitations, but I am not sure if they are applicable here:
"The services configuration feature of the Windows Installer cannot configure network service accounts, install shared service host (svchost) processes, or restart services stopped as part of the installation"
(see http://msdn.microsoft.com/en-us/library/windows/desktop/dd408113(v=vs.85).aspx )
I have tried this with several variations on the failure actions count and type.
Using SC_ACTION_NONE or SC_ACTION_RUN_COMMAND actions indeed work and lead to a successful install.
Can you tell, why SC_ACTION_RESTART or SC_ACTION_REBOOT does not work fine?
MSI Log File excerpt:
Action 08:21:51: InstallServices. Installing new services
MSI (s) (78:74) [08:21:51:828]: Executing op: ProgressTotal(Total=5,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:51:859]: Executing op: ServiceInstall(Name=PCSProxy,DisplayName=Protection Communication System Proxy,ImagePath="C:\Program Files (x86)\Protection Communication System\Pcs.Proxy.Service.exe",ServiceType=16,StartType=2,ErrorControl=32769,,Dependencies=[~],,,Password=**********,Description=Provides limited write access to the PPS,,)
InstallServices: Service:
MSI (s) (78:74) [08:21:52:218]: Executing op: ActionStart(Name=MsiConfigureServices,,)
Action 08:21:52: MsiConfigureServices.
MSI (s) (78:74) [08:21:52:280]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:52:280]: Executing op: ServiceConfigure(,Name=PCSProxy,Event=1,ConfigType=4,Argument=1)
MSI (s) (78:74) [08:21:52:280]: Changing configuration of service PCSProxy.
MSI (s) (78:74) [08:21:52:280]: Changed configuration of service PCSProxy with ConfigType SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
MSI (s) (78:74) [08:21:52:358]: Done changing configuration of service PCSProxy
MSI (s) (78:74) [08:21:52:358]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:52:358]: Executing op: ServiceConfigureFailureAction(,Name=PCSProxy,Event=1,ResetPeriod=259200,RebootMessage=Rebooting the system,Command=cmd.exe,Actions=1[~]2[~]3,DelayActions=60000[~]60000[~]60000)
MSI (s) (78:74) [08:21:52:374]: Changing configuration of failure action for service PCSProxy.
MSI (s) (78:74) [08:21:52:374]: Error: 5. Failed to change current configuration of failure action for service PCSProxy
MSI (s) (78:74) [08:21:52:374]: Failed to change configuration of failure action for service PCSProxy
Error 1939. Service 'Protection Communication System Proxy' (PCSProxy) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
MSI (s) (78:74) [08:22:04:791]: Product: Protection Communication System -- Error 1939. Service 'Protection Communication System Proxy' (PCSProxy) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
Action ended 08:22:04: InstallFinalize. Return value 3.
[...]
Property(C): VersionNT = 602
Property(C): VersionDatabase = 500
Property(C): VersionMsi = 5.00
Property(C): VersionNT64 = 602
Property(C): WindowsBuild = 9200
Property(C): ServicePackLevel = 0
Property(C): ServicePackLevelMinor = 0
Property(C): MsiNTProductType = 3
Property(C): UserLanguageID = 1031
Property(C): ComputerName = WIN-D4AOTTU5CRV
Property(C): SystemLanguageID = 1031
Property(C): Time = 07:33:17
Property(C): Date = 18.04.2013
Property(C): MsiNetAssemblySupport = 4.0.30319.17929
Property(C): MsiWin32AssemblySupport = 6.2.9200.16384

Stand alone jython JMX client for WebSphere Application Server 7.0 using SOAP

I'm trying to write a stand alone jython JMX client to monitor WebSphere Application Server. It connects to the DMGR using SOAP and SSL.
The code works when running it w/ WSADMIN, but fails when trying to run it as a stand alone jython client. This makes me believe the code is correct and that I'm missing a JAR or configuration file when trying to run it as a stand alone client. Also, this works w/ SSL disabled.
I have the following questions:
How can I establish the connection with security enabled (so with SSL)?
How can I make my client run from another machine? (which jars are needed?)
WAS Version:
7.0.0.21 ND on Solaris
import java.util.Properties as Properties
import javax.management.ObjectName as ObjectName
import com.ibm.websphere.management.AdminClient as AdminClient
import com.ibm.websphere.management.AdminClientFactory as AdminClientFactory
class DeploymentManager:
def __init__(self, host, soapport, user, password):
self.host = host
self.soapport = soapport
self.user = user
self.password = password
def create_admin_client(dmgrhost, dmgrsoapport, user, password):
props = Properties()
props.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP)
props.setProperty(AdminClient.CONNECTOR_HOST, dmgrhost)
props.setProperty(AdminClient.CONNECTOR_PORT, dmgrsoapport)
props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
props.setProperty(AdminClient.USERNAME, user);
props.setProperty(AdminClient.PASSWORD, password);
props.setProperty("javax.net.ssl.trustStore",
"/opt/IBM/Profiles/dmgr01/etc/DummyClientTrustFile.jks");
props.setProperty("javax.net.ssl.keyStore",
"/opt/IBM/Profiles/dmgr01/etc/DummyClientKeyFile.jks");
adminClient = AdminClientFactory.createAdminClient(props)
return adminClient
def get_servers():
servers = [s for s in adminClient.queryNames(queryName, None).toArray()]
return servers
def get_server_states(servers):
serverstates = {}
for server in servers:
name = adminClient.getAttribute(server, "name")
pid = adminClient.getAttribute(server, "pid")
state = adminClient.getAttribute(server, "state")
serverstates[name] = {'name' : name, 'state' : state, 'pid' : pid}
return serverstates
DMGRs = []
DMGRs.append(DeploymentManager('dmgr1_host', 'dmgr1_soap_port', 'dmgr1_user', 'dmgr1_pw'))
DMGRs.append(DeploymentManager('dmgr2_host', 'dmgr2_soap_port', 'dmgr2_user', 'dmgr2_pw'))
DMGRs.append(DeploymentManager('dmgr3_host', 'dmgr3_soap_port', 'dmgr3_user', 'dmgr3_pw'))
for DMGR in DMGRs:
adminClient = create_admin_client(DMGR.host, DMGR.soapport, DMGR.user, DMGR.password)
queryName = ObjectName("WebSphere:*,node=*,type=Server,name=srv*")
servers = get_servers()
serverstates = get_server_states(servers)
print '## %s ##' % DMGR.host
keys = serverstates.keys()
keys.sort()
for key in keys:
print '%s %s: %s' % (serverstates[key]['name'],
serverstates[key]['pid'],
serverstates[key]['state'])
print
Here's the error I see when I run it:
jython -Dpython.path=/opt/IBM/WebSphere/AppServer/runtimes/com.ibm.ws.admin.client_7.0.0.jar:/opt/IBM/WebSphere/AppServer/plugins/com.ibm.ws.security.crypto.jar:/opt/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar -Dcom.ibm.SOAP.ConfigURL=/opt/IBM/Profiles/dmgr01/properties/soap.client.props was_common.py
Apr 16, 2012 3:07:39 PM com.ibm.ws.management.connector.interop.JMXClassLoader
WARNING: Could not find tmx4jTransform.jar in null/etc/tmx4jTransform.jar - Interoperability to older versions of WebSphere is disabled
Apr 16, 2012 3:07:40 PM com.ibm.ws.ssl.config.SSLConfigManager
INFO: ssl.disable.url.hostname.verification.CWPKI0027I
Apr 16, 2012 3:07:40 PM com.ibm.ws.security.config.SecurityObjectLocator
INFO: Client code attempting to load security configuration
Traceback (most recent call last):
File "was_common.py", line 56, in <module>
adminClient = create_admin_client(DMGR.host, DMGR.soapport, DMGR.user, DMGR.password)
File "was_common.py", line 30, in create_admin_client
adminClient = AdminClientFactory.createAdminClient(props)
at com.ibm.websphere.management.AdminClientFactory.createAdminClientPrivileged(AdminClientFactory.java:632)
at com.ibm.websphere.management.AdminClientFactory.access$000(AdminClientFactory.java:123)
at com.ibm.websphere.management.AdminClientFactory$1.run(AdminClientFactory.java:206)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
com.ibm.websphere.management.exception.ConnectorException: com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: The system cannot create a SOAP connector to connect to host dmgr1_host at port dmgr1_soap_port
Note: I changed some values in this example to generic values.

Resources