Monday, October 15, 2018

ORA-00119: invalid specification for system parameter LOCAL_LISTENER /ORA-00132: syntax error or unresolved network name 'LISTENER_'

ORA-00119: invalid specification for system parameter LOCAL_LISTENER  /ORA-00132: syntax error or unresolved network name 'LISTENER_':


Some time when you try to startup the database you will get the following errors.

ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'

It is just because of Listener not running or missing listener which was shown in the error.

To solve this you need to add entry in listener.ora  file.

in my case I have did the following steps. It might help you to resolve the issue in you case.. please check the following steps which I was followed.

when I try to start the database I got this error.


















I was added entry in Listener.ora as well tnsnames.ora fiels.


This was before adding the exact name in tnsnames.ora file

After adding exact listener name in the file 


And then I was try to do tnsping to the listener which was added. If the tnsping was success then it was communicating.. 












Now you can see the database is up with the proper listener which was added.



How to Check Oracle Database Tablespace for individual tablespace.

Check Individual tablespace allocated Quota, Free and used  details.


You can run the below query with DBA privileges.

Below query will give you the result in GB's


SELECT df.tablespace_name "Tablespace",
  totalusedspace "Used GB",
  (df.totalspace - tu.totalusedspace) "Free GB",
  df.totalspace "Total GB",
  ROUND(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace)) "% Free"
FROM
  (SELECT tablespace_name,
    ROUND(SUM(bytes) / (1024*1024*1024)) TotalSpace
  FROM dba_data_files
  GROUP BY tablespace_name
  ) df,
  (SELECT ROUND(SUM(bytes)/(1024*1024*1024)) totalusedspace,
    tablespace_name
  FROM dba_segments
  GROUP BY tablespace_name
  ) tu
WHERE df.tablespace_name = tu.tablespace_name
and df.tablespace_name='USERS'



You will get the Tablespace size in MB's by running the following :

SELECT df.tablespace_name "Tablespace",
  totalusedspace "Used GB",
  (df.totalspace - tu.totalusedspace) "Free GB",
  df.totalspace "Total GB",
  ROUND(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace)) "% Free"
FROM
  (SELECT tablespace_name,
    ROUND(SUM(bytes) / (1024*1024)) TotalSpace
  FROM dba_data_files
  GROUP BY tablespace_name
  ) df,
  (SELECT ROUND(SUM(bytes)/(1024*1024)) totalusedspace,
    tablespace_name
  FROM dba_segments
  GROUP BY tablespace_name
  ) tu
WHERE df.tablespace_name = tu.tablespace_name
and df.tablespace_name='USERS'

Thursday, October 4, 2018

Original date created for an Oracle table

Created date from the Oracle table :

To know the original created date of a particular table there is a view called "dba_objects".

here is the view description

SYSTEM@orcl:SQL>desc dba_objects
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(30)
 OBJECT_NAME                                        VARCHAR2(128)
 SUBOBJECT_NAME                                     VARCHAR2(30)
 OBJECT_ID                                          NUMBER
 DATA_OBJECT_ID                                     NUMBER
 OBJECT_TYPE                                        VARCHAR2(19)
 CREATED                                            DATE
 LAST_DDL_TIME                                      DATE
 TIMESTAMP                                          VARCHAR2(19)
 STATUS                                             VARCHAR2(7)
 TEMPORARY                                          VARCHAR2(1)
 GENERATED                                          VARCHAR2(1)
 SECONDARY                                          VARCHAR2(1)
 NAMESPACE                                          NUMBER
 EDITION_NAME                                       VARCHAR2(30)

In this view there  is a column named "created " exists in the data dictionary dba_objects view.

using this created we can get the details when was table created.

you can use the following query to get the date.

SELECT CREATED FROM DBA_OBJECTS
WHERE  OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME = 'USERDETAILS';

sample out put will be :

CREATED
---------
13-FEB-18