テーブルスペースとユーザーを作成します。
oracleユーザーを切り替えます
su - oracle
データベースへの接続
sqlplus /nolog
conn /as sysdba
一時テーブルスペースを作成し、一時テーブルスペース名とパスが独自に指定することができます
create temporary tablespace MES_TEMP tempfile '${ORACLE_HOME}\oradata\MES_TEMP.bdf' size 100m reuse autoextend on next 20m maxsize unlimited;
表スペースを作成し、テーブルスペースのパス名は、独自に指定することができます
create tablespace MES datafile '${ORACLE_HOME}\oradata\MES.dbf' size 100M reuse autoextend on next 40M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited);
ユーザーを作成し、表スペースを指定
create user mes identified by mes default tablespace MES temporary tablespace MES_TEMP;
またはデフォルトの表スペースを使用
create user mes identified by mes
許可されたユーザへ
grant dba to mes;
grant connect,resource to mes;
grant select any table to mes;
grant delete any table to mes;
grant update any table to mes;
grant insert any table to mes;
ユーザーが作成され、ユーザーは新しいテスト接続を使用することができます
一時テーブルスペースを削除します。
一時テーブルスペースファイルを照会します
select name from v$tempfile;
一時テーブルスペースファイルを削除します。
drop tablespace MES_TEMP including contents and datafiles;
一時テーブルスペースファイルの再クエリ
select name from v$tempfile;
表スペースは、一時的な成功を削除します
削除するには、テーブルスペース
照会テーブル・スペース・ファイル
select name from v$datafile;
表スペースの使用を停止します
alter tablespace MES offline;
表スペースのファイルを削除します。
drop tablespace MES including contents and datafiles;
再検索テーブルスペースファイル
select name from v$datafile;
表スペースが正常に削除しました
ユーザの削除
drop user mes cascade;