How Do You Get SonarQube to Use a New Database Connection and Change It from the Previous One It Was Working with?

Problem scenario
You try to start an old SonarQube instance but with a new database connection. In the web.log file you see a message like this: “Can not connect to database. Please check connectivity and settings.” What should you do?

Solution
Go to sonar.properties. Find the connection string for the new database. It should look something like this:

sonar.jdbc.url=jdbc:oracle://FQDN:1521:XE

The default port for Oracle databases is 1521.

 » Read more..

How Do You Delete an Aurora Database when You Get an Error about It Not Being Started?

Problem scenario
You are trying to delete an Aurora database but you get this error: “This database is not started.” What do you do?

Possible Solution #1 (with the web console)
1. Log into the web console.
2. Go to “Amazon RDS”.
3. Go to “Databases”
4. Click on the Aurora cluster of the database you want to delete or its parent.

 » Read more..

What Are Some Free SQL Front-end Applications to Install on a Windows Desktop?

Problem scenario
You want a free trial or a completely open source (always free) graphical user interface application to install on your Windows desktop or laptop. What options do you have for a free front-end?

Answer
These GUIs are free or free to start out with an initial trial:

https://www.aquafold.com/aquadatastudio/trialregform
https://www.heidisql.com/
https://dbeaver.io/
https://www.devart.com/dbforge/postgresql/studio/
https://www.pgadmin.org/
https://omnidb.org/en/
https://teamsql.io/
https://download.cnet.com/DbVisualizer/3000-10254_4-10202406.html
https://fishcodelib.com/database.htm

 » Read more..

Many Ways to Optimize an OLTP Database Running PostgreSQL

Studying the business requirements carefully can allow you to redesign the database and the SQL queries to make things happen more efficiently. You could rewrite stored procedures to involve less computational complexity. We cannot provide every possible way of enhancing the performance of your PostgreSQL database given the multitude of idiosyncrasies that could exist. We hope that some of these ideas give you some ideas of where to begin.

1. Place important indexes of heavily used tables on solid state disks.

 » Read more..

How Big is a Page in SQL Databases?

Question
Pages are sizes of a database table read from disk and placed into memory (either virtual memory or into RAM). Is a page always 8 KB in a SQL database?

Answer
No. But they are often 8 KB in size.

  • PostgreSQL has pages that are 8 KB in size (according to this page).
  • MySQL pages vary in size from 8 KB to 64 KB (according to this page).

 » Read more..

What is a SQL Statement That Will Work for Any MySQL Database?

Problem scenario
You want to test connectivity to a database. But you do not know anything about the database beyond its connection information. What SQL statement is universal and guaranteed to work?

Solution
show databases;

 » Read more..

How Do You Use the AWS CLI to List Aurora Databases?

Problem scenario
You have an Amazon Aurora database in you AWS account. You want to see the status of this database with the AWS CLI. How do you list information about your Aurora databases?

Solution
Prerequisites

You must have the AWS CLI installed and configured with a user that has the ability to view Aurora databases (e.g., an administrator of your AWS account).

 » Read more..

How Do You Find what VPC an Aurora Database Is In?

Problem scenario
You want to be sure that a given Aurora database is in a specific VPC. How do you determine what VPC it is in?

Solution
Prerequisite
You must have the AWS CLI installed and configured with a user that has the ability to view Aurora databases (e.g., an administrator of your AWS account). If you need assistance,

 » Read more..

How Do You Troubleshoot the Java Program Message “java.sql.SQLException: No database selected”

Problem scenario
Your Java program returns this message: “java.sql.SQLException: No database selected”
What should you do?

Possible Solution #1
Your SQL statement was appropriate for a database but not for the circumstance of connecting to a SQL instance. Try show databases; instead of the SQL you were running.

Possible Solution #2
Did you connect to the SQL instance you thought you connected to?

 » Read more..

How Do You Run a Java Program to Run SQL Commands Against a MySQL Database?

Problem scenario
You have a MySQL database. Rather than use a SQL front-end application, you want to write a Java program that will run a SQL statement against the database. What should you do?

Solution

1. Install the Java compiler if it is not already installed. If you need assistance, see this posting.

2. Run this command:
curl -Lk https://www.javatpoint.com/src/jdbc/mysql-connector.jar /tmp/mysql-connector.jar

3.

 » Read more..