Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts

Thursday, March 4, 2010

How to Check Your IP Address

Well, you are using Internet and wish to know your Public IP Address that currently used for you Internet connection. This is specially if you are using dial up connection or using a proxy server to connection to the Internet then ipconfig on windows or ifconfig on linux machine does not show your Public IP Address rather they show your Private IP address like below.
E:\>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

Media State . . . . . . . . . . . : Media disconnected

Ethernet adapter Wireless Network Connection:

Media State . . . . . . . . . . . : Media disconnected

PPP adapter GP-INTERNET:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.130.20.120
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 10.130.20.120

If you are not aware about Private and Public IP address then a little discussion about IP Address will help you to understand the thins.

Internet Protocol (IP) Address is a numerical label that is assigned to a device in order to uniquely identify in a network/Internet. In the Internet Protocol Version 4 (IPV4) the designers of TCP/IP defined an IP address as a 32-bit number which limits the address space to 4,294,967,296 (2 to the power 32) possible unique addresses. Out of 4,294,967,296 IP Addresses some addresses are reserved such as private networks (~18 million addresses) or multicast addresses (~270 million addresses).

The addresses which are reserved for private networks are called Private IP Address and rest addresses are called Public IP Address. Following is the range of all IP Address exists in IPV4.

Class First octet in binary Range of first octet Network ID Host ID Number of networks Number of addresses
A 0XXXXXXX 0 - 127 a b.c.d 27-2 = 126 224-2 = 16,777,214
B 10XXXXXX 128 - 191 a.b c.d 214 = 16,384 216-2 = 65,534
C 110XXXXX 192 - 223 a.b.c d 221-1 = 2,097,151 28-2 = 254


From the above list following is the range of Private IP Address,

Class Start End No. of addresses
24-bit Block (/8 prefix, 1 x A) 10.0.0.0 10.255.255.255 16,777,216
20-bit Block (/12 prefix, 16 x B) 172.16.0.0 172.31.255.255 1,048,576
16-bit Block (/16 prefix, 256 x C) 192.168.0.0 192.168.255.255 65,536


So, 10.130.20.120 is my private IP Address and as Private IP addresses are not routed on the Internet and thus their use need not be coordinated with an IP address registry so to communicate with Internet there must have a Public IP address. There are many websites through which you can check your IP Address along with many features. From them, I see AnalyzeMy really helps me which much more information.

Saturday, January 9, 2010

What is Tnsnames.ora and sample Tnsnames.ora in Oracle

What is TNSNAMES.ORA
The TNSNAMES.ORA is a configuration file and the entry inside this file is used to connect to a oracle database server. This file exist in oracle client pc and from the client computer this file entry is used to resolve oracle service to establish connection to oracle server. It is nothing but contains net service names mapped to connect descriptors for the local naming method, or net service names mapped to listener protocol addresses. Note that we can easily connect to oracle database server without the help of tnsnames.ora. We can connection to oracle database server using easy naming service which is discuss in the topic Easy Naming Service.

Inside the TNSNAMES.ORA an entry is called name service name or simply TNS entry. It is an alias mapped to a database network address contained in a connect descriptor. A connect descriptor contains the location of the listener through a protocol address and the service name of the database to which to connect.

Find out the location of TNSNAMES.ORA
Based on the operating system default path of tnsnames.ora file is mentioned below.

i)Windows 3.x client
ORAWIN\NETWORK\ADMIN directory

ii)Windows 95/98 client
SQL*Net 2.x - ORAWIN95\NETWORK\ADMIN
Net8 - ORAWIN95\NET80\admin
Net8i - ORACLE\ORA81\NETWORK\ADMIN

iii)Windows NT client
SQL*Net 2.x - ORANT\NETWORK\ADMIN
Net8 - ORANT\NET80\ADMIN
Net8i - ORACLE\ORA81\NETWORK\ADMIN

iv)UNIX Client
$ORACLE_HOME/NETWORK/ADMIN
or /etc
or /var/opt/oracle

