Create a tablespace SQL script in Oracle

Source: Internet
Author: User

1. Create a temporary tablespace

Create temporary tablespace TS_TMP

TEMPFILE 'd: \ Oracle \ ORADATA \ TMP. dbf'

SIZE 32 M

AUTOEXTEND ON

NEXT 32 m maxsize 2048 M

Extent management local;

 

2. Create a data table space

Create tablespace TS_DATA

LOGGING

DATAFILE 'd: \ ORACLE \ ORADATA \ TMP \ DATA. dbf'

SIZE 32 M

AUTOEXTEND ON

NEXT 32 m maxsize 2048 M

Extent management local;

 

3. Create a user and specify a tablespace

Create user db identified by db

Default tablespace TS_DATA

Temporary tablespace TS_TMP;

 

4. grant permissions to users

Grant connect, resource to db;

5. Modify the table structure:

Add Field

Alter table docdsp add dspcode char (200)

Delete Field

Alter table table_NAME drop column column_NAME

Modify Field Type

Alter table table_name alter column column_name new_data_type

Rename

Sp_rename

Change the name of the user-created object (such as a table, column, or user-defined data type) in the current database.

Set the primary key:

Alter table yourtable add constraint PK_ID primary key (ID)

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.