You have been helpful in your sugeestion,
i was able to resolve the issue. i had to re-configure the listener and correct to service name parameter in the tnsnames.ora file.
the database could not connect because the open listener was not the correct one so i deleted the database since it is a test db. recreated a new one.
i ping the host machine and also did tnsping. everything was good n back. once again thanks to HamidHelal and all other contributors.