Oracle database installation and use scripts to create the database authorization

Install Database

In fact Oracle installation

 

1 , ready to install

 

Oracle after the installation package download are two archive, select both right-click to decompress compressed package

 

 

 

 

2 , extraction is completed as shown below

 

 

 

 

3 , double-click the setup.exe file to install, the following window will pop up

 

 

 

 

Security Configuration: then will enter the installation interface, then let us fill in the e-mail, the mailbox is not a required option can be filled from time to fill in, do not fill, then there will be a prompt, we can direct disregard of, the next step is to click

 

 

 

 

 

Installation options: Direct Select the default to create and configure a database ( After installing database management software, the system will automatically create a database instance ) .

 

 

 

 

 

Installation Type: We choose the default desktop class

 

 

 

 

 

Typical installation: an important step. Only need to recommend Oracle base directory updates, the directory path do not contain Chinese or other special characters. Global database name can be the default, password and password must be kept in mind. When the password is entered, it prompted a warning, do not meet the Oracel not control when advice.

 

 

 

 

 

Such as the password is too simple, the system will prompt does not meet the oracle standards, we can click on a

 

 

 

 

Summary: When fill in information such as passwords, the system displays all the configuration information, such as we need to modify the configuration click the back can be re-fill, if there is no problem, we just click Finish.

 

 

 

 

 

Product installation: Because Oracle database is relatively large, the installation phase will take some time, we do not do anything directly wait for the system installation is complete.

 

 

 

 

 

File and database management software dbms files after installation, the installation automatically creates an instance of the default database front orcl the name of the database

 

 

 

 

 

After the instance of the database is created, the system will pop up a database of information, directly click OK, we can see that Oracle has been successfully installed. Then click the lower right corner to close the window is closed

 

 

 

 

 

Creating oracle database

Previously developed when used more than is mysql and sql server, oracle with a relatively small, relatively unfamiliar with them, mysql and sql server using up more similar to the oracle and use them in different ways, in the creation of a database of oracle to correspond to a user, database, and users generally correspond, mysql sql server and direct "database name" you can create a database by create databse direct, and create a oracle database requires the following three steps:

 

Create two table spaces (the so-called database) files

Create a user mapping form a relationship with the file created above

Add permissions to users

First, open the SQLPlus   

Connections: Input: scott / tiger Enter

View users: show user

Switch to the system administrator

Input: conn as sysdba

Input: sysdba Enter

Enter the password directly

Show users: show user

Now is the administrator mode, you can create a table space (ie database)

First, create two database files (xxxx.dbf and xxxx_temp.dbf two files)  

This book author orcacle mounted on the disk as follows: D: \ Softs \ Oracle \ product \ 11.2.0 \ dbhome_1 \ oradata \ xxxx.dbf

SQL> create tablespace xxxx logging datafile 'D:\Softs\Oracle\product\11.2.0\dbh

ome_1\oradata\xxxx.dbf' size 100m autoextend on next 100m maxsize 500m extent management local;

 

Second, create a user with the file created above to form a mapping relationship (user name xxxx, password xxxx)

CREATE USER xxxx IDENTIFIED BY xxxx DEFAULT TABLESPACE xxxx (TEMPORARY TABLESPACE xxxx_temp, the sentence may be omitted); 

Third, add permissions 

grant connect,resource,dba to xxxx;

grant create session to xxxx (can be omitted); 

Sometimes used to delete the database and delete the user's operation, delete the statements given here

Fourth, delete the database

DROP TABLESPACE xxxx INCLUDING CONTENTS AND DATAFILES;  

Fifth, delete users

drop user mxxxx cascade;

 

The above-described specific operations as follows:

SQL * Plus: Release 11.2.0.1.0 Production on Monday, April 1 14:13:05 2019

Copyright (c) 1982, 2010, Oracle. All rights reserved.

 

Please enter your user name: scott / tiger

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show user

USER 为 "SCOTT"

SQL> conn as sysdba

Please enter your user name: sysdba

Password:

connected.

SQL> show user

USER 为 "SYS"

SQL> create tablespace xxxx logging datafile 'D:\Softs\Oracle\product\11.2.0\dbh

ome_1\oradata\xxxx.dbf' size 100m autoextend on next 100m maxsize 500m extent ma

nagement local;

 

Table space has been created.

SQL> create user xxxxbdc identified by xxxxbdc default tablespace xxxx;

User has created.

 

SQL> grant connect,resource,dba to xxxxbdc;

Authorization successful.

SQL>

 

Navicat Premium using a script or PL / SQL to perform database xxxx construction of the table, you can create a data table, here is a script to create data tables

Script: omitted. . .
----------------
Disclaimer: This article is the original article CSDN bloggers "longtenggenssupreme", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/LongtengGensSupreme/article/details/100918229

Guess you like

Origin www.cnblogs.com/1175429393wljblog/p/11532131.html