Connection Failed Database-Zabbix - database

I received this error after updating Zabbix from 5 to 6 for my database:
# cat /var/log/zabbix/zabbix_server.log | grep database
55202:20220803:093334.621 [Z3001] connection to database 'zabbix' failed: [0] FATAL: the database system is shutting down
FATAL: the database system is shutting down
55202:20220803:093334.621 database is down: reconnecting in 10 seconds
55202:20220803:093344.636 database connection re-established
55202:20220803:093344.639 current database version (mandatory/optional): 05000000/05000005
1117:20220807:163451.680 current database version (mandatory/optional): 05000000/05000005
The following one is in my zabbix webpage:
The Zabbix database version does not match current requirements. Your database version: 5000000. Required version: 6000000. Please contact your system administrator.
I use postgresql!Zabbix and Postgresql services are active!

Related

Connect MSSQL db with docker

I am trying to connect MSSQL Db with docker.
I tried with docker MSSQL documentation,
https://hub.docker.com/_/microsoft-mssql-server
It starts the container and stops immediately, and I used the following commands,
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=My_password' -p 1433:1433 --name db -d mcr.microsoft.com/mssql/server
docker exec -it containername /opt/mssql-tools/bin/sqlcmd -S my_server_ip -U My_user -P My_password
Container logs
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
2020-10-02 05:21:03.67 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2020-10-02 05:21:03.92 Server Did not find an existing master data file /var/opt/mssql/data/master.mdf, copying the missing default master and other system database files. If you have moved the database location, but not moved the database files, startup may fail. To repair: shutdown SQL Server, move the master database to configured location, and restart.
2020-10-02 05:21:03.95 Server Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.
2020-10-02 05:21:04.00 Server Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'.
2020-10-02 05:21:04.06 Server Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'.
2020-10-02 05:21:04.12 Server Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'.
2020-10-02 05:21:04.19 Server Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.
2020-10-02 05:21:04.27 Server Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.mdf' to '/var/opt/mssql/data/model_replicatedmaster.mdf'.
2020-10-02 05:21:04.35 Server Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.ldf' to '/var/opt/mssql/data/model_replicatedmaster.ldf'.
2020-10-02 05:21:04.42 Server Setup step is FORCE copying system data file 'C:\templatedata\model_msdbdata.mdf' to '/var/opt/mssql/data/model_msdbdata.mdf'.
2020-10-02 05:21:04.53 Server Setup step is FORCE copying system data file 'C:\templatedata\model_msdblog.ldf' to '/var/opt/mssql/data/model_msdblog.ldf'.
2020-10-02 05:21:05.01 Server Microsoft SQL Server 2019 (RTM-CU7) (KB4570012) - 15.0.4063.15 (X64)
Aug 15 2020 10:48:11
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 18.04.5 LTS) <X64>
2020-10-02 05:21:05.03 Server UTC adjustment: 0:00
2020-10-02 05:21:05.04 Server (c) Microsoft Corporation.
2020-10-02 05:21:05.04 Server All rights reserved.
2020-10-02 05:21:05.05 Server Server process ID is 40.
2020-10-02 05:21:05.05 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2020-10-02 05:21:05.06 Server Registry startup parameters:
-d /var/opt/mssql/data/master.mdf
-l /var/opt/mssql/data/mastlog.ldf
-e /var/opt/mssql/log/errorlog
2020-10-02 05:21:05.10 Server SQL Server detected 1 sockets with 4 cores per socket and 8 logical processors per socket, 8 total logical processors; using 8 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2020-10-02 05:21:05.13 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2020-10-02 05:21:05.14 Server Detected 5032 MB of RAM. This is an informational message; no user action is required.
2020-10-02 05:21:05.90 Server Using conventional memory in the memory manager.
2020-10-02 05:21:05.92 Server Page exclusion bitmap is enabled.
2020-10-02 05:21:05.97 Server Buffer pool extension is not supported on Linux platform.
2020-10-02 05:21:05.97 Server Buffer Pool: Allocating 1048576 bytes for 723370 hashPages.
2020-10-02 05:21:06.91 Server Buffer pool extension is already disabled. No action is necessary.
2020-10-02 05:21:09.77 Server Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2020-10-02 05:21:09.88 Server Query Store settings initialized with enabled = 1,
2020-10-02 05:21:09.92 Server The maximum number of dedicated administrator connections for this instance is '1'
2020-10-02 05:21:09.93 Server Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2020-10-02 05:21:09.97 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2020-10-02 05:21:10.02 Server In-Memory OLTP initialized on lowend machine.
2020-10-02 05:21:10.10 Server CLR version v4.0.30319 loaded.
2020-10-02 05:21:10.11 Server [INFO] Created Extended Events session 'hkenginexesession'
2020-10-02 05:21:10.12 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
ForceFlush is enabled for this instance.
2020-10-02 05:21:10.17 Server Total Log Writer threads: 2. This is an informational message; no user action is required.
2020-10-02 05:21:10.18 Server clflushopt is selected for pmem flush operation.
2020-10-02 05:21:10.20 Server Software Usage Metrics is disabled.
2020-10-02 05:21:10.21 spid9s [1]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2020-10-02 05:21:10.21 spid9s Starting up database 'master'.
ForceFlush feature is enabled for log durability.
2020-10-02 05:21:10.79 spid9s The tail of the log for database master is being rewritten to match the new sector size of 4096 bytes. 3584 bytes at offset 393728 in file /var/opt/mssql/data/mastlog.ldf will be written.
2020-10-02 05:21:10.98 Server Common language runtime (CLR) functionality initialized.
2020-10-02 05:21:11.30 spid9s Converting database 'master' from version 897 to the current version 904.
2020-10-02 05:21:11.31 spid9s Database 'master' running the upgrade step from version 897 to version 898.
2020-10-02 05:21:11.56 spid9s Database 'master' running the upgrade step from version 898 to version 899.
2020-10-02 05:21:11.85 spid9s Database 'master' running the upgrade step from version 899 to version 900.
2020-10-02 05:21:12.14 spid9s Database 'master' running the upgrade step from version 900 to version 901.
2020-10-02 05:21:12.38 spid9s Database 'master' running the upgrade step from version 901 to version 902.
2020-10-02 05:21:12.90 spid9s Database 'master' running the upgrade step from version 902 to version 903.
2020-10-02 05:21:13.13 spid9s Database 'master' running the upgrade step from version 903 to version 904.
2020-10-02 05:21:14.13 spid9s Resource governor reconfiguration succeeded.
2020-10-02 05:21:14.13 spid9s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2020-10-02 05:21:14.16 spid9s SQL Server Audit has started the audits. This is an informational message. No user action is required.
2020-10-02 05:21:14.53 spid9s SQL Trace ID 1 was started by login "sa".
2020-10-02 05:21:15.24 spid9s Server name is '313c0fa336a7'. This is an informational message only. No user action is required.
2020-10-02 05:21:15.29 spid9s [4]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2020-10-02 05:21:15.29 spid41s Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2020-10-02 05:21:15.30 spid9s Starting up database 'msdb'.
2020-10-02 05:21:15.31 spid41s Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2020-10-02 05:21:15.51 spid11s [32767]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2020-10-02 05:21:15.52 spid11s Starting up database 'mssqlsystemresource'.
2020-10-02 05:21:15.54 spid11s The resource database build version is 15.00.4063. This is an informational message only. No user action is required.
2020-10-02 05:21:15.60 spid11s [3]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2020-10-02 05:21:15.61 spid11s Starting up database 'model'.
2020-10-02 05:21:15.76 spid9s The tail of the log for database msdb is being rewritten to match the new sector size of 4096 bytes. 3072 bytes at offset 50176 in file /var/opt/mssql/data/MSDBLog.ldf will be written.
2020-10-02 05:21:16.29 spid11s The tail of the log for database model is being rewritten to match the new sector size of 4096 bytes. 512 bytes at offset 73216 in file /var/opt/mssql/data/modellog.ldf will be written.
2020-10-02 05:21:16.32 spid39s Password policy update was successful.
2020-10-02 05:21:16.75 spid9s Converting database 'msdb' from version 897 to the current version 904.
2020-10-02 05:21:16.76 spid9s Database 'msdb' running the upgrade step from version 897 to version 898.
2020-10-02 05:21:16.77 spid39s A self-generated certificate was successfully loaded for encryption.
2020-10-02 05:21:16.79 spid39s Server is listening on [ 'any' <ipv6> 1433].
2020-10-02 05:21:16.80 spid39s Server is listening on [ 'any' <ipv4> 1433].
2020-10-02 05:21:16.82 Server Server is listening on [ ::1 <ipv6> 1434].
2020-10-02 05:21:16.82 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2020-10-02 05:21:16.83 Server Dedicated admin connection support was established for listening locally on port 1434.
2020-10-02 05:21:16.85 spid39s Server is listening on [ ::1 <ipv6> 1431].
2020-10-02 05:21:16.86 spid39s Server is listening on [ 127.0.0.1 <ipv4> 1431].
2020-10-02 05:21:16.87 spid39s SQL Server is now ready for client connections. This is an informational message; no user action is required.
2020-10-02 05:21:17.24 spid11s Converting database 'model' from version 897 to the current version 904.
2020-10-02 05:21:17.25 spid11s Database 'model' running the upgrade step from version 897 to version 898.
2020-10-02 05:21:18.45 spid9s Database 'msdb' running the upgrade step from version 898 to version 899.
2020-10-02 05:21:18.45 spid18s ERROR: Unable to set system administrator password: Password validation failed. The password does not meet SQL Server password policy requirements because it is not complex enough. The password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols..
2020-10-02 05:21:18.52 spid18s An error occurred during server setup. See previous errors for more information.
2020-10-02 05:21:18.53 spid18s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2020-10-02 05:21:18.57 spid11s Database 'model' running the upgrade step from version 898 to version 899
I dont know to how to run my sql server using docker-compose file, I tried with the following
version: "3"
services:
nsetest:
image: my_image/abc
dbconnect:
image: mcr.microsoft.com/mssql/server
environment:
- ConnectionString=data source=100.10.143.192;Initial Catalog=sharedb;Integrated Security=True;User Id=vart;Password=adm;MultipleActiveResultSets=True;Pooling=False
- ACCEPT_EULA=Y
Normally when I run my code it will give me some output and it will store in my db.
But when I run through docker my code is running and i'm getting datas but it is not storing in my db.
It is running only in Master db but I need to use other db.
please help on this
The fourth last line of the container logs describe the issue clearly:
2020-10-02 05:21:18.45 spid18s ERROR: Unable to set system administrator password: Password validation failed. The password does not meet SQL Server password policy requirements because it is not complex enough. The password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols.
Your current password, My_password, does not match the requirements. Try to set a strong password that includes Uppercase letters, Lowercase letters, Base 10 digits, and Symbols.

