[20170625]参数LOG_ARCHIVE_DEST_1.txt
--//昨天帮别人解决问题时再次遇到,在测试环境重复测试.
1.环境:
SCOTT@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> show parameter log_archive_dest_1
NAME TYPE VALUE
------------------ ------ ---------------------------------------------------------------------------------------------------------
log_archive_dest_1 string LOCATION=/u01/app/oracle/archivelog/book MANDATORY VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=book
--//别人的环境没有建立book目录.
$ mv /u01/app/oracle/archivelog/book /u01/app/oracle/archivelog/bookx
2.现在做日志切换看看.
SCOTT@book> alter system archive log current ;
System altered.
--//一样ok.
$ ls -l /u01/app/oracle/archivelog/
total 13896
-rw-r--r-- 1 oracle oinstall 6 2017-04-12 10:58:26 a.txt
-rw-r----- 1 oracle oinstall 14199296 2017-06-26 09:23:22 book1_710_896605872.dbf
drwxr-xr-x 2 oracle oinstall 4096 2017-06-23 15:24:55 bookx
--//你可以发现归档放在/u01/app/oracle/archivelog目录,文件命令为book1_710_896605872.dbf.
SCOTT@book> show parameter log_archive_format
NAME TYPE VALUE
------------------ ------ ------------
log_archive_format string %t_%s_%r.dbf
--//有一种说法,最好在book尾部加入斜线.
SCOTT@book> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archivelog/book/ MANDATORY VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=book';
alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archivelog/book/ MANDATORY VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=book'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16032: parameter LOG_ARCHIVE_DEST_1 destination string cannot be translated
ORA-07286: sksagdi: cannot obtain device information.
Linux-x86_64 Error: 2: No such file or directory
--//你可以发现这样问题很容易暴露.
$ mv /u01/app/oracle/archivelog/bookx /u01/app/oracle/archivelog/book
--//再次执行就ok了.
SCOTT@book> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archivelog/book/ MANDATORY VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=book';
System altered.
SCOTT@book> alter system archive log current ;
System altered.
$ ls -l /u01/app/oracle/archivelog/book/ | grep 2017-06-26
-rw-r----- 1 oracle oinstall 837120 2017-06-26 09:30:01 1_711_896605872.dbf
--//关于斜线的问题,最突出的是$ORACLE_HOME.
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.4/dbhome_1
--//不过11.2.0.4这个问题已经不存在了.参考链接:blog.itpub.net/267265/viewspace-2055052/ =>[20160310]神奇的斜线.txt