OS 환경 : Oracle Linux 8.8 (64bit)
DB 환경 : Oracle Database 19.27.0.0
에러 : ORA-15032: not all alterations performed
현재는 존재하지 않는 이미 drop database를 실행한 db에서 생성된 asm 경로를 수동으로 삭제하려할때 발생하는 에러
현재 ora11db는 이미 drop하여 존재하지 않는 db지만 asm에는 폴더가 존재함
1
2
3
4
5
|
$ asmcmd -p
ASMCMD [+] > cd data
ASMCMD [+data] > ls
ORA11DB/
ORA19DB/
|
asmcmd로 해당 경로 삭제 시도
1
2
3
|
ASMCMD [+data] > rm +data/ora11db
ORA-15032: not all alterations performed
ORA-15177: cannot operate on system aliases (DBD ERROR: OCIStmtExecute)
|
에러 발생함
해결 방법 : rm시 -rf 옵션 함께 사용
asmcmd로 rm -rf 사용해서 삭제 시도
1
2
3
|
ASMCMD [+data] > rm -rf +data/ora11db
ASMCMD [+data] > ls
ORA19DB/
|
정상적으로 삭제됨
*일반적인 상황에서는 시스템이 만든 디렉토리를 삭제하면 안됨, 본문은 이미 drop한 데이터베이스이기 때문에 사용한것임
원인 : system이 만든 폴더는 기본적으로는 사용자가 지울수 없음
system이 만든 폴더는 기본적으로는 사용자가 지울수 없음, 그렇기 때문에 에러가 발생하는것은 시스템 손상을 막기위함임
참고용. asmcmd에서의 rm 가이드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
ASMCMD [+data] > help rm
rm
Deletes the specified Oracle ASM files and directories.
Synopsis
rm [-rf] [--target <target>] <names...>
Description
The options for the rm command are described below.
-r - Recursively deletes files and subdirectories.
-f - Deletes files and subdirectories without prompting for
confirmation.
--target - Argument for target option could be either ASM, IOS, or
APX, depending which type of instance ASMCMD needs to be
connected to remove the file or files.
name - Names of the file, file path, pattern, or directory you
want to remove, separated by space.
If name is a file or alias, then the rm command can delete the file
or alias only if it is not currently in use. If name is a directory,
then the rm command can delete it only if it is empty (unless the -r
flag is used) and it is not a system-generated directory. If name is
an alias, then the rm command deletes both the alias and the file to
which the alias refers. To delete only an alias and retain the file
that the alias references, use the rmalias command.
Note: When you delete all of the files in a system-created directory,
the directory is removed. If the parent directories are empty, all of
the parent directories are also removed.
name can contain wildcard characters.
If you use a wildcard, the rm command deletes all of the matches
except nonempty directories, unless you use the -r flag. To
recursively delete, use the -r flag. With -r option you can delete
a nonempty directory, including all files and directories in it and
in the entire directory tree underneath it. If you use the -r flag
or a wildcard character, then the rm command prompts you to confirm
the deletion before proceeding, unless you specify the -f flag. If
a wildcard character matches an alias or a system-generated file that
has an alias, then both the alias and the system-generated file that
it references are deleted. When using the -r flag, either the
system-generated file or the alias must be present in the directory
in which you run the rm command.
For example, if you have a user alias, +data/dir1/file.alias
that points to +data/orcl/DATAFILE/System.256.146589651,
then running the rm -r +data/dir1 command removes the
+data/dir1/file.alias and +data/orcl/DATAFILE/System.256.146589651.
Examples
The following are examples of the rm command. The
first example deletes the myexamples.bak file. The second example
removes the subdir2 directory and its contents. The third example
removes the IOS parameter file.
ASMCMD [+data/orcl/datafile] > rm myexamples.bak
ASMCMD [+data] > rm -r subdir2
You may delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD [+data] > rm --target IOS IOS/PARAMETERFILE/spfile.264.925756331
|
참조 :
https://heliosguneserol.com/2016/02/09/ora-15032ora-15177-while-removing-files-in-asm/