alter database backup controlfile to trace

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博客 ” ,链接:http://blog.itpub.net/17001255/viewspace-610365/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17001255/viewspace-610365/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值