0% found this document useful (0 votes)
64 views

Oracle Installation

The document provides information about installing and configuring Oracle Database Express Edition. It discusses downloading and extracting the installation files, running the setup program, completing the installation wizard, specifying passwords, and verifying a successful installation. SQL*Plus is introduced as the primary interface for database administration tasks like starting and stopping the database, creating users and objects, and running SQL queries. The steps for connecting to the database using SQL*Plus are outlined, including setting environment variables and using the CONNECT command. Database administrator privileges and accounts are also mentioned.

Uploaded by

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

Oracle Installation

The document provides information about installing and configuring Oracle Database Express Edition. It discusses downloading and extracting the installation files, running the setup program, completing the installation wizard, specifying passwords, and verifying a successful installation. SQL*Plus is introduced as the primary interface for database administration tasks like starting and stopping the database, creating users and objects, and running SQL queries. The steps for connecting to the database using SQL*Plus are outlined, including setting environment variables and using the CONNECT command. Database administrator privileges and accounts are also mentioned.

Uploaded by

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

ORACLE

INSTALLATION
ORACLE INSTALLATION
• Oracle Database Express Edition (XE) Release 18.4.0.0.0 (18c)

 Oracle Developer
ORACLE INSTALLATION
1. Log on to Windows with Administrator privileges. You must be part of the
Administrators group on Windows to install Oracle Database XE. If you are logged
in as a domain user, ensure that you are connected to the network. Otherwise, you
may receive a prerequisite check failure for Administrator privileges during the
install.
2. If the ORACLE_HOME environment variable has been set, then delete it.
3. Download the Microsoft Windows version of Oracle Database XE. 4. Extract the
downloaded zip file to a temporary location. Locate setup.exe and double click it.
ORACLE INSTALLATION
5. In the Welcome to the InstallShield Wizard for Oracle Database 18c Express Edition
window, click Next.
6. In the License Agreement window, read the text of the agreement and if you agree to its
terms, select I accept the terms in the license agreement and then click Next.
7. The installer now performs a prerequisite check to ensure that the version of Windows is
supported, that the installation user has administrative privileges, and that there is no
Oracle Database XE service already created. If any of these checks fail a Prerequisite
Checks window will open notifying the user. In that case, cancel the installation, fix the
problem, and retry the installation.
8. In the Choose Destination Location window, either accept the default or click Change to
select a different installation directory. (Do not select a directory that has spaces in its
name.) Then click Next.
9. In the Specify Database Passwords window, enter and confirm the single database
password to use for the SYS, SYSTEM, and PDBADMIN database accounts. Then
click Next.
11. When the installation is
complete, the Oracle Database
Installed Successfully window
is displayed.
DATA BASE
ADMINISTRATION Chapter 2

ORACLE
SQL*PLUS
SQL*Plus is the primary command-line interface to your Oracle database. You use
SQL*Plus to start up and shut down the database, set database initialization
parameters, create and manage users, create and alter database objects (such as tables
and indexes), insert and update data, run SQL queries, and more.
SQL*PLUS
Before you can submit SQL statements and commands, you must connect to the
database.
With SQL*Plus, you can connect locally or remotely.
Connecting locally means connecting to an Oracle database running on the same
computer on which you are running SQL*Plus.
Connecting remotely means connecting over a network to an Oracle database that
is running on a remote computer. Such a database is referred to as a remote database
CONNECTING TO THE
DATABASE WITH SQL*PLUS
Connecting to the Database with SQL*Plus Oracle Database includes the following
components:
The Oracle Database instance, which is a collection of processes and memory
■ A set of disk files that contain user data and system data
When you connect with SQL*Plus, you are connecting to the Oracle instance. Each
instance has an instance ID, also known as a system ID (SID). Because there can be
multiple Oracle instances on a host computer, each with its own set of data files, you
must identify the instance to which you want to connect. For a local connection, you
identify the instance by setting operating system environment variables
CONNECTING TO THE
DATABASE WITH SQL*PLUS
To connect to an Oracle instance with SQL*Plus, therefore, you must complete the
following steps:
Step 1: Open a Command Window
Step 2: Set Operating System Environment Variables
Step 3: Start SQL*Plus
Step 4: Submit the SQL*Plus CONNECT Statemen
CONNECTING TO THE
DATABASE WITH SQL*PLUS
Step 1: Open a Command Window Take the necessary action on your platform to
open a window into which you can enter operating system commands.
Step 2: Set Operating System Environment Variables Depending on your platform,
you may have to set environment variables before starting SQL*Plus, Setting
Environment Variables in Windows
SET ORACLE_SID=orcl
Step 3: Start SQL*Plus
CONNECTING TO THE
DATABASE WITH SQL*PLUS
Step 4: Submit the SQL*Plus
You submit the SQL*Plus CONNECT statement to initially connect to the Oracle
instance or at any time to reconnect as a different user. The syntax of the CONNECT
statement is as follows:
 CONN[ECT] [logon] [AS {SYSOPER | SYSDBA}]
 Conn sys as sysdba
 ]
