數據字典dict總是屬於Oracle用戶sys的
select username from dba_users;
改口令
alter user spgroup identified by spgtest;
select * from dba_data_files;
select * from dba_tablespaces;//表空間
select tablespace_name
from dba_free_space group by tablespace_name;//空閒表空間
select * from dba_data_files
where tablespace_name=
select * from dba_segments
where tablespace_name=
select * from dba_objects;
CLUSTER
PROCEDURE
select * from dba_tables;
analyze my_table compute statistics;
select extent_id
where segment_name=
order by extent_id;//表使用的extent的信息
列信息
select distinct table_name
from user_tab_columns
where column_name=
select * from dba_indexes;//索引
select * from dba_ind_columns;//索引列
select i
from user_indexes i
where i
and i
select * from dba_sequences;
select * from dba_views;
select * from all_views;
text 可用於查詢視圖生成的腳本
select * from dba_clusters;
select * from dba_snapshots;
快照
select * from dba_synonyms
where table_owner=
//if owner is PUBLIC
if owner is one of users
select * from dba_db_links;
在spbase下建數據庫鏈
create database link dbl_spnew
connect to spnew identified by spnew using
insert into acc_nbr@dbl_spnew
select * from acc_nbr where nxx_nbr=
select * from dba_trigers;
存儲過程
其文本
建立出錯
oracle總是將存儲過程
(
可以臨時禁止約束
alter table book_example
disable constraint book_example_
alter table book_example
enable constraint book_example_
(
(
select * from user_constraints
where table_name=
select owner
from user_constraints
where constraint_type=
order by table_name;
(
如
(identifier number not null);
create table book_example
(identifier number constranit book_example_
在所有的修改結果存入磁盤前
回滾段數量=並發事務/
create rollback segment r
tablespace rbs;
create rollback segment rbs_cvt
tablespace rbs
storage(initial
使回滾段在線
alter rollback segment r
用dba_extents
回滾段的區間信息
select * from dba_extents
where segment_type=
回滾段的段信息
select * from dba_segments
where segment_type=
為事物指定回歸段
set transaction use rollback segment rbs_cvt
針對bytes可以使用回滾段回縮
alter rollback segment rbs_cvt shrink;
select bytes
where segment_type=
回滾段的當前狀態信息
select * from dba_rollback_segs
where segment_name=
比多回滾段狀態status
查優化值optimal
select n
from v$rollname n
where n
回滾段中的數據
set transaction use rollback segment rb
select n
from v$rollname n
where n
當事務處理完畢
查詢回滾段中的事務
column rr heading
column us heading
column os heading
column te heading
select r
from v$lock l
where l
and trunc(l
and l
and l
order by r
查詢作業信息
select job
select job
查詢正在運行的作業
select * from dba_jobs_running;
使用包exec dbms_job
exec dbms_job
From:http://tw.wingwit.com/Article/program/Oracle/201311/18236.html