But if we set the TNS_ADMIN environment variable or registry value then that location override the default location.

Sample TNSNAMES.ORA
<alias>= [ (DESCRIPTION_LIST =  # Optional depending on whether u have 
# one or more descriptions
# If there is just one description, unnecessary ]
(DESCRIPTION=
[ (SDU=2048) ] # Optional, defaults to 2048
# Can take values between 512 and 32K
[ (ADDRESS_LIST= # Optional depending on whether u have
# one or more addresses
# If there is just one address, unnecessary ]
(ADDRESS=
[ (COMMUNITY=) ]
(PROTOCOL=tcp)
(HOST=)
(PORT=)
)
[ (ADDRESS=
(PROTOCOL=ipc)
(KEY=)
)
]
[ (ADDRESS=
[ (COMMUNITY=) ]
(PROTOCOL=decnet)
(NODE=)
(OBJECT=)
)
]
... # More addresses
[ ) ] # Optional depending on whether ADDRESS_LIST is used or not
[ (CONNECT_DATA=
(SID=)
[ (GLOBAL_NAME=) ]
)
]
[ (SOURCE_ROUTE=yes) ]
)
(DESCRIPTION=
[ (SDU=2048) ] # Optional, defaults to 2048
# Can take values between 512 and 32K
[ (ADDRESS_LIST= ] # Optional depending on whether u have more
# than one address or not
# If there is just one address, unnecessary
(ADDRESS
[ (COMMUNITY=) ]
(PROTOCOL=tcp)
(HOST=)
(PORT=)
)
[ (ADDRESS=
(PROTOCOL=ipc)
(KEY=)
)
]
... # More addresses
[ ) ] # Optional depending on whether ADDRESS_LIST
# is being used
[ (CONNECT_DATA=
(SID=)
[ (GLOBAL_NAME=) ]
)
]
[ (SOURCE_ROUTE=yes) ]
)
[ (CONNECT_DATA=
(SID=)
[ (GLOBAL_NAME=) ]
)
]

where ... # More descriptions
[ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not

From the above sample TNSNAMES.ORA syntax you can easily made your own TNSNAMES.ORA alias.

Following is an example of TNSNAMES.ORA from my machine.

LISTENER_LOCAL =
  (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = ARJU)(PORT = 1521))
       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.1)(PORT = 1522))
  )

ORCL =
   (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ARJU)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.1)(PORT = 1522))
      (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl)
      )
   )

First one is for resolving listener name and second one is the tns alias resolving net service name. Based on your server setting you can simply use one ADDRESS from the two shown above and for your client computer you only need to use ORCL like tns alias. To make it easy understandable I have made the color red which need to be changed for your environment setting.

For example if your
database machine IP Address is 10.1.1.2 and
database service name is PROD8
database running on listener port 1521
then in your client computer the TNS entry inside the TNSNAMES.ORA file will look like below,
TNS_ALIAS=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =10.1.1.2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD8)
)
)

Then you can use TNS_ALIAS name to connect to database server from a client machine.


The following example shows a tnsnames.ora file configured for client load balancing:
sales_server=
(DESCRIPTION=
(ADDRESS_LIST=
(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521)))
(CONNECT_DATA=
(SERVICE_NAME=sales.com)))
The following example shows a tnsnames.ora file configured for connect-time failover:
sales_server=
(DESCRIPTION=
(ADDRESS_LIST=
(LOAD_BALANCE=off)
(FAILOVER=ON)
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=sales.com)))

Related Documents
http://arjudba.blogspot.com/2010/01/service-names-using-ldap-fails-with-tns.html
http://arjudba.blogspot.com/2010/01/troubleshoot-ora-12154-tns-12154-tns.html
http://arjudba.blogspot.com/2009/11/list-of-oracle-networking-components.html
http://arjudba.blogspot.com/2009/11/network-connection-in-oracle-using.html
http://arjudba.blogspot.com/2008/10/ora-28547-connection-to-server-failed.html
http://arjudba.blogspot.com/2008/08/ora-12560-tnsprotocol-adapter-error-on.html
http://arjudba.blogspot.com/2008/06/ora-12154-tnscould-not-resolve-connect.html
http://arjudba.blogspot.com/2008/06/ora-12641-authentication-service-failed.html

