11 Replies Latest reply: Jun 3, 2010 5:29 AM by 713290 RSS

    Does directory exist or not?

    340688
      ASM 10.2.0.3 on RHEL4. I am trying to clean up a database.
      ASMCMD> cd FRA/RACTEST/BACKUPSET/2007_07_27
      ASMCMD> ls
      annnf0_BACKUP_RACTEST_000_0727070220_0.368.62904
      annnf0_BACKUP_RACTEST_000_0727070220_0.369.62904
      annnf0_BACKUP_RACTEST_RAC_0727070314_0.380.62904
      annnf0_BACKUP_RACTEST_RAC_0727070314_0.381.62904
      nnndn0_BACKUP_RACTEST_000_0727070220_0.363.62904
      nnndn0_BACKUP_RACTEST_000_0727070220_0.364.62904
      nnndn0_BACKUP_RACTEST_RAC_0727070314_0.375.62904
      nnndn0_BACKUP_RACTEST_RAC_0727070314_0.376.62904
      ASMCMD> rm -rf *
      ORA-15032: not all alterations performed
      ORA-15173: entry 'nnndn0_BACKUP_RACTEST_000_0727070220_0.363.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'nnndn0_BACKUP_RACTEST_000_0727070220_0.364.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'annnf0_BACKUP_RACTEST_000_0727070220_0.368.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'annnf0_BACKUP_RACTEST_000_0727070220_0.369.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'nnndn0_BACKUP_RACTEST_RAC_0727070314_0.375.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'nnndn0_BACKUP_RACTEST_RAC_0727070314_0.376.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'annnf0_BACKUP_RACTEST_RAC_0727070314_0.380.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ORA-15032: not all alterations performed
      ORA-15173: entry 'annnf0_BACKUP_RACTEST_RAC_0727070314_0.381.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
      ASMCMD> exit
      Why would "ls" show the files, but "rm" says they do not exist? I did not find any hits on Metalink, and google came back with more questions than answers.
        • 1. Re: Does directory exist or not?
          578825
          try rmalias command.
          • 2. Re: Does directory exist or not?
            340688
            ASMCMD> ls
            annnf0_BACKUP_RACTEST_000_0727070220_0.368.62904
            annnf0_BACKUP_RACTEST_000_0727070220_0.369.62904
            annnf0_BACKUP_RACTEST_RAC_0727070314_0.380.62904
            annnf0_BACKUP_RACTEST_RAC_0727070314_0.381.62904
            nnndn0_BACKUP_RACTEST_000_0727070220_0.363.62904
            nnndn0_BACKUP_RACTEST_000_0727070220_0.364.62904
            nnndn0_BACKUP_RACTEST_RAC_0727070314_0.375.62904
            nnndn0_BACKUP_RACTEST_RAC_0727070314_0.376.62904
            ASMCMD> rm annnf0_BACKUP_RACTEST_000_0727070220_0.368.62904
            ORA-15032: not all alterations performed
            ORA-15173: entry 'annnf0_BACKUP_RACTEST_000_0727070220_0.368.62904' does not exist in directory '2007_07_27' (DBD ERROR: OCIStmtExecute)
            ASMCMD> rmalias annnf0_BACKUP_RACTEST_000_0727070220_0.368.62904
            ORA-15032: not all alterations performed
            ORA-15177: cannot operate on system aliases (DBD ERROR: OCIStmtExecute)
            • 3. Re: Does directory exist or not?
              516450
              Not sure, if you are hitting some kind of bug, this is on 10.2.0.3 on SLES, and the rm * or rm <file_name> works just fine...you may like to open an SR to see if it is a known bug of some kind:

              ASMCMD> ls
              ncsnf0_TAG20070818T193803_0.276.630963531
              ncsnf0_TAG20070818T193909_0.278.630963657
              nnndf0_TAG20070818T193803_0.275.630963485
              nnndf0_TAG20070818T193909_0.277.630963581
              ASMCMD> rm ncsnf0_TAG20070818T193803_0.276.630963531
              ASMCMD> rm *
              You may delete multiple files and/or directories.
              Are you sure? (y/n) y
              ASMCMD>
              • 4. Re: Does directory exist or not?
                340688
                I hate filing SRS. But I did, seeing no other recourse.

                I am hoping this next question is related. I have a rogue controlfile sitting out in ASM and I have no idea what database is using it (ora-15028). How do I determine what ASM thinks is the owning process id?
                • 5. Re: Does directory exist or not?
                  340688
                  bug 6110998
                  metalink note 444812.1
                  No fix as of yet.

                  What a bummer.
                  • 6. Re: Does directory exist or not?
                    410710
                    I just ran into this also, I want to run backup but since I can not remove all the files I do not have enough space.
                    • 7. Re: Does directory exist or not?
                      410710
                      I opened up an sr with oracle. The issue seems to be that the max size of an alias is 48, but the actual length can be more, so you need to delete the file, by file number + file incarnation.

                      I wrote this to help:
                      SELECT 'alter diskgroup bk_group drop file ' --change as needed
                      || '''+bk_group.' --change as needed
                      || a.file_number
                      || '.'
                      || file_incarnation
                      || ''';'
                      FROM v$asm_alias a, v$asm_file b
                      WHERE a.group_number = b.group_number
                      AND a.file_number = b.file_number
                      AND b.type = 'BACKUPSET'
                      AND a.name like 'backupname%' --change as needed
                      AND a.group_number = 3 --change as needed
                      ORDER by a.name
                      ;
                      • 8. Re: Does directory exist or not?
                        80838
                        It worked. Thanks a lot.

                        SELECT 'alter diskgroup DATA drop file ' || '''+DATA.' || a.file_number || '.' || file_incarnation || ''';'
                        FROM v$asm_alias a, v$asm_file b
                        WHERE a.group_number = b.group_number
                        AND a.file_number = b.file_number
                        AND b.type = 'BACKUPSET'
                        AND a.name like '%CAFEWPRD_RMAN0%'
                        AND a.group_number = 1
                        ORDER by a.name
                        ;


                        alter diskgroup DATA drop file '+DATA.7016.661595797';
                        alter diskgroup DATA drop file '+DATA.7869.661595157';
                        • 9. Re: Does directory exist or not?
                          528349
                          i face the same problem too.

                          ASMCMD> ls
                          nnndf0_BACKUP_EPCORE.COMM_1114081056_0.291.67080
                          ASMCMD> rm nnndf0_BACKUP_EPCORE.COMM_1114081056_0.291.67080
                          ORA-15032: not all alterations performed
                          ORA-15173: entry 'nnndf0_BACKUP_EPCORE.COMM_1114081056_0.291.67080' does not exist in directory '2008_11_14' (DBD ERROR: OCIStmtExecute)

                          i do the select statement before run that script.. but no rows selected.. and i still can't remove the file..

                          SQL> SELECT GROUP_NUMBER, NAME FROM V$ASM_DISKGROUP;

                          GROUP_NUMBER NAME
                          ------------ ------------------------------
                          1 DATA

                          SQL> select name||'.'||file_number||'.'||file_incarnation from v$ASM_ALIAS WHERE GROUP_NUMBER=1;

                          no rows selected



                          thanks in advance

                          -julie-
                          • 10. Re: Does directory exist or not?
                            528349
                            i made mistake.. i didn't change the instance to ASM..
                            now.. the problem solved..

                            thanks.
                            • 11. Re: Does directory exist or not?
                              713290
                              It helped!!
                              Thanks a lot!!!