Oracle database installation & uninstallation

1. Database version description

1998 Oracle8i: i refers to the internet, indicating that Oracle is developing towards the Internet. Before 8i, the database can only correspond to one instance.
2001 Oracle9i: 8i upgrade, with better performance and more user-friendly management.
2003 Oracle10g: g refers to grid, indicating the use of the Internet. Operates in a lattice computing manner with better performance
2007 Oracle11g: A stable version of 10g, currently the most commonly used in the company
2013 Oracle12c: c refers to cloud, indicating cloud computing, supporting big data processing
2018 Oracle18c: Part of the work is completed independently, reducing Manual workload
Oracle 19c in 2019: a stable version of 12c and 18c

2. Software download and installation

1. Download software

Download 11g through the official website

image.png

If you are not logged in, you need to log in first before downloading.

image.png

After downloading, unzip it

image.png

2.Installation data

After unzipping, go to the first directory and find setup.exe. Just double-click to run.

image.png

Then follow the steps to install it

image.png

Next step

image.png

image.png

Configuration password: unified 123456

image.png

image.png

Installation waiting

image.png

continue waiting

image.png

Password management

image.png

The installation is complete

image.png

You can view the started and running Oracle database in system services.

image.png

Install the method in oracle 11g R2. After successfully installing Oracle 11g, there are a total of 7 services. The meanings of these seven services are:

  1. Oracle ORCL VSS Writer Service: Oracle volume mapping copy writing service, VSS (Volume Shadow Copy Service) allows storage infrastructure devices (such as disks, arrays, etc.) to create high-fidelity point-in-time images, that is, shadow copies. It can create mapped copies on multiple volumes or a single volume without affecting the system performance. (not required to start)
  2. OracleDBConsoleorcl: Oracle database console service, orcl is the instance identifier of Oracle, and the default instance is orcl. When running Enterprise Manager (Enterprise Manager OEM), you need to start this service. (not required to start)
  3. OracleJobSchedulerORCL: Oracle job scheduling (timer) service, ORCL is the Oracle instance identifier. (Not necessary)
  4. OracleMTSRecoveryService: server-side control. This service allows the database to act as a resource manager for Microsoft Transaction Server MTS, COM/COM+ objects and transactions in a distributed environment. (not required to start)
  5. OracleOraDb11g_home1ClrAgent: Part of Oracle Database .NET extended services. (not required to start)
  6. OracleOraDb11g_home1TNSListener: listener service, the service is only needed when the database requires remote access. (It is not necessary to start, as will be explained in detail below).
  7. OracleServiceORCL: database service (database instance), which is the core service of Oracle. This service is the basis for database startup. Only when this service is started, the Oracle database can start normally. (Must be started) So which services need to be started during development? For novices, if you only use Oracle's own sql*plus, you only need to start OracleServiceORCL. If you use third-party tools such as PL/SQL Developer, the OracleOraDb11g_home1TNSListener service must also be enabled. OracleDBConsoleorcl must be enabled to enter web-based EM, and other services are rarely used.
    Note: ORCL is the database instance name. The default database is ORCL. You can create other ones, namely OracleService + database name.

image.png

Service management:

1. Change all services to "Manual"
2. Start two

  1. Listening service: OracleOraDb10g_home1TNSListener listens for client connections
  2. Database service: OracleServiceORCL Naming rule: OracleService+instance name

3.Create database

  When installing the database normally, an orcl database will be installed by default. We can also create a new database through the Database Configuration Assistant. Here's how to do it:

image.png

Enter operation

image.png

Create database

image.png

image.png

Create a unique identification SID for the database

image.png

image.png

Specify password

image.png

image.png

Next step

image.png

Always take the next step. finally completed

image.png

image.png

image.png

Creation completed

image.png

4.PLSQL

Client tool download: https://www.oracle.com/tools/downloads/sqldev-downloads-2143.html

image.png

After decompressing it, run

image.png

Home page after opening

image.png

establish connection

image.png

Enter relevant information:

image.png

Add test. Check if the connection is successful

image.png

