1、启动至nomount状态

  1. SYS@orcl> startup nomount;
2、查找trace文件目录

  1. SYS@orcl> select TRACEFILE from v$process where addr in(select paddr from v$session where sid in(select sid from v$mystat where rownum=1));

  2. TRACEFILE                                                                        
    --------------------------------------------------------------------------------
    /u01/app/oracle/diag/rdbms/primary_orcl/orcl/trace/orcl_ora_2519.trc             


3、启动会话级别10046事件

  1. SYS@orcl> alter session set events '10046 trace name context forever,level 12';
  2.                                                                                
  3. Session altered.

4、将数据库启动至打开状态

  1. SYS@orcl> alter database mount;
  2.                                     
  3. Database altered.
  4.                                     
  5. SYS@orcl> alter database open ;
  6.                                     
  7. Database altered.

5、关闭10046事件

  1. SYS@orcl> alter session set events '10046 trace name context off';
  2.                                                                      
  3. Session altered.

6、查看跟踪日志文件

  1. [root@test-db ~]# less /u01/app/oracle/diag/rdbms/primary_orcl/orcl/trace/orcl_ora_2519.trc

7、开始分析日志

09-26 23:31