using find to find files but ignore lost+found

>> Tuesday, 19 September 2017

Because it took me a while to work this out and I know I'll never remember how I did it:

e.g.

/usr/bin/find /path/to/search/ -name "myfile_name_in_some_form*.tar.gz"  -not \( -path ".lost+found" -prune \) -print  -mtime +92 -exec ls {} \;


delete my backup files over 92 days old:

/usr/bin/find /backup/mydir/ -name "mybackupfile*.tar.gz"  -not \( -path ".lost+found" -prune \) -print  -mtime +92 -exec rm {} \;


An alternative:

/usr/bin/find /backup/mydir/ \! -readable -prune -o  -name "mybackupfile_*.tar.gz" -print  -mtime +92 -exec rm {} \;

Read more...

Finding Oracle tablespaces with mixed autoextensible datafiles

>> Monday, 27 February 2017




Two ways to identify tablespaces where some datafiles are autoextend true and some are false.
(Mixing these can cause issues with monitoring, so try to keep them consistent.)


SELECT DISTINCT a.tablespace_name
FROM dba_data_files a
WHERE a.autoextensible ='YES'
AND EXISTS
(SELECT DISTINCT b.tablespace_name
FROM dba_data_files b
WHERE b.autoextensible ='NO'
AND b.tablespace_name=a.tablespace_name )
ORDER BY tablespace_name;



SELECT  ddf2.tablespace_name
FROM
(SELECT DISTINCT ddf.tablespace_name,ddf.autoextensible
FROM  dba_data_files ddf
GROUP BY ddf.tablespace_name,ddf.autoextensible
) ddf2
GROUP BY ddf2.tablespace_name
HAVING  count(1) = 2
ORDER BY ddf2.tablespace_name;





Read more...

ORA-00600: internal error code, arguments: [kkqctdrvCVM(2): More than one CV!]

>> Friday, 18 November 2016


Oracle Database 11g 11.2.0.3.0

ORA-00600: internal error code, arguments: [kkqctdrvCVM(2): More than one CV!], [], [], [], [], [], [], [], [], [], [], []



Sql causing error
/* SQL Analyze(27,1) */ select "foo"."foo" "foo .....


Call Stack
kgeadse kgerinv_internal kgerinv kgeasnmierr kkqctdrvCVM


This error comes out of SQL Tuning Advisor, if you aren't using the tuning advisor disable it:


select client_name, status,attributes,service_name
from dba_autotask_client;

BEGIN
DBMS_AUTO_TASK_ADMIN.disable(
client_name => 'sql tuning advisor',
operation => NULL,
window_name => NULL);
END;
/

select client_name, status,attributes,service_name
from dba_autotask_client;


Read more...

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP