Thursday, 24 July 2014

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>/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' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
/
SQL> DROP USER mgmt_view CASCADE;
SQL> DROP ROLE mgmt_user;
SQL> DROP USER sysman CASCADE;
SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;

The above will completely delete the DB Control repository from the database;
under certain circumstances (e.g. you want to recreate the repository later on)
the following statements may be sufficient to remove the repository:

Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and
management objects:
SQL> drop user sysman cascade;
SQL> drop role MGMT_USER;
SQL> drop user MGMT_VIEW cascade;
SQL> drop public synonym MGMT_TARGET_BLACKOUTS;
SQL> drop public synonym SETEMVIEWUSERCONTEXT;

4. Create the DB Control Repository Objects and Configuration Files
<ORACLE_HOME>bin/emca -config dbcontrol db -repos drop
<ORACLE_HOME>bin/emca -config dbcontrol db -repos create

5. Then check the following:
5.1 emctl start dbconsole (any errors?)
5.2 emctl status dnconsole
5.3 emctl status agent
5.4 emctl upload

Monday, 21 July 2014

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 storage array). Otherwise, there would be lot of contention with the I/O activity resulting in slowness.


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' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
/
SQL> DROP USER mgmt_view CASCADE;
SQL> DROP ROLE mgmt_user;
SQL> DROP USER sysman CASCADE;
SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;

The above will completely delete the DB Control repository from the database;
under certain circumstances (e.g. you want to recreate the repository later on)
the following statements may be sufficient to remove the repository:

Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and
management objects:
SQL> drop user sysman cascade;
SQL> drop role MGMT_USER;
SQL> drop user MGMT_VIEW cascade;
SQL> drop public synonym MGMT_TARGET_BLACKOUTS;
SQL> drop public synonym SETEMVIEWUSERCONTEXT;

4. Create the DB Control Repository Objects and Configuration Files
<ORACLE_HOME>bin/emca -config dbcontrol db -repos drop
<ORACLE_HOME>bin/emca -config dbcontrol db -repos create

5. Then check the following:
5.1 emctl start dbconsole (any errors?)
5.2 emctl status dnconsole
5.3 emctl status agent
5.4 emctl upload