Thursday, January 7, 2010

Service Names Using LDAP Fails With TNS-03505 and ORA-12154

Problem Description
It is used LDAP, sqlnet.ora entry is NAMES.DIRECTORY_PATH = (LDAP) and Tnsping fails with TNS-03505: Failed to resolve name or TNS-12154 / ORA-12154: TNS:could not resolve service name.

Problem Symptom
- Service name is registered in Internet Directory tree.
- Internet Directory tree is configured for service name resolution.
- If we look at sqlnet.ora trace file we will see the text 'Directory server type is 4096'.

Cause of the Problem
In LDAP, the problem occurs if oracle cannot locate the ldap.ora file. Directory server type 4096 stands for "unknown", which indicates that the client is not able to pickup the ldap.ora file.

Solution of the Problem
If you use TNSNAMES.ORA then for the solution of this problem look at http://arjudba.blogspot.com/2010/01/troubleshoot-ora-12154-tns-12154-tns.html.

In case of LDAP configuration,
On windows, ensure that there is a correctly configured ldap.ora file on the client in the ORACLE_HOME\network\admin directory.

On Unix, ensure that ldap.ora file on the client exist on $ORACLE_HOME/network/admin
directory.
In some types of installations on unix, there may be an ldap.ora file in ORACLE_HOME\ldap\admin directory.

On Oracle9i the ldap.ora file can also be placed in the directory defined by the TNS_ADMIN environment variable.

Following is an example of ldap.ora:
DEFAULT_ADMIN_CONTEXT = "dc=no,dc=oracle,dc=com"
DIRECTORY_SERVERS= (hostname:389:636)
DIRECTORY_SERVER_TYPE = OID
Related Documents 
ORA-12560: TNS:protocol adapter error on windows machine while starting oracle 
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
Startup fails with oracle error ORA-00119, ORA-00132
http://arjudba.blogspot.com/2010/01/troubleshoot-ora-12154-tns-12154-tns.html

Troubleshoot ORA-12154 TNS-12154 TNS-03505: Failed to resolve name

In this document I will discuss step by step solutions for ORA-12154, TNS-12154 and TNS-03505. About ORA-12154 it is already discussed in Troubleshoot ORA-12154. This post will be applicable to troubleshoot for both ORA-12154, TNS-12154 and TNS-03505.

What Oracle Says about the Problem
If you open http://arjudba.blogspot.com/2008/06/how-to-get-oracle-error-message-from.html you will see about the description of TNS-12154 or ORA-12154 they are telling same like below.
Oracle Error : TNS-12154
TNS: could not resolve the connect identifier specified

Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.

Action:
- If you are using local naming (TNSNAMES.ORA file):

- Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)

- Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.

- Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.

- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.

- If you are using directory naming:

- Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

- Verify that the LDAP directory server is up and that it is accessible.

- Verify that the net service name or database name used as the connect identifier is configured in the directory.

- Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier

- If you are using easy connect naming:

- Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

- Make sure the host, port and service name specified are correct.

- Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.

For case TNS-03505: it says
TNS-03505: Failed to resolve name
Cause: The service name you provided could not be found in TNSNAMES.ORA, an Oracle Names server, or a native naming service.
Action: Verify that you entered the service name correctly. You may need to ensure that the name was entered correctly into the network configuration.

which indicates for both ORA-12154, TNS-12154 and TNS-03505 we will have a generic solution.


Step 01: Overview of the Problem
Both ORA-12154, TNS-12154 and TNS-03505 indicates that SQL*Net could not find the alias specified for a connection in the TNSNAMES.ORA file or other naming adapter.

