linux oracle目录权限不够,Linux 目录权限不足导致ORA-39070错误 | 信春哥,系统稳,闭眼上线不回滚!...
同事要做數(shù)據(jù)遷移測試,需要服務(wù)器權(quán)限,就在操作系統(tǒng)上給他創(chuàng)建了一個用戶wzs,給分了dba組,擁有dba組的用戶就可以正常操作數(shù)據(jù)庫,而且可以使用最高權(quán)限(SYS)。
[root@SL010A-IVDB08 ~]# id wzs
uid=54322(wzs) gid=54322(dba) groups=54322(dba)
可是他在用impdp向這個數(shù)據(jù)庫中導(dǎo)入數(shù)據(jù)的時候,遇到了下面的錯誤。
[wzs@SL010A-UVDB08 ~]$ impdp mig directory=BK dumpfile=ugcall.dmp logfile=impdp_ugcall.log
Import: Release 11.2.0.4.0 - Production on wed Mar 28 12:21:42 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 -64bit Production
With the Partitioning,OLAP,Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
這個錯誤最關(guān)鍵的部分是ORA-39070錯誤,一看就是沒有權(quán)限寫log文件導(dǎo)致的,我也沒想那么多,就登錄數(shù)據(jù)庫給MIG用戶授予了BK這個目錄的讀寫權(quán)限。
SQL> grant read,write on directory BK to mig;
Grant succeeded.
然后,問題并沒有解決,還是這個錯誤,那這就不是數(shù)據(jù)庫層面的權(quán)限問題了,應(yīng)該是操作系統(tǒng)層的權(quán)限不足,查看了一下他創(chuàng)建的這個目錄對應(yīng)操作系統(tǒng)的文件系統(tǒng)中的位置。
SQL> select * from dba_directories where directory_name=’BK’;
OWNER DIRECTORY_NAME DIRECTORY_PATH
---------- -------------- -------------------
SYS BK /home/wzs
他竟然把BK這個目錄創(chuàng)建到了/home下,/home目錄下的全是是很嚴(yán)格的,不同的用戶是不能訪問其他用戶的家目錄的,他把BK這個目錄創(chuàng)建到了他操作系統(tǒng)用戶的家目錄,Oracle用戶肯定是無法向那寫log文件的。
通常我們會把oracle數(shù)據(jù)庫安裝在/u01目錄下,而/u01目錄通常都是755權(quán)限,而/home目錄是700權(quán)限。
[root@SL010A-IVDB08 ~]# cd /home/
[root@SL010A-IVDB08 home]# ll
total 12
drwx------. 5 oracle oinstall 4096 Sep 20 2017 oracle
drwx------. 4 wzs dba 4096 Mar 28 12:14 wzs
drwx------. 4 xguest xguest 4096 Aug 28 2017 xguest
再看下/home/wzs目錄下的文件權(quán)限,應(yīng)該是644權(quán)限。
[root@SL010A-IVDB08 wzs]# ll
total 1763972
-rw-r--r--. 1 wzs dba 303373994 Sep 20 2017 hm_cust_t_20170920.zip
-rw-r--r--. 1 wzs dba 455213056 Mar 28 11:06 mig_object.dump
-rw-r--r--. 1 wzs dba 118055080 Mar 28 11:20 mig_object.zip
-rw-r--r--. 1 wzs dba 641916928 Sep 20 2017 pub_data_0920.dump
-rw-r--r--. 1 wzs dba 999 Sep 20 2017 pub_data_0920.log
-rw-r--r--. 1 wzs dba 187157270 Sep 20 2017 pub_data_0920.tar.gz
-rw-r--r--. 1 wzs dba 74407936 Mar 28 12:05 ugcall.dmp
-rw-r--r--. 1 wzs dba 26166012 Mar 28 12:14 ugcall.zip
644權(quán)限dba組也只有讀的權(quán)限,而沒有寫的權(quán)限。將/home/wzs目錄的權(quán)限修改為755,問題解決。
其實(shí)/u01目錄是755權(quán)限,wzs這個用戶完全有權(quán)限向/u01目錄里寫數(shù)據(jù),如果他將BK這個目錄創(chuàng)建到/u01目錄下面,就不會遇到這個問題,但這哥們不按套路出牌,把BK這個目錄創(chuàng)建到了操作系統(tǒng)用戶的家目錄,才遇到這個權(quán)限不足的錯誤。
總結(jié)
以上是生活随笔為你收集整理的linux oracle目录权限不够,Linux 目录权限不足导致ORA-39070错误 | 信春哥,系统稳,闭眼上线不回滚!...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 9i rac Linux,
- 下一篇: oracle rac 节点启动,Orac