Oracle数据库如何定位trace file位置

用一个示例来说明吧。

在导入master key时,出现错误:

sql 复制代码
ADMINISTER KEY MANAGEMENT
  IMPORT KEYS WITH SECRET "my_secret"
  FROM '/tmp/export.exp'
  IDENTIFIED BY keypwd
  5    WITH BACKUP;
ADMINISTER KEY MANAGEMENT
*
ERROR at line 1:
ORA-46655: no valid keys in the file from which keys are to be imported

另一个错误:

sql 复制代码
ADMINISTER KEY MANAGEMENT
  IMPORT KEYS WITH SECRET "my_secret"
  FROM '/tmp/export.exp'
  IDENTIFIED BY keypwd
  5    WITH BACKUP;
ADMINISTER KEY MANAGEMENT
*
ERROR at line 1:
ORA-46654: cannot add the imported keys to the keystore

第2个错误提示让看trace file,第一个错误虽然没提示,但详细的错误信息也在trace file中。

sql 复制代码
SQL> !oerr ora 46654
46654, 00000, "cannot add the imported keys to the keystore"
// *Cause: The operation of writing the imported keys to the keystore failed.
// *Action: Check the contents of the trace file for more information on the
//          cause of the failure and retry the command.

SQL> !oerr ora 46655
46655, 00000, "no valid keys in the file from which keys are to be imported"
// *Cause: The specified keystore, from which keys are to be imported, did not
//         contain any valid keys.
// *Action: None.

根据Oracle的文档,运行以下命令以定位trace file:

sql 复制代码
select s.sid,s.serial#,s.audsid,s.username,s.osuser, s.client_identifier, s.sql_trace,s.action, p.spid, p.TRACEFILE
from v$session s,v$process p
where s.paddr=p.addr
and s.username is not null;

...
TRACEFILE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_ora_32145.trc
...

然后就可以找到准确的错误信息:

bash 复制代码
Trace file /u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_ora_32379.trc
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
Build label:    RDBMS_19.20.0.0.0DBRU_LINUX.X64_230621
ORACLE_HOME:    /u01/app/oracle/product/19c/dbhome_1
System name:    Linux
Node name:      instance-20231013-1024-db19c-iaas
Release:        5.4.17-2136.322.6.2.el7uek.x86_64
Version:        #2 SMP Sat Aug 19 11:55:11 PDT 2023
Machine:        x86_64
Instance name: ORCL
Redo thread mounted by this instance: 1
Oracle process number: 56
Unix process pid: 32379, image: oracle@instance-20231013-1024-db19c-iaas (TNS V)
相关推荐
伯恩bourne1 天前
【SqlServer】日志文件无法收缩的解决方法
数据库·oracle·sqlserver
小白银子1 天前
零基础从头教学Linux(Day 62)
数据库·mysql·oracle
dblens 数据库管理和开发工具2 天前
PostgreSQL模式:数据库中的命名空间艺术
数据库·postgresql·oracle
yumgpkpm2 天前
Hadoop大数据平台在中国AI时代的后续发展趋势研究CMP(类Cloudera CDP 7.3 404版华为鲲鹏Kunpeng)
大数据·hive·hadoop·python·zookeeper·oracle·cloudera
l1t2 天前
把ITPUB newkid先生编写的Oracle语法数独求解SQL改写成DuckDB
数据库·人工智能·sql·oracle·duckdb
betazhou2 天前
Oracle Goldengate 同步过程的同步用户权限设置
数据库·oracle·goldengate·ogg·goldengate授权
0和1的舞者2 天前
《MySQL数据库进阶(九):数据库备份与恢复(二)》
数据库·mysql·oracle·程序员·策略模式·备份与恢复
末点2 天前
Oracle空间函数ST_AsText配置
oracle·arcsde·st_geometry·st_astext
敲上瘾2 天前
C++ ODB ORM 完全指南:从入门到实战应用
linux·数据库·c++·oracle·db
终生成长者2 天前
MongoDB 操作命令
数据库·mongodb·oracle