As the problem is regarding TNSNAMES.ORA and SQLNET.ORA so in order to dig into solution it is important to print out or a view of both the TNSNAMES.ORA and the SQLNET.ORA files. Looking at these files at the same time is helpful since references will be made to both.

Step 02: Identify the location of TNSNAMES.ORA and SQLNET.ORA
It is necessary to locate the location of TNSNAMES.ORA and SQLNET.ORA. If you simply use tnsping dummy it will say the location of SQLNET.ORA and there TNSNAMES.ORA should be in the same location.
E:\Documents and Settings\Arju>tnsping dummy

TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 08-JAN-2010 11:00:46

Copyright (c) 1997, 2007, Oracle. All rights reserved.

Used parameter files:
D:\app\Arju\product\11.1.0\db_1\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name
From the above output we see both of these files are located in the path D:\app\Arju\product\11.1.0\db_1\network\admin\.

Through above ways we can determine current path of these two files. However it is important to know the default path of these files. Based on the operating system default path are mentioned below.

i)Windows 3.x client
ORAWIN\NETWORK\ADMIN directory

ii)Windows 95/98 client
SQL*Net 2.x - ORAWIN95\NETWORK\ADMIN
Net8 - ORAWIN95\NET80\admin
Net8i - ORACLE\ORA81\NETWORK\ADMIN

iii)Windows NT client
SQL*Net 2.x - ORANT\NETWORK\ADMIN
Net8 - ORANT\NET80\ADMIN
Net8i - ORACLE\ORA81\NETWORK\ADMIN

iv)UNIX Client
$ORACLE_HOME/NETWORK/ADMIN
or /etc
or /var/opt/oracle

Step 03: Print out or View both TNSNAMES.ORA and SQLNET.ORA.
Following is the correct TNSNAMES.ORA from my system
# tnsnames.ora Network Configuration File: D:\app\Arju\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

A =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ARJU)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = a)
)
)
Following is the correct SQLNET.ORA from my system.
# sqlnet.ora Network Configuration File: D:\app\Arju\product\11.1.0\db_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)


Step 04: Check several factors one by one.
To Troubleshoot problem let's start with some complex TNSNAMES.ORA and SQLNET.ORA.
TNSNAMES.ORA Experimental Sample
DEV.WORLD = 
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 10.1.1.1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
SQLNET.ORA Experimental Sample
TRACE_LEVEL_CLIENT = OFF 
SQLNET.AUTHENTICATION_SERVICES = (NONE)
NAMES.DIRECTORY_PATH = (TNSNAMES)
AUTOMATIC_IPC = OFF
i) Determine which tns entry you used to connect. For example if you used dummy then issue a tnsping dummy and ensure that the entry DUMMY must exist in the TNSNAMES.ORA.

For example, my "tnsping a" worked because in my TNSNAMES.ORA I have an entry regarding alias A which I have pasted my TNSNAMES.ORA above.
E:\Documents and Settings\Arju>tnsping a

TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 08-JAN-2010 11:00:34

Copyright (c) 1997, 2007, Oracle. All rights reserved.

Used parameter files:
D:\app\Arju\product\11.1.0\db_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ARJU)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = a)))
OK (330 msec)

tnsping dummy will fail because there is no entry in my TNSNAMES.ORA with name dummy and also connection with dummy will fail too.
Make sure by using IP Address entry instead of hostname inside TNSNAMES.ORA. So use HOST=192.168.1.1 something like that instead of HOST=ARJU.

ii) Check both file again and ensure that there is no CTRL-A (^A) or CTRL-C (^C) characters inserted at the ends of any lines.

iii) If both are fine check the TNSNAMES.ORA alias. Here in our experimental sample it is DEV.WORLD which means .WORLD is our domain and it should be specified it our SQLNET.ORA. So add the parameter NAMES.DEFAULT_DOMAIN = world anywhere in the SQLNET.ORA file. Save the file, and try the connection again.

