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