Thursday, October 19, 2017

Postgres psql: could not connect to server error



Would like to share postgres error , which I happen to notice on psql (9.2). It is sort of weird and I was not able to initiate any database connections.

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I happened to check database was down.

[root@sajidserver ~]# ps -ef|grep pg
root       4152   4238  0 12:43 pts/2    00:00:00 grep --color=auto pg

####
 Fix:
####

[root@sajidserver ~]$ cd /u01/pgsql/data
[root@sajidserver ~]$ cp postmaster.pid postmaster.pid.bkp
[root@sajidserver ~]$ rm postmaster.pid

Sweet and cool to see DB is back up and running

[root@sajidserver ~]# ps -ef|grep pg
root       4152   4238  0 13:43 pts/2    00:00:00 grep --color=auto pg
postgres  21453      1  0 oct19 ?        00:01:00 postgres -D /u01/pgsql/data

Friday, April 28, 2017

How to Install Oracle Enterprise Manager Cloud Control 13c Release 2 (13.2.0.0) Installation on Oracle Linux 6


          In the next few minutes,I will be discussing about the installing Oracle Enterprise Manager Cloud Control 13c Release 2 (13.2.0.0) Installation on Oracle Enterprise Linux 6 . OEM makes the life of DBA or DMA much easier. You need to have the appropriate Linux OS packages, kernel parameters and database parameters to be in place.  First you need to install the repository database, for step by step instructions to install 12c database you can follow ( http://sajidkhadarabad.blogspot.com/2015/09/12c-database-install-with-screenshots.html )

Once you are done with the repository installation. Lets proceed with Oracle Enterprise Manager installation.


[oracle@sajidserver oracle]$ mkdir -p /usr/app/oracle/oms13c
[oracle@sajidserver oracle]$ mkdir -p /usr/app/oracle/agent13c
[oracle@sajidserver oracle]$ mkdir -p /usr/app/oracle/oms13c/swlib

[oracle@sajidserver oracle]$ chmod 775 -R oms13c agent13c

[oracle@sajidserver stage]$ ./em13200_linux64.bin






It will check for all the repository pre-requisites





Provide the credentials and keep them recorded. If not you can even change it later as you needed. You need to have the right host name and database name.


Make sure if you database is RAC, you have the connect string provided right here




It will check for pre-requisites in repository database. Provide the software library location here /usr/app/oracle/oms13c/swlib. If you want to enable BI publisher you can select that here and by any chance if it is RAC it is recommended to keep it on a shared drive.








At this point you are done with installation of  Oracle Enterprise Manager Cloud Control 13c Release 2 (13.2.0.0) on Oracle Linux 6

Tuesday, March 21, 2017

OMS responded illegally [ERROR- Failed to Update Target Type Metadata] in 13cR2



                       I have been working on applying latest February patches to 13cR2 oem agents recently. Once the oem agents are patched successfully, When I was checking status of the agent happen to find out Heartbeat status shows up error OMS responded illegally [ERROR- Failed to Update Target Type Metadata] in 13cR2.



[oracle@Sajidserver ~]$ emctl status agent

Oracle Enterprise Manager Cloud Control 13c Release 2
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------

Last successful upload                       : (none)

Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 290
Size of XML files pending upload(MB)         : 4.47
Available disk space on upload filesystem    : 42.52%
Collection Status                            : Collections enabled
Heartbeat Status       : OMS responded illegally [ERROR- Failed to Update Target Type Metadata]
Last attempted heartbeat to OMS              : 2017-03-21 15:11:37
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-03-21 15:12:07


Solution:


1. Stop the oem agents (emctl stop agent)
2. Rollback the oem agent psu or any plugin patches applied 
    (opatch rollback -id 25414194)
3. Start the agents (emctl start agent)
4. Check agent status  (emctl status agent)