SQL Server crash

I had SQL Server 2016 in one of our servers, then I decided to install SSIS AND SSAS for Bi purpose, and I tried to install these two services (SSAS AND SSRS) in another instance.
After installing the second Instance, I noticed that: I can't connect to the first instance SQL databases (It has been somehow replaced by the second instance).
I get this message when I connect to database:
I get this message while restarting the service:
In SQL Server configuration manager there no service for the first Instance:
That's the last records in my SQL log file:
2020-08-23 14:46:11.87 Backup RESTORE DATABASE successfully processed 96898 pages in 21.859 seconds (34.631 MB/sec).
2020-08-23 17:35:02.25 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2020-08-23 17:35:02.32 spid12s Always On: The availability replica manager is going offline because SQL Server is shutting down. This is an informational message only. No user action is required.
2020-08-23 17:35:02.53 spid40s Service Broker manager has shut down.
2020-08-23 17:35:02.53 spid40s Error: 17054, Severity: 16, State: 1.
2020-08-23 17:35:02.53 spid40s The current event was not reported to the operating system error log. Operating system error = (null). You may need to clear the operating system error log if it is full.
2020-08-23 17:35:02.53 spid12s .NET Framework runtime has been stopped.
2020-08-23 17:35:09.04 spid12s [INFO] Database ID: [18]. Cleaning up StorageArray. LastClosedCheckpointEndTs: '55'
Questions:
How can I get back to my previous state of SQL Server (the mdf and ldf files exist in their location but I can't find masterdb files)?
Is there a way to restore users and SQL jobs?

How to fix "Database error: The frontend does not match Zabbix database."

I have a problem with Zabbix:
Database error:
The frontend does not match Zabbix database. Current database version (mandatory/optional): 0/0. Required mandatory version: 2020000. Contact your system administrator.

cant connect to sqlserver docker image

running the container
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password_01!" -p 1433:1433 --name sql1 -d microsoft/mssql-server-linux:2017-latest
the container status is UP
trying to connect
docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password_01!
or using the docker machine ip insted of localhost
docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd -S 192.168.99.100 -U SA -P 'Password_01!'
i got this error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Timeout error [258]. .
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Unable to complete login process due to delay in prelogin response.
this is the container log
$ docker logs sql1
2018-08-17 12:41:55.65 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2018-08-17 12:41:55.77 Server Did not find an existing master data file /var/opt/mssql/data/master.mdf, copying the missing default master and other system database files. If you have moved the database location, but not moved the database files, startup may fail. To repair: shutdown SQL Server, move the master database to configured location, and restart.
2018-08-17 12:41:55.78 Server Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.
2018-08-17 12:41:55.81 Server Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'.
2018-08-17 12:41:55.91 Server Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'.
2018-08-17 12:41:56.01 Server Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'.
2018-08-17 12:41:56.17 Server Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.
2018-08-17 12:41:56.26 Server Microsoft SQL Server 2017 (RTM-CU9-GDR) (KB4293805) - 14.0.3035.2 (X64)
Jul 6 2018 18:24:36
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 16.04.5 LTS)
2018-08-17 12:41:56.27 Server UTC adjustment: 0:00
2018-08-17 12:41:56.27 Server (c) Microsoft Corporation.
2018-08-17 12:41:56.27 Server All rights reserved.
2018-08-17 12:41:56.27 Server Server process ID is 4120.
2018-08-17 12:41:56.27 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2018-08-17 12:41:56.27 Server Registry startup parameters:
-d /var/opt/mssql/data/master.mdf
-l /var/opt/mssql/data/mastlog.ldf
-e /var/opt/mssql/log/errorlog
2018-08-17 12:41:56.28 Server SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per socket, 1 total logical processors; using 1 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2018-08-17 12:41:56.29 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2018-08-17 12:41:56.29 Server Detected 3160 MB of RAM. This is an informational message; no user action is required.
2018-08-17 12:41:56.30 Server Using conventional memory in the memory manager.
2018-08-17 12:41:56.70 Server Buffer pool extension is already disabled. No action is necessary.
2018-08-17 12:41:57.35 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2018-08-17 12:41:57.35 Server Implied authentication manager initialization failed. Implied authentication will be disabled.
2018-08-17 12:41:57.35 Server Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2018-08-17 12:41:57.59 Server The maximum number of dedicated administrator connections for this instance is '1'
2018-08-17 12:41:57.59 Server Node configuration: node 0: CPU mask: 0x0000000000000001:0 Active CPU mask: 0x0000000000000001:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2018-08-17 12:41:57.72 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2018-08-17 12:41:57.80 Server In-Memory OLTP initialized on lowend machine.
2018-08-17 12:41:58.09 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
ForceFlush is enabled for this instance.
2018-08-17 12:41:58.13 Server Query Store settings initialized with enabled = 1,
2018-08-17 12:41:58.33 spid6s Starting up database 'master'.
2018-08-17 12:41:58.39 Server Software Usage Metrics is disabled.
ForceFlush feature is enabled for log durability.
2018-08-17 12:41:58.95 spid6s The tail of the log for database master is being rewritten to match the new sector size of 4096 bytes. 3072 bytes at offset 418816 in file /var/opt/mssql/data/mastlog.ldf will be written.
2018-08-17 12:42:00.16 spid6s Converting database 'master' from version 862 to the current version 869.
2018-08-17 12:42:00.16 spid6s Database 'master' running the upgrade step from version 862 to version 863.
2018-08-17 12:42:00.62 spid6s Database 'master' running the upgrade step from version 863 to version 864.
2018-08-17 12:42:01.38 spid6s Database 'master' running the upgrade step from version 864 to version 865.
2018-08-17 12:42:01.76 spid6s Database 'master' running the upgrade step from version 865 to version 866.
2018-08-17 12:42:02.12 spid6s Database 'master' running the upgrade step from version 866 to version 867.
2018-08-17 12:42:02.56 spid6s Database 'master' running the upgrade step from version 867 to version 868.
2018-08-17 12:42:02.97 spid6s Database 'master' running the upgrade step from version 868 to version 869.
2018-08-17 12:42:05.05 spid6s Resource governor reconfiguration succeeded.
2018-08-17 12:42:05.06 spid6s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2018-08-17 12:42:05.07 spid6s SQL Server Audit has started the audits. This is an informational message. No user action is required.
2018-08-17 12:42:05.36 spid6s SQL Trace ID 1 was started by login "sa".
2018-08-17 12:42:05.77 spid20s Password policy update was successful.
2018-08-17 12:42:06.15 spid6s Server name is '980bd8d92bc7'. This is an informational message only. No user action is required.
2018-08-17 12:42:06.35 spid23s Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2018-08-17 12:42:06.36 spid6s Starting up database 'msdb'.
2018-08-17 12:42:06.36 spid23s Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2018-08-17 12:42:06.37 spid9s Starting up database 'mssqlsystemresource'.
2018-08-17 12:42:06.37 spid9s The resource database build version is 14.00.3035. This is an informational message only. No user action is required.
2018-08-17 12:42:06.51 spid9s Starting up database 'model'.
2018-08-17 12:42:06.89 spid6s The tail of the log for database msdb is being rewritten to match the new sector size of 4096 bytes. 512 bytes at offset 306688 in file /var/opt/mssql/data/MSDBLog.ldf will be written.
2018-08-17 12:42:06.95 spid20s A self-generated certificate was successfully loaded for encryption.
2018-08-17 12:42:07.08 spid20s Server is listening on [ 'any' <ipv4> 1433].
2018-08-17 12:42:07.09 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2018-08-17 12:42:07.09 Server Dedicated admin connection support was established for listening locally on port 1434.
2018-08-17 12:42:07.16 spid20s SQL Server is now ready for client connections. This is an informational message; no user action is required.
this i the refernece that i followed: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-2017
I've found more success with giving the container a hostname (-h option), then connecting to that hostname, if that's an option for you.

