Article directory
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
If you are not logged in, you need to log in first before downloading.
After downloading, unzip it
2.Installation data
After unzipping, go to the first directory and find setup.exe. Just double-click to run.
Then follow the steps to install it
Next step
Configuration password: unified 123456
Installation waiting
continue waiting
Password management
The installation is complete
You can view the started and running Oracle database in system services.
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:
- 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)
- 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)
- OracleJobSchedulerORCL: Oracle job scheduling (timer) service, ORCL is the Oracle instance identifier. (Not necessary)
- 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)
- OracleOraDb11g_home1ClrAgent: Part of Oracle Database .NET extended services. (not required to start)
- 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).
- 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.
Service management:
1. Change all services to "Manual"
2. Start two
- Listening service: OracleOraDb10g_home1TNSListener listens for client connections
- 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:
Enter operation
Create database
Create a unique identification SID for the database
Specify password
Next step
Always take the next step. finally completed
Creation completed
4.PLSQL
Client tool download: https://www.oracle.com/tools/downloads/sqldev-downloads-2143.html
After decompressing it, run
Home page after opening
establish connection
Enter relevant information:
Add test. Check if the connection is successful
Tip: Status: Success. It means our connection is normal
Click + and we can see the relevant database information.
3. Uninstall the database
1. Close related services
We enter service
and close all services related to Oracle
3. Uninstall the software
Find Universal Installer in the search. Double click to start uninstallation
Select the Oracle product you want to delete and click Delete
Find the deinstall.bat file in the app folder you installed and double-click it.
After double-clicking: All single sample listeners [LISTENER] specified to be unconfigured appear:
No permissions need to be opened by administrator
Then enter OCRL
The waiting time is relatively long. Enter y to continue
continue
At this step, the operation in CMD is completed. Just wait for the CMD interface to disappear automatically.
3. Delete registration information
Then we enter the registry and delete the related registration information of oracle. Enter: regedit to enter
Delete all service names starting with Oracle in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ path
Delete: All files starting with Oracle in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application registry
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;
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.
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:
After that, you can dpb
log in normally through this account.
Delete user operation:
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