All basic Oracle operations

Source: Internet
Author: User

I. constraint operations
1: Change the constraint name:
Alter table TName rename constraint oldname TO newname;
2: delete Constraints
Alter table TName drop constraint cname
3: Stop Constraints
Alter table TName modify constraint cname DISABLE;
4: restrictions on use
Alter table TName modify constraint cname enable validate;
5. Add Constraints
Alter table TName add constraint cname foreign key (ORG_ID) REFERENCES ref_table (ORGID );
2. Field operations
1: Change the field data type:
Alter table TName MODIFY (ORG_ID VARCHAR2 (50 BYTE ));
2: change the data length of a field:
Alter table TName MODIFY (ORG_ID VARCHAR2 (80 BYTE ));
3. Modify the column name of a table.
Alter table TName rename column xx to yy;

Iii. Table operations
1: Delete table data:
Truncate table TName;
2: copy the empty table structure
Create table new_table as select * from old_table where 1 = 2;
3: copy a table (including records)
Create table new_table as select * from old_table;

Iv. Stored Procedure
1: command line compilation Stored Procedure
Alter procedure procedure_name COMPILE;

5. Database Link)
1. Establish a database connection
Create database link DBaseLinkName connect to UserName identified by Password USING 'netservicename ';

  • 1
  • 2
  • 3
  • Next Page
[Content navigation]
Page 1st: Full Oracle Operation Records Page 2nd: Full Oracle Operation Records
Page 3rd: Full Oracle Operation Records

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.