SELECT 'create tablespace ' || TABLESPACE_NAME || ' datafile ' || '''c:\oracle_data\' || substr(file_name, instr(file_name,'/', -1)+1) || ''' size ' || BYTES/1024/1024 || 'm
AUTOEXTEND ON NEXT 30M'
|| ' default storage('
|| ' initial 80k'
|| ' next 80k'
|| ' minextents 1'
|| ' maxextents 121'
|| ' pctincrease 80'
|| ' )online;'
as table_space
FROM
(
SELECT E.TABLESPACE_NAME,E.FILE_NAME,E.BYTES, (E.BYTES-SUM(F.BYTES)) RESULT
FROM DBA_DATA_FILES E, DBA_FREE_SPACE F
WHERE E.FILE_ID = F.FILE_ID
GROUP BY E.TABLESPACE_NAME, E.FILE_NAME, E.BYTES
) A
union
select 'create temporary tablesapce npqs_temp tempfile ''c:\oracle_data\npqs_temp.dbf'' size 10240m autoextend on;'
from dual;
;
SELECT 'create tablespace ' || TABLESPACE_NAME || ' datafile ' || '''c:\oracle_data\' || substr(file_name, instr(file_name,'/', -1)+1) || ''' size ' || '10' || 'm
AUTOEXTEND ON NEXT 30M'
|| ' default storage('
|| ' initial 80k'
|| ' next 80k'
|| ' minextents 1'
|| ' maxextents 121'
|| ' pctincrease 80'
|| ' )online;'
as table_space
FROM
(
SELECT E.TABLESPACE_NAME,E.FILE_NAME,E.BYTES, (E.BYTES-SUM(F.BYTES)) RESULT
FROM DBA_DATA_FILES E, DBA_FREE_SPACE F
WHERE E.FILE_ID = F.FILE_ID
GROUP BY E.TABLESPACE_NAME, E.FILE_NAME, E.BYTES
) A
union
select 'create temporary tablesapce npqs_temp tempfile ''c:\oracle_data\npqs_temp.dbf'' size 10M autoextend on;'
from dual;
;
select *
from dba_data_files
where 1=1
and tablespace_name like 'ODS%'
;
select *
from dba_tablespaces
where 1=1
and tablespace_name like '%TEMP%'
;
select *
from dba_users
;
select distinct tablespace_name
from dba_data_files
;
select distinct tablespace_name
from dba_tablespaces
minus
select distinct tablespace_name
from dba_data_files
;
create temporary tablesapce npqs_temp tempfile '' size 10M autoextend on;
'데이터베이스 > 오라클' 카테고리의 다른 글
DB링크 생성 및 조회 (0) | 2021.09.03 |
---|---|
데이타펌프진행상태조회 (0) | 2021.09.03 |
오라클서비스 기동 (0) | 2021.09.03 |
특정테이블만 datapump (0) | 2021.09.03 |
ORACLE / tablespace / 확인 / 수정 / 삭제 / 변경 / 관리 (0) | 2021.09.03 |
댓글