iv) If within the TNSNAMES.ORA there is no default domain in the alias*(for example it is simply DEV but not DEV.WORLD) then remove NAMES.DEFAULT_DOMAIN = world from the SQLNET.ORA file if there existed. After removing the parameter, save the SQLNET.ORA file, and try connecting again.

v) If the parameter NAMES.DIRECTORY_PATH exists in the SQLNET.ORA file, make sure the value in parenthesis lists TNSNAMES. For example following two examples are valid entry.
NAMES.DIRECTORY_PATH=(TNSNAMES) 
NAMES.DIRECTORY_PATH=(TNSNAMES, HOSTNAME)
Though NAMES.DIRECTORY_PATH parameter is not needed, but if it exists then it should look ok. After removing it you can try connecting again.

vi) At this phase the configuration files are most likely technically accurate.
Now you have to ensure that your TNSNAMES.ORA is in the correct location and you have used correct TNS entry while connecting. The TNS location can be set by TNS_ASMIN environmental variable.

On your Unix environment,
% echo $TNS_ADMIN

If nothing is returned, try setting the TNS_ADMIN environment variable to explicitly point to the location of the TNSNAMES.ORA file.

In C Shell, the syntax is:
% setenv TNS_ADMIN full_path_to_tnsnames.ora_file

In K Shell, the syntax is:
% TNS_ADMIN=full_path_to_tnsnames.ora_file; export TNS_ADMIN

After setting try the connection/tnsping again.

In case of Windows 3.x,
- TNS_ADMIN is set in the ORACLE.INI.

- Look in the C:\WINDOWS directory for the ORACLE.INI file. Look for the parameter TNS_ADMIN. TNS_ADMIN is a parameter that can be set to have SQL*Net point to an alternate location for the configuration files.
- Search for duplicate TNSNAMES.ORA and SQLNET.ORA files.
- Make sure none exist.
- Once you are sure try the connection/tnsping again.

In case of Windows 95/98,
- Open the file ORACLE_HOME\bin\oracle.key.
- Search for Registry under the location specified by the .key file, such as HKEY_LOCAL_MACHINE\Software\Oracle\Home1 for a parameter called TNS_ADMIN.
- TNS_ADMIN is a parameter that can be set to have SQL*Net point to an alternate location for the configuration files.
- Search for duplicate TNSNAMES.ORA and SQLNET.ORA files.
- Make sure none exist.
- Once you are sure try the connection/tnsping again.

In case of Windows XP,
- Make sure TNS_ADMIN environemental points to correct location. Ensure that there must not exist both user variable or system variable environmental variable. If nothing exist you can add one user variable. To set user/system variable,
-- Right click on My computer
-- Click Properties.
-- Click Advanced Tab.
-- Click Environemental Variables.
-- You can have both User and System Variables there.
You can add, edit or delete variables. You can simply add TNS_ADMIN and its location in the user variable section. Note that Variable Name would be "TNS_ADMIN" and variable would be "The location of the TNSNAMES.ORA in your client environement."

- After you set try connection again.

Your problem would be resolved.
Related Documents
ORA-12560: TNS:protocol adapter error on windows machine while starting oracle
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Startup fails with oracle error ORA-00119, ORA-00132

Tuesday, October 7, 2008

Who is connected to your windows machine using which port.

To access any application of another system either through WWW service, FTP service, POP3/SMTP services, or even just NetBIOS over TCP/IP you have to go through a port. In other sense if someone from outside access something on your system he enter through a port. And you sometimes might be curious to know who is accessing your system and which ports they are using.
With netstat tool you can easily identify it.
On windows system in order to know details of it just type netstat /? in command prompt.
Here is the output,

C:\Documents and Settings\Queen>netstat /?

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]

