I want to check SID and current database name.
I am using following query for checking oracle SID
select instance from v$thread;
bu
The V$ views are mainly dynamic views of system metrics. They are used for performance tuning, session monitoring, etc. So access is limited to DBA users by default, which is why you're getting ORA-00942.
The easiest way of finding the database name is:
select * from global_name;
This view is granted to PUBLIC, so anybody can query it.