0% found this document useful (0 votes)
17 views10 pages

Lab1. Installation, Configuration and Connection

Uploaded by

phungb2206004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views10 pages

Lab1. Installation, Configuration and Connection

Uploaded by

phungb2206004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Lab 1.

Oracle Database installation, connection and configuration

Content
- Oracle Database Express Edition installation
- Local database connections
- Oracle Net Listener
o Configuring Oracle Net Listener
o Viewing the status of Oracle Net Listener
o Starting and stopping the listener
o Configuring the tnsnames.ora file
- Remote database connections

Oracle Database Express Edition installation


1. Download the Oracle DB XE installer (~320MB):
https://drive.google.com/drive/folders/1WbjAVT0UTtqwjGY9RTd_tC4tT75MEs5h
2. Run setup.exe and click Next

1
3. Accept the license agreement and click Next

4. Choose the location for installing Oracle DB and click Next

2
5. Configure the password for the database. Save this password because you need it to connect
with the database.

6. Save the summary. These are the details for connecting with the database.

3
7. Database installation is successful. Now, the database is ready to use.

4
8. Mostly, the Oracle database gets started automatically after installation. But as this is the first
time, let's start the database manually. Search for the Oracle Database 11g XE and click on Start
Database.

9. Once installed, you can run Oracle on the Web at:


http://127.0.0.1:8080/apex/f?p=4950:1:535275793956732

5
Local database connection
Establishing a connection locally means running the SQL command-line utility on the same
computer where Oracle Database 11g XE is installed, and initiating a database connection command
using the valid database credentials.
The following screenshot is taken from Oracle Database 11g XE on Windows, and demonstrates
establishing a local database connection to the database:

ORA_DBA is a local Windows group that is automatically created when you install Oracle Database
XE, and your Windows username is automatically added to this group. Members of ORA_DBA can
connect to the Oracle Database XE without a password, as shown in the following screenshot:

Oracle Net Listener


To connect to the database remotely, Oracle Net Listener should be running on the host where
Oracle Database 11g XE is installed. When a remote client initiates a database connection request,
this connection request is received by Oracle Net Listener. The job of the listener is to listen to these
incoming database connection requests and hand over the connection requests to the appropriate
databases.
Thereafter, the remote-client connection directly communicates with the database without the
need for the listener. Without the listener service running, we cannot connect to the database
remotely. There may be more than one database running on the host server; however, you will only
have one database listener for all incoming requests. Based on the incoming request, Oracle Net
Listener will hand over the connection request to the appropriate database.

6
Oracle Net Listener and the tnsnames.ora files are configured by default when we install Oracle
Database 11g XE. The listener's configuration file is located under
$ORACLE_HOME\network\admin\listener.ora. Oracle Database XE automatically creates a
Windows service for Oracle Net Listener (OracleXETNSListener).
Configuring Oracle Net Listener
listener.ora is the name of the Oracle Net Listener configuration file, and it resides under
$ORACLE_HOME\network\admin folder.
The content of a sample listener.ora file in its simplest form is as follows:
SID_LIST_LISTENER = (SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
)
)
LISTENER = (DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = amomen-PC)(PORT = 1521))
)
)
The description of the parameters is as follows:
• LISTENER: The name of the listener
• SID_NAME: The Oracle Database name
• ORACLE_HOME: The Oracle software installation home directory
• HOST: The name of the host where Oracle Net Listener is running
• PORT: The port on which Oracle Net Listener is listening to the incoming requests
Make the necessary changes to the preceding parameters, save the file, and restart the Windows
Oracle Listener service OracleXETNSListener.
Viewing the status of Oracle Net Listener
If the listener is not started, the command displays an error message, as shown in the following
screenshot:

7
If the listener is running, the command displays detailed listener information as shown in the
following screenshot:

The listener is automatically configured when we install Oracle Database 11g XE.
Starting and stopping the listener
• To stop the listener on Windows, launch the Services window by navigating to Start |
Control Panel | Administrative Tools | Services and stop the
OracleXETNSListener service, or launch the listener utility (lsnrctl) and enter the
LSNRCTL> stop command. To stop the listener on Linux, within the listener utility
(lsnrctl) enter the stop command as we did in the Windows environment.
• To start the listener on Windows, launch the Services window by navigating to Start |
Control Panel | Administrative Tools | Services and start the
OracleXETNSListener service, or launch the listener utility (lsnrctl) and enter the
LSNRCTL> start command. To start the listener on Linux, within the listener utility
(lsnrctl) enter the start command as we did in Windows environment.
Configuring the tnsnames.ora file
Transparent Network Susbstrate (TNS) handles all remote database connections. Oracle software
reads the TNS connection string to understand how to connect to the remote databases. Every
Oracle database and the Oracle Client software will have this file. By default the tnsnames.ora file
is located under $ORACLE_HOME\network\ admin. A sample alias entry from the tnsnames.ora file
is as follows:
MY_XE = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = amomen-PC)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SID = XE))
)

8
In the preceding code:
• MY_XE is an alias name. You can name it anything you like.
• HOST is the hostname or IP-Address where database is running.
• PORT is the port number on which Oracle Net Listener is listening.
• SID is the Oracle database name.
We will use my_xe as a connect string when connecting to the remote database.

Remote database connections


Establishing a connection remotely means running the SQL command-line utility on a different host
other than the Oracle Database 11g XE machine and initiating a database connection command
using the valid database credentials over the network using a connect string.
The following screenshot is taken from Oracle Database 11g XE on Windows, and demonstrates
establishing a remote database connection to the database:

As discussed earlier, a connect string defines which database server to connect to, on what port,
and using what protocol. In the preceding example, xe is the name of the connect string.
Alternatively, we can connect to the database by providing the database hostname and port as
shown in the following screenshot:

The database hostname name and port information are encapsulated in the connect string.

9
Tài liệu tham khảo
[1] https://www.oicbasics.com/2020/01/download-oracle-database-11g-xe-express.html
[2] https://dangvinhcuong.wordpress.com/2015/04/15/oraclelession01-cai-dat-oracle-
xeoracle-database-express-edition-11g/
[3] https://docs.oracle.com/en/database/oracle/oracle-database/21/xeinw/installing-oracle-
database-xe.html#GUID-7BF9ACDC-1281-494C-AF96-77A25B1BD67D
[4] https://drive.google.com/file/d/1B3v1dUHPV0Tu82WWZJG9Va8iX5w4tWL2/view?usp=sh
aring
[5] https://medium.com/analytics-vidhya/step-by-step-guide-for-installation-of-oracle-11g-
express-edition-76e25e8248a9
[6] https://docs.oracle.com/cd/E17781_01/server.112/e18804/getstart.htm#ADMQS110
[7] https://www.oracle.com/database/technologies/xe-prior-release-downloads.html (11g)
[8] https://www.oracle.com/database/technologies/express-edition-downloads.html (18c)
[9] https://www.oracle.com/in/database/technologies/instant-client/macos-intel-x86-
downloads.html

10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy