You have to know if the problem come from the listener or from the database.
So first, restart the listener, it could solve the problem.
Second, it could come from the db if it's not in open mode (nomount, mount, restrict). To check it, connect locally and do the following query:
sqlplus /nolog
connect / as sysdba
SQL> select instance_name, status, database_status from v$instance;