In this Blog you can learn database, networking and cloud skills that will help you to understand Oracle Database and Non Oracle Database with extra key skill

Installation and Uninstallation of PostgreSQL Database Cluster on Linux

No comments :

+++++++++++++++++++++++++++++++++
Installation PostgreSQL Database Cluster
+++++++++++++++++++++++++++++++++
1.Check yum is install or not
# cd /etc/yum.repos.d
2. Check internet pinging or not
# ping www.google.com
3. Installation through YUM
3.1:  Go to the link and follow instructions
https://www.postgresql.org/download/linux/redhat/
4. Run the following command:
service postgresql-9.6 initdb #initialise postgresql 9.6 database
chkconfig postgresql-9.6 on #For autostart postgresql
service postgresql-9.6 start #Starting Postgresql cluster
5. Verify the services
ps -ef | grep postmaster
ps -ef | grep postgres #These will show running process
6. Connecting to the postgresql cluster database
# su - postgres
$ psql
/l #list the database
7. Stopping the database cluster
Service postgresql-9.6 stop
++++++++++++++++++++++++++++++++++
Uninstallation of  PostgreSQL Database Cluster
++++++++++++++++++++++++++++++++++
1. Start postgreSQL database cluster
service postresql-9.6 start
2. Connect to PostgreSQL Cluster and get the data dir. location by running following query:
# su - postgres
$ psql 
postgres=# 
postgres=# select s.name, s.setting, s.short_desc from pg_settings s where s.name='data_directory';
3. Connect to root user
$ su - root
4. Stop the running services
    # service postgresql-9.6 stop
5. Verify services are stopped or not
ps -ef | grep postmaster
ps -ef | grep postgres
6. Remove data directory
data dir location: /var/lib/pgsql/11/data
cd /var/lib/pgsql/
rm -rf 11
7. Remove user
# userdel postgrese

No comments :

Post a Comment