oracle怎么查桌面上的表格 Oracle怎么訪問其他數(shù)據(jù)庫或者表的用戶數(shù)據(jù)?
Oracle怎么訪問其他數(shù)據(jù)庫或者表的用戶數(shù)據(jù)?如果您訪問其他用戶 數(shù)據(jù),需要有一定的權(quán)限。(1)您可以授權(quán)該用戶查看其他用戶 桌子。如:在scott.emp上grant select進行測試。(2)
Oracle怎么訪問其他數(shù)據(jù)庫或者表的用戶數(shù)據(jù)?
如果您訪問其他用戶 數(shù)據(jù),需要有一定的權(quán)限。
(1)您可以授權(quán)該用戶查看其他用戶 桌子。
如:在scott.emp上grant select進行測試。
(2)或者直接授予該用戶dba權(quán)限。
如授權(quán)dba進行測試
(3)查詢其他用戶表
select * from scott.emp
如果您訪問其他數(shù)據(jù)庫表。
(1)創(chuàng)建一個相應的dblink來連接其他數(shù)據(jù)庫中的用戶。
配置相應的tnsname.ora,創(chuàng)建后通過tnsping命令檢查網(wǎng)絡是否連接。
(2)配置數(shù)據(jù)庫鏈接,通過數(shù)據(jù)庫鏈接進行查詢。
例如select * from
oracle查看表是否分區(qū)?
如果查詢當前用戶下的分區(qū)表:
如果要查詢整個數(shù)據(jù)庫中的已分區(qū)表,請選擇* from user _ tables where partitioned # 39 Yes # 39:
如果要查詢用戶下的分區(qū)表,請選擇* from DBA _ tables where partitioned # 39 Yes # 39:
Select * from DBA _ tables其中partitioned # 39 yes # 39 and owner # 39 ABCDEFG # 39其中ABCD
如何查看表空間?
SQL語句可用于查詢Oracle中使用的所有表和表空間:
select Segment_Name,Sum(bytes)/1024/1024 From User _ Extents Group By Segment _ Name
在數(shù)據(jù)庫管理員的日常工作中,要經(jīng)常查詢表空間的利用率,根據(jù)數(shù)據(jù)庫系統(tǒng)的具體情況預估表空間的增長情況,當表空間的利用率超過90%時,要及時采取措施。
擴展數(shù)據(jù)
oracle表空間其他查詢方法介紹;
1.查詢oracle系統(tǒng)用戶的默認表空間和臨時表空間。
從dba_users中選擇default_tablespace、temporary _ tablespace
2、查詢單表的使用情況
select segment_name,bytes from DBA _ segments where segment _ name tablename and owner USER;
3.查詢所有用戶表的前30個使用大小
選擇*from (select segment_name,bytes from DBA _ segments where owner USER order by bytes desc)where rownum lt 30;
4.檢查表空間的物理文件的名稱和大小。
SELECT表空間名稱,文件id,文件名,round(bytes / (1024 * 1024),0)總空間FROM dba_data_files ORDER BY表空間名稱