--oracle Database Creation Table space
Create Tablespace New_taspace
--Table space name
DataFile ' D:\NEWTABLESPACE. DBF ' -the data file and location associated with the tablespace
Size 200M --File Initial size
Autoextend on next 20MB MAXSIZE 400MB; --File size can be expanded automatically, 20MB per expansion, Max 400MB
-- CREATE TABLE Space Create - - table space associated data file and location 'D:\NEWTABLESPACE1. DBF'-- file Initial size 200M
--Log file
Logging
Extent Management Local
Segment Space management auto; --End with a semicolon
--Delete the table space Delete the physical files
Drop tablespace new_taspace including contents and datafiles
--Create User
Create User Orders
Identified by 123456
Default Tablespace new_taspace; --Create default tablespace for user
--Give the user a role
Grant Connect,resource to Orders
Grant DBA from Orders
--Revoke the user Administrator role
Revoke DBA from Orders
--Add permission to access a table
Grant SELECT on Tep to Orders
--Create a book table
CREATE TABLE book (
ID number (one) primary key,
BookName varchar2 () NOT NULL,
Price Number (11,2) is not NULL,
Storage number (one) NOT NULL
)
Oracle Database Creation Table Space