Posts

script for zipping files in a directory for linux

 for i in `ls *.*`  do  gzip $i  done

oracle emctl is not working

if oracle emctl is not working or not starting .Need to check down one by one :- 1. is emctl  start responds ? 2. if yes , then check 1158 port is open or not ? 3. if port is not opening then request to IT team to open it , if its opened then move to next step . 4.check the firewall at your end , some times firewall prevents to start the  OracleDbConsoleorcl  services . 5.check the dbsnmp account status ,it may be locked or its password has been expired, unlock it and if require change the password. 6. If everything is OK , then reconfigure the OEM. Here i am sharing the steps to configre the EM from scratch , even if the database is running , please get approval to before run on Production :- 1. Please set the following environment variables ORACLE_SID ORACLE_HOSTNAME 2.Delete DB Control Configuration Files Manually: - Remove the following directories from your filesystem: <ORACLE_HOME>/<hostname_sid> <ORACLE_HOME>/o...

steps to minimize the archive log generations

 steps to minimize the archive log generations ,Few more recommendations, see below:-  1) Regarding the tables that are involved in this data activity/loads.  Please alter the DDL of the tables to avoid redo log generation using options like NOLOGGING. It should boost DB performance significantly.must use  append and nologging hint in the insert query. However, with this kind of change, you should do RMAN database backups immediately after your db loads are finished (for disaster recovery in the future, if needed). 2) Use GLOBAL TEMPORARY tables to store temp activity instead of regular tables. It should cut down redo generation & improve DB performance. 3) Spread your data load & update jobs to different timings, particularly when working on the same tables. It should avoid queuing-up/wait events. 4) Again, ensure redo logs/temp files are stored under different mount points than the data files (basically different controller on the stor...

install/configure em for oracle database

Here i am sharing the steps to configre the EM from scratch , even if the database is running , please get approval to before run on Production :- 1. Please set the following environment variables ORACLE_SID ORACLE_HOSTNAME 2.Delete DB Control Configuration Files Manually: - Remove the following directories from your filesystem: <ORACLE_HOME>/<hostname_sid> <ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid> 3. Delete DB Control Repository Objects Manually Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects: SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP RESTRICT; SQL> EXEC sysman.emd_maintenance.remove_em_dbms_jobs; SQL> EXEC sysman.setEMUserContext('',5); SQL> REVOKE dba FROM sysman; SQL> DECLARE CURSOR c1 IS SELECT owner, synonym_name name FROM dba_synonyms WHERE table_owner = 'SYSMAN'; BEGIN FOR r1 IN c1 LOOP IF r1.owner = 'PUBLIC...

restore UNDO tablespace from RMAN

[oracle@shiven instance]$ sqlplus sys/sys as sysdba SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 3 11:01:08 2014 Copyright (c) 1982, 2010, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> archive log list; Database log mode              No Archive Mode Automatic archival             Disabled Archive destination            /data1/shiven01/dbs/arch Oldest online log sequence     1 Current log sequence           3 SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area  535662592 bytes Fixed Size                  13...

monitoring oracle datapump jobs

Scripts to monitoring oracle datapump jobs :- sqlplus / as sysdba SET lines 200 COL owner_name FORMAT a20; COL job_name FORMAT a20 COL state FORMAT a15 COL operation LIKE owner_name COL job_mode LIKE owner_name SELECT owner_name, job_name, operation, job_mode, state, attached_sessions FROM dba_datapump_jobs; SELECT * FROM DBA_DATAPUMP_SESSIONS; select username,opname,target_desc,sofar,totalwork,message from V$SESSION_LONGOPS; select     substr(sql_text,instr(sql_text,'into "'),30) table_name,     rows_processed, round((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60,1) minutes,    trunc(rows_processed/((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60)) rows_per_minute from       sys.v_$sqlarea  where      sql_text like 'insert %into "%' and command_type = 2 and open_versions > 0;

renice oracle

bash-2.05# renice -n -19 -u oracle bash-2.05# renice -n -19 -p 5022 renice -10 -u oracle