FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Oracle-Database-Scripts/gather_stats.sql at main · co360/Oracle-Database-Scripts · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
co360
/
Oracle-Database-Scripts
Public
forked from
fatdba/Oracle-Database-Scripts
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Oracle-Database-Scripts
/
gather_stats.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (33 loc) · 801 Bytes
Breadcrumbs
Oracle-Database-Scripts
/
gather_stats.sql
Copy path
File metadata and controls
40 lines (33 loc) · 801 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
BEGIN
DBMS_STATS
.
GATHER_TABLE_STATS
(
ownname
=>
'
SCOTT
'
,
tabname
=>
'
TEST
'
,
cascade
=>
true,
--
-- For collecting stats for respective indexes
method_opt
=>
'
for all indexed columns size 1
'
,
granularity
=>
'
ALL
'
,
estimate_percent
=>
dbms_stats
.
auto_sample_size
,
degree
=>
8
);
END;
/
--
For a single table partition
BEGIN
DBMS_STATS
.
GATHER_TABLE_STATS
(
ownname
=>
'
SCOTT
'
,
tabname
=>
'
TEST
'
,
--
- TABLE NAME
partname
=>
'
TEST_JAN2016
'
--
- PARTITOIN NAME
method_opt
=>
'
for all indexed columns size 1
'
,
GRANULARITY
=>
'
APPROX_GLOBAL AND PARTITION
'
,
degree
=>
8
);
END;
/
--
for schema
Begin
dbms_stats
.
gather_schema_stats
(
ownname
=>
'
SCOTT
'
,
--
- schema name
options
=>
'
GATHER AUTO
'
,
estimate_percent
=>
dbms_stats
.
auto_sample_size
,
method_opt
=>
'
for all columns size repeat
'
,
degree
=>
24
);
END;
/
Back
|
FazBrowse Home
|
New Git URL