Is using heap_open() is possible? or else any other way is there ?
It's not possible from _PG_init .
I replied to a similar thread with details on how bgworkers can access different databases; look at the archives.
The gist is that you have to register a bgworker that attaches to shared memory and to a database (or use InvalidOid if you only want shared catalog access), then do your work from there.