Tip: The article was written on 2018/04/24. The daily notes are generally only used as a note and will not do much to explain
The main content of the note: oracle simple structure diagram, create database tablespace user basic authorization
Note Purpose: When building a new project, prepare the basic oracle database for the project
1. Oracle simple structure diagram, the relationship between table space and users and tables
2. Flowchart of Oracle database creation
Note: About why you want to create a temporary table space, please Baidu yourself. If you do not create a table space and temporary table space, then when you create a user, the system default table space and default temporary table space will be used. When you add users, data Increase, if you put them in a table space and a temporary table space ( the system default table space), then you may blow up! ! !
3. Create temporary table space and table space ------------- The previous oracle instance, the dba account creation is omitted.
-- sysdba login -- to create a temporary table space, you need to specify the physical path of the table space file, the file suffix name is dbf -- such as my temporary table space path: E:\zero\life\temp\myTempTablespace.dbf --initial size 1024M , each expansion is 256M, the maximum size is 2048M CREATE TEMPORARY TABLESPACE MY_TEMP_TABLESPACE TEMPFILE 'E:\zero\life\temp\myTempTablespace.dbf' SIZE 1024M REUSE AUTOEXTEND ON NEXT 256M MAXSIZE 2048M; --The syntax for creating a tablespace is the same as for creating a temporary tablespace. The tablespace lacks the TEMPORARY keyword CREATE TABLESPACE MY_TABLESPACE DATAFILE 'E:\zero\life\temp\myTablespace.dbf' SIZE 4096M REUSE AUTOEXTEND ON NEXT 1024M MAXSIZE UNLIMITED; --Keyword description: -- TEMPORARY : Temporary table space, if not added, it will be table space-- TEMPFILE: Specify the path of table space file-- SIZE : Initial file size-- REUSE: Table space file reuse-- AUTOEXTEND ON NEXT: When the initial size is full, automatically expand the size -- MAXSIZE UNLIMITED: the maximum size of the table space, there is no limit
4. Create a user and specify the tablespace and temporary tablespace
--Create user and specify tablespace and temporary tablespace CREATE USER MY_USERNAME IDENTIFIED BY MY_PASSWORD DEFAULT TABLESPACE MY_TABLESPACE TEMPORARY TABLESPACE MY_TEMP_TABLESPACE;
5, grant user login, resource permissions
--Grant user login, resource permissions GRANT CONNECT, RESOURCE TO MY_USERNAME