Tuesday, January 31, 2012

ORA-01841: (full) year must be between -4713 and +9999, and not be 0

the solution of this problem is simple;

before starting rman ; setting NLS_LANG  like the example below
export NLS_LANG=.UTF8
echo $NLS_LANG
view raw ORA-01841 hosted with ❤ by GitHub

ORA-00392


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 01/31/2012 11:30:04
ORA-00392: log 2 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 2 thread 1: '/oradata2/database/onlinelog/redolog_22.log'
ORA-00312: online log 2 thread 1: '/oradata1/database/onlinelog/redolog_21.log'
SQL> alter database clear logfile group 2;
Database altered.
 
SQL> alter database drop logfile group 2;

Monday, January 30, 2012

How to enable and disable ALL Jobs in ORACLE

u can use this query to disable or enable all jobs except EXFSYS,ORACLE_OCM,SYS.. u can simply chose in which owners should be not by adding user names at the end of script...

TO DISABLE
select q'! exec dbms_scheduler.disable('!' || OWNER || '.' || JOB_NAME || q'!');!'
from DBA_SCHEDULER_JOBS where enabled='TRUE' and owner not in ('EXFSYS','ORACLE_OCM','SYS')
view raw disable_job.sql hosted with ❤ by GitHub
TO ENABLE
select q'! exec dbms_scheduler.disable('!' || OWNER || '.' || JOB_NAME || q'!');!'
from DBA_SCHEDULER_JOBS where enabled='FALSE' and owner not in ('EXFSYS','ORACLE_OCM','SYS')
view raw enable.sql hosted with ❤ by GitHub


just run outputs...

Enterprise Manager (Emctl) Droping and Recreating..

First of all ;
drop user SYSMAN cascade;
drop user MGMT_VIEW cascade;
drop role MGMT_USER;
drop public synonym MGMT_TARGET_BLACKOUTS;
drop public synonym SETEMVIEWUSERCONTEXT;
drop public synonym MGMT_AVAILABILITY;
view raw drop.sql hosted with ❤ by GitHub
if its needed to set host;
export ORACLE_HOST=ip
view raw export_host hosted with ❤ by GitHub

u can drop by using
emca -deconfig dbcontrol db -repos drop
view raw drop_emca.sql hosted with ❤ by GitHub


or recreating
emca -config dbcontrol db -repos recreate
view raw create_emca.sql hosted with ❤ by GitHub



how to handle with The listener supports no services problem

add these lines in listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC=
(GLOBAL_DBNAME=DB11G)
(ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1)
(SID_NAME=DB11G)
)
)
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST =localhost-ip)(PORT = 1521))
)
)
view raw listener.ora hosted with ❤ by GitHub
dont forget to modify ORACLE_HOME,SID_NAME and HOST....

Creating DB_LINK with dbms_metadata.get_ddl

select dbms_metadata.get_ddl('DB_LINK','db_link_already_created',user) from dual;

dont forget to replace "db_link_already created"