CREATE tablespace shopping
datafile ' D:\oracle\mypc\oradata\orcl\shopping.dbf ' SIZE 20M
autoextend on;
Create user shopping--creating username
identified by shopping-password password character
default tablespace shopping--default table space table space name
tem Porary Tablespace Shopping; --Temporary tablespace table space name
--gives permission
Grant connect to shopping with admin option;
--Role
Grant DBA to shopping with admin option;
Use SQL Plus to log in to the Administrator account and to grant DBA authority to shopping users
Grant DBA to Shopping;
The following is the automatic growth step for setting ID:
1, build the table
2. Construction sequence
3. Building triggers
Insert Auto Grow ID
INSERT into table_name (ID)
VALUES (bill_seq_id. Nextval);
Note: Later I encountered a problem, because my table has the field data is empty, the actual table design is not empty, I inserted the insert sentence of the data "NULL", so when inserting the automatic growth ID error:
Modify a table field check to be empty, unless the ID, the other fields can be empty, if not null, then the field data to be really not NULL to
Turn from: https://www.cnblogs.com/sincoolvip/p/5910751.html