Oracle common script memo

Source: Internet
Author: User
1. Create a table T2 with the structure of table T1
Create Table T2 as select * from T1 where 1 <> 2;

2. Create a table T2 with the structure and data of table T1
Create Table T2 as select * from T1;

3. Modify Michael user to save the tablespace as users, temporary tablespace as temp, and create a 15 m space quota for him in users tablespace.
Alter user Michael default tablespace users temporary tablespace temp quota 15 m on users;

4. Script example of table creation statement, case sensitive
Set echo off
Spool material_test_items.log
Create Table material_test_items
(
Material_test_no VARCHAR2 (6) not null,
Test_date date not null,
Category VARCHAR2 (2) not null,
Mtrl_item_no VARCHAR2 (2) not null,
Mtrl_item_value VARCHAR2 (60) NULL,
Modify_date date null,
Modify_user VARCHAR2 (30) NULL,
Insert_user VARCHAR2 (30) NULL,
Insert_date date null,
Data_owner VARCHAR2 (10) NULL,
CONSTRAINT material_test_items_PK primary key (Material_test_no, Test_date, Category, Mtrl_item_no ))
STORAGE (initialize 65536
Next 1, 65536
Minextents 1
Maxextents 505
Pctincrease 0 );
SPOOL OFF
SET ECHO ON

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.