Modify the table to add the default value of the field default

Source: Internet
Author: User

Add one field to the tables in the production database. The field type is INT type, and the table data contains tens of millions. alter table table_name add xxoo number (4) default 0;

Therefore, you must not only modify the dictionary, but also refresh all the data.

1) if there is a default value in ALTER SQL, ORACLE will directly refresh all records.
2) There is no default value in ALTER SQL. ORACLE will only affect subsequent records.

 
Executed in 0.062 seconds

Alter table table_name add xxoo number (4) default 0;
 
Table altered

Where B. lock_id1 = 33784 and a. SID = B. session_id
And a. SQL _ADDRESS = c. ADDRESS;


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.