資源描述:
《oracle建立表空間和用戶》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、建表空間:Createdatabasesmdatafile‘datafile地址’size2048mautoextendonnext100mmaxsize20000m其中sm為表空間名datafile地址為存放表空間路徑,例如:E:oracleproduct10.2.0oradataorclmof.dbfMof.dbf為表空間文件,和表空間名一樣。建立用戶:Createuserzhangsanidentifiedby1defaulttablespacesm其中zhangsan為用戶,sm是表空間給用戶授權(quán):Grantconnect,dbatozhangsan;Zhan
2、gsan是要授權(quán)的用戶。ORACLE日期時(shí)間函數(shù)大全??TO_DATE格式(以時(shí)間:2007-11-02??13:45:25為例)?????????Year:????????????yytwodigits兩位年???????????????顯示值:07???????yyythreedigits三位年???????????????顯示值:007???????yyyyfourdigits四位年???????????????顯示值:2007??????????????????Month:????????????mm???number????兩位月?????????????顯示值:11?
3、??????mon???abbreviated字符集表示?????????顯示值:11月,若是英文版,顯示nov???????????monthspelledout字符集表示?????????顯示值:11月,若是英文版,顯示november????????????????Day:????????????dd???number????????當(dāng)月第幾天???????顯示值:02???????ddd???number????????當(dāng)年第幾天???????顯示值:02???????dy???abbreviated當(dāng)周第幾天簡(jiǎn)寫???顯示值:星期五,若是英文版,顯示fri???????
4、day???spelledout??當(dāng)周第幾天全寫???顯示值:星期五,若是英文版,顯示friday??????????????ddspthspelledout,ordinaltwelfth?????????????????????????Hour:?????????????hh???twodigits12小時(shí)進(jìn)制???????????顯示值:01?????????????hh24twodigits24小時(shí)進(jìn)制???????????顯示值:13??????????????????????????Minute:?????????????mi???twodigits60進(jìn)制?????
5、??????????顯示值:45??????????????????????????Second:?????????????ss???twodigits60進(jìn)制???????????????顯示值:25??????????????????????????其它?????????????Q????digit????????季度?????????????????顯示值:4?????????????WW???digit????????當(dāng)年第幾周???????????顯示值:44?????????????W???digit?????????當(dāng)月第幾周???????????顯示值:1????
6、????????????????24小時(shí)格式下時(shí)間范圍為:0:00:00-23:59:59....????????????12小時(shí)格式下時(shí)間范圍為:1:00:00-12:59:59....???????????1.日期和字符轉(zhuǎn)換函數(shù)用法(to_date,to_char)????????selectto_char(sysdate,'yyyy-mm-ddhh24:mi:ss')asnowTimefromdual;??//日期轉(zhuǎn)化為字符串??selectto_char(sysdate,'yyyy')asnowYear??fromdual;??//獲取時(shí)間的年??selectto_cha
7、r(sysdate,'mm')???asnowMonthfromdual;??//獲取時(shí)間的月??selectto_char(sysdate,'dd')???asnowDay???fromdual;??//獲取時(shí)間的日??selectto_char(sysdate,'hh24')asnowHour??fromdual;??//獲取時(shí)間的時(shí)??selectto_char(sysdate,'mi')???asnowMinutefromdual;??//獲取時(shí)間的分??selectto