ORA-16019 和 ORA-16018 错误的处理方法(转)
一. ORA-16019 和 ORA-16018 错误产生描述
同事在修改归档目录,一不小心把参数设置错误了, 他设置的是log_archive_dest参数。 这个参数和默认log_archive_dest_n 和 DB_RECOVERY_FILE_DEST是冲突的。也就是说, 只能用一个。 先看相关的代码来说明这个问题。
SQL> show parameter log_archive_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string /u01/oracle/archive_test/test1
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_2 string
这是同事修改之后的结果,我们来修改一下DB_RECOVERY_FILE_DEST参数:
SQL> alter system set DB_RECOVERY_FILE_DEST='';
alter system set DB_RECOVERY_FILE_DEST=''
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use db_recovery_file_dest with LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST
报错,不能修改,在修改log_archive_dest_1 参数:
SQL> alter system set log_archive_dest_1="location=/u01/oracle/archive_test/test1";
alter system set log_archive_dest_1="location=/u01/oracle/archive_test/test1"
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use LOG_ARCHIVE_DEST_1 with LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST
还是报错,不能修改,在修改log_archive_dest 参数:
SQL> alter system set log_archive_dest='location=/u01/oracle/archive_test/test1';
alter system set log_archive_dest='location=/u01/oracle/archive_test/test1'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16018: cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
依旧报错, 至此,我们不能修改归档的任何目录。 他们他们是不兼容的,如果我们在没有清空其他目录的条件下来修改,就会造成如上的死锁。 既谁不能修改谁。 他们之间互相锁住了。
解决方法:
在这种情况下,我们只能通过修改pfile文件来删除掉冲突的参数,在用修改之后的pfile启动数据库。
SQL> create pfile from spfile;
File created.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
删除pfile里的相关冲突参数
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup pfile=?/dbs/initorcl.ora
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 1218968 bytes
Variable Size 109053544 bytes
Database Buffers 167772160 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
二. 关于log_archive_dest, ORA-16019 , ORA-16018 的说明
ORA-16018: cannot use string with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
Cause: One of the following events caused an incompatibility:
1) Parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST was in use when a LOG_ARCHIVE_DEST_n (n = 1...10) parameter was encountered while fetching initialization parameters.
2) An ALTER SYSTEM ARCHIVE LOG START TO command was in effect when a LOG_ARCHIVE_DEST_n parameter was encountered while fetching initialization parameters.
3) A LOG_ARCHIVE_DEST_n parameter was in use when an ALTER SYSTEM command was used to define a value for either the LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST parameter.
4) Parameter DB_RECOVERY_FILE_DEST was in use when an attempt was made to use an ALTER SYSTEM or ALTER SESSION command to define a value for LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST.
Action: Eliminate any incompatible parameter definitions.
ORA-16018: cannot use string with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
Cause: One of the following events caused an incompatibility:
1) Parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST was in use when a LOG_ARCHIVE_DEST_n (n = 1...10) parameter was encountered while fetching initialization parameters.
2) An ALTER SYSTEM ARCHIVE LOG START TO command was in effect when a LOG_ARCHIVE_DEST_n parameter was encountered while fetching initialization parameters.
3) A LOG_ARCHIVE_DEST_n parameter was in use when an ALTER SYSTEM command was used to define a value for either the LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST parameter.
4) Parameter DB_RECOVERY_FILE_DEST was in use when an attempt was made to use an ALTER SYSTEM or ALTER SESSION command to define a value for LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST.
Action: Eliminate any incompatible parameter definitions.
关于log_archive_dest 参数,我们参考Oracle 连接文档:
LOG_ARCHIVE_DEST is applicable only if you are running the database in ARCHIVELOG mode or are recovering a database from archived redo logs. LOG_ARCHIVE_DEST is incompatible with the LOG_ARCHIVE_DEST_n parameters, and must be defined as the null string ("") or (' ') when any LOG_ARCHIVE_DEST_n parameter has a value other than a null string. Use a text string to specify the default location and root of the disk file or tape device when archiving redo log files. (Archiving to tape is not supported on all operating systems. The value cannot be a raw partition.
If LOG_ARCHIVE_DEST is not explicitly defined and all the LOG_ARCHIVE_DEST_n parameters have null string values, LOG_ARCHIVE_DEST is set to an operating system-specific default value on instance startup.
To override the destination that this parameter specifies, either specify a different destination for manual archiving or use the SQL*Plus statement ARCHIVE LOG START filespec for automatic archiving, where filespec is the new archive destination. To permanently change the destination, use the statement ALTER SYSTEM SET LOG_ARCHIVE_DEST = filespec, where filespec is the new archive destination.
Neither LOG_ARCHIVE_DEST nor LOG_ARCHIVE_FORMAT have to be complete file or directory specifiers themselves; they only need to form a valid file path after the variables are substituted into LOG_ARCHIVE_FORMAT and the two parameters are concatenated together.
http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/initparams118.htm#REFRN10085
三. 如何正确设置参数
3.1 如果我们想设置log_archive_dest 这个参数的时候,我们应该如何操作:
3.1.1清空db_recover_file_dest 和 log_archive_dest_n 参数,因为这2个参数和log_archive_dest参数冲突:
SQL> alter system set db_recovery_file_dest='';
System altered.
SQL> alter system set log_archive_dest_1='';
System altered.
3.1.2修改log_archive_dest参数,注意这里写的是直接路径,没有location选项。 因为我们之前清空了冲突的两个参数,所以可以随便修改,不会报错了。
SQL> alter system set log_archive_dest='/u01/oracle/archive_test/test1';
System altered.
SQL> alter system set log_archive_dest='/u01/oracle/archive_test';
System altered.
SQL> alter system set log_archive_dest='/u01/oracle/archive_test/test1';
System altered.
3.2 如果我们想从log_archive_dest 这个参数 切换回log_archive_dest_1参数,操作也是一样,
3.2.1 先清空该参数
SQL> alter system set log_archive_dest='';
System altered.
3.2.2 修改相应的log_archive_dest_1参数:
SQL> alter system set log_archive_dest_1="location=/u01/oracle/archive_test/test1";
System altered.
SQL> alter system set DB_RECOVERY_FILE_DEST='/u01/oracle/archive_test/test1';
System altered.
ORA-16019 和 ORA-16018 错误的处理方法(转)的更多相关文章
- 【ORA】ORA-00257 archiver error. 错误的处理方法
今天连接数据库,结果报错,ora-00257查看 [oracle@exam oracle]$ oerr ora 00257 00257, 00000, "archiver error. Co ...
- oracle错误(ORA:12154 ORA:01034 和 ORA:27101 ORA-18008 ORA-01081)
按照正常操作流程,启动项目,发现项目报错,原因是连接不上oracle数据库, PLSQL连接时报错,错误码 ORA:12154 无法解析指定的连接标识符 第一次,遇到这个错误,在网上找了资料都是需要 ...
- 真心崩溃了,oracle安装完成后居然没有tnsnames.ora和listener.ora文件
problem: oracle 11 r2 64位安装完成后NETWORK/ADMIN目录下居然没有tnsnames.ora和listener.ora文件 solution: 问题是之前安装了另 ...
- 安装好oracle11gR2之后在相应路径下却没有生成tnsnames.ora和listener.ora
oracle安装帖子:https://blog.csdn.net/wjb123sw99/article/details/80780277 oracle安装过程中检查失败:需开启C盘共享,或者勾选忽略, ...
- oracle中的listener.ora和tnsnames.ora
一.oracle的客户端与服务器端 oracle在安装完成后服务器和客户端都需要进行网络配置才能实现网络连接. 服务器端配置监听器,客户端配置网络服务名. 服务器端可配置一个或多个监听程序 . ...
- 记录一份Oracle 正确的监听配置文件listener.ora与tnsnames.ora
一.前言 昨天中午接到领导指示,有其他组的负责人B在厄瓜多尔演示他们组的产品,然后我们组的负责人就想说也在那边搭一套环境,(北美那边的亚马逊云环境),让B帮忙演示下我们的系统. 于是,开始了一个比较曲 ...
- PLSQL连接ORACLE配置字符串简介 oracle网络配置 三个配置文件 listener.ora、sqlnet.ora、tnsnames.ora原理解释
PLSQL连接ORACLE配置字符串简介 oracle网络配置 三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora原理解释 oracle网络配置三个配置文件 lis ...
- oracle: listener.ora 、sqlnet.ora 、tnsnames.ora的配置及例子
1.解决问题:TNS或者数据库不能登录. 最简单有效方法:使用oracle系统提供的工具 netca 配置(把原来的删除掉重新配置) $netca 2.然而,仍有疑问:如何指定'l ...
- oracle手动修改listener.ora和tnsnames.ora之后竟然无效
oracle手动修改listener.ora和tnsnames.ora之后竟然无效 花式重启都没有生效,需要使用Net Configuration Assistant来进行刷一下,重新生成的监听还是一 ...
- oracle三个网络配置文件(listener.ora、tnsname.ora、sqlnet.ora)的作用
oracle网络配置 三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME\network\admin目录下. 1. sqlne ...
随机推荐
- 错误:the apk for your currently selected variant(app-release-unsigned.apk)is not signed.Please specity a signing configuration for this variant(release)
1:导入android studio project 时总会出现运行处一个红色叉号,这里可以点击选择叉号上面显示的Edit Configurations 查看右下角的错误警告信息.: 2:记录错误: ...
- 继承&封装
扩展一个已有的类,并且继承该类的属性和行为这种方式成为继承. 实例 public class Polygon { public int sides; public double area; publi ...
- print输出带颜色的方法详解
书写格式: 开头部分:\033[显示方式;前景色;背景色m + 结尾部分:\033[0m 注意:开头部分的三个参数:显示方式,前景色,背景色是可选参数,可以只写其中的某一个:另外由于 ...
- JS 封装一个求数组最大值的函数
var aa = [1,2,3,4,9,2,5]; z(aa); function z(attr){ var b = 0 for(var i =1;i<aa.length;i++){ if(aa ...
- 前端开发—BOM对象DOM文档对象操作
BOM 浏览器对象 BOM:Browser Object Model 操作浏览器,需要调用window对象,它是所有浏览器都支持的对象,表示的就是浏览器窗口 window对象可以通过点调用子对象 wi ...
- immutable-js基础
Immutable.js(和原生方法不同): 用于深层次的数组和对象的比较 数据结构:Map Set Seq List Rang(和原生不同) 首先:先忘记es5 es6的数组对象方法 官 ...
- 00073_Math类
1.Math类概述 (1)Math 类是包含用于执行基本数学运算的方法的数学工具类,如初等指数.对数.平方根和三角函数: (2)类似这样的工具类 ,其所有方法均为静态方法,并且一般不会创建对象.如Sy ...
- PHP 防xss攻击
PHP直接输出html的,可以采用以下的方法进行过滤: 1.htmlspecialchars函数 2.htmlentities函数 3.HTMLPurifier.auto.php插件 4.Remove ...
- 洛谷 U3346 A1-偶回文数
U3346 A1-偶回文数 题目背景 方方方很喜欢回文数,于是zzq就出了一道关于回文数的题目. 因为偶回文数比较简单,所以方方方就把它放在了第一题... 题目描述 我们定义一个长度为偶数的回文数叫做 ...
- socketpair和pipe的区别
http://blog.csdn.net/bingqingsuimeng/article/details/9055499 管道pipe是半双工的,pipe两次才能实现全双工,使得代码复杂.socket ...