Category Archives: Oracle

What to do when listener.log is growing.

over time, the Listener.log file can grow to huge size and take a lot of disk space.
If you will try to delete it in windows you may get the following error:

—————————
Error Deleting File or Folder
—————————
Cannot delete listener: It is being used by another person or program.

Close any programs that might be using the file and try again.
—————————
OK
—————————


Linux will allow you to delete the file but it will not create a new one.


The solution to this issue is simple. following are some options:


The easiest solution would be to stop the listener process, delete the file and restart the listener service. However, stopping the listener will prevent new connections to the database and disrupt service.


A better option would be to stop logging to the listener.log file:

In the command prompt type >lsnrctl
This will open the Listener control utility. Type LSNRCTL> set log_status off
now you can navigate to the file location and delete the file using the operating system.
This will prevent the file from growing in the futre.
If you like, you can restart logging LSNRCTL> set log_status on
This will allow you to delete listener.log but nothing will be logged when the log_status is set to off.


If you want to the logging to continue. you can switch to a different logging file:
type LSNRCTL> set log_file listener2.log

The listener will now log to the new file. you can delete or move the old file.

Possible Causes to ORA-00980 Synonym Transaltion no longer valid

ORA-00980: synonym translation is no longer valid
This error usually means that the synonym used is based on a table, view, or synonym that no longer exists. in order to fix it you will need to replace the synonym with the name of the object it references or re-create the synonym so that it refers to a valid table, view, or synonym. However, this is not always simple. following are some common causes and suggested solutions.

    1) If you imported a specific schema, it is possible that one of the sysnonyms is pointing to an object on a different schema that is simply not there. run SELECT * FROM all_synonyms and verify that all the table name are there and reachable.
    2) If you imported from a different version it is also possible that that the synonym is pointing to an object that does not exists in the new version. This could be due to the fact that this component was not installed on the new version or that the component is not in a valid state.
    SELECT comp_name, version,status FROM dba_registry
    and make sure that all the components are valid.
    3) it is also possible that object is there but you don’t have access to it. connect as system and do the SELECT * FROM dba_synonyms WHERE owner=’YOUR USER”. again, make sure that your user have access to all the objects under TABLE_NAME. If not, grant it.
    4) if this issue happens during import or export, add trace=y to the imp/exp command (imp user/pass file=filename.dmp trace=y) This will create a trace file that will provide more information on what is failing.

OUI.EXE has stopped working on Windows 2008

If you are trying to install Oracle 10.2.0.3 client on a Windows 2008 server and you get the following error:

OUI.EXE has stopped working
Close the program

 

For some reason, the Oracle installer is having problem with long directory structures.
To overcome this, you can simply copy the installtion directory to a location with a shorter path.

    1)create a new Temp directory on the root of your drive
    2)copy the installtion files to this directory. it is possible that windows will say that ” you need permission to perform this action”. This could be overcome by turning off the User Account Control (UAC) but a simpler soulution would be to copy the files using the command promptmove “10203_vista_w2k8_x86_production_client” c:\temp\ (weird, but it works)
    3) run the installer from the new location.

Restart Data Pump after import errors

When using Data Pump, you may encounter the following error:
ORA-39171: Job is experiencing a resumable wait.
Together with

ORA-01653: Unable to extend table %s.%s by %s in tablespace %s
Or
ORA-01691  unable to extend lob segment string.string by string in tablespace string
Both errors basically say that the table space you are using can not allocate more space. This could be because the datafile is full, the disk is full or autoextend is not set. This is simple to check by running the following query on DBA_DATA_FILE:
select *
from dba_data_files
where tablespace_name=’TABLESPACE_NAME’

The bytes column will tell you how many bytes are used by Oracle in the tablespace. If AUTOEXTENSIBLE is set to NO, then Oracle will not extend the size of the tablespace.

In many cases, the Data Pump import may seem to hang. Data Pump will try to continue after some time but unless something is changed, you will keep getting the above errors.

The solution, however, is simple enough. All you need to do is use the Data Pump Restart Capability:
1)    In the IMPDP window, click CTRL-C to stop the job.
2)    In the command line type:
Import> stop_job=immediate
3)    Use SQLPlus to make the required changes to the table space. You can:

    a)    Add DataFile ALTER TABLESPACE <tablespace name> ADD DATAFILE ‘<path to file name and  file name>’ SIZE <integer>M;

    b)    Resize the Datafile:
    ALTER DATABASE DATAFILE ‘< path to file name and  file name >’ RESIZE <integer>M;
    c)     Enable autoextend:
    ALTER DATABASE DATAFILE ‘< path to file name and  file name >’ AUTOEXTEND ON MAXSIZE UNLIMITED;

4)    Attach the Job.
>impdp system/manager attach=Job_Name
If you did not provide a specific job name when you first ran the IMPDP, Oracle will assign a default name for it. In order to find the System assigned name for the IMPDP job you can run the following query:
SELECT * FROM DBA_DATAPUMP_JOBS;
The result will probably be something like SYS_IMPORT_FULL_number.
5)     Restart the job
Import> start_job
6)    You can check the status of the job by simply typing STATUS in the utility command prompt.
Import> status

How to Configure the ODBC on Oracle XE Client

Even Oracle veterans may encounter some challenges when it comes to setting an odbc  using the Oracle XE Client.    As every DBA will tell you, you will need to configure the tnsnames.ora  (using  net configuration Assistant or by going  to oracle home\network\admin and edit it manually). After that, theTNS Service name in the ODBC will be populated with the entries from the tnsnames.ora file. You will only be required to choose the appropriate entry and you should be good to go.
This was the case in all the latest Oracle releases However If you will download the Oracle XE client you will quickly discover  that there is no tnsnames.ora under the Oracle client XE directory structure. In addition, the network\admin directory is not there as well.
Oracle documentation explains (In their usual user friendly way) how to connect to the Data Base using a connection string (username/password@[//]host[:port][/service_name] where service name is usually XE and port is 1521) but it is not that obvious how to configure the odbc to use this.
The solution is simple enough (once you find it). All that needs to be done is to type  the connection string  on the ODBC’s “ TNS Service Name” field.  Just add the line 127.0.0.1/XE (no need to use the drop down) and test the connection.
If the Data Base is on a different machine, you can replace 127.0.0.1 with the address of the remote server.