Auto Start Enterprise Manager Cloud Control Agent 12c Oracl

Embed Size (px)

DESCRIPTION

Auto Start Enterprise Manager Cloud Control Agent 12c Oracl with Oracle restart

Citation preview

  • Tweet 34

    Oracle Class Wissem All AboutOracle

    Wissem All About Oracle

    HOMEBOOKSARTICLESREVIEWSINTERVIEWSWEBINARFORUMNOSQLABOUT MEBLOG

    Auto Restart Enterprise Manager Cloud ControlAgent 12c;

    March 5th, 2012 | Posted in 11gR2, 12c, Blog, enterprise manager, RAC | 3 Comments

    2 pessoas curtiram isso.CurtirCurtir

    Introduction:

    Oracle Restart is a component added to the 11gR2 in order to improve the highavailability of dierent database resources.Database instances, listeners are resources that can be automatically restartedafter a hardware or software failure or whenever the server host restarts.

    These components can be easily added to the Oracle Restart using the crsctl addcommand.

    In this article, I am going to show you how to add the Enterprise Manager Agent12c component to the Oracle Restart.

    The following procedure has been tested on 11.2.0.3 RAC environment underRedhat Enterprise Linux. Apply the following steps on each node of the cluster.

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    1 of 12 05/03/2014 04:56 PM

  • The procedure:

    The Agent cloud control 12c is installed under the /opt/agent12c directory.The agent can be started / Stopped by running $AGENT_HOME/bin/emctl startagent , $AGENT_HOME/bin/emctl stop agent commands, where$AGENT_HOME is /opt/agent12c/agent_inst in my case.

    First, login to one of the RAC nodes as a root user, change the directory to$GRID_HOME/crs/script (or $CRS_HOME/crs/script). Create two scriptscrs_agent12c.sh and agentstartup.sh with the following contents; (Remember tochange the values to reect your environment);

    view plain copy to clipboard print ?

    [grid@node1 script]$ cat crs_agent12c.sh 01.

    #!/bin/bash 02.

    # 03.

    # dbcagent.sh - script to start and stop the EMC 12c agent 04.

    # 05.

    06.

    ORACLE_BASE=/opt/app/oracle 07.

    ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1 08.

    LIBRARY_PATH=$ORACLE_HOME/lib 09.

    ORACLE_SID=tstdb1 10.

    ORACLE_UNQNAME=tstdb 11.

    PATH=$ORACLE_HOME/bin:$PATH 12.

    13.

    export ORACLE_BASE 14.

    export ORACLE_HOME 15.

    export LD_LIBRARY_PATH 16.

    export ORACLE_SID 17.

    export ORACLE_UNQNAME 18.

    export PATH 19.

    20.

    agent_start () { 21.

    sudo -u oracle /opt/11.2.0/grid/crs/script/agentstartup.sh start 22.

    } 23.

    24.

    agent_stop () { 25.

    sudo -u oracle /opt/11.2.0/grid/crs/script/agentstartup.sh stop 26.

    } 27.

    28.

    agent_check () { 29.

    sudo -u oracle /opt/11.2.0/grid/crs/script/agentstartup.sh check 30.

    } 31.

    32.

    case "$1" in 33.

    start) 34.

    agent_start 35.

    ;; 36.

    stop) 37.

    agent_stop 38.

    ;; 39.

    check) 40.

    agent_check 41.

    ;; 42.

    clean) 43.

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    2 of 12 05/03/2014 04:56 PM

  • agent_clean $(ps -C emagent -o pid=) 44.

    ;; 45.

    *) 46.

    echo $"Usage: `basename $0` {start|stop|status|clean}" 47.

    exit 1 48.

    esac 49.

    [grid@node1 script]$ 50.

    51.

    52.

    [grid@node1 script]$ cat agentstartup.sh 53.

    #!/bin/bash 54.

    # 55.

    56.

    ORACLE_BASE=/opt/app/oracle 57.

    ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1 58.

    LIBRARY_PATH=$ORACLE_HOME/lib 59.

    ORACLE_SID=tstdb1 60.

    ORACLE_UNQNAME=tstdb 61.

    AGENT_HOME=/opt/agent12c/agent_inst 62.

    63.

    export ORACLE_BASE 64.

    export ORACLE_HOME 65.

    export LD_LIBRARY_PATH 66.

    export ORACLE_SID 67.

    export ORACLE_UNQNAME 68.

    export AGENT_HOME 69.

    70.

    agent_start () { 71.

    $AGENT_HOME/bin/emctl start agent 72.

    } 73.

    74.

    agent_stop () { 75.

    $AGENT_HOME/bin/emctl stop agent 76.

    } 77.

    78.

    agent_check () { 79.

    $AGENT_HOME/bin/emctl status agent 80.

    } 81.

    82.

    case "$1" in 83.

    start) 84.

    agent_start 85.

    ;; 86.

    stop) 87.

    agent_stop 88.

    ;; 89.

    check) 90.

    agent_check 91.

    ;; 92.

    clean) 93.

    agent_clean $(ps -C emagent -o pid=) 94.

    ;; 95.

    *) 96.

    echo $"Usage: `basename $0` {start|stop|status|clean}" 97.

    exit 1 98.

    esac 99.

    [grid@node1 script]$ 100.

    Run the following commands:

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    3 of 12 05/03/2014 04:56 PM

  • [root@node1 ~]# chown -R grid:oinstall $GRID_HOME/crs/script 01.

    [root@node1 ~]# chmod 755 $GRID_HOME/crs/script/* 02.

    Now, edit the /etc/sudoers le where all the access rules are saved. Per default,sudo requires authentication through a password. When NOPASSWD is speciedthe execution of the commands will not requires a password.

    view plain copy to clipboard print ?

    [root@node1 ~]# chmod 640 /etc/sudoers 01.

    02.

    ####Comment out the line (#Defaults requiretty) in /etc/sudoers files 03.

    04.

    ####Add the following lines to /etc/sudoers where node1 is the hostname. 05.

    06.

    grid node1 =(oracle) NOPASSWD: /opt/11.2.0/grid/crs/script/agentstartup.sh start 07.

    grid node1 =(oracle) NOPASSWD: /opt/11.2.0/grid/crs/script/agentstartup.sh stop 08.

    grid node1 =(oracle) NOPASSWD: /opt/11.2.0/grid/crs/script/agentstartup.sh check 09.

    10.

    11.

    [root@node1 ~]# chmod 440 /etc/sudoers 12.

    Modify the following les permission;

    [root@node1 ~]# chmod 664 /opt/agent12c/agent_inst/sysman/config/emd.properties 01.

    [root@node1 ~]# chmod 755 /opt/agent12c/agent_inst/bin/emctl 02.

    Now, lets add the resource to Oracle restart;

    view plain copy to clipboard print ?

    [root@node1 ~]# su - grid 01.

    [grid@node1 ~]$ crsctl add resource crs_agent12c -type local_resource -attr " ACTION_SCRIPT=

    /11.2.0/grid/crs/script

    /crs_agent12c.sh,DESCRIPTION=Local Ressource for Agent 12c, DEGREE=1, ENABLED=1, AUTO

    02.

    [grid@node1 ~]$ 03.

    [grid@node1 ~]$ crsctl start res crs_agent12c 04.

    CRS-2672: Attempting to start 'crs_agent12c' on 'node1' 05.

    CRS-2676: Start of 'crs_agent12c' on 'node1' succeeded 06.

    [grid@node1 ~]$ 07.

    08.

    09.

    [grid@node1 ~]$ crsctl status res crs_agent12c 10.

    NAME=crs_agent12c 11.

    TYPE=local_resource 12.

    TARGET=ONLINE 13.

    STATE=ONLINE on node1 14.

    15.

    [grid@node1 ~]$ 16.

    Hope it helps!,Wissem

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    4 of 12 05/03/2014 04:56 PM

  • 3 Comments to Auto Restart Enterprise Manager Cloud

    Control Agent 12c;

    Andreas says:April 11, 2012 at 9:12 am

    Hello Wissem,

    thank you for the scripts, they are very helpful! However, there seems to bea small problem: I cannot nd the denition of agent_clean(), which isreferenced in this command:

    agent_clean $(ps -C emagent -o pid=)

    Can you add the missing function? The start, stop, and check actions areeasy to understand, but I do not understand yet what the clean() function iscalled for.

    Reply

    1.

    Auto Restart Enterprise Manager Cloud Control Agent 12c All Things

    Oracle says:May 10, 2012 at 10:25 am

    [...] the full article here: Auto Restart Enterprise Manager Cloud ControlAgent 12c; Wissem El [...]

    Reply

    2.

    Joachim Pierre says:November 20, 2012 at 8:20 pm

    I dont understand agent_clean either. Please elaborate.

    Reply

    3.

    Leave a Comment

    Name (required)

    Mail (will not be published) (required)

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    5 of 12 05/03/2014 04:56 PM

  • Website

    Blog's RSS Feed

    Polls

    which oracle topic interests you most?

    Oracle data guard

    Oracle RAC

    Oracle performance tuning

    Oracle installation

    PL/SQL or SQL

    Oracle enterprise manager

    ASM / Storage

    RMAN, backup and recovery

    Vote

    View Results

    Polls Archive

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    6 of 12 05/03/2014 04:56 PM

  • Oracle Class Tweets

    Recent Posts

    Packts 2000th Title CampaignOracle 12c & Hadoop for better Data Management and ProcessingOracle Flex ASM Espaol (Article in Spanish)Oracle Database 12c Backup and Recovery Survival GuideE-books: 50% discountBook: Oracle Database 12c Backup and Recovery Survival GuideOracle Data Guard 11gR2 Administration Beginners GuideOracle 12c: Recover tables using RMANOracle 12c: Managing ResourcesOracle 12c: Transport tablespaces across platformsOracle 12c: [INS-20802] Oracle Services For Microsoft Transaction Serverfailed.Oracle 12c: Whats New in Oracle Data Guard 12cR1?Oracle 12c: Managing PDBs using TriggersOracle 12c: Managing PDBs using Sql DeveloperOracle 12c: Performing PDB Point-In-Time RecoveryOracle 12c: Manual container database creation in SQL*PlusOracle 12c: NOOPEN option for RMAN duplicateOracle Data Guard 11gR2 Administration Beginners GuideOracle 12c: Truncate Table CascadeOracle 12c: Managing PartitioningOracle 12c: DBMS_PART Package: Clean up global indexes on partitionedtablesOracle 12c: RMAN restore / recover pluggable databaseOracle 12c: RMAN restore / recover dataleOracle 12c: Invisible ColumnOracle 12c: ASM New asmcmd commandsOracle 12c: DBA_HIST_* TablesOracle 12c: RMAN Multisection Image Copies & Incremental BackupsAdd Oracle Database 12c to Enterprise Manager 12cOracle 12c: RMAN recover TableOracle 12c ; RMAN supports SELECT statementsOracle Database 12c available for downloadEnterprise Manager Cloud Control 12c: RMAN-06403: could not obtain afully authorized session ORA-01034: ORACLE not availableReinstall Enterprise Manager Cloud Control 12c Agent

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    7 of 12 05/03/2014 04:56 PM

  • My experience with ORA-07445: exception encountered: core dump[kglic0()+1086]Incremental updated backup failed after database restore.CBO unnests subqueriesTroubeshooting Oracle Backup to Tape Problem;E-Books Packt Special oersRevert security conguration changes for 11gExport Table statistics from one user to another11g; Sql Plan Management11gR2; Troubleshooting OHAS error autorun le for ohasd is missingTroubleshooting ASM error ORA-15063: ASM discovered an insucientnumber of disks for diskgroupOracle Database 12c New features; Container Database and PluggableDatabase (CDB & PDB)Data Guard Physical Standby Database Best Practices Part IIPackt Publishing reaches 1000 IT titles and celebrates with their registredusers!Reallocate Enterprise Manager 11g Master Node in RAC 11gR2 ;Data Guard Physical Standby Database Best Practices Part IThe Oracle Advanced PL/SQL Developer Professional Guide book review11gR2; The SQL Performance Analyzer to decide an Index DeletionMy Interview Published In The Oracle Magazine July/August 2012Oracle Enterprise Manager 12c Cloud Control: Managing Data CenterChaos BookOracle Advanced PL/SQL Developer Professional Guide book review11gR2; RAC + Clusterware Silent InstallationPackt Publishing Exclusive discounts in March + Upcoming eventsAuto Restart Enterprise Manager Cloud Control Agent 12c;Generate AWR report AutomaticallyORA-19685: SPFILE could not be veriedRAC 11gR2; Bug 11807012 really xed with PSU3?Enterprise Manager 11g; Cluster alert metrics test casesRAC 11gR2; Guaranteed Restore Points with Flashback Logging DisabledEnterprise Manager Cloud 12c InstallationManually Clear Alerts in Oracle Enterprise Manager 11g11gR2; Silent Installation for Oracle Grid Infrastructure for a ClusterNominated an Oracle ACE :)Recongure Database Control in RAC environment using EMCARAC 11gR2; How do I troubleshoot my clusterware startup issue?11gR2 Clusterware de-installation procedure11gR2; AWR Reports in RAC11gR2 RAC: Patch Set Update 3 InstallInterview with Ben Prusinski Oracle ACE and Oracle Expert11gR2 RAC: add Enterprise Manager Database Control to crs resources for

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    8 of 12 05/03/2014 04:56 PM

  • automatic restartStatspack in RACTape datale recoverInterview with Kellyn Potvin Rocky Mountain Oracle User Group Directorof membership and vendors and Oracle Expert11.2.0.1.3 PSU Oracle Solaris on SPARC (64-bit)Entrevista con Nelson Calero Presidente del UYOUG y Experto en OracleRACEntrevista con Nelson Calero Presidente del UYOUG y Experto enOracle RACCopy ASM les to le systemInterview with Kai Yu Oracle ACE Director and Oracle ExpertAuto-managing an Oracle database: Fix database alerts automaticallyInterview with Fahd Mirza Oracle ACE and Oracle Expert11gR2; Silent installation in Oracle Solaris 10Interview with Surachart Opun Oracle ACE and Oracle RAC ExpertTesting RAC Check audit toolInterview with Debra Lilley Oracle ACE Director and UKOUG PresidentInterview with Eddie Awad Oracle ACE Director and Oracle Expert11gR2; Automatic restart of DB Console11gR2; Redmarrerautomatiquement DB Console 11gR2; Reiniciar Automticamente DBConsoleInterview with Kyle Hailey Oracle ACE and Oracle ExpertOracle 11g R1/R2 Real Application Clusters Essentials Book review11gR2 ASM Inside story Part 6 (Recreate High available Service andrename Disk group)11gR2 ASM Inside story Partie 6 (Recrer le servicede haute disponibilt et renommer un group de disques)11gR2 ASM Inside story Parte 6 (Crear de nuevo el servicio de alta disponibilidad yrenombrar un grupo de discos)Interview with Hans Forbrich Oracle ACE Director and OracleExpertInterview avec Hans Forbrich Oracle ACE Directeur et ExpertOracleEntrevista con Hans Forbrich Oracle ACE Director y ExpertoOracleEntrevista con Hans Forbrich Oracle ACE Director y ExpertoOracleRAC Database tape Restore to a new server11gR2; Sqlnet.ora and Oracle Restart11gR2 ; DB console Policy Violations Directory ObjectsPatch 12311357 11.2.0.2.2 Patch Set Update Standalone gridinfrastructureTrace Materialized views;RAC 11gR2 ORA-00245: control le backup operation failedRAC 11.2.0.2 Patch 12311357 11.2.0.2.2 GI Patch Set Update and mutexpatch 4 Nodes on Redhat Linux11g recongure DB console11gR2 RMAN incremental updated backup demo

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    9 of 12 05/03/2014 04:56 PM

  • Oracle 11g R1/R2 Real Application Clusters Essentials BookRAC 11gR2 ORA-29540 class does not exist error11gR2 Oracle Restart errors : CRS-0259, CRS-2680, CRS-5802RMAN backup into more than one locationDatapump; Import using query11g, Cold backup using RMAN and detached job11gR2 RAC run ADDM report11gR2 RAC CRS-2632 ErrorNOSQL: Hypertable Installation11gR2 ASM Inside story Part5 (Read database le from OS)Active Session History (ASH) tool11gR2 ASM Inside story Part4 (ASM Preferred Read Failure Group)11g ASM Inside story Part3 (Export Datapump)10g vs 11g add a column with not null default value11gR2 ASM Inside story Part2 (Diskgroup restore)11gR2 ASM Inside story Part1 (including grid infrastructure installation)11g Data Recovery Advisor DRAOracle Enterprise Manager Grid Control Installation 11g Failed withSEVERE: Exception: java.net.BindException: Address already in use:JVM_Bind11g Oracle Flashback Data ArchivesOracle Enterprise Manager Grid Control Installation 11g Release 1(11.1.0.1.0) on fedora Linux 14ORA-00918 ANSI Join Bug in 11.2.0.1 xed in 11.2.0.211gR2 Physical Data Guard Setup project, with Active Data Guardoption11gR2 Congurer Data Guard physique, avec loption dActif DataGuard11gR2 Congurar Data Guard physico, con la opcion de Activo DataGuardHow to x EXCEPTION in chrow processing code: -14551 msg:ORA-14551: cannot perform a DML operation inside a query in 11.2.0.1versionHow to x ORA-979: not a GROUP BY expression in 11.2.0.1 versionManaging Resources; Real World ExampleOracle Exchange partition ExampleDealing with block corruptionDuplicate an Oracle 11gR2 Using RMANStep by Step clone of an Oracle 11g using RMANAnalyse this; Learning from the optimizerTrack the row change timeTip ; DML error captureStep by Step clone of an Oracle 10g using RMANPl Sql TipsOracle Support AuditOracle Optimizer; Index hint usage limits

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    10 of 12 05/03/2014 04:56 PM

  • Incomplete Database Recovery in 10g and 11g DatabasesHow to manually use Sql Tunning AdvisorHow to check available partitionHow do I x ORA-01455 error on 11g Release 2 oracle database ?Find out who is locking my accountFast delete- Best practiceDBA Sql TipsDataGuard : Step-by-Step Instructions for Creating a Physical StandbyDatabaseData Pump in 11g ; New parametersConvert money into words using PL SQL function,Alternative statement, rewrite query

    Visit Oracle Community

    Recent Comments

    Adrian Iriarte: Saludos, Que buen articulo, casi siempre al momento dequerer implementar soluciones para el...Patricia: Hi Wissem, is there a workaround for this? I mean I want to usethe sqlnet.authentication_services =none,...Brian: I created the cdb manually using the instruction, but then I tried tocreate pdb within in, it failed. have...Farmer Johnson: Hi Wissem. How did you avoid the error you hadprevisouly encountered: sudo opatch auto...Hctor Moro: Querido Nelson; Despus de entrevistar a mas de 50profesionales de primer nivel en Uruguay, al n te...What is NO2 Maximus: I genuinely apreciated your site! You shoulupdate it with new info!Nav: Indeed helpful, to the point article..Koti: Can you please explain all the sections of AWR report in RAC. I meanto ask output produced by awrgrpt.sql...Himanshu: Nice post.can you please comment on this Why RMAN restoredthe DATA_REORTING datae to +DATA diskgroup?Enrique: Great post.gabriel: what version of sqldeveloper support plugable database?Kal: Quality thanks

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    11 of 12 05/03/2014 04:56 PM

  • wissem: Well , like I mentioned in the post, delete service and add serviceusing IP.Kelly: were you able to solve this? Thanks!wissem: Hello, You can buy the book from PakT: http://www.packtpub.com/oracle -data-guard-11gr2-administr...goutham: hi i want to buy this book.could you please let me know how can ibuy this book. i am in Malaysia. thanks...cesar Lopez: Hola me gustaria saber tu punto de vista de MYSQl vsORACLE para una sistema de Nomina de unos 1500...wissem: Check my previous article in English; Oracle 12c: RMAN recoverTable http://www.oracle-class.com/?p =2866NILESH: Sir, English pleaseRamakrishna: I want step by step installation of Hyper-table in windowsand also usage of Hyper-table like data...

    Oracle-Class Forums Latest Activity

    Callow Protrude by: jodyoy11May 3, 2014, 08:52

    Mature galleries by: gilbertkt60May 3, 2014, 06:09

    New Job by: rachelle11May 3, 2014, 05:30

    Free adult galleries by: gilbertkt60May 3, 2014, 01:41

    Mature purlieus by: rachelle11May 3, 2014, 01:09

    Mature site by: jodyoy11May 3, 2014, 00:25

    Copyright Oracle Class Wissem All About Oracle is proudly powered by -Me-

    Wissem EL KHLIFI

    Contact

    Auto Restart Enterprise Manager Cloud Control ... http://www.oracle-class.com/?p=2597

    12 of 12 05/03/2014 04:56 PM