利用RMAN进行基于时间点的修复,有时候需要设置nls_date_format参数,才能正确执行,如:
在SQL*Plus中可以使用如下方式:
C:>set NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS在RMAN中修改日期格式可以使用如下方式:
C:>rman nocatalog target /
RMAN>run {
allocate channel c1 type disk;
alloctae channel c2 type disk;
set until time='2011-04-21:11:09:01';
restore database;
recover database;
sql 'alter database open resetlogs';
release channel c1;
release channel c2;
}
RMAN>run { sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";}
在SQL*Plus中可以使用如下方式:
SQL>alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
SQL>select sysdate from dual;
SYSDATE
-------------------
2011-04-21 11:11:20


Leave a comment