日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

oracle数据库应用(2)

發布時間:2024/3/13 数据库 67 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle数据库应用(2) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.序列
1.1 序列和表是平級的。
1.2 一個序列可以給多張表共用
1.3 create sequence seq_num
startwith 1
maxvalue nomaxvalue
cache 20
2.表空間
create tablespace tab
datafile 'E:\xxx.dbf' size 10m
maxsize unlimited
3.函數
單行函數
1.日期函數:Monthes_between 月份之差
2.數字函數: round() 四舍五入 trunc() 截斷
3.字符串函數: upper() lower() initCap() concat() substr() length() lengthb() instr()
4.轉換函數 :to_date(字符串) to_char(數字) to_number()
5.nvl nvl2
6.decode 相當于 case when then else end

分組函數

分析函數
1.rank 特點:1 1 3

2.row_nubmer 1 2 3


3.desrank 1 1 2

4.創建/刪除表空間權限不足
用system.登錄,grant授權然后就可以了。

5.查詢當前用戶所能管理的所有表空間
select tablespace_name from user_tablespaces

6.設置只讀
------------------------------------------------------------------
4.同義詞

grant create synonym to SCOTT
GRANT CREATE PUBLIC SYNONYM TO scott;


create synonym ee for SCOTT.emp
create public synonym tt for SCOTT.emp


grant select on emp to 具體的用戶或者是模式
grant select on emp to public

可以訪問了


5.索引
索引作用:快速訪問數據的途徑,提高數據庫的性能。
SQL Server 索引:唯一索引(1) 復合索引 聚集索引(3) 非聚集索引 全文 索引 主鍵索引(2)。

B數索引


算法
Bound mismatch: The generic method sort(List<T>) of type Collections is not applicable(合適) for the arguments (List<Student>). The inferred(推斷) type Student is not a valid substitute(代用品) for the bounded parameter <T extends Comparable<? super T>>
http://blog.csdn.net/xjyzxx/article/details/18465661
http://www.cnblogs.com/pipi-style/p/4738072.html
http://hexo.trity.cc/2015/08/24/Arrays.sort%E5%92%8CCollections.sort%E5%8C%BA%E5%88%AB/
http://lib.csdn.net/article/datastructure/9282


6.表分區


create table orders
(
order_id number,
order_date date,
order_total number
)
partition by range(order_date)
(
partition p1 values less than (to_date('2005-01-01','yyyy-mm-dd')),
partition p2 values less than (maxvalue)

)

--添加數據
insert into orders values(1,sysdate,100)


select * from orders partition(p2)

SELECT table_name,partition_name
FROM user_tab_partitions
WHERE table_name=UPPER('orders');

create table intervalOrders
partition by range(order_date)
interval(numtoyminterval(1,'YEAR'))
(partition P1 values less than (to_date('2015-01-01','yyyy/mm/dd')))
as select * from orders;

insert into intervalOrders values(2,to_date('2010-01-01','yyyy/mm/dd'),200)

select * from intervalOrders partition(SYS_P42)


insert into intervalOrders values(3,sysdate,300)

?

轉載于:https://www.cnblogs.com/dongyuhan/p/7541521.html

總結

以上是生活随笔為你收集整理的oracle数据库应用(2)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。