eygle.com   eygle.com
eygle.com  
 
NLS_DATE_FORMAT-RMAN不完全修复中的时间格式 - Digest Net
利用RMAN进行基于时间点的修复,有时候需要设置nls_date_format参数,才能正确执行,如:

C:>set NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS
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中修改日期格式可以使用如下方式:
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


| | No Comments | | Edit | Pageviews:

Leave a comment