2
0

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コマンドメモ

Last updated at Posted at 2017-03-15

OracleDBを久しぶりに触る。殆ど忘れているので基本的なことからメモしておく。

表領域作成
SQL> CREATE TABLESPACE "TABLESPACE_NAME" DATAFILE
'/path/to/file.dbf' SIZE 8G AUTOEXTEND ON MAXSIZE 24G 
LOGGING ONLINE PERMANENT BLOCKSIZE 8192 
EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO;
テーブル一覧
SQL> select username from user_users;
テーブル一覧
SQL> select username from all_users;
表領域一覧
select TABLESPACE_NAME,FILE_NAME from dba_data_files;
ユーザ確認
SQL> select username from all_users where username = 'ichiro';
テーブル一覧
select table_name, tablespace_name, status from user_tables
接続ユーザ所有オブジェクト確認
select * from user_objects 
where object_type in ('PROCEDURE','FUNCTION','PACKAGE','PACKAGEBODY','TRIGGER');
ストアドプロシージャ実行
SQL> execute test_procedure;
SQL*Plus上でOSコマンド実行
SQL> !ls -l
SQLローダーによるデータインポート
テーブルの作成日時を知る
select object_name, to_char(created,'yyyy/mm/dd hh24:mi:ss') as created from user_objects where object_type = 'TABLE';
LOBデータ一覧
SQL> select segment_name,table_name from dba_lobs where owner = 'ユーザ名';
2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?