The following query can get you the portal_id:
select pretty_name, portal_id from dotlrn_communities_all;
Look at the datamodel in new-portal/sql/postgresql/portal-core-create.sql.
The following queries can get you the state (hidden, shaded, full, or pinned) of your portlet (portal element):
select page_id, pretty_name from portal_pages where portal_id = :portal_id_of_community;
select state from portal_element_map where page_id = :id_of_the_page;
Can you see your portlet on the customize layout page?