Oracle creates user, tablespace, and specifies tablespace for index __oracle

Source: Internet
Author: User
Tags create index

-----------Case one: Create table spaces and users

/* 1th step: Create temporary table space/*
Create temporary tablespace ivms86x0_temp----test successfully. Note: The table space name can not be repeated, even if the storage location is inconsistent, but the DBF file is consistent
Tempfile ' I:\oracle\oradata\oracle11g\IVMS86X0_TEMP.dbf '
Size 50m---50m for tablespace sizes, recommended for large data volume 20G, even 32G
Autoextend on
Next 50m maxsize 20480m
Extent management Local;

/* 2nd step: Create a datasheet space/*
Create tablespace ivms86x0_data----test successfully.
Logging
DataFile ' I:\oracle\oradata\oracle11g\IVMS86X0_DATA.dbf '
Size 50m
Autoextend on
Next 50m maxsize 20480m
Extent management Local;

/* 3rd step: Create user and specify Tablespace/
Create user IVMS86X0_WJ identified by IVMS86X0_WJ---test succeeded.
Default Tablespace ivms86x0_data
Temporary tablespace ivms86x0_temp;

/* 4th step: Granting user permission
--grant Connect,resource to IVMS86X0_WJ; ---test was successful.

Grant CONNECT,RESOURCE,DBA to IVMS86X0_WJ; -----Create permissions before you can connect the test successfully.


/* Delete table space and user/*

Drop user IVMS86X0_WJ cascade; ---Remove all objects from the user successfully in the delete user test.
--drop tablespace yuanmin_data including contents;
--drop tablespace yuanmin_temp including contents;


Drop tablespace ivms86x0_data including contents and datafiles deletes tablespace-----, including file test success.
Drop tablespace ivms86x0_temp including contents and datafiles deletes tablespace-----, including file test success.

-----Delete User tablespace and delete user, there is no successive test success.

----Experience Summary ...
----There is a situation
-A user is in use when performing the drop tablespace ivms86x0_data including contents and datafiles, causing the drop user IVMS86X0_WJ cascade to
--execution, and the corresponding table space file can not be deleted at this time, disconnect the IVMS86X0_WJ user, you can manually delete the table space file


----Case TWO: Specify Tablespace for table index

--STEP0: Create Tablespace P201507

Create tablespace P201507----test successfully.
Logging
DataFile ' I:\oracle\oradata\oracle11g\P201507.dbf '
Size 50m
Autoextend on
Next 50m maxsize 20480m
Extent management Local;

--STEP2: Create an index and specify the table space

CREATE INDEX Idx_vehiclepass_com3
On Traffic_vehicle_pass (Plate_no, Pass_time, crossing_id) tablespace P201507; --Specify Tablespace for index

-----Case Three: Modify the size of the table space after the Oracle tablespace (data file) is full

1, expand the table space

ALTER DATABASE DataFile ' D:\ORACLE\PRODUCT\ORADATA\TEST\USERS01. DBF ' resize 50m;


2, automatic growth

ALTER DATABASE DataFile ' D:\ORACLE\PRODUCT\ORADATA\TEST\USERS01. DBF ' autoextend on next 50m maxsize 500m;

3. Add data files

Alter tablespace yourtablespacename add datafile ' d:\newtablespacefile.dbf ' size 5m;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.