Oracle 常用語句備份

2022-01-24 18:26:57 字數 1276 閱讀 2515

1、oracle 11g 使用者名稱和密碼預設區分大小寫,可更改alter system set sec_case_sensitive_logon=false 設定改為不區分大小寫。

2、授權建立檢視:grant create view to 使用者;

--檢視使用者和預設表空間的關係

select username,default_tablespace from dba_users;

--檢視當前使用者能訪問的表

select * from user_tables; 

--oracle查詢使用者表

select * from user_all_tables;

--oracle查詢使用者檢視

select * from user_views;

--查詢所有函式和儲存過程:

select * from user_source;

--查詢所有使用者:

select * from all_users;

--select * from dba_users

--檢視當前使用者連線:

select * from v$session;

--檢視使用者角色

select * from user_role_privs;

--檢視當前使用者許可權:

select * from session_privs;

--檢視所有使用者所擁有的角色

select * from dba_role_privs;

--檢視所有角色

select * from dba_roles;

--檢視資料庫名

select name from v$database;

--檢視所有表空間使用情況

select a.file_id "fileno",

a.tablespace_name "tablespace_name",

a.bytes "bytes",

a.bytes - sum(nvl(b.bytes, 0)) "used",

sum(nvl(b.bytes, 0)) "free",

sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free"

from dba_data_files a, dba_free_space b

where a.file_id = b.file_id(+)

group by a.tablespace_name, a.file_id, a.bytes

order by a.tablespace_name;

Oracle常用語句備份

1 修改表的儲存表空間語句 解決方法1 alter table move tablespace move過table以後索引會丟失,所以還重建索引,先查詢失效的索引 select index name from user indexes where status unusable alter ind...

oracle 常用語句

oracle 產看表空間 select total.name tablespace name free space,total space free space used space,total space from select tablespace name,sum bytes 1024 102...

oracle常用語句

drop tablespace crm online space including contents and datafiles 刪除表空間 drop user wuliu01 cascade 刪除使用者 exp orcl file d dmp 匯出資料庫 imp orcl file e alen...