Pages

Tuesday, February 18, 2014

How to resolve error TNS:listener does not currently know of service requested in connect descriptor

This time we would like to look at one of problem in oracle, especially “ORA-12514: TNS:listener does not currently know of service requested in connect descriptor”.

The vast majority of the time, this error results from an incorrectly specified connect descriptor in the tnsnames.ora file. Let’s look at a very typical example then diagnose and fix it. After that we will dig in to how the listener comes to know of a service name.

For the first we need to analyze why the error occured by starting listener.
[oracle@vmlnx01 admin]$ lsnrctl start
 
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 18:44:49
 
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
 
Starting /ora00/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Log messages written to /ora00/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521)))
 
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                16-MAR-2011 18:44:49
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /ora00/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521)))
The listener supports no services
The command completed successfully

It said that The listener supports no services. It means that the listener doesn't have any associates service. So the solution is we need to add a service to listener.ora as example below :

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME=vlnxora1)
      (ORACLE_HOME = /ora00/app/oracle/product/10.2.0/db_1)
      (SID_NAME = vlnxora1)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = vmlnx01.vmdomain)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

Restart listener by command lsnrctl stop followed by lsnrctl start. Now you can try login using your oracle user e.g : sqlplus scott@vlnxora1

If you get this problem in your oracle client installation, please make sure that your service name is configured correctly. To check that, do the following steps :

  1. Edit tnsnames.ora
  2. Make sure that service name in connect descriptor is same with oracle database service name.
  3. To check oracle database service name, login to your oracle database server and execute the query below : 
    sqlplus / as sysdba
    select value from v$parameter where name='service_names';
    show parameter service_names;
  4. To change oracle service name you can use alter
    ALTER SYSTEM SET SERVICE_NAMES='application_a.your.domain','application_b.your.domain' SCOPE=BOTH;

Thursday, February 6, 2014

How to extract files in linux

compressed files


In linux operating system, there are some kinds of compressed files. Here they are:
  1. tar.bz2.  Below are the steps to extract .tar.bz2 file :
    • Open a terminal
    • type command "tar xvjf filename.tar.bz2"
  2. tar.gz.  Below are the steps to extract .tar.gz file :
    • Open a terminal
    • type command "tar xvzf filename.tar.gz"

Monday, December 9, 2013

How to copy file between host using scp

How to copy file between host using scp

 What is Secure Copy?

scp(Secure copy) allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh

Below are the example syntax of scp :

Copy the file "foobar.txt" from a remote host to the local host
$ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host
$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar"
$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"
$ scp your_username@rh1.edu:/some/remote/directory/foobar.txt \ your_username@rh2.edu:/some/remote/directory/

Copy the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host
$ scp foo.txt bar.txt your_username@remotehost.edu:~

Copy the file "foobar.txt" from the local host to a remote host using port 2264
$ scp -P 2264 foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy multiple files from the remote host to your current directory on the local host
$ scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} .
$ scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} .

By default scp uses the Triple-DES cipher to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed. This can be done by using option -c blowfish in the command line.
$ scp -c blowfish some_file your_username@remotehost.edu:~

It is often suggested that the -C option for compression should also be used to increase speed. The effect of compression, however, will only significantly increase speed if your connection is very slow. Otherwise it may just be adding extra burden to the CPU. An example of using blowfish and compression:
$ scp -c blowfish -C local_file your_username@remotehost.edu:~
Don't Forget To Join Our Community
×
Widget