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/