oracle如何查账号权限The usage of SQLPATH

The usage of SQLPATH

 

1. create directory    www.2cto.com  

mkdir /home/oracle/scripts

2. copy script to the directory

cp gettrc.sql /home/oracle/scripts

3. edit ./.bash_profile and add the following info into it

export SQLPATH=/home/oracle/scripts:$SQLPATH

4. Explanation:

sqlplus will find script default with SQLPATH parameter. 

When you use @gettrc.sql,then the sqlplus can locate it and execute it successfully.

 

The following sql statement is the detail of gettrc.sql .

SELECT    d.VALUE

       || '/'

       || LOWER (RTRIM (i.INSTANCE, CHR (0)))

       || '_ora_'

       || p.spid

       || '.trc' trace_file_name

  FROM (SELECT p.spid

          FROM v$mystat m, v$session s, v$process p

         WHERE m.statistic# = 1 AND s.SID = m.SID AND p.addr = s.paddr) p,

       (SELECT t.INSTANCE

          FROM v$thread t, v$parameter v

         WHERE v.NAME = 'thread'

           AND (v.VALUE = 0 OR t.thread# = TO_NUMBER (v.VALUE))) ioracle账号,

       (SELECT VALUE

          FROM v$parameter

         WHERE NAME = 'user_dump_dest') d;

 

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。