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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
SQL> select comp_id,status from dba_registry;
COMP_ID STATUS
------------------------------ -----------
CATALOG VALID
CATPROC VALID
select object_name, object_type
from dba_objects
where object_name||object_type in
(select object_name||object_type
from dba_objects
where owner = 'SYS')
and owner = 'SYSTEM';SP2-0734: unknown command beginning "olumn obje..." - rest of line ignored.
SQL> SQL> 2 3 4 5 6 7
OBJECT_NAME OBJECT_TYPE
--------------------------------------------------- -------------------
DBMS_REPCAT_AUTH PACKAGE BODY
AQ$_SCHEDULES_PRIMARY INDEX
AQ$_SCHEDULES TABLE
DBMS_REPCAT_AUTH PACKAGE
SQL >@dbupgdiag.sql
*** Start of LogFile ***
Oracle Database Upgrade Diagnostic Utility 05-13-2015 09:09:57
===============
Hostname
===============
primary-host
===============
Database Name
===============
PROD
===============
Database Uptime
===============
22:31 10-MAY-15
=================
Database Wordsize
=================
This is a 64-bit database
================
Software Version
================
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
=============
Compatibility
=============
Compatibility is set as 11.2.0
================
Archive Log Mode
================
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /uv1172/apps/oracle/product/11.2.0.2.2013Q4/dbs/arch
Oldest online log sequence 15143
Current log sequence 15145
================
Auditing Check
================
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /uv1172/ofaroot/PROD/adump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string NONE
================
Cluster Check
================
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1
DOC>################################################################
DOC>
DOC> If CLUSTER_DATABASE is set to TRUE, change it to FALSE before
DOC> upgrading the database
DOC>
DOC>################################################################
DOC>#
===========================================
Tablespace and the owner of the aud$ table
===========================================
OWNER TABLESPACE_NAME
------------ ------------------------------
SYS SYSTEM
============================================================================
count of records in the sys.aud$ table where dbid is null- Standard Auditing
============================================================================
0
============================================================================================
count of records in the system.aud$ when dbid is null, Std Auditing with OLS or DV installed
============================================================================================
select count(*) from system.aud$ where dbid is null
*
ERROR at line 1:
ORA-00942: table or view does not exist
======================================================
List of Invalid Database Objects Owned by SYS / SYSTEM
======================================================
Number of Invalid Objects
------------------------------------------------------------------
There are 2 Invalid objects
================
Component Status
================
Comp ID Component Status Version Org_Version Prv_Version
------- ---------------------------------- --------- -------------- -------------- --------------
CATALOG Oracle Database Catalog Views VALID 11.2.0.2.0 10.2.0.1.0 10.2.0.1.0
CATALOG Oracle Database Catalog Views VALID 11.2.0.2.0 10.2.0.1.0 10.2.0.1.0
Oracle Multimedia/interMedia is installed and listed with the following version: 11.2.0.2.0 and status: VALID
.
Checking for installed Database Schemas...
ORDSYS user exists.
ORDPLUGINS user exists.
MDSYS user exists.
SI_INFORMTN_SCHEMA user exists.
ORDDATA user exists.
.
Checking for Prerequisite Components...
JAVAVM installed and listed as valid
XDK installed and listed as valid
XDB installed and listed as valid
Validating Oracle Multimedia/interMedia...(no output if component status is valid)
ORDIM INVALID OBJECTS: CARTRIDGE - 5 - 11
ORDIM DICOM repository has 0 documents.
The following default DICOM repository documents are not installed:
ordcman.xml
ordcmcmc.xml
ordcmcmd.xml
ordcmct.xml
ordcmmp.xml
ordcmpf.xml
ordcmpv.xml
ordcmsd.xml
ordcmui.xml
PL/SQL procedure successfully completed.
*** End of LogFile ***
SQL>@/apps/oracle/product/11.2.0.3/utlrp.sql
SQL> @$ORACLE_HOME/rdbms/admin/preupgrd.sql
----It will generate below files
$ cd /apps/oracle/cfgtoollogs/PROD/preupgrade/
$ ls -ltr
total 28
-rw-r--r-- 1 oracle dba 7068 Apr 21 03:56 preupgrade.log
-rw-r--r-- 1 oracle dba 3568 Apr 21 03:56 preupgrade_fixups.sql
-rw-r--r-- 1 oracle dba 2637 Apr 21 03:56 postupgrade_fixups.sql
SQL> SELECT * FROM DBA_DEPENDENCIES
WHERE referenced_name IN ('UTL_TCP','UTL_SMTP','UTL_MAIL','UTL_HTTP','UTL_
INADDR','DBMS_LDAP')
AND owner NOT IN ('SYS','PUBLIC','ORDPLUGINS'); 2 3 4
no rows selected
SQL> SELECT version FROM v$timezone_file;
VERSION
----------
14
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
PL/SQL procedure successfully completed.
SQL> select s.obj#,o.obj#,s.containerobj#,lastrefreshdate,pflags,xpflags,o.name,o.owner#, bitand(s.mflags, 8) from obj$ o, sum$ s
where o.obj# = s.obj# and o.type# = 42 AND bitand(s.mflags, 8) = 8; 2
no rows selected
SQL> SELECT * FROM v$recover_file;
no rows selected
SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';
no rows selected
SQL> SELECT * FROM dba_2pc_pending;
no rows selected
SQL> PURGE DBA_RECYCLEBIN;
DBA Recyclebin purged.
SQL> SELECT SUBSTR(value,INSTR(value,'=',INSTR(UPPER(value),'SERVICE'))+1)
FROM v$parameter
WHERE name LIKE 'log_archive_dest%' AND UPPER(value) LIKE 'SERVICE%'; 2 3
no rows selected
SQL> set pagesize 2000
SQL> set lines 2000
SQL> set long 99999
SQL> select owner,JOB_NAME,ENABLED,state from dba_scheduler_jobs;
OWNER JOB_NAME ENABL STATE
------------------------------ ------------------------------ ----- ---------------
SYS SM$CLEAN_AUTO_SPLIT_MERGE FALSE DISABLED
SYS RSE$CLEAN_RECOVERABLE_SCRIPT FALSE DISABLED
SYS BSLN_MAINTAIN_STATS_JOB FALSE DISABLED
SYS DRA_REEVALUATE_OPEN_FAILURES TRUE SCHEDULED
SYS ORA$AUTOTASK_CLEAN FALSE DISABLED
SYS FILE_WATCHER FALSE DISABLED
SYS HM_CREATE_OFFLINE_DICTIONARY FALSE DISABLED
SYS AUTO_SPACE_ADVISOR_JOB FALSE DISABLED
SYS GATHER_STATS_JOB FALSE DISABLED
SYS FGR$AUTOPURGE_JOB FALSE DISABLED
SYS PURGE_LOG FALSE DISABLED
ORACLE_OCM MGMT_STATS_CONFIG_JOB FALSE DISABLED
13 rows selected.
--- Disable the scheduled jobs by using below command
SQL> execute dbms_scheduler.disable('DRA_REEVALUATE_OPEN_FAILURES);
SQL> SELECT username, default_tablespace
FROM dba_users
WHERE username in ('SYS','SYSTEM'); 2 3
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
SYSTEM SYSTEM
SYS SYSTEM
SQL> SELECT name FROM sys.user$
WHERE ext_username IS NOT NULL
AND password = 'GLOBAL';
2 3
no rows selected
----Enterprise Manager Database Control is superseded in 12c by Oracle Enterprise Manager Express . Therefore no repository is needed anymore .
---Run the below script
$emctl stop dbcontrol
SQL> @ ?/rdbms/admin/emremove.sql
SQL> SELECT name, value from SYS.V$PARAMETER WHERE name LIKE '\_%' ESCAPE '\' order by name;
no rows selected
SQL> alter system set db_recovery_file_dest_size=10G scope=both;
System altered.
SQL> alter system set db_recovery_file_dest='/dumparea/FRA/B2BRBMT3' scope=both;
System altered.
SQL> alter database flashback on;
Database altered.
SQL> startup force
CREATE RESTORE POINT BEF_UPGRADE GUARANTEE FLASHBACK DATABASE;
Restore point created.