Oracle Database シノニムをリネームする
- 作成日 2023.11.24
- Oracle Database
- Oracle Database
Oracle Databaseで、シノニムをリネームする手順を記述してます。「RENAME」を使用することで可能です。ここでは、実際に実行した結果を画像で掲載してます。
環境
- OS windows11 home
- Oracle Database 21c Express Edition
- SQL Developer 21.2.1.204
手順
シノニムをリネームするには、「RENAME」を使用します。
RENAME シノニム名 TO 変更したいシノニム名;
実際に、「BAR」というシノニムを「BAR2」に変更してみます。
RENAME BAR TO BAR2;
実行結果を見ると変更されていることが確認できます。
publicなシノニムのリネーム
publicなシノニムを変更しようとするとエラーとなります。
※publicなシノニムはリネームができません。
RENAME PBAR TO PBAR2
エラー・レポート -
ORA-04043: オブジェクトPBARは存在しません。
04043. 00000 - "object %s does not exist"
*Cause: An object name was specified that was not recognized by the system.
There are several possible causes:
- An invalid name for a table, view, sequence, procedure, function,
package, or package body was entered. Since the system could not
recognize the invalid name, it responded with the message that the
named object does not exist.
- An attempt was made to rename an index or a cluster, or some
other object that cannot be renamed.
*Action: Check the spelling of the named object and rerun the code. (Valid
names of tables, views, functions, etc. can be listed by querying
the data dictionary.)
-
前の記事
Dart リスト(配列)の値を範囲を指定して削除する 2023.11.24
-
次の記事
mac 起動しているアプリを切り替えるショートカットキー 2023.11.24
コメントを書く