In the morning, a friend in the forum encountered the following error when trying to invalidate the index:
ORA-02243: the alter index or alter materialized view option is invalidThe statement used is as follows:
Alter index index_name disable;
When I first saw it, I thought it was because of constraints, so I could not disable the index, because I remember that
ALTER TABLE allows you to modify the structure of an existing table. For example, you can add or delete columns, create or eliminate indexes, change the type of existing columns, or rename columns or the table itself. You can also change the annotation of the table and the type of the table.You can rename a column using the change old_col_name create_definition clause. In order to do so, specify the old and new column names and the current types of co
1 alter Database: modify data files
Alter database datafile 4 offline;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' offline;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' resize 100 m;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' auto
DB2 Alter Table introduction and use of normal Table modification and creation, you need to consider the following two situations: 1. when data is stored in a table, you can only modify the Data Type of the column to a compatible data type, or keep the original data type unchanged, the length is reduced (cannot be smaller than the maximum length of the stored value), or the table length is increased. 2. modification without data columns in the table c
This section describes how to use the alter table statement to modify a table. The alter table statement can execute the following tasks:
1. Add, modify, or delete Columns
2. add or delete Constraints
3. enable or disable Constraints
1. Add a column (alter table table_name add column name type)
(1) Add a column named modified_by to order_status2, whose type is in
Name
Alter table -- change the definition of a table
Synopsis
ALTER TABLE [ ONLY ] name [ * ] action [, ... ]ALTER TABLE [ ONLY ] name [ * ] RENAME [ COLUMN ] column TO new_columnALTER TABLE name RENAME TO new_nameALTER TABLE name SET SCHEMA new_schemawhere action is one of: ADD [ COLUMN ] column data_type [ COLLATE collation ] [ column_constraint
This article mainly introduces how to use the ALTER command in MySQL, which is the basic knowledge in MySQL beginners. it is very useful for anyone who needs it to refer to the ALTER command in MySQL, if you want to change the table name, table field, or add or delete an existing table column.
Let's start to create a table named testalter_tbl:
root@host# mysql -u root -p password;Enter password:*******mys
MySQL ALTER and mysqlalter
When we need to modify the data table name or field, we need to use the MySQL ALTER command.
Before starting this chapter, let's create a table named testalter_tbl.
root@host# mysql -u root -p password;Enter password:*******mysql> use TUTORIALS;Database changedmysql> create table testalter_tbl -> ( -> i INT, -> c CHAR(1) -> );Query OK, 0 rows affected (0.05 sec)mysql>
Label:Lin Bingwen Evankaka Original works. Reprint please specify the source Http://blog.csdn.net/evankaka This article explains in detail the use of the ALTER command in MySQL syntax, which is a much more useful syntax, and the functionality is very powerful. [SQL]View PlainCopy
Use learning; (to be built in advance)
CREATE TABLE student (id INT not NULL,
Name CHAR (Ten) is not NULL,
Class INT not NULL,
Age INT
)
Label:
SQL Example 4–alter
SQL Create
/etc/my.cnf
character show create database test; alter Database Test character set
UTF8; alter database Test character set GBK; show create
Table user1; alter table user1 character
set GBK;
We need to use the MySQL alter command when we need to modify the data table names or modify the field of the data tables.Before starting this tutorial, let's create a table with the table named: Testalter_tbl.[Email protected]# mysql-u root-p password; Enter password:*******mysql> use tutorials;database changedmysql> CREATE TABLE testalter_tbl - > i INT, C CHAR (1) ); Query OK, 0 rows affected (0.05 sec) mysql> SHOW COLUMNS from testalter_tb
1Alter database: Modify data files
Alter database datafile 4 offline;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' offline;
Alter database datafile '/opt/oracle/datafile/users01.dbf' resize 100 M;
Alter database datafile '/opt/oracle/datafile/users01.dbf' autoextend on next 100 M maxsize 1000 M;
Label:ALTER Table Statement to add, modify, or delete columns in an existing table 1.ADD [Column] column name (column definitions) [first or after column_name] Adds a column and can specify that the column be added before or after a column name (column_name) 2. ADD INDEX [index_name] (column_list) Increase the index of a column 3.ADD PRIMARY KEY (column_list) Increase the primary key of a column 4.ADD UNIQUE [index_name] (column_list) Add a column's unique constraint 5.
Some syntaxes add fields: ALTERTABLEtable_nameADDfield_namefield_type; modify the original field name and type: ALTERTABLEtable_nameCHANGE
Some syntaxes ADD fields: alter table table_name ADD field_name field_type; modify the original field name and type: alter table table_name CHANGE
Homepage → Database Technology
Background:Read News
MySQL alter
Mysql changes the table structure: add, delete, modify, and adjust the field order to add a field: altertable 'user _ movement_log 'AddcolumnGatewayIdintnotnulldefault0AFTER 'regionid' (after which field is added) Delete the field: altertable 'user _ movement_log 'dropcolumnGatewayi
Mysql changes the table structure: add, delete, modify fields, adjust the field order to add fields: alter table 'user _ movement_log 'Add column GatewayId int not null de
Label:In MySQL5.5 and previous versions, performing an alter operation on a large table (over millions of records) in a running production environment is a difficult task. Because the table and lock table will be rebuilt, affecting the user's use. It is therefore important to know when the alter operation will end. Even when the CREATE index is executed. If Fast_index_creation is enabled, the table is not r
If you have a string in an SQL statement that is enclosed in a single or double quotation mark, you need to be consistent in the same table, or you will see a "Row not found" error.
Use of ALTER statements the use of ALTER statements requires that the structure be modified to use an ALTER statement, as follows: The ALTER
ArticleDirectory
Drop table
ALTER TABLE
Loading files into table
Join
Hive official documentation on the query language has a very detailed description, please refer to: http://wiki.apaCHE.org/hadoop/hive/?agemanual. Most of the content in this article is translated from this page. Some things to be noted during use are added.
C Reate table
CReate [External] Table [if not exists] table_name [(COl_name data_type [COmmentCOl _
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.