\db- List all tablespaces
\dn- List all schemas
Sharing knowledge is the ultimate key to gaining knowledge..
The only two things that stay with you for life
are you & your knowledge !
Live while you can!
Teach & inspire while you could &
Smile while you have the teeth.. 😉
If you have a problem with PostgreSQL, it starts some processes that consume lots of resources. You kill those processes but they will restart after a few minutes.
Later you check the /var/log but there is nothing about this. What does that mean?😟
What is High Availability?
It is the amount of time that a service is available and is usually defined by the business.
A recent scenario,
We had a single table with about 50M records that use around 80gb of space. Application recently deleted older records which was no longer needed reducing the Number of records to 30M.
Sometimes RMAN backup files might get corrupted. Sometimes disk block corruption might happen. So it is better we do validate the database backups more frequently in order to make sure it is recoverable.
I had gone through Oracle documents, forums, and other websites but could not get a clear picture of what blocksize to choose for my environment where 64 bit OLTP databases are running. I came across the following websites that give practical and more useful information about Oracle Block size selection.
http://www.ixora.com.au/tips/buffered_block_size.htm
http://www.nextre.it/oracledocs/blocksize.html
This is a great explanation of Postgres toast internals for anyone who doesn't know about them
https://hakibenita.com/sql-medium-text-performance
By enabling and disabling the following parameters, we can influence the query execution plan generated by the optimizer.
If you have followed the instructions to make a replica (If not have a visit at this quick post), and your replication setup is not working, than the first thing to do is check MySQL error log. (if you dont know where it is? Just check my.cnf for the location of that file). Most of time, you will get the actual error from the log if not than you can try below things.
Recently, when I tried to increase the memory_target of Oracle database, I got the following error:
ORA-00845: MEMORY_TARGET not supported on this system
While checking, we found that /dev/shm size was 2 GB, but we were trying to increase the memory_target values to 7 GB that is more than the size of /dev/shm. So we got the error.
Then we increased the /dev/shm size to 8 GB using the command as below
mount -t tmpfs shmfs -o size=8192m /dev/shm
After that, we were able to bring up the database with the parameter value memory_target =7G without the issue.
After my recent DB upgrade activity, I was unable to create extension and was failing with the below errors.
There are various ways to know since how long PostgreSQL is running.
Below will cover 3 ways to find this.
If you plan to work with date and time data in PostgreSQL, you’ll want to ensure that you’ve set the correct time zone for your location. Fortunately, it’s easy to make this change using the psql command-line interface. In this article, we’ll explain how to connect to PostgreSQL and set the time zone.
Clean up the page-cache :
# sync; echo
1> / proc / sys / vm / drop_caches
Clean dentrie and inode caches:
# sync; echo
2> / proc / sys / vm / drop_caches
To clean the page-cache, dentrie and inode caches:
# sync; echo
3> / proc / sys / vm / drop_caches
# swapoff -a && swapon -a
1) Shutdown the database and its services (pg_ctl stop , sudo service postgresql stop, etc.)
2) sync
3) sudo echo 3> / proc / sys / vm / drop_caches
4) Start the database server
free && sync && echo 3> / proc / sys
/ vm / drop_caches && free
Found this post interesting? Subscribe us 😊😉
Read more
Configure Streaming Replication in PostgreSQL
All about Physical Replication and Log shipping in Postgres
Streaming-Replication Sync and Async, benefits of streaming replication over Log-shipping
Sometimes the database user account is getting locked if the login was tried with the wrong password. In 11g database, the user account will get locked after 10 consequent failed login attempts. Oracle 11g database's default profile makes the database account password lifetime as 3 months and the number of failed login attempts as 10 days. Once these limits are reached, it will lock the account.
The following command can be used to change the default profile to allow an unlimited number of failed login attempt:
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
The following command can be used to change the default profile to allow an unlimited number of days as password lifetime.
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
In my previous post here, I tried to explain how the log shipping works and its advantages. Let's see more about Streaming replication in Postgres.
As a Database Administrator, we always classify various types of schema with specific privileges. In the standard application, there are a few various types of Database Users like Application user, Read-only user, Admin user.
Ora2Pg is Free Software written and maintained by Gilles Darold. Its an Ideal for large migration projects.
3 Reasons to move to PostgreSQL :
Below query can be used
SELECT pg_relation_size(object_id, 'main')/8192);
I tried to enable the pg_stat_statements and Database was unable to start
The
major highlights:
Postgres has made great strides in adding features to match proprietary databases, and it has many complex features that other databases don't have.
“FLUSH TABLES” is generally used for closing all tables by force in MySQL. Its really interesting that how mysql do this. Most of time we are doing this because someone adds new tables outside of MySQL.
MySQL replication is a core process for maintaining multiple copies of data – and replication is a very important aspect in database administration.
This setup provides redundancy and fault tolerance such that in the event of a failure in the Master node, the databases can still be recovered in the Slave node.
In my previous post, I tried to explain how we can configure the replication step by step. Today, I thought I will mention a few things about how it actually works.
PgCenter It's well known that PostgreSQL has rich activity statistics that allow a better understanding of its internal processes. Top-like interface for viewing stats. System resource utilization (cpu, memory, storage, networking). PostgreSQL general utilization (connections, autovacuum, qps) Common admin tasks.