//Table space Create Smallfile tablespace"Zuoye" DataFile ' D:\ORACLE\11G\ORADATA\ORCL\ZUOYE. DBF 'SIZE 100M autoextend on NEXT 100M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT auto//table Empty Space for room repair add alter tablespace"Zuoye" ADD datafile ' D:\ORACLE\11G\ORADATA\ORCL\ZUOYE1. DBF 'SIZE 100M autoextend on NEXT 100M MAXSIZE unlimited//Create user--Create the user create user Zuoye//User nameIdentified by "123654789"//Password defaultTablespace Zuoye//Table SpaceTemporary tablespace TEMP;//Temporary table Space--grant/Revoke Role Privileges Grant connect to Zuoye; //Grant Connect permissionGrant DBA to Zuoye;//Grant DBA Authority//Column contents--Create tablecreate table T_hq_zyl ("Bianh" number notNULL, "Xingm" VARCHAR2 (Ten) notNULL, "XINGB" numberdefault1 notNULL, "NIANL" number notNULL, "Jiatzz" VARCHAR2 (50), "Xins" numberdefault0 notNULL, "GONGZSJ" number notNULL);//Comment--ADD comments to the columns comment on column t_hq_zyl."Bianh" isId; Comment on column t_hq_zyl."XINGM" isName; Comment on column t_hq_zyl."XINGB" is' Gender: male-1; female-2; '; Comment on column t_hq_zyl."Nianl" isAge; Comment on column t_hq_zyl."Jiatzz" is' Home Address '; Comment on column t_hq_zyl."Xins" isSalary; Comment on column t_hq_zyl."GONGZSJ" is' Working hours ';//check, constraint--create/recreate CHECK constraints ALTER TABLE T_hq_zy add constraint check_bianh check (Bianh!=Bianh); ALTER TABLE T_hq_zy add constraint check_nianl CHECK (nianl>20 and Nianl<50ALTER TABLE T_hq_zy add constraint check_xingb CHECK (xingb= 1 or XINGB = 2);
You need to create a tablespace before creating a user.
Be careful to add the suffix name of the tablespace file when creating the Tablespace! For example: Biaokongjian. Dbf.. DBF is a file suffix that needs attention
Creation of database users, creation of table spaces, editing of data