Oracle NLS_TIMESTAMP_FORMAT引數
20:14:42 > alter session set nls_timestamp_format = 'yyyy-mm-dd hh24.mi.ss.ff';
Session altered.
20:15:32 > select ora_rowscn, scn_to_timestamp(ora_rowscn) from ow_subscriber where rownum <= 10;
20:15:32 > select ora_rowscn, scn_to_timestamp(ora_rowscn) from ow_subscriber where rownum <= 10;
ORA_ROWSCN SCN_TO_TIMESTAMP(ORA_ROWSCN)
---------- ---------------------------------------------------------------------------
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
---------- ---------------------------------------------------------------------------
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
935854 2009-05-26 04.09.15.000000000
10 rows selected.
20:15:57 > alter system set nls_timestamp_format = 'yyyy-mm-dd hh24:mi:ss.ff' scopt=spfile;
alter system set nls_timestamp_format = 'yyyy-mm-dd hh24:mi:ss.ff' scopt=spfile
*
ERROR at line 1:
ORA-02096: specified initialization parameter is not modifiable with this option
alter system set nls_timestamp_format = 'yyyy-mm-dd hh24:mi:ss.ff' scopt=spfile
*
ERROR at line 1:
ORA-02096: specified initialization parameter is not modifiable with this option
在修改system層面的這個引數時,出現了該引數在該選項下是不能被修改的錯誤(即system級別下不能修改)。
該如何在這個級別修改呢?
透過在作業系統層面修改這個引數,發現實現了這個目的:
透過在.bash_profile中的oracle環境引數配置區加入如下環境變數:
export NLS_TIMESTAMP_FORMAT='yyyy-mm-dd hh24:mi:ss.ff'
[oracle@localhost ~]$ !so
source .bash_profile
[oracle@localhost ~]$ echo $NLS_TIMESTAMP_FORMAT
yyyy-mm-dd hh24:mi:ss.ff
source .bash_profile
[oracle@localhost ~]$ echo $NLS_TIMESTAMP_FORMAT
yyyy-mm-dd hh24:mi:ss.ff
重啟資料庫,檢查資料:
[oracle@localhost ~]$ sqlplus lyon/passwd
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 8月 5 20:24:27 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Session altered.
Session altered.
20:24:27 > show parameter nls_timestamp
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
nls_timestamp_format string
nls_timestamp_tz_format string
20:24:33 > select ora_rowscn, scn_to_timestamp(ora_rowscn) from ow_subscriber where rownum <= 10;
------------------------------------ --------------------------------- ------------------------------
nls_timestamp_format string
nls_timestamp_tz_format string
20:24:33 > select ora_rowscn, scn_to_timestamp(ora_rowscn) from ow_subscriber where rownum <= 10;
ORA_ROWSCN SCN_TO_TIMESTAMP(ORA_ROWSCN)
---------- ---------------------------------------------------------------------------
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
---------- ---------------------------------------------------------------------------
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
935854 2009-05-26 04:09:15.000000000
10 rows selected.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12932950/viewspace-611445/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle引數-隱藏引數Oracle
- oracle 引數Oracle
- Oracle引數檔案解析——引數解析Oracle
- Oracle 核心引數Oracle
- Oracle UNDO引數Oracle
- Oracle引數大全Oracle
- oracle引數配置Oracle
- oracle 效能引數Oracle
- ORACLE核心引數Oracle
- oracle引數整理Oracle
- Oracle引數檔案 各引數解釋Oracle
- Oracle:PDB 引數管理Oracle
- Oracle rman 配置引數Oracle
- Oracle 引數檔案Oracle
- ORACLE 配置event引數Oracle
- Oracle檢視引數Oracle
- Oracle隱式引數Oracle
- Oracle 隱含引數Oracle
- ORACLE隱含引數Oracle
- oracle重要初始引數Oracle
- Oracle 各版本引數/隱藏引數 介紹Oracle
- Oracle動態、靜態引數引數修改規則Oracle
- Linux核心引數以及Oracle引數調整(updated)LinuxOracle
- oracle 安全性引數Oracle
- Oracle UNDO引數詳解Oracle
- Oracle引數修改小結Oracle
- 談談ORACLE核心引數Oracle
- Oracle expdp 排除表引數Oracle
- Oracle 隱藏引數使用Oracle
- oracle的引數檔案Oracle
- oracle 資料泵引數Oracle
- Oracle PGA引數的管理Oracle
- Oracle 引數檔案(轉)Oracle
- oracle初始化引數Oracle
- Oracle Extent引數問題Oracle
- oracle兩個 retention 引數Oracle
- oracle核心引數意義Oracle
- oracle shutdown 引數對比Oracle