-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection or
listening port. In some cases well-known executables host
multiple independent components, and in these cases the
sequence of components involved in creating the connection
or listening port is displayed. In this case the executable
name is in [] at the bottom, on top is the component it called,
and so forth until TCP/IP was reached. Note that this option
can be time-consuming and will fail unless you have sufficient
permissions.
-e Displays Ethernet statistics. This may be combined with the -s
option.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
-p proto Shows connections for the protocol specified by proto; proto
may be any of: TCP, UDP, TCPv6, or UDPv6. If used with the -s
option to display per-protocol statistics, proto may be any of:
IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are
shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;
the -p option may be used to specify a subset of the default.
-v When used in conjunction with -b, will display sequence of
components involved in creating the connection or listening
port for all executables.
interval Redisplays selected statistics, pausing interval seconds
between each display. Press CTRL+C to stop redisplaying
statistics. If omitted, netstat will print the current
configuration information once.

In order to know all connection along with port now connection to your system just press netstat.
C:\Documents and Settings\Queen>netstat
The listing will appear with several fields.
-The protocol type.
-Hostname:port
-Foreign Address that is who is connected to your system.
-State of the connection.

Related Documents
How to Setup Windows Machine For Best Performance
How to Use Special Characters in Windows
Internet Explorer Keyboard Shortcuts
More Internet Explorer Keyboard Shortcuts

Tuesday, August 12, 2008

How to Monitor traffic between nodes

With the command netstat -i we can monitor the traffic in the network nodes. The sample output of netstat -i is below.
# netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 226707 0 0 0 68280 0 0 0 BMRU
lo 16436 0 13 0 0 0 13 0 0 0 LRU
vmnet 1500 0 0 0 0 0 6 0 0 0 BMRU


We can get the the elaboration of the preceding terms below.
* Name - The type of the Ethernet interface
* Mtu - The maximum size of the packets that are transmitted on the network.
* Net/Dest - The subnet address
* Address - The name of the system
* Ipkts - The number of packets received
* Ierrs - The number of received packets that have errors
* Opkts - The number of packets sent
* Oerrs - The number of sent packets that have errors
* Collis - The number of output packets that result in collision
* Queue - The number of packets that are queued

Considerations on the output

* The Queue field should have a 0 value.
* The Collis field value should not be greater than 5% of the no. of Opkts.
* If Ierrs field value is greater than 25% of the Ipkts field value the system is dropping packets, which causes a high number of input errors.

It is difficult to interpret the output of the netstat utility for a system with many network interfaces. In that case you can use,
$netstat -i eth1(interface name)
to get traffic of a particular interface.

Sunday, July 27, 2008

How to setup Wireless Network Connection on Windows XP

Before proceed note that your OS is determine the wireless networks. That is you will see an unplugged icon in the wireless network connections. If windows can't detect your wireless driver then you need to install the driver of the wireless adaptor.

Here is the procedure if you want to setup wireless network on your laptop with operating system windows XP.
1)Go to control panel and then click Network Connections.

2)If you have driver setup either built in OS or from third party software then you will see Wireless Network Connection icon. Right Click on the Wireless Network Connection then and click Status

3)If there is no received data then click on View Wireless Network Connection.

4)AT this stage you need to be cautious. If you click Refresh Network list then no connection will be shown if other third party software is used to configure your wireless other than windows.

5)If you want other software then don't use windows one. However if you want to let windows to configure your wireless connection and after refresh network list no list is shown then Click Change Advanced Settings.

6)Select Wireless Networks Tab.

7)Just check the box "Use Windows to configure my wireless network settings."

8)Click ok.

9)Now click Refresh Network list and you will see the available connection.

10)Select your desired network and connect to wireless network.

Tuesday, June 24, 2008

ORA-12154: TNS:could not resolve the connect identifier specified

Problem Description:
--------------------------------------------

Whenever you try to connect your database it returns error ORA-12154.
SQL> conn prod/prod@jupi
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Cause of The Problem:
------------------------------------

The cause of the problem is depends on the which naming method you are using. Suppose if you use tnsnames.ora for naming method then there might be problem in it. I look for oerr command on my unix machine and got,

-bash-3.00$ oerr ora 12154
12154, 00000, "TNS:could not resolve the connect identifier specified"
// *Cause: A connection to a database or other service was requested using
// a connect identifier, and the connect identifier specified could not
// be resolved into a connect descriptor using one of the naming methods
// configured. For example, if the type of connect identifier used was a
// net service name then the net service name could not be found in a
// naming method repository, or the repository could not be
// located or reached.
// *Action:
// - If you are using local naming (TNSNAMES.ORA file):
// - Make sure that "TNSNAMES" is listed as one of the values of the
// NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA)
// - Verify that a TNSNAMES.ORA file exists and is in the proper
// directory and is accessible.
// - Check that the net service name used as the connect identifier
// exists in the TNSNAMES.ORA file.
// - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
// file. Look for unmatched parentheses or stray characters. Errors
// in a TNSNAMES.ORA file may make it unusable.
// - If you are using directory naming:
// - Verify that "LDAP" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Verify that the LDAP directory server is up and that it is
// accessible.
// - Verify that the net service name or database name used as the
// connect identifier is configured in the directory.
// - Verify that the default context being used is correct by
// specifying a fully qualified net service name or a full LDAP DN
// as the connect identifier
// - If you are using easy connect naming:
// - Verify that "EZCONNECT" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Make sure the host, port and service name specified
// are correct.
// - Try enclosing the connect identifier in quote marks.
//
// See the Oracle Net Services Administrators Guide or the Oracle
// operating system specific guide for more information on naming.

Solution of The Problem:
-----------------------------------------------

Actually above solution already depicted what to do if you get the problem. My suggest after getting ORA-12154 immediately go as the steps mentioned below.

Step 1: Look for tnsnames.ora and sqlnet.ora.
-----------------------------------------------------------------------

Look for your tnsnames.ora and sqlnet.ora file that you are using. On unix the default location is $ORACLE_HOME/network/admin. You better avoid to use tnsnames.ora. By using easy naming service you can easily avoid this error. Easy naming service is discussed on See the solution part of this post

Step 2: Check both file
---------------------------------------------------------------------------

•After locating both file open it with any viewer like on windows with notepad and on unix with less or more or cat.

•Check within the files whether any illegal character or any unnecessary space exists. If have then remove that.

•Check whether the exact entry exist on the tnsnames.ora that you used in connection identifer. Like if you use conn a/a@jupi then within tnsnames.ora search for only jupi alias.

•You can check your whether there is error or not in the tnsnames alias inside tnsnames.ora by using tnsping. In order to check alias jupi we issue,

bash-3.00$ tnsping jupi

TNS Ping Utility for Solaris: Version 10.2.0.1.0 - Production on 12-OCT-2008 03:25:58

Copyright (c) 1997, 2005, Oracle. All rights reserved.

Used parameter files:
/oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = ((ADDRESS = (PROTOCOL = TCP)(HOST = neptune)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ARJU)))
TNS-12533: TNS:illegal ADDRESS parameters
So there is illegal ADDRESS parameter which we see an extra ( before ADDRESS parameter.

If our tnsalias was good, then it would result below with how many miliseconds.
bash-3.00$ tnsping jupi

TNS Ping Utility for Solaris: Version 10.2.0.1.0 - Production on 12-OCT-2008 03:28:26

Copyright (c) 1997, 2005, Oracle. All rights reserved.

Used parameter files:
/oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = neptune)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ARJU)))
OK (10 msec)

•Note that with name alias checking tnsnames also tell us which location parameter files it used. Here the location is /oracle/app/oracle/product/10.2.0/db_1/network/admin. So /oracle/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora location is used in order to resolve name. However if your tnsnames.ora is in other location then you have to set TNS_ADMIN variable.

•If you see tnsnames.ora is most likely accurate, echo the TNS_ADMIN environment variable.

% echo $TNS_ADMIN

•If nothing is returned, try to set the TNS_ADMIN environment variable to explicitly point to the location of the TNSNAMES.ORA file.

In C Shell, the syntax is:
% setenv TNS_ADMIN full_path_of_tnsnames.ora_file

In K Shell or bash, the syntax is:
% export TNS_ADMIN=full_path_of_tnsnames.ora_file

In windows the syntax is:
set TNS_ADMIN=full_path_of_tnsnames.ora_file

•Now try and see whether error remains. If still you get error then in the SQLNET.ORA file, add the parameter AUTOMATIC_IPC = OFF. If AUTOMATIC_IPC is already set to ON, then change the value to OFF. And try to connect. If still you get error then check the permission of tnsnames.ora and sqlnet.ora. For workaround you can set chmod 777 of these files and try to connect. At this point it is expected you have solved your problem.

Related Documents
ORA-12560: TNS:protocol adapter error on windows machine while starting oracle
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Startup fails with oracle error ORA-00119, ORA-00132

Monday, April 21, 2008

How to Import data without Dumpfile-Network Mode Import

It is possible to import data in a database without the dump file. From network the data will be retrieved from one database and then import that data back to the target database. There are no dump files involved.

How to do the Network Mode Import:
-------------------------------------

1)Create a database link (with the source database) in the database where you will perform the import operation.

SQL> create database link ARJU.REGRESS.RDBMS.DEV.US.ORACLE.COM connect to arju identified by a using 'NEPTUNE';
Database link created.


In your tnsnames.ora you have entry with NEPTUNE and it works correctly.

I have to used this long name because the database global name settings.

2)Check the database link works:

If destination table name is select perfectly then your database link is ok.
SQL> select table_name from user_tables@ARJU.REGRESS.RDBMS.DEV.US.ORACLE.COM;
TABLE_NAME
------------------------------
FIRST_TABLE
TEST
NAME
In source database you can check by,
SQL> select table_name from user_tables;
no rows selected

3)Connect to the source database and note down the SCN of the database. This SCN is needed in order to ensure consistency in the dumpfile. You can do it while you are sitting on destination database by helping database links.
SQL>SELECT CURRENT_SCN FROM V$DATABASE@ARJU.REGRESS.RDBMS.DEV.US.ORACLE.COM;
118740640

Also you can logon to that database and see SCN.

4)Perform the network mode import operation.Specify database link parameter with NETWORK_LINK. Also specify FLASHBACK_SCN that you find in step 3.

SQL> host impdp arju/arju directory=dnet FLASHBACK_SCN=118740640 NETWORK_LINK=ARJU.REGRESS.RDBMS.DEV.US.ORACLE.COM


Note that no dumpfile parameter here. I created dnet directory into which log file will be written.

Restrictions of Network Mode Import:
-------------------------------------------


1.If the source database is read-only, then the user on the source database must have a locally-managed tablespace assigned as a default temporary tablespace. Otherwise, the job will fail.

2.If the USERID that is executing the import job has the IMP_FULL_DATABASE role on the target database, then that user must also have the EXP_FULL_DATABASE role on the source database.

3.The only types of database links supported by Data Pump Import are: public, fixed-user, and connected-user.

4.When the NETWORK_LINK parameter is used in conjunction with the TABLES parameter, only whole tables can be imported (not partitions of tables).

5.Network imports do not support the use of evolved types.

Related Documents:
Extract DDL from Dump

Import Oracle Data from Anywhere.

Suppose, I have server machine named "NEPTUNE". In the server machine under /oradata2 directory there is a dump file named net.dmp. However to run import operation we need not connect to server "NEPTUNE" and then perform import operation. From any machine which have data pump import client can do the operation.

In this case we need to specify with username/password field a net service name. We can easily use easy name service method here.

Note that, The dump file, the directory are all in server. Only impdp client is on another machine from which I will invoke impdp utility.


In server machine "NEPTUNE" I invoked lsnrctl status and saw the listener port is 1522 and service name is ARJU. The dump file is /oradata2/net.dmp and a directory is there named as dimp.


From Another machine just invoke,

impdp arju/a@neptune:1522/ARJU directory=dimp dumpfile=net.dmp

Related Documents:
-------------------

Extract DDL from Dump