7 Replies Latest reply: Mar 5, 2013 4:09 PM by hank_nj_usa RSS

    cannot use asmcmd after srvctl stop db / remove database

    518459
      Hello,

      I have an Oracle instance SNM with datafiles stored in ASM (Oracle 11.2.0.2 running on Solaris 10), Oracle Grid is also running on the machine. I have taken a backup of the database instance, and now I want to restore it.
      Before starting the restore, I performed some cleanup of the grid resources:
      srvctl stop db -d SNM
      srvctl remove database -d SNM
      dbca -silent -deleteDatabase -sourceDB SNM

      crs_stat -t reports all other resources online, the problem is I cannot connect anymore with asmcmd to the ASM instance:

      $ asmcmd
      Connected to an idle instance.
      ASMCMD> lsdg
      ASMCMD-08102: no connection to ASM; command requires ASM to run

      Did one of the srvctl commands or the dbca -deleteDatabase interfere with the ASM instance?
      I'm using the same environment (ORACLE_SID, ORACLE_HOME etc.) as I used before the cleanup, but now I'm just not able to connect to the ASM instance anymore.

      Any help is appreciated,
      AdrianM
        • 1. Re: cannot use asmcmd after srvctl stop db / remove database
          727876
          Hi AdrianM,

          Are you sure ASM is running?
          Are the environment variables set?

          Please post output of:
          echo $ORACLE_SID
          echo $ORACLE_HOME
          If they are not set correctly you can do the following.
          If you have installed the GRID/ASM as the grid user switch your user(if not already done) to it and set you ORACLE_SID and ORACLE_HOME environment variables:
          su - grid
          export ORACLE_SID=+ASM
          export ORACLE_HOME=<GRID_HOME>
          if this is a RAC instance please export the ORACLE_SID to ASM1 or ASM2 ... +ASM(n) depending on the node your are working.
          After this has been done please try the asmcmd command again.

          Regards.

          Edited by: user10506095 on Jun 6, 2011 4:31 PM
          • 2. Re: cannot use asmcmd after srvctl stop db / remove database
            518459
            $ORACLE_HOME is set to /opt/app/grid/11.2.0.2, $ORACLE_SID is +ASM1. These are the same values I used before the cleanup.

            Kind regards,
            Adrian
            • 3. Re: cannot use asmcmd after srvctl stop db / remove database
              727876
              Hi Adrian,

              Is this a RAC instance?
              Did you do the install as the grid user?
              If you did please switch to the grid user and post the output of the following:
              <GRID_HOME>/crsctl stat res -t
              cat /etc/oratab
              ps -ef|grep asm_pmon
              <GRID_HOME>/srvctl status asm
              Also please look in the asm alert log for any errors.

              Regards
              • 4. Re: cannot use asmcmd after srvctl stop db / remove database
                rajeysh
                Are the $ORACLE_HOME and $ORACLE_SID, what is the result of the env command?

                also the result of

                which asmcmd
                • 5. Re: cannot use asmcmd after srvctl stop db / remove database
                  518459
                  Hello,

                  Yes, this is a RAC instance, installed as the grid user (oracle:oinstall).
                  I'm afraid the crsctl and srvctl status reports aren't meaningfull anymore, as the server is now in a different state (asmcmd now running, some of the resources offline though).
                  However, here's the output of the oratab file (which is located in /var/opt/oracle, as we're on Solaris, not Linux)

                  #
                  +ASM1:/opt/app/grid/11.2.0.2:N          # line added by Agent
                  SNM:/opt/app/oracle/product/11.2.0.2:N # line added by Agent

                  Would this be the issue? (+ASM1 and SNM instances not being started automatically?)

                  Kind regards,
                  Adrian
                  • 6. Re: cannot use asmcmd after srvctl stop db / remove database
                    727876
                    Hi Adrian,

                    QUOTE: +"I'm afraid the crsctl and srvctl status reports aren't meaningfull anymore, as the server is now in a different state (asmcmd now running, some of the resources offline though)."+
                    What do you mean the server is in a different state?

                    To see if the auto start is enabled you can run as root user:
                    <GRID_HOME>/crsctl config has
                    Please post the output of:
                    <GRID_HOME>/crsctl stat res -t
                    So that we can make sure all the correct resources are started.

                    Regards.
                    • 7. Re: cannot use asmcmd after srvctl stop db / remove database
                      hank_nj_usa
                      Adrian,

                      I encountered the same issue, after removing database and re-register database to OCR again, I found asmcmd connect to idle instance, in the same I used to access ASMCOM.
                      $ asmcmd
                      Connected to an idle instance.

                      I checked the other databases/using ASM on the server, they are still working well.

                      so odd. have you fixed the issue? please share your experience if this is fixed.

                      Thanks,

                      - Hank