哪些oracle数据库对象可以重命名
哪些oracle数据库对象可以重命名
CLUSTER can’t be renamed.
FUNCTION can’t be renamed.
INDEX ALTER INDEX old_name RENAME TO new_name;
INDEX PARTITION ALTER INDEX index_name RENAME PARTITION partition TO new_name;
INDEX SUB PARTITION ALTER INDEX index_name RENAME SUBPARTITION subpartition TO new_name;
LOB ALTER TABLE T MOVE LOB(lob_column) STORE AS newlogseg_name;
PACKAGE can’t be renamed.
PACKAGE BODY can’t be renamed.
PROCEDURE can’t be renamed.
FUNCTION can’t be renamed.
SEQUENCE RENAME oldseq_name TO newseq_name;
SYNONYM can’t be renamed.
COLUMN ALTER TABLE table_name RENAME COLUMN old TO new;
TABLE RENAME old_table TO new_table;
TABLE PARTITION ALTER TABLE table_name RENAME PARTITION partition TO new_name;
TABLE SUB PARTITION ALTER TABLE table_name RENAME SUBPARTITION subpartition TO new_name;
TRIGGER ALTER TRIGGER old_name RENAME TO new_name;
CONSTRAINT ALTER TABLE table_name RENAME CONSTRAINT old_name TO new_name;
VIEW RENAME old_table TO new_table;
datafile alter database rename file ‘old’ to ‘new’;
logfile alter database rename file ‘old’ to ‘new’;
TABLESPACE ALTER TABLESPACE old RENAME TO new; [10g new]
OUTLINE ALTER OUTLINE old_name RENAME TO new_name;
SCHEMA can’t be renamed.
DATABASE modify db_name in init.ora and recreate controlfile
INSTANCE shutdown;change ORACLE_SID;startup
视图改名例子:
SQL> rename V_TB_IRL_BET_DETA to v_test;
Table renamed
表改名例子
SQL> alter table tb_access_log rename to tb_access;
Table altered