author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Wed, 11 Dec 2019 01:04:57 +0200 | |
changeset 2395 | a8f39320e076 |
parent 2341 | d241ba9f9366 |
child 2569 | 8f4415990863 |
permissions | -rw-r--r-- |
1403
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8; -*- |
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
================== |
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
Oracle database. |
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
================== |
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
.. contents:: |
1905
fba288d59662
Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1625
diff
changeset
|
7 |
:local: |
1403
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
|
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
Oracle database development environment. |
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
======================================== |
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
|
2221 | 12 |
http://en.wikipedia.org/wiki/Oracle_SQL_Developer |
13 |
Integrated development environment (IDE) for working with |
|
14 |
SQL/PLSql in Oracle databases. |
|
15 |
http://en.wikipedia.org/wiki/SQL*Plus |
|
16 |
An Oracle database client that can run SQL and PL/SQL commands |
|
17 |
and display their results. |
|
18 |
http://en.wikipedia.org/wiki/Oracle_Forms |
|
19 |
Is a software product for creating screens that interact with an |
|
20 |
Oracle database. It has an IDE including an object navigator, |
|
21 |
property sheet and code editor that uses PL/SQL. |
|
22 |
http://en.wikipedia.org/wiki/Oracle_JDeveloper |
|
23 |
JDeveloper is a freeware IDE supplied by Oracle Corporation. It |
|
24 |
offers features for development in Java, XML, SQL and PL/SQL, |
|
25 |
HTML, JavaScript, BPEL and PHP. |
|
26 |
http://en.wikipedia.org/wiki/Oracle_Reports |
|
27 |
Oracle Reports is a tool for developing reports against data |
|
28 |
stored in an Oracle database. |
|
1403
8f86324134d6
Oracle database development environment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
29 |
|
2194
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
30 |
Useful PL/SQL stubs |
1494
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
31 |
=================== |
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
32 |
|
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
33 |
Declare executable block:: |
1494
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
34 |
|
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
35 |
declare |
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
36 |
begin |
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
37 |
null; |
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
38 |
end; |
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
39 |
/ |
f7e956de0cd7
Useful PL/SQL stub.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1486
diff
changeset
|
40 |
|
2113 | 41 |
Using variables:: |
42 |
||
43 |
declare |
|
44 |
x number; |
|
45 |
begin |
|
46 |
select 1 into x from dual; |
|
47 |
end; |
|
48 |
/ |
|
49 |
||
2194
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
50 |
Call procedure:: |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
51 |
|
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
52 |
create or replace procedure MY_PROC as |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
53 |
begin |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
54 |
null; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
55 |
end; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
56 |
/ |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
57 |
|
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
58 |
begin |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
59 |
MY_PROC; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
60 |
end; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
61 |
/ |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
62 |
|
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
63 |
Call function:: |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
64 |
|
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
65 |
create or replace function MY_FUN return number as |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
66 |
begin |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
67 |
return 42; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
68 |
end; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
69 |
/ |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
70 |
|
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
71 |
declare |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
72 |
x NUMBER; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
73 |
begin |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
74 |
ret := MY_FUN(); |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
75 |
end; |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
76 |
/ |
60f74f8b5967
Call procedure/function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2185
diff
changeset
|
77 |
|
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
78 |
Common client options |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
79 |
===================== |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
80 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
81 |
Following options supports Sql*Plus, SQLcl, Oracle Developer. |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
82 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
83 |
Enabling printing:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
84 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
85 |
set serveroutput on; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
86 |
exec DBMS_OUTPUT.PUT_LINE('Hello'); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
87 |
exec DBMS_OUTPUT.DISABLE(); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
88 |
exec DBMS_OUTPUT.PUT_LINE('Silence'); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
89 |
exec DBMS_OUTPUT.ENABLE(); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
90 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
91 |
Enable printing of query execution time:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
92 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
93 |
set timing on; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
94 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
95 |
Sql*Plus client options |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
96 |
======================= |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
97 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
98 |
Enable printing execution plan stats:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
99 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
100 |
set autotrace on; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
101 |
set autotrace off; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
102 |
set autotrace on statistics; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
103 |
set autotrace on explain; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
104 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
105 |
Disable printing of ``select`` result, show only stats:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
106 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
107 |
set autotrace traceonly; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
108 |
set autotrace traceonly on explain; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
109 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
110 |
Adjust date format. |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
111 |
=================== |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
112 |
:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
113 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
114 |
column parameter format a32; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
115 |
column value format a32; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
116 |
select parameter, value from v$nls_parameters; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
117 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
118 |
alter session set NLS_DATE_FORMAT = 'yyyy-mm-dd HH:MI:SS'; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
119 |
alter session set NLS_TIMESTAMP_FORMAT = 'MI:SS.FF6'; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
120 |
alter session set NLS_TIME_FORMAT = 'HH24:MI:SS.FF6'; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
121 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
122 |
alter session set TIME_ZONE = '+06:00'; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
123 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
124 |
select sysdate from dual; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
125 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
126 |
Working with SQL/Plus |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
127 |
===================== |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
128 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
129 |
Show error details:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
130 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
131 |
show errors; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
132 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
133 |
Modify output format:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
134 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
135 |
set pagesize 40; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
136 |
set linesize 400; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
137 |
|
2221 | 138 |
Database info |
139 |
============= |
|
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
140 |
|
1624
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
141 |
List of users:: |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
142 |
|
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
143 |
select distinct(OWNER) from ALL_TABLES; |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
144 |
|
1623 | 145 |
List of current user owned tables:: |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
146 |
|
1623 | 147 |
select * from USER_TABLES; |
1624
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
148 |
select TABLE_NAME from USER_TABLES; |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
149 |
|
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
150 |
List of tables by owner:: |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
151 |
|
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
152 |
select OWNER || '.' || TABLE_NAME from ALL_TABLES |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
153 |
order by OWNER; |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
154 |
|
1623 | 155 |
List of current user table sizes:: |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
156 |
|
1623 | 157 |
select SEGMENT_NAME, SEGMENT_TYPE, sum(BYTES) from USER_EXTENTS |
158 |
group by SEGMENT_NAME, SEGMENT_TYPE order by sum(BYTES); |
|
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
159 |
|
1623 | 160 |
select sum(BYTES) from USER_EXTENTS; |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
161 |
|
2270
da95425e3010
Get LOB stored size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2245
diff
changeset
|
162 |
Get LOB stored size:: |
da95425e3010
Get LOB stored size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2245
diff
changeset
|
163 |
|
da95425e3010
Get LOB stored size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2245
diff
changeset
|
164 |
select sum(dbms_lob.getchunksize(COL))/1024/1024 MiB from TBL; |
da95425e3010
Get LOB stored size.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2245
diff
changeset
|
165 |
|
2185
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
166 |
Table indexes restricted to user:: |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
167 |
|
1623 | 168 |
select * from USER_INDEXES order by TABLE_NAME; |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
169 |
|
2185
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
170 |
Table indexes available to user:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
171 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
172 |
select * from ALL_INDEXES order by TABLE_NAME; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
173 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
174 |
All table indexes:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
175 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
176 |
select * from DBA_INDEXES order by TABLE_NAME; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
177 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
178 |
View index columns:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
179 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
180 |
select * from DBA_IND_COLUMNS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
181 |
select * from ALL_IND_COLUMNS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
182 |
select * from USER_IND_COLUMNS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
183 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
184 |
Vie index expressions:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
185 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
186 |
select * from DBA_IND_EXPRESSIONS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
187 |
select * from ALL_IND_EXPRESSIONS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
188 |
select * from USER_IND_EXPRESSIONS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
189 |
|
1623 | 190 |
List of index sizes:: |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
191 |
|
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
192 |
select index_name, table_name, sum(user_extents.bytes) as bytes from user_indexes |
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
193 |
left outer join user_extents on user_extents.segment_name = table_name |
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
194 |
group by index_name, table_name |
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
195 |
order by table_name; |
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
196 |
|
2185
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
197 |
View index statistics:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
198 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
199 |
select * from DBA_IND_STATISTICS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
200 |
select * from ALL_IND_STATISTICS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
201 |
select * from USER_IND_STATISTICS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
202 |
select * from INDEX_STATS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
203 |
|
1624
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
204 |
List of tables without primary keys:: |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
205 |
|
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
206 |
select OWNER || '.' || TABLE_NAME from ALL_TABLES |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
207 |
where TABLE_NAME not in ( |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
208 |
select distinct TABLE_NAME from ALL_CONSTRAINTS where CONSTRAINT_TYPE = 'P' |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
209 |
) and OWNER in ('USER1', 'USER2') |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
210 |
order by OWNER, TABLE_NAME; |
baf11017516f
List of tables by owner.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1623
diff
changeset
|
211 |
|
2216
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
212 |
List tables that has foreign key to given table:: |
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
213 |
|
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
214 |
select * from SYS.USER_CONSTRAINTS cons |
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
215 |
join SYS.USER_CONSTRAINTS rcons on rcons.CONSTRAINT_NAME = cons.R_CONSTRAINT_NAME |
2218 | 216 |
where cons.CONSTRAINT_TYPE = 'R' and rcons.TABLE_NAME = 'TBL_NAME'; |
2216
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
217 |
|
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
218 |
select * from SYS.USER_CONSTRAINTS cons |
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
219 |
join SYS.USER_CONSTRAINTS rcons on rcons.CONSTRAINT_NAME = cons.R_CONSTRAINT_NAME |
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
220 |
where cons.CONSTRAINT_TYPE = 'R' and rcons.TABLE_NAME like '%/_OLD' escape '/'; |
303e4963ffc5
List tables that has foreign key to given table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2194
diff
changeset
|
221 |
|
2220
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
222 |
List of missing index for foreign key constraint:: |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
223 |
|
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
224 |
select |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
225 |
case when b.table_name is null then 'unindexed' else 'indexed' end as status, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
226 |
a.table_name as table_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
227 |
a.constraint_name as fk_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
228 |
a.fk_columns as fk_columns, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
229 |
b.index_name as index_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
230 |
b.index_columns as index_columns |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
231 |
from ( |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
232 |
select |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
233 |
a.table_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
234 |
a.constraint_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
235 |
listagg(a.column_name, ',') within group (order by a.position) fk_columns |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
236 |
from user_cons_columns a, user_constraints b |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
237 |
where |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
238 |
a.constraint_name = b.constraint_name |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
239 |
and b.constraint_type = 'R' |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
240 |
and a.owner = b.owner |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
241 |
group by a.table_name, a.constraint_name |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
242 |
) a, ( |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
243 |
select |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
244 |
table_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
245 |
index_name, |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
246 |
listagg(c.column_name, ',') within group (order by c.column_position) index_columns |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
247 |
from user_ind_columns c |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
248 |
group by table_name, index_name |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
249 |
) b |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
250 |
where a.table_name = b.table_name(+) |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
251 |
and b.index_columns(+) like a.fk_columns || '%' |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
252 |
order by 1 desc, 2; |
f643c573f870
List of missing index for foreign key constraint.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2219
diff
changeset
|
253 |
|
2185
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
254 |
List of current constraints limited to current user:: |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
255 |
|
1623 | 256 |
select * from USER_CONSTRAINTS; |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
257 |
|
2185
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
258 |
List of constraints available to user:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
259 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
260 |
select * from ALL_CONSTRAINTS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
261 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
262 |
List of all constraints:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
263 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
264 |
select * from DBA_CONSTRAINTS; |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
265 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
266 |
.. note:: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
267 |
``CONSTRAINT_TYPE``: |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
268 |
|
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
269 |
* ``C`` (check constraint on a table) |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
270 |
* ``P`` (primary key) |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
271 |
* ``U`` (unique key) |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
272 |
* ``R`` (referential integrity) |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
273 |
* ``V`` (with check option, on a view) |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
274 |
* ``O`` (with read only, on a view) |
f31a1ff8d8d9
Discover indexes and constraints.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2147
diff
changeset
|
275 |
|
1623 | 276 |
List of tablespaces:: |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
277 |
|
1623 | 278 |
select distinct TABLESPACE_NAME from USER_TABLES; |
1462
27d4d6c15cb4
Информация о таблицах в БД Oracle.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1403
diff
changeset
|
279 |
|
2112 | 280 |
List user objects:: |
281 |
||
282 |
select OBJECT_NAME, OBJECT_TYPE from USER_OBJECTS |
|
283 |
order by OBJECT_TYPE, OBJECT_NAME; |
|
284 |
||
1622
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
285 |
List of current user permissions:: |
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
286 |
|
1623 | 287 |
select * from SESSION_PRIVS; |
1622
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
288 |
|
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
289 |
List of user permissions to tables:: |
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
290 |
|
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
291 |
select * from ALL_TAB_PRIVS where TABLE_SCHEMA not like '%SYS' and TABLE_SCHEMA not like 'SYS%'; |
dec1fd4222e8
List of current user permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1583
diff
changeset
|
292 |
|
1625
0fa6542d8c93
List of user privileges.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1624
diff
changeset
|
293 |
List of user privileges:: |
0fa6542d8c93
List of user privileges.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1624
diff
changeset
|
294 |
|
0fa6542d8c93
List of user privileges.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1624
diff
changeset
|
295 |
select * from USER_SYS_PRIVS |
0fa6542d8c93
List of user privileges.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1624
diff
changeset
|
296 |
select * from USER_TAB_PRIVS |
0fa6542d8c93
List of user privileges.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1624
diff
changeset
|
297 |
select * from USER_ROLE_PRIVS |
0fa6542d8c93
List of user privileges.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1624
diff
changeset
|
298 |
|
2219
f991bbf12a59
List of other users that have access to given user tables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2218
diff
changeset
|
299 |
List of other users that have access to given user tables:: |
f991bbf12a59
List of other users that have access to given user tables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2218
diff
changeset
|
300 |
|
f991bbf12a59
List of other users that have access to given user tables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2218
diff
changeset
|
301 |
select * from ALL_TAB_PRIVS where GRANTOR = 'ME'; |
f991bbf12a59
List of other users that have access to given user tables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2218
diff
changeset
|
302 |
|
2146
274a3e6678ba
Dump how exactly field stored.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2137
diff
changeset
|
303 |
Dump how exactly field stored:: |
274a3e6678ba
Dump how exactly field stored.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2137
diff
changeset
|
304 |
|
274a3e6678ba
Dump how exactly field stored.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2137
diff
changeset
|
305 |
select dump(date '2009-08-07') from dual; |
274a3e6678ba
Dump how exactly field stored.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2137
diff
changeset
|
306 |
select dump(sysdate) from dual; |
274a3e6678ba
Dump how exactly field stored.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2137
diff
changeset
|
307 |
|
2217 | 308 |
https://dba.stackexchange.com/questions/11047/how-to-retrieve-foreign-key-constraints-data/ |
309 |
How to retrieve foreign key constraints data. |
|
310 |
||
2111
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
311 |
Managing data files location |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
312 |
============================ |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
313 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
314 |
To find out where is data files located run as ``sysdba``:: |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
315 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
316 |
select * from dba_data_files; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
317 |
select * from dba_temp_files; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
318 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
319 |
Above files represent table spaces:: |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
320 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
321 |
select * from dba_tablespaces; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
322 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
323 |
Another information about installation:: |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
324 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
325 |
select * from v$controlfile; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
326 |
select * from v$tablespace; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
327 |
select * from v$database; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
328 |
show parameter control_files; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
329 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
330 |
Place for dumps:: |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
331 |
|
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
332 |
show parameter user_dump_dest; |
f780f1b08e12
Managing data files location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1912
diff
changeset
|
333 |
|
2274
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
334 |
Sessions and locks |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
335 |
================== |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
336 |
|
2275
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
337 |
List locked objects:: |
2274
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
338 |
|
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
339 |
select * from v$locked_object; |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
340 |
|
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
341 |
select * from v$locked_object a, all_objects b |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
342 |
where a.object_id = b.object_id; |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
343 |
|
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
344 |
select b.owner, b.object_name, a.oracle_username, a.os_user_name |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
345 |
from v$locked_object a, all_objects b |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
346 |
where a.object_id = b.object_id; |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
347 |
|
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
348 |
select |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
349 |
c.owner, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
350 |
c.object_name, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
351 |
c.object_type, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
352 |
b.sid, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
353 |
b.serial#, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
354 |
b.status, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
355 |
b.osuser, |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
356 |
b.machine |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
357 |
from v$locked_object a, v$session b, dba_objects c |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
358 |
where b.sid = a.session_id and a.object_id = c.object_id; |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
359 |
|
2275
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
360 |
select * from DBA_BLOCKERS; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
361 |
select * from DBA_DDL_LOCKS; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
362 |
select * from DBA_DML_LOCKS; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
363 |
select * from DBA_LOCK_INTERNAL; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
364 |
select * from DBA_LOCKS; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
365 |
select * from DBA_WAITERS; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
366 |
|
2274
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
367 |
Kill session:: |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
368 |
|
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
369 |
alter system kill session 'SID,SERIAL#'; |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
370 |
alter system kill session '361,565'; |
b72b5f7d98ac
Sessions and locks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2270
diff
changeset
|
371 |
|
2275
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
372 |
List session parameters:: |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
373 |
|
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
374 |
select * from v$parameter; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
375 |
select NAME, VALUE from v$parameter; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
376 |
|
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
377 |
show parameters ddl_lock_timeout; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
378 |
|
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
379 |
Alter session parameter:: |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
380 |
|
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
381 |
alter session set ddl_lock_timeout = 10; |
adb168e2b3a0
List locked objects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2274
diff
changeset
|
382 |
|
2112 | 383 |
Installing express edition |
384 |
========================== |
|
385 |
||
386 |
Disable APEX port |
|
387 |
----------------- |
|
388 |
||
389 |
Find APEX port in usage:: |
|
390 |
||
391 |
select dbms_xdb.GetHttpPort, dbms_xdb.GetFtpPort from dual; |
|
392 |
||
393 |
Disable APEX lisener (to free useful 8080 port) from ``system``:: |
|
394 |
||
395 |
execute dbms_xdb.SetHttpPort(0); |
|
396 |
||
397 |
or move to another port:: |
|
398 |
||
399 |
execute dbms_xdb.SetHttpPort(8090); |
|
400 |
||
401 |
http://stackoverflow.com/questions/165105/how-to-disable-oracle-xe-component-which-is-listening-on-8080 |
|
402 |
How to disable Oracle XE component which is listening on 8080? |
|
403 |
http://daust.blogspot.co.il/2006/01/xe-changing-default-http-port.html |
|
404 |
XE: Changing the default http port. |
|
405 |
https://erikwramner.wordpress.com/2014/03/23/stop-oracle-xe-from-listening-on-port-8080/ |
|
406 |
Stop Oracle XE from listening on port 8080. |
|
407 |
||
2113 | 408 |
Creating user |
409 |
------------- |
|
410 |
||
411 |
From ``system`` account:: |
|
412 |
||
413 |
create user BOB identified by 123456; |
|
414 |
alter user BOB account unlock; |
|
415 |
alter user BOB default tablespace USERS; |
|
416 |
alter user BOB temporary tablespace TEMP; |
|
417 |
alter user BOB quota 100M on USERS; |
|
418 |
grant CREATE SESSION, ALTER SESSION to BOB; |
|
419 |
grant CREATE PROCEDURE, CREATE TRIGGER to BOB; |
|
420 |
grant CREATE TABLE, CREATE SEQUENCE, CREATE VIEW, CREATE SYNONYM to BOB; |
|
421 |
||
2226
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
422 |
Profiling |
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
423 |
========= |
1483
1475d464e8a8
Timing info about last queries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1482
diff
changeset
|
424 |
|
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
425 |
``explain plan for`` can be used to show probable execution plan for query:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
426 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
427 |
explain plan for select 1 from dual; |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
428 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
429 |
``plan_table`` should be examined to display result:: |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
430 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
431 |
select * from table(dbms_xplan.display); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
432 |
|
2277
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
433 |
Remove statistics:: |
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
434 |
|
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
435 |
execute DBMS_STATS.DELETE_SCHEMA_STATS('BOB'); |
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
436 |
|
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
437 |
Collect statistics:: |
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
438 |
|
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
439 |
execute DBMS_STATS.GATHER_DATABASE_STATS; |
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
440 |
execute DBMS_STATS.GATHER_SCHEMA_STATS('BOB'); |
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
441 |
execute DBMS_STATS.GATHER_TABLE_STATS('BOB', 'EMPLOYEE'); |
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
442 |
|
39da290b29bb
About removing/collecting statistics.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2276
diff
changeset
|
443 |
Get actual execution plan of query after executing query:: |
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
444 |
|
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
445 |
select * from table(dbms_xplan.display_cursor); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
446 |
select * from table(dbms_xplan.display_cursor(format => 'basic')); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
447 |
select * from table(dbms_xplan.display_cursor(format => 'typical')); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
448 |
select * from table(dbms_xplan.display_cursor(format => 'all')); |
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
449 |
|
2226
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
450 |
Last queries' execution stats are available through ``v$sql`` view:: |
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
451 |
|
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
452 |
grant select on v_$sql to BOB; |
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
453 |
|
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
454 |
select * from v$sql; |
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
455 |
select * from v$sql_plan; |
1483
1475d464e8a8
Timing info about last queries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1482
diff
changeset
|
456 |
|
1475d464e8a8
Timing info about last queries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1482
diff
changeset
|
457 |
select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql |
1475d464e8a8
Timing info about last queries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1482
diff
changeset
|
458 |
order by LAST_LOAD_TIME desc |
1475d464e8a8
Timing info about last queries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1482
diff
changeset
|
459 |
|
1486
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
460 |
Improved version of above code:: |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
461 |
|
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
462 |
column LAST_LOAD_TIME format a20; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
463 |
column TIME format a20; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
464 |
column MODULE format a10; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
465 |
column SQL_TEXT format a60; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
466 |
|
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
467 |
set autotrace off; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
468 |
set timing off; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
469 |
|
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
470 |
select * from ( |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
471 |
select LAST_LOAD_TIME, to_char(ELAPSED_TIME/1000, '999,999,999.000') || ' ms' as TIME, MODULE, SQL_TEXT from SYS."V_\$SQL" |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
472 |
where SQL_TEXT like '%BATCH_BRANCHES%' |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
473 |
order by LAST_LOAD_TIME desc |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
474 |
) where ROWNUM <= 5; |
f3be7476145d
Improved version of code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1485
diff
changeset
|
475 |
|
2226
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
476 |
In SQL/Plus query execution time (up to ):: |
1484 | 477 |
|
478 |
SET TIMING ON; |
|
479 |
-- do stuff |
|
480 |
SET TIMING OFF; |
|
481 |
||
482 |
or:: |
|
483 |
||
2221 | 484 |
set serveroutput on; |
485 |
variable n number; |
|
1484 | 486 |
exec :n := dbms_utility.get_time; |
487 |
select ...... |
|
488 |
exec dbms_output.put_line( (dbms_utility.get_time-:n)/100) || ' seconds....' ); |
|
489 |
||
2136
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
490 |
In SQL Developer you get execution time in result window. By default SQL |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
491 |
Developer limit output to 50 rows. To run full query select result window nat |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
492 |
press ``Ctrl+End``. |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
493 |
|
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
494 |
Alternatively you may wrap you query with (and optionally use hint to disable |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
495 |
optimizations??):: |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
496 |
|
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
497 |
select count(*) from ( ... ORIGINAL QUERY ... ); |
2136
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
498 |
|
2137 | 499 |
Another option is:: |
500 |
||
501 |
delete plan_table; |
|
502 |
explain plan for ... SQL statement ...; |
|
503 |
select time from plan_table where id = 0; |
|
504 |
||
2226
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
505 |
.. note:: |
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
506 |
From docs: |
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
507 |
|
2276 | 508 |
PLAN_TABLE is automatically created as a global temporary table to hold the output of an |
509 |
EXPLAIN PLAN statement for all users. PLAN_TABLE is the default sample output table into which |
|
510 |
the EXPLAIN PLAN statement inserts rows describing execution plans. |
|
2226
d72d3ce66806
Last queries' execution stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2221
diff
changeset
|
511 |
|
1484 | 512 |
See: |
513 |
||
2136
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
514 |
http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2113.htm |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
515 |
$SQL lists statistics on shared SQL area without the GROUP BY clause. |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
516 |
http://stackoverflow.com/questions/22198853/finding-execution-time-of-query-using-sql-developer |
3f34a66e6a2a
Finding Execution time of query using SQL Developer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2114
diff
changeset
|
517 |
Finding Execution time of query using SQL Developer. |
2137 | 518 |
http://stackoverflow.com/questions/3559189/oracle-query-execution-time |
519 |
Oracle query execution time. |
|
520 |
http://tkyte.blogspot.com/2007/04/when-explanation-doesn-sound-quite.html |
|
521 |
When the explanation doesn't sound quite right... |
|
1484 | 522 |
|
1485
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
523 |
Last table modification time. |
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
524 |
============================= |
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
525 |
:: |
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
526 |
|
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
527 |
select max(scn_to_timestamp(ora_rowscn)) from TBL; |
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
528 |
|
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
529 |
select timestamp from all_tab_modifications where table_owner = 'OWNER'; |
752e99dbb016
Last table modification time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1484
diff
changeset
|
530 |
select timestamp from all_tab_modifications where table_name = 'TABLE'; |
1484 | 531 |
|
1482
1a012d9fe613
List of Oracle Reserved Words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1462
diff
changeset
|
532 |
List of Oracle Reserved Words. |
1a012d9fe613
List of Oracle Reserved Words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1462
diff
changeset
|
533 |
============================== |
1a012d9fe613
List of Oracle Reserved Words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1462
diff
changeset
|
534 |
|
2231
2813a509381c
Common client options. Sql*Plus client options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2226
diff
changeset
|
535 |
* http://docs.oracle.com/cd/B19306_01/em.102/b40103/app_oracle_reserved_words.htm |
1496
7679a0100061
Adjust date format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1495
diff
changeset
|
536 |
|
2147 | 537 |
Find time zone |
538 |
============== |
|
539 |
||
540 |
Set TZ data formt:: |
|
541 |
||
542 |
alter session set 'YYYY-MM-DD HH24:MI:SS.FF3 TZR'; |
|
543 |
||
544 |
For system TZ look to TZ in:: |
|
545 |
||
546 |
select SYSTIMESTAMP from dual; |
|
547 |
||
548 |
For session TZ look to TZ in:: |
|
549 |
||
550 |
select CURRENT_TIMESTAMP from dual; |
|
551 |
||
552 |
or directly in:: |
|
553 |
||
554 |
select SESSIONTIMEZONE from dual; |
|
555 |
||
556 |
You can adjust session TZ by:: |
|
557 |
||
558 |
alter session set TIME_ZONE ='+06:00'; |
|
559 |
||
560 |
which affect on ``CURRENT_DATE``, ``CURRENT_TIMESTAMP``, ``LOCALTIMESTAMP``. |
|
561 |
||
562 |
``DBTIMEZONE`` is set when database is created and can't be altered if the |
|
563 |
database contains a table with a ``TIMESTAMP WITH LOCAL TIME ZONE`` column and |
|
564 |
the column contains data:: |
|
565 |
||
566 |
select DBTIMEZONE from dual; |
|
567 |
||
568 |
Find time at timezone:: |
|
569 |
||
570 |
select SYSTIMESTAMP at time zone 'GMT' from dual; |
|
2243
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
571 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
572 |
Move data across DBes |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
573 |
===================== |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
574 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
575 |
Format ``select`` data as ``insert`` statements with ``/*insert*/`` hind (use ``F5`` key in Oracle |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
576 |
developer):: |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
577 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
578 |
select /*insert*/ * from tbl; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
579 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
580 |
Another useful hint:: |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
581 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
582 |
select /*csv*/ * from tbl; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
583 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
584 |
Alternatively enable output as ``insert`` statments (use ``F5`` key in Oracle developer):: |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
585 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
586 |
set sqlformat insert; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
587 |
select * from tbl; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
588 |
|
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
589 |
spool /home/user/insert.sql; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
590 |
select * from tbl where ...; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
591 |
spool off; |
eccc5846e1dd
Move data across DBes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2231
diff
changeset
|
592 |
|
2280
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
593 |
Another ``sqlformat``:: |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
594 |
|
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
595 |
set sqlformat default; |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
596 |
set sqlformat csv; |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
597 |
set sqlformat html; |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
598 |
set sqlformat xml; |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
599 |
set sqlformat json; |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
600 |
|
2244 | 601 |
https://dba.stackexchange.com/questions/173540/generate-insert-statements-for-each-entry-in-a-table |
602 |
Generate ``insert`` statements for each entry in a table. |
|
2280
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
603 |
https://oracle-base.com/articles/misc/sqlcl-format-query-results-with-the-set-sqlformat-command |
9ffe47dfa862
SQLcl : Format Query Results with the SET SQLFORMAT Command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2278
diff
changeset
|
604 |
SQLcl : Format Query Results with the SET SQLFORMAT Command. |
2245
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
605 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
606 |
Unlock expired password |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
607 |
======================= |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
608 |
|
2340
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
609 |
Login as sysdba:: |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
610 |
|
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
611 |
sqlplus / as sysdba |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
612 |
|
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
613 |
Check expiration date for user:: |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
614 |
|
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
615 |
select EXPIRY_DATE from DBA_USERS where USERNAME = 'me'; |
2341
d241ba9f9366
Check expiration date for user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2340
diff
changeset
|
616 |
select USERNAME, ACCOUNT_STATUS from DBA_USERS where USERNAME = 'me'; |
2340
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
617 |
|
2245
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
618 |
Connect as sysdba to the database and reset password and unlock user:: |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
619 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
620 |
alter user <USER> identified by <PASSWORD>; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
621 |
alter user <USER> account unlock; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
622 |
|
2340
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
623 |
or with single request:: |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
624 |
|
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
625 |
alter user <USER> identified by <PASSWORD> account unlock; |
2245
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
626 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
627 |
To make password lasts infinitely check which profile is used assigned:: |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
628 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
629 |
select USERNAME, PROFILE from DBA_USERS; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
630 |
|
2340
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
631 |
and check settings for this profile:: |
2245
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
632 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
633 |
select * from DBA_PROFILES where PROFILE = 'SA'; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
634 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
635 |
and reset limits for password lifetime:: |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
636 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
637 |
alter profile DEFAULT limit PASSWORD_LIFE_TIME UNLIMITED; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
638 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
639 |
You may create separate profile with its own settings:: |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
640 |
|
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
641 |
create profile MY; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
642 |
alter profile MY PASSWORD_LIFE_TIME UNLIMITED; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
643 |
alter user <USER> profile MY; |
30d831980005
Unlock expired password.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2244
diff
changeset
|
644 |
|
2340
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
645 |
To completely disable all password checks:: |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
646 |
|
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
647 |
alter profile DEFAULT limit COMPOSITE_LIMIT UNLIMITED |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
648 |
PASSWORD_LIFE_TIME UNLIMITED |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
649 |
PASSWORD_REUSE_TIME UNLIMITED |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
650 |
PASSWORD_REUSE_MAX UNLIMITED |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
651 |
PASSWORD_VERIFY_FUNCTION NULL |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
652 |
PASSWORD_LOCK_TIME UNLIMITED |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
653 |
PASSWORD_GRACE_TIME UNLIMITED |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
654 |
FAILED_LOGIN_ATTEMPTS UNLIMITED; |
fc5d1153f3df
Check expiration date for user,
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2280
diff
changeset
|
655 |
|
2278
954eb979bb4d
Oracle naming conventions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2277
diff
changeset
|
656 |
Oracle naming conventions |
954eb979bb4d
Oracle naming conventions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2277
diff
changeset
|
657 |
========================= |
954eb979bb4d
Oracle naming conventions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2277
diff
changeset
|
658 |
|
954eb979bb4d
Oracle naming conventions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2277
diff
changeset
|
659 |
http://www.gplivna.eu/papers/naming_conventions.htm |
954eb979bb4d
Oracle naming conventions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2277
diff
changeset
|
660 |
https://oracle-base.com/articles/misc/naming-conventions |
954eb979bb4d
Oracle naming conventions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2277
diff
changeset
|
661 |