STEP 4: SUBMIT THE
SQL*PLUS
(CON.)
Example 1–3 This simple example connects to a local database as user SYSTEM. SQL*Plus prompts for the
SYSTEM user password.
connect system
Example 1–4 This example connects to a local database as user SYS with the SYSDBA privilege. SQL*Plus prompts
for the SYS user password.
connect sys as sysdba
When connecting as user SYS, you must connect AS SYSDBA.
Example 1–5 This example connects locally with the SYSDBA privilege with operating system authentication.
connect / as sysdba
Example 1–6 This example uses easy connect syntax to connect as user salesadmin to a remote database running on
the host dbhost.example.com. The Oracle Net listener (the listener) is listening on the default port (1521). The
database service is sales.example.com. SQL*Plus prompts for the salesadmin user password.
connect salesadmin@"dbhost.example.com/sales.example.com"
Example 1-7 Connecting with Easy Connect Syntax This example uses easy connect syntax to connect as user salesadmin to a remote database running on the host
dbhost.example.com. The Oracle Net listener (the listener) is listening on the default port (1521). The database service is sales.example.com. SQL*Plus prompts for the
salesadmin user password.
connect salesadmin@"dbhost.example.com/sales.example.com"
Example 1-8 Connecting with Easy Connect Syntax with the Service Handler Type Indicated This example is identical to Example 1-7 (page 1-10), except that the
service handler type is indicated.
connect salesadmin@"dbhost.example.com/sales.example.com:dedicated"
Example 1-9 Connecting with Easy Connect Syntax with a Nondefault Listener Port This example is identical to Example 1-7 (page 1-10), except that the listener is
listening on the nondefault port number 1522.
connect salesadmin@"dbhost.example.com:1522/sales.example.com"
Example 1-10 Connecting with Easy Connect Syntax with the Host IP Address This example is identical to Example 1-7 (page 1-10), except that the host IP address is
substituted for the host name.
connect salesadmin@"192.0.2.5/sales.example.com"
Example 1-11 Connecting with an IPv6 Address This example connects using an IPv6 address. Note the enclosing square brackets.
connect salesadmin@"[2001:0DB8:0:0::200C:417A]/sales.example.com"
Example 1-12 Connecting by Specifying and Instance This example specifies the instance to which to connect and omits the database service name. A default database
service must have been specified, otherwise an error is generated. Note that when you specify the instance only, you cannot specify the service handler type.
connect salesadmin@"dbhost.example.com//orcl"
Example 1-13 Connecting with a Net Service Name This example connects remotely as user salesadmin to the database
service designated by the net service name sales1. SQL*Plus prompts for the salesadmin user password.
connect salesadmin@sales1
Example 1-14 Connecting with External Authentication This example connects remotely with external authentication to the
database service designated by the net service name sales1.
connect /@sales1
Example 1-15 Connecting with SYSDBA Privilege and External Authentication This example connects remotely with the
SYSDBA privilege and with external authentication to the database service designated by the net service name sales1.
connect /@sales1 as sysdba
Example 1-16 Connecting as a User with a Service Name This example connects remotely as user salesadmin to the database
service designated by the net service name sales1. The database session starts in the rev21 edition. SQL*Plus prompts for the
salesadmin user password.
connect salesadmin@sales1 edition=rev21
1.3.3.5.1 Syntax of the SQL*Plus CONNECT Command Use the SQL*Plus CONNECT command to initially connect to the
Oracle instance or to reconnect to the Oracle instance.
SYNTAX OF THE SQL*PLUS
CONNECT COMMAND USE
THE SQL*PLUS
Syntax of the SQL*Plus CONNECT Command Use the SQL*Plus CONNECT
command to initially connect to the Oracle instance or to reconnect to the Oracle
instance.
Syntax
CONN[ECT] [logon] [AS {SYSOPER | SYSDBA | SYSBACKUP | SYSDG |
SYSKM}]
The syntax of logon is as follows:
{username | /}[@connect_identifier] [edition={edition_name |
DATABASE_DEFAULT}]
When you provide username, SQL*Plus prompts for a password. The password is
not echoed as you type it. The following table describes the syntax components of
the CONNECT command.
Read table Syntax Component Description in book page 61
DATABASE ADMINISTRATOR
SECURITY AND PRIVILEGES
To perform the administrative tasks of an Oracle Database DBA, you need specific
privileges within the database and possibly in the operating system of the server on
which the database runs. Access to a database administrator's account should be
tightly controlled.
This section contains the following topics:
 The Database Administrator's Operating System Account
 Administrative User Accounts
THE DATABASE
ADMINISTRATOR'S
OPERATING SYSTEM
•ACCOUNT
To perform many of the administrative duties for a database, you must be able to
execute operating system commands. Depending on the operating system on which
Oracle Database is running, you might need an operating system account or ID to
gain access to the operating system.
•if so, your operating system account might require operating system privileges or
access rights that other database users do not require (for example, to perform Oracle
Database software installation).
•Although you do not need the Oracle Database files to be stored in your account,
you should have access to them.
ADMINISTRATIVE USER
ACCOUNTS
Administrative User Accounts Oracle Database provides several administrative user
accounts that are associated with administrative privileges.
 About Administrative User Accounts Administrative user accounts have special privileges required to
