7
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Oracle DB内の特定のTableのDDLを取得する手順

Posted at

1.sqlplusを発行できるサーバへログインする。

2.以下のコマンドを実行する。

<コマンド>
sqlplus / as sysdba

3.以下のコマンドを実行して描画行数を設定する。

<コマンド>
set long 3000;

4.以下のコマンドを実行してDDLを取得する。

<コマンド>
select DBMS_METADATA.GET_DDL('TABLE','TABLE_NAME','SCHEMA_NAME') from dual;

※TABLE_NAME : 参照したいテーブル名に置換すること
※SCHEMA_NAME : 参照したいテーブルのスキーマ名に置換すること

7
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?