Pages

Thursday, August 29, 2013

How to Change a Table Name in Oracle

Oracle is a relational database application, meaning that it holds data in multiple tables organized into rows and columns. Each table must have a unique name. The table names often describe the data held within the table so that users know what data can be placed into or retrieved from the table. The tables are named when they are created. The "Alter table" statement is used to change a table name after the table is created.

Instructions

    1

    Log in to the Oracle database. You will be presented with the "SQL>" prompt where you will need to type several statements.

    2

    Type the statement "alter table rename to ;" into the prompt. Replace "" with the original name of the table. Replace "" with the new table name. Press the "Enter" key to change the name of a table.

    3

    Type the statement "select from user_tables;" and replace "" with the new table name. Press the "Enter" key to ensure that the table name has been changed.

    4

    Type the command "quit" and press the "Enter" key to close the connection to the Oracle database.

0 comments:

Post a Comment