Tip: Status: Success. It means our connection is normal

image.png

Click + and we can see the relevant database information.

3. Uninstall the database

1. Close related services

  We enter serviceand close all services related to Oracle

image.png

image.png

3. Uninstall the software

  Find Universal Installer in the search. Double click to start uninstallation

image.png

image.png

Select the Oracle product you want to delete and click Delete

image.png

image.png

Find the deinstall.bat file in the app folder you installed and double-click it.

image.png

After double-clicking: All single sample listeners [LISTENER] specified to be unconfigured appear:

image.png

No permissions need to be opened by administrator

image.png

Then enter OCRL

image.png

The waiting time is relatively long. Enter y to continue

image.png

continue

image.png

At this step, the operation in CMD is completed. Just wait for the CMD interface to disappear automatically.

image.png

3. Delete registration information

  Then we enter the registry and delete the related registration information of oracle. Enter: regedit to enter

image.png

Delete all service names starting with Oracle in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ path

image.png

Delete: All files starting with Oracle in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application registry

image.png

Delete: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE registry

If there are Oracle-related settings in the environment variables, delete them directly. If not, skip this step.

Delete all files in the E:\app directory and follow your installation directory.

Delete the Oracle directory under the C:\Program File directory under the C drive

Then delete the Oracle file C:\user\dpb under the C drive

Note: If you encounter the java.exe program running during the deletion process, press CTRL+shift+esc to enter the task manager and end the task.

After deleting it, restart your computer.

4. Users and permissions

In Oracle, it is generally not easy to create multiple databases on one server. In a database, different projects are accessed by different users. Each user has his own database object created, so the concept of users is very important in Oracle. Oracle users can be created using the CREATE USER command. Its syntax is:

CREATE
USER username IDENTIFIED BY password [ACCOUNT LOCK|UNLOCK]

Description: LOCK|UNLOCK Whether to lock when creating a user, the default is locked state. Locked users cannot log in normally to perform database operations.

Case:

CREATE USER dpb IDENTIFIED BY 123456 ACCOUNT UNLOCK;

image.png

Although the user is successfully created, it cannot log in to the Oracle database system normally because the user does not have any permissions. If the user can log in normally, at least the CREATE SESSION system permission is required.

image.png

Oracle users' rights to database management or object operations are divided into system permissions and database object permissions. System permissions such as: CREATE SESSION, CREATE TABLE, etc. Users with system permissions are allowed to have corresponding system operations. Database object permissions, such as adding, deleting, and modifying data in tables. Users with database object permissions can perform corresponding operations on the objects they own.

Another concept is database role. A database role is a collection of several system permissions. Here are some common roles:

  • The CONNECT role is mainly used for temporary users, especially those who do not need to create tables. They are usually only given the CONNECT role. CONNECT is a simple permission to use Oracle. Users with the CONNECT role can establish a connection session with the server (session, the client connects to the server, called a session).
  • RESOURCE role , more reliable and formal database users can be granted the RESOURCE
    role. RESOURCE provides users with additional permissions to create their own tables, sequences, procedures, triggers, indexes, etc.
  • DBA role, the DBA role has all system permissions - including unlimited space quotas and the ability to grant various permissions to other users. User SYSTEM has the DBA role.

Under normal circumstances, an ordinary user (such as SCOTT) with two roles, CONNECT and RESOURCE, can perform regular database development work.

A certain permission can be granted to a certain role, and permissions and roles can be granted to a certain user. System permissions can only be authorized by the DBA user, and object permissions are authorized by the user who owns the object. The authorization syntax is:

GRANT role|Permission TO user (role)

Case:

image.png

After that, you can dpblog in normally through this account.

Delete user operation:

image.png

Other operations:

//recover permissions

REVOKE
role | Permission FROM user (role)

//Change user's password

ALTER USER username IDENTIFIED BY new password

//Modify the user to be in locked (unlocked) status

ALTER USER usernameACCOUNT LOCK|UNLOCK

image.png

Guess you like

Origin blog.csdn.net/qq_28314431/article/details/132952044