Thursday, February 14, 2013

EM12c Startup & Shutdown scripts

Hi,

Here below are the 2 scripts for bouncing process of EM12c Server including repository services and Databases.

Slightly hardcoded for Agent/OMS Locations.

Stop12c.sh



export ORACLE_SID=em12c

. /home/oracle/em12c.env
echo ""
echo "Stopping EM Agent..."
echo ""
/e01/app/oracle/Middleware/agent/agent_inst/bin/emctl stop agent
echo ""
echo "Stopped EM Agent..."

echo ""
echo "Stopping OMS Services..."
echo ""
/e01/app/oracle/Middleware/oms/bin/emctl stop oms -all
echo ""
echo "Stopped OMS Services..."

echo ""
echo "Stopping Database Listener..."
echo ""
$ORACLE_HOME/bin/lsnrctl stop
echo ""
echo "Stopped Database Listener..."

echo ""
echo "Shuting down EM respository database..."
echo ""
sqlplus "/ as sysdba" << EOF
shutdown immediate;
exit;
echo ""
echo "EM respository database is down now..."
EOF

echo ""
echo "12c Grid Shutdown is Complete..."
echo ""


Start12c.sh

export ORACLE_SID=em12c

. /home/oracle/em12c.env
echo ""
echo "Starting EM respository database..."
echo ""
sqlplus "/ as sysdba" << EOF
startup;
exit;
echo ""
echo "EM respository database is UP..."
EOF

echo ""
echo "Starting Database Listener..."
echo ""
$ORACLE_HOME/bin/lsnrctl start
echo ""
echo "Database Listener is UP..."

echo ""
echo "Starting OMS Services..."
echo ""

/e01/app/oracle/Middleware/oms/bin/emctl start oms
echo ""
echo "OMS Services are UP..."

echo ""
echo "Starting EM Agent..."
echo ""
/e01/app/oracle/Middleware/agent/agent_inst/bin/emctl start agent
echo ""
echo "EM Agent is UP..."

echo ""
echo "Grid Startup is Complete..."
echo ""


Sunday, February 10, 2013

How to Increase Java Memory in Windows 7

Running Java applications in computers takes some memory during the process which is known as Java memory (Java heap). Frequently, it is necessary to increase that heap to prevent throttling the performance of the application. This is how to for Windows 7.


  1. Go to Control Panel. Click on "Start" button. Then click on "Control Panel."

    Java Persistence Tools

    OpenJPA, Toplink, Hibernate Suppt No Lock-in, Eclipse-Based
    www.myeclipseide.com
  2. 2
    Find Programs
    Find Programs
    Select Programs. In the left side of Control Panel click on "Programs." Pleas click on the "Programs" written with green color, not the "Uninstall a program," which is in blue color.
  3. 3
    Find Java
    Find Java
    Go to Java settings. In the next dialog click on "Java," usually at the bottom of the other Programs; "Java Control Panel" dialog pop-up opens.
  4. 4
    Find Java Tab
    Find Java Tab
    Select "Java" tab. Inside the Java tab, click on "View" button. It opens the "Java Runtime Environment Settings"
  5. 5
    View Java Runtime Environment
    View Java Runtime Environment
    Change amount of heap. In the "Runtime Parameters" column change the value, or if it is blank decide for the new value, of the Java memory.
  6. 6
    Modify Runtime Parameter
    Modify Runtime Parameter
    Modify the parameter. To modify the parameter, double click in the "Runtime Parameters" column and,
    • type -Xmx512m that assigns 512MB memory for the Java.
    • type -Xmx1024m that assigns 1GB memory for the Java.
    • type -Xmx2048m that assigns 2GB memory for the Java.
    • type -Xmx3072m that assigns 3GB memory for the Java, and so on.
    • Please note, it begins with a minus sign and ends to an m.
    • Also note, there is no blank space between characters.
  7. 7
    Close the dialogue box. Click on "OK" button on the "Java Runtime Environment Settings" to close it.
  8. 8
    Close Java dialogue box. "Apply" button in the "Java Control Panel" has been enabled now. You should click on "Apply" to finalise the new Java memory. Then click on the "OK" button.
  9. 9
    Close the Windows 7 Control Panel.
    Tips
  • No restart of the computer is necessary after modifying the Java memory.
  • This is a 'temporary' amount of memory which is available to Java applications when you are running them. It does not "steal" or permanently deduct from the memory of computer. It is only a guarantee for Java Virtual Machine.
  • The value you select depends on how much memory your computer has and how much memory all running processes consume.
  • If Java cannot find enough memory it dispatches an "exception" message to the Windows as, "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space."
  • This method with some modification also can be used for Windows Xp
  • This method also can be used for Windows 8.