select * from v$version;
Create Tablespace DATA_TEST
datafile 'D:\oracle_test\test.dbf' Size 2G
autoextend On
maxsize UNLIMITED
extent management local;
select * from dba_data_files where tablespace_name='DATA_TEST';
ALTER DATABASE DATAFILE 'D:\ORACLE_TEST\TEST.DBF' RESIZE 3G;
ALTER TABLESPACE DATA_TEST ADD DATAFILE 'D:\ORACLE_TEST\TEST01.DBF' size 3G;
ALTER DATABASE DATAFILE 'D:\ORACLE_TEST\TEST01.DBF' AUTOEXTEND ON NEXT 200M MAXSIZE UNLIMITED;
SELECT a.tablespace_name,
(a.bytes) / (1024 * 1024* 1024) total,
(b.bytes) / (1024 * 1024* 1024) used,
(c.bytes) / (1024 * 1024* 1024) free,
(b.bytes * 100) / a.bytes "% USED ",
(c.bytes * 100) / a.bytes "% FREE "
FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c
WHERE a.tablespace_name = b.tablespace_name
AND a.tablespace_name = c.tablespace_name;
Create Table ac_real_data(
record_time timestamp(3),
ac_1 Float,
ac_2 Float
)
nologging
Tablespace DATA_TEST;
create or replace procedure proc_update_AC1 as
begin
update ac_real_data set ac_1 =0;
commit;
end;
declare
job number;
BEGIN
DBMS_JOB.SUBMIT(
JOB => job, /*自动生成JOB_ID*/
WHAT => 'proc_update_AC1 ;', /*需要执行的存储过程名称或SQL语句*/
NEXT_DATE =>sysdate+5/(24), /*初次执行时间-下5个小时*/
INTERVAL => 'TRUNC(sysdate+1)+1/24' /*每天凌晨1点执行*/
);
commit;
end;
INTERVAL => ‘trunc(sysdate,’‘mi’‘)+5/(24*60)’ /每隔5分钟执行一次/
--1.删除数据
delete from ac_real_data where ac_1 =0;
--2.清高水位
ALTER TABLE SYS_INTERFACE_LOG MOVE
--3.重建索引(如需要)
ALTER INDEX INDEX_AC1 REBUILD;