ITPub博客

首页 > Linux操作系统 > Linux操作系统 > alter database backup controlfile to trace

alter database backup controlfile to trace

原创 Linux操作系统 作者:rambob 时间:2009-07-24 16:30:38 0 删除 编辑

alter database backup controlfile to ['filename' | trace]
This command comes in two versions. One backs up the control file in a binary format while the other backs it up in a human readable form.
It is required if the database is running in archive log mode and a structural change was made to the database.

Backing it up in a binary format:
alter database backup controlfile to '/some/arbitrary/path';
alter database backup controlfile to '/some/arbitrary/path' reuse;


Backing it up in a human readable format:
alter database backup controlfile to trace;
alter database backup controlfile to trace as '/some/arbitrary/path';
alter database backup controlfile to trace as '/some/arbitrary/path' reuse;

 

SQL> alter database mount;

Database altered.

SQL> alter database backup controlfile to trace;

Database altered.

SQL> @getmytrace

TRACE_FILE
--------------------------------------------------------------------------------

D:\oracle\admin\XUE\udump\xue_ora_3308.trc
PHP code:--------------------------------------------------------------------------------
the content of getmytrace:

select a.value||b.symbol||c.instance_name||'_ora_'||d.spid||'.trc' trace_file
from
 (select value from v$parameter where name='user_dump_dest') a,
 (select substr(value,-6,1) symbol from v$parameter where name='user_dump_dest') b,
 (select instance_name from v$instance) c,
 (select spid from v$session s,v$process p,v$mystat m where s.paddr=p.addr
  and s.sid=m.sid and m.statistic#=0) d

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17001255/viewspace-610365/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: RAID0+1
请登录后发表评论 登录
全部评论

注册时间:2009-07-24

  • 博文量
    6
  • 访问量
    10631