Saturday, April 12, 2014

How to control Oracle Management Agent .... Part 2 (How to control Oracle Management Agent in Windows)

How to stop, start Management Agent on Windows

Installation of Oracle Management Agent on a Windows system, creates one new service in the Services control panel.
From that control pannel you can start and stop the services

Component Service Name Format Description
Oracle Management Agent
  OracleAgent
For example:

OracleOraHome1Agent
 Use this to start and stop the Management Agent.


If you have problem in stoping in Windows NT platform (not to other Windows platforms, such as Windows 2000 or Windows XP systems) You can also use the below command to stop agent.

$PROMPT> \bin\emctl istop agent
After stopping the Management Agent using the emctl istop agent command, start the Management Agent using the Services control panel.


How to check the Status of the Management Agent on Windows:

To check the status of the Management Agent on Windows systems:

1.Change directory to the following location in the AGENT_INSTANCE_HOME directory:

AGENT_INSTANCE_HOME\bin
2.Enter the following emctl command to check status of the Management Agent:

$PROMPT> emctl status agent

How to control Oracle Management Agent ....Part 1

How to control Oracle Management Agent

Below are the activities mainly requeired for working with OEM Agent. We need the emctl utility to control this.


  1. How to stop, start, and check status of Management Agent on UNIX
  2. How to stop, start Management Agent on Windows
  3. How to check the Status of the Management Agent on Windows
  4. How to troubleshoot Errors related to startup of Management Agent 


How to stop, start, and check status of Management Agent on UNIX:

When you start the agent on UNIX systems, it starts the parent watchdog process and the child Java process for the agent. The watchdog monitors the agent Java process and attempts to start it if it fails abnormally.

To start, stop, or check the status of the Management Agent on UNIX systems:

1.You have to go to the AGENT_INSTANCE_HOME/bin directory.

2.Need to run the emctl command with appropriate parameter

Below is an example to stop an agent

$PROMPT> cd AGENT_INSTANCE_HOME/bin
$PROMPT> emctl stop agent

Command:
emctl start agent
 Starts the Management Agent

emctl stop agent
 Stops the Management Agent

emctl status agent
 it shows the status

$ ./emctl status agent
Oracle Enterprise Manager 12c Release 3 Cloud Control 12.1.0.3.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version     : 12.1.0.2.0
OMS Version       : 12.1.0.2.0
Protocol Version  : 12.1.0.1.0
Agent Home        : /scratch/aime/work/agtbase7453/agent_inst
Agent Binaries    : /scratch/aime/work/agtbase7453/core/12.1.0.3.0
Agent Process ID  : 7834
Parent Process ID : 7781
Agent URL         : https://slc01lwi.us.oracle.com:3872/emd/main/
Repository URL    : https://slc01lwi.us.oracle.com:4900/empbs/upload
Started at        : 2013-06-05 01:33:33
Started by user   : aime
LLast Reload       : (none)
Last successful upload                       : 2013-06-20 22:17:50
Last attempted upload                        : 2013-06-20 22:17:50
Total Megabytes of XML files uploaded so far : 20.08
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 62.89%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2013-06-20 22:17:49
Last successful heartbeat to OMS             : 2013-06-20 22:17:49
Next scheduled heartbeat to OMS              : 2013-06-20 22:18:49
---------------------------------------------------------------

Important OS command related to printer

Please go thoroughly with the below commands in OS uses.

  1. lpadmin
  2. lpstat
  3. lpoptions 

lpadmin -p -E -v 'socket://:9100' -m -D 'Description' -L 'Lebel'
lpstat -a
lpoptions -d printer_name

Friday, January 24, 2014

How to collect Memory utilization in linux

How to collect Memory utilization

Ran the below command

sar -rq 1
Linux 2.6.31-201.18.1.el5uek (abcdef.testing.com)    01/25/2014

01:28:07 AM kbmemfree kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused  %swpused  kbswpcad
01:28:08 AM  14303340 250232948     94.59   1688944 144753888  25165816         0      0.00         0

01:28:07 AM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
01:28:08 AM         2      2085      1.34      1.39      1.36

Average:    kbmemfree kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused  %swpused  kbswpcad
Average:     14303340 250232948     94.59   1688944 144753888  25165816         0      0.00         0

Average:      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
Average:            2      2085      1.34      1.39      1.36

Memory utilization = (kbmemused-kbcached-)*100/(kbmemfree+kbmemused)

Some uses
Memory utilization = (kbmemused-kbcached-kbbuffers)*100/(kbmemfree+kbmemused)

Thursday, January 23, 2014

How to restart Oracle Standby Database(DR Database)

How to restart Oracle Standby Database(DR Database)

1. First stop the managed recovery with the below command. in standby database
              alter database recover managed standby database cancel;
2. Once it is done you have to stop the database using the srvctl or by sqlplus.
3. Startup standby database to mount stage
              startup mount;
4. Then you have to start the managed recovery.
              alter database recover managed standby database using current logfile disconnect from session;

How to move or rename a datafile of a tablespace in oracle database

Datafile movement 12c Database Code

ALTER DATABASE MOVE DATAFILE '+DATA/orcl/datafile/orcl_custom.702.836915343' TO '+DATA_BKP/orcl/datafile/orcl_custom.702.836915343';


In 12c Database you need not have to make the datafile offline to do the changes. You can do it online. It is a new feature. 

For other version you need to follow the below steps.

step1: Bring the datafile offline
ALTER DATABASE DATAFILE '+DATA/orcl/datafile/orcl_custom.702.836915343' OFFLINE;
step 2: Nove the datafile to new location
rman target /
COPY DATAFILE '+DATA/orcl/datafile/orcl_custom.702.836915343' TO '+DATA_BKP';
step 3: Rename the datafile with new details with alter database  
ALTER DATABASE RENAME FILE '+DATA/orcl/datafile/orcl_custom.702.836915343'
TO '+DATA_BKP/orcl/datafile/';
step 4: Make a copy of datafile
rman target /
SWITCH DATAFILE '+DATA_BKP/orcl/datafile/' TO COPY;
step 5: Recover the datafile
RECOVER DATAFILE '+DATA_BKP/orcl/datafile/';
step 6: Bring the datafile online
ALTER DATABASE DATAFILE '+DATA_BKP/orcl/datafile/' ONLINE;

Tuesday, January 21, 2014

How to take a snapshot in oracle Database

To create a snapshot you have to run the below command in oracle database.

EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;

New snapshot with snap id will be generated.

Troubleshooting ACFS-07981: Metadata Validation Errors

  Troubleshooting ACFS-07981: Metadata Validation Errors Introduction The ACFS-07981 error indicates that an attempt to run an online file ...