How to connect Oracle using SQL Developer or Apex

I installed Oracle 11g on Ubuntu 14.04 by review this reference links. When installing, I do not see any step to create username and password
After that, I configured as below
$# sudo /etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration
This will configure on-boot properties of Oracle Database 11g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]:8080
Specify a port that will be used for the database listener [1521]:1522
Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration:
Confirm the password:
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y
Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.
I tried to login to apex using http://localhost:8080/apex/f?p=4950 ==> Unable to connect. Firefox can't establish a connection to the server at localhost:8080.
I try to connect using SQL Developer
Error: Status : Failure -Test failed: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
More information:
$ lsnrctl status
rgm#Motown:~$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 25-JUL-2015 08:49:19
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 23-JUL-2015 17:21:04
Uptime 1 days 15 hr. 28 min. 14 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/Motown/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Motown)(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
listener.ora file
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = Motown)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
Login SqlPlus using SYSTEM
rgm#Motown:~$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Sat Jul 25 09:00:29 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name: SYSTEM
Enter password:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
Enter user-name: oracle
Enter password:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Login SqlPlus using oracle (su to oracle user)
rgm#Motown:~$ su oracle
Password:
oracle#Motown:/home/rgm$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Sat Jul 25 09:02:19 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL>
SQL>
Please help me to fix the problem to login SQL using Apex and SQL Developer.
Thanks
Your SQL Developer screenshot, you are not using tnsnames.ora - which is fine.
How about using service name = XE, instead of SID. And localhost to Motown.
Before doing this - Go to the command and see if you can tnsping Motown.
c:\ tnsping motown
You should see OK somewhere on the last line. I'm assuming you have installed the Oracle client tools
In your install log it shows a port of 1522 instead of the default 1521.
Specify a port that will be used for the database listener [1521]:1522
In your SQL Developer screenshot you showed a connection dialog using the default of 1521. At least getting the port number right will move you closer if not solve it.

Resources