administer areas of the database, such as the CREATE ANY TABLE or ALTER SESSION privilege, or
EXECUTE privileges on packages owned by the SYS schema. The following administrative user accounts
are automatically created when Oracle Database is installed:

• SYS
• SYSTEM
• SYSBACKUP
• SYSDG
• SYSKM
ADMINISTRATIVE USER
ACCOUNTS
SYS
When you create an Oracle database, the user SYS is automatically created and granted the DBA role.
All of the base tables and views for the database data dictionary are stored in the schema SYS. These
base tables and views are critical for the operation of Oracle Database.
To maintain the integrity of the data dictionary, tables in the SYS schema are manipulated only by the
database.
They should never be modified by any user or database administrator, and no one should create any
tables in the schema of user SYS. (However, you can change the storage parameters of the data
dictionary settings if necessary.)

Ensure that most database users are never able to connect to Oracle Database using the SYS account.
ADMINISTRATIVE USER
ACCOUNTS
SYSTEM
When you create an Oracle database, the user SYSTEM is also automatically created and granted the DBA role.
The SYSTEM user name is used to create additional tables and views that display administrative information, and internal
tables and views used by various Oracle Database options and tools. Never use the SYSTEM schema to store tables of
interest to non-administrative users.
 SYSBACKUP, SYSDG, and SYSKM
When you create an Oracle database, the following users are automatically created to facilitate separation of duties for
database administrators: SYSBACKUP, SYSDG, and SYSKM.
These users separate duties in the following ways:
SYSBACKUP facilitates Oracle Recovery Manager (RMAN) backup and recovery operations either from RMAN or
SQL*Plus.
SYSDG facilitates Data Guard operations. The user can perform operations either with Data Guard Broker or with
the DGMGRL command-line interface.
SYSKM facilitates Transparent Data Encryption keystore operations.
ADMINISTRATIVE USER
ACCOUNTS
Each of these accounts provides a designated user for the new administrative
privilege with the same name. Specifically, the SYSBACKUP account provides a
designated user for the SYSBACKUP administrative privilege. The SYSDG account
provides a designated user for the SYSDG administrative privilege. The SYSKM
account provides a designated user for the SYSKM administrative privilege.
Operations Authorized by Administrative Privileges

Administrative Privilege Operations Authorized

SYSDBA •Perform STARTUP and SHUTDOWN operations
•ALTER DATABASE: open, mount, back up, or change character set
•CREATE DATABASE
•DROP DATABASE
•CREATE SPFILE
•ALTER DATABASE ARCHIVELOG
•ALTER DATABASE RECOVER
•Includes the RESTRICTED SESSION privilege
This administrative privilege allows most operations, including the ability to view user data. It is the most powerful administrative
privilege.
SYSOPER •Perform STARTUP and SHUTDOWN operations
•CREATE SPFILE
•ALTER DATABASE: open, mount, or back up
•ALTER DATABASE ARCHIVELOG
•ALTER DATABASE RECOVER (Complete recovery only. Any form of incomplete recovery, such as UNTIL TIME|CHANGE|
CANCEL|CONTROLFILE requires connecting as SYSDBA.)
•Includes the RESTRICTED SESSION privilege
This privilege allows a user to perform basic operational tasks, but without the ability to view user data.

SYSBACKUP This privilege allows a user to perform backup and recovery operations either from Oracle Recovery Manager (RMAN) or SQL*Plus.

SYSDG This privilege allows a user to perform Data Guard operations. You can use this privilege with either Data Guard Broker or the DGMGRL command-line interface.

SYSKM This privilege allows a user to perform Transparent Data Encryption keystore operations.
OPERATIONS AUTHORIZED BY
ADMINISTRATIVE PRIVILEGES
The manner in which you are authorized to use these privileges depends upon the
method of authentication that you use.

When you connect with an administrative privilege, you connect with a current
schema that is not generally associated with your username. For SYSDBA, the
current schema is SYS. For SYSOPER, the current schema is PUBLIC. For
SYSBACKUP, and SYSDG, the current schema is SYS for name resolution
purposes. However, the current schema for SYSKM is SYSKM.
OPERATIONS AUTHORIZED BY
ADMINISTRATIVE PRIVILEGES
Example 1-17 Current Schema When Connecting AS SYSDBA This example illustrates that a user is assigned
another schema (SYS) when connecting with the SYSDBA administrative privilege. Assume that the sample user
mydba has been granted the SYSDBA administrative privilege and has issued the following command and statement:
CONNECT mydba
CREATE TABLE admin_test(name VARCHAR2(20));
Later, user mydba issues this command and statement:
CONNECT mydba AS SYSDBA
SELECT * FROM admin_test;
User mydba now receives the following error:
ORA-00942: table or view does not exist
Having connected as SYSDBA, user mydba now references the SYS schema, but the table was created in the mydba
schema.

You might also like