2007年7月4日 星期三

那些ORACLE 物件支援重新命名

物件

支援

說明

CLUSTER X -
CONSTRAINT O ALTER TABLE table_name RENAME CONSTRAINT old_name TO new_name
CONTROL FILE o Alter the control_files parameter using the ALTER SYSTEM comamnd.
Shutdown the database.
Rename the physical file on the OS.
Start the database.
COLUMN O ALTER TABLE table_name RENAME COLUMN old_name TO new_name
DATAFILE O Shutdown the database.
Rename the physical file on the OS.
Start the database in mount mode.
Issue the ALTER DATABASE RENAME FILE command to rename the file within the Oracle dictionary.
Open the database.
DATABASE NAME O

SQL>alter system switch logfile;
SQL>alter database backup controlfile to trace;
SQL>shutdown
Modify (and optionally rename) the created trace file:
create new controlfile
modify db_name in init.ora
SQL>STARTUP

FUNCTION X -
INDEX O ALTER INDEX old_name RENAME TO new_name;
INDEX PARTITION O ALTER INDEX index_name RENAME PARTITION ptn_name TO new_name
INDEX SUB PARTITION O ALTER INDEX index_name RENAME SUBPARTITION ptn_name TO new_name
INSTANCE O SQL>SHUTDOWN
change ORACLE_SID (方法參考DATABASE NAME 更名)
SQL>STARTUP
LOB O ALTER TABLE T MOVE LOB(lob_column) STORE AS newlogseg_name;
LOGFILE X

Shutdown the database.
Rename the physical file on the OS.
Start the database in mount mode.
Issue the ALTER DATABASE RENAME FILE command to rename the file within the Oracle dictionary.
Open the database.

OUTLINE O ALTER OUTLINE old_name RENAME TO new_name
PACKAGE X -
PACKAGE BODY X -
PROCEDURE X -
SEQUENCE O RENAME oldseq_name TO newseq_name;
SYNONYM X -
SCHEMA X -
TABLE O RENAME old_table TO new_table;
TABLE PARTITION O ALTER TABLE table_name RENAME PARTITION ptn_name TO new_name;
TABLE SUB PARTITION O ALTER TABLE table_name RENAME SUBPARTITION ptn_name TO new_name
TRIGGER O ALTER TRIGGER old_name RENAME TO new_name
TABLESPACE O ALTER TABLESPACE old_name RENAME TO new_name [10g new]
VIEW O RENAME old_table TO new_table;

1 則留言:

花生狼 提到...

這張表不錯耶……
清楚又明瞭…
存下來使用囉~~