Abnormal backup processing

Oracle manually executed the export report ora-31634, ora-31664
. The backup task of oracle was deployed on the server through a scheduled task. Recently, it was found that a table space was not backed up successfully. After manual execution, an error was reported. The Baidu search results are as follows

ORA-31634: job already exists (JOB already exists)

ORA-31664: unable to construct unique job name when defaulted (using the default method, can not create a unique JOB name)

Solution:

The first step: query and generate SQL statements to clean up DBA_DATAPUMP_JOBS

1 select 'drop table ' || owner_name || '.' || job_name || ';'
2 from dba_datapump_jobs
3 where state = 'NOT RUNNING'

Copy the generated processing SQL statement and clean up the table DBA_DATAPUMP_JOBS. The example sentences are as follows:

...............
drop table neands3.SYS_EXPORT_SCHEMA_06;
drop table neands3.SYS_EXPORT_SCHEMA_40;
...............

Step 2: After cleaning up, check again to confirm whether DBA_DATAPUMP_JOBS has been cleaned up

1 SELECT owner_name, job_name, operation, job_mode,
2 state, attached_sessions
3 FROM dba_datapump_jobs
4 ORDER BY 1,2;

After the first step is executed, the backup is ready, so the third step is not executed.

Step 3: If the cleanup fails, execute the following statement for processing

EXEC DBMS_DATAPUMP.STOP_JOB(DBMS_DATAPUMP_ATTACH(‘SYS_EXPORT_SCHEMA_02’,’OAK’));

Actually used

select from dba_data_files where tablespace_name = 'USERS';
--2.查看表空间使用率:
select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round(((a.bytes-b.bytes)/a.bytes)
100,2) "percent_used"
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc;

select * from dba_directories;

select 'drop table ' || owner_name || '.' || job_name || ';'
from dba_datapump_jobs
where state = 'NOT RUNNING'

Generated a similar drop table WMS_ZD.SYS_EXPORT_SCHEMA_84; hundred tables execution


Checked the scheduler in jobs to check the PROC_DAY_TASK process

Guess you like

Origin blog.51cto.com/bks2015/2542699