After oracle8i, the database instance is created with two names: the database service name, the database instance name. (Oracle8i previously only DB instance name)
When you create a new database, the database service name can be the same, and the database instance name must be unique, so there can be multiple DB instances in the name of the database service.
The database Network service name is provided to other machines on the network for distributed calls.
For example, when using Plsql to connect to a database, the database network service name is selected. It is configured in Oracle's Tnsnames.ora.
Once the external network is configured, the database can be connected. There are several matching methods, in which MYORCL is the network service name provided externally:
1. MYORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
& nbsp; (Connect_data =
(SERVER = dedicated)
(service_name = ORCL)//Database service name
(SID = ORCL)//If you have an instance, this line can be done without writing (this is the default). If multiple instances specify a specific DB instance name.
)
)
This method is used for oracle8i or later versions. Because the database service name service_name = ORCL is used here.
The following versions of Oracle8i have no database service name service_name.
2. MYORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
(Connect_data =
(SID = ORCL)
)
)
This method is used to oracle8i the following versions. This configuration method is also compatible with oracle8i versions above.
So as long as there is an Oracle client, in the client's Tnsnames.ora file configuration of the database to operate, you can be local to the remote database for data import, export and so on any operation.
Like what:
To import a DMP data file for a remote Oracle database:
IMP username/[email protected] FILE=JJJG. DMP Ignore=y full=y
The MYORCL after @ should be the Network service name. That is, the network service name that is configured in the Tnsnames.ora file of your local machine Oracle client.