You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Database discovery and analysis tool is a SQL utility that captures necessary details of an oracle database in order to analyse on-premises or cloud Oracle Databases for the suitability of migration/upgrades. This utility runs on Non Container or Container databases and helps in generating HTML report with detailed description.
4
+
5
+
## When to use this asset?
6
+
7
+
This script is to be executed in the discovery phase if it is identified the oracle on-premises database is to be migrated to OCI.
8
+
9
+
## How to use this asset?
10
+
```
11
+
sqlplus "/ as sysdba" @oradb_discovery_v3_6_11_19.sql
12
+
```
13
+
14
+
### Step 1
15
+
This is a discovery utility for Oracle database compatible for 11g onwards with a below features:
16
+
1. Current version of the script is v3.6 and it supports Oracle 11g or above database
17
+
2. Single version script for both Oracle Multitenant and Non-Multitenant database
18
+
3. This is a platform independent script as we need `sqlplus "/ as sysdba" ` to execute only.
19
+
20
+
This script needs to execute on Oracle database server with a user who has `“/as sysdba” ` access.
21
+
• Copy the oradb_discovery_v3_6_11_19.sql file to the server
22
+
• To execute the script: `sqlplus "/ as sysdba" @oradb_discovery_v3_6_11_19.sql`
23
+
24
+
### Step 2
25
+
The above script will generate .LST as output files on the same location.
26
+
Convert this .LST to .HTML to view the file.
27
+
28
+
Note: This script generates dynamic files like version_not_matched.sql which gets executed and deleted automatically.
29
+
30
+
31
+
## License
32
+
Copyright (c) 2023 Oracle and/or its affiliates.
33
+
34
+
Licensed under the Universal Permissive License (UPL), Version 1.0.
Copy file name to clipboardExpand all lines: cloud-architecture/custom-apps-and-consolidation/oracle-db-consolidation/db-discovery/discovery-utility/files/oradb_discovery_v3_6_11_19.sql
XTTS Pre-check for ORACLE Database is a SQL script-based utility that captures the necessary details of an Oracle database in order to analyze the suitability of the XTTS method.
4
+
This utility runs on Oracle 11g onwards, both on Container/Non-Container databases, and helps in generating an HTML report with self-contained tablespace violation status and other detailed descriptions.
5
+
6
+
## When to use this asset?
7
+
8
+
This script is to be executed in the discovery phase if it is identified the Oracle on-premises database is to be migrated using the XTTS method.
9
+
10
+
## How to use this asset?
11
+
12
+
```
13
+
sqlplus "/ as sysdba" @oradb_xtts_prechecks.sql
14
+
```
15
+
16
+
This script needs to be executed on an Oracle database server with a user who has ` "/as sysdba" ` access.
17
+
18
+
- Copy the oradb_xtts_prechecks.sql file to the server.
19
+
- Execute the script as ```sqlplus "/ as sysdba" @oradb_xtts_prechecks.sql``` .
20
+
21
+
The above script will generate a .htm output file on the same location.
22
+
23
+
## License
24
+
Copyright (c) 2023 Oracle and/or its affiliates.
25
+
26
+
Licensed under the Universal Permissive License (UPL), Version 1.0.
EXECUTE IMMEDIATE 'select case when CDB =''YES'' then 1 else 0 END as CDB from sys.v_$database' into v_cdb_count;
48
+
49
+
If v_cdb_count =0 THEN
50
+
DBMS_OUTPUT.put_line('INFO: This Oracle database is not multitenant!! Please check the details below');
51
+
:gv_multi := v_cdb_count;
52
+
END IF;
53
+
54
+
If v_cdb_count =1 THEN
55
+
DBMS_OUTPUT.put_line('INFO: This Oracle database is a multitenant!! Please check the details below');
56
+
:gv_multi := v_cdb_count;
57
+
END IF;
58
+
59
+
EXCEPTION WHEN OTHERS THEN
60
+
DBMS_OUTPUT.put_line('INFO: This Oracle database is not multitenant!! Please check the details below');
61
+
:gv_multi :=0;
62
+
END;
63
+
/
64
+
65
+
DECLARE
66
+
v_sql varchar2(2000);
67
+
BEGIN
68
+
IF :gv_multi =0 THEN
69
+
v_sql :='select d.DBID,d.NAME,i.INSTANCE_NUMBER inst_id,d.OPEN_MODE,i.HOST_NAME,i.INSTANCE_NAME,to_char(i.STARTUP_TIME,''YYYY/MM/DD HH:MI:SS'') open_TIME from sys.v_$database d,sys.v_$INSTANCE i WHERE upper(d.NAME)=substr(upper(i.INSTANCE_NAME),0,length(upper(d.NAME)))';
70
+
OPEN :gv_dbinfosql FOR v_sql;
71
+
END IF;
72
+
IF :gv_multi =1 THEN
73
+
v_sql :='select p.con_id,p.name, p.inst_id, p.OPEN_MODE,i.host_name,i.instance_name,to_char(p.open_TIME,''YYYY/MM/DD HH:MI:SS'') open_TIME from gv$pdbs p, gv$instance i where i.inst_id=p.inst_id order by 1,2';
74
+
OPEN :gv_dbinfosql FOR v_sql;
75
+
END IF;
76
+
END;
77
+
/
78
+
print :gv_dbinfosql
79
+
BEGIN
80
+
IF :gv_multi =0 THEN DBMS_OUTPUT.put_line('Please verify the instance and press Enter to continue : '); END IF;
81
+
IF :gv_multi =1 THEN DBMS_OUTPUT.put_line('Please verify CDB/PDB instance and Press Enter to continue : '); END IF;
82
+
END;
83
+
/
84
+
ACCEPT v_pdbconid CHAR FORMAT 'A20' PROMPT '>>>>>>' default 2
85
+
PROMPT
86
+
87
+
set markup HTML ON entmap off spool on
88
+
alter session set nls_date_format='YYYY-MM-DD HH24:Mi:SS';
89
+
alter session set nls_language=american;
90
+
91
+
REM
92
+
REM spool file name AUTOMATICALLY GENERATED
93
+
REM
94
+
95
+
REM Collection name SRDC_ or MOS_
96
+
define PREFIXHTM='MF_XTTS_DA'
97
+
column ORAGGSPOOLNAME new_val ORAGGSPOOLNAME
98
+
column SYSTEMDATE new_val SYSTEMDATE
99
+
100
+
selectsysdate SYSTEMDATE from dual;
101
+
select'&&PREFIXHTM'||'_'||upper(instance_name)||'_'||to_char(sysdate,'YYYYMMDD_HH24MISS')||'.htm' ORAGGSPOOLNAME from v$instance, v$database;
prompt <table border='0' width='90%' align='center'><tr><td colspan=2 style="width:30%"><a name="top"><span style="font-size: 20px; color: rgb(51, 102, 153);"><strong> Main Menu </strong></span></a></td></tr><tr><td><li style="font-size: 12px; color: rgb(51, 102, 153);"><strong>Configuration Info </strong></li></td><td><a href="#Database">Database Information</a> | <a href="#Additional">Additional Information</a></td></tr><tr><td><li style="font-size: 12px; color: rgb(51, 102, 153);"><strong>xTTS Info </strong></li></td><td><a href="#excludedTBS">Tablespaces excluded for XTTS Migration</a> | <a href="#eligibleTBS">Eligible Tablespace list for XTTS Migration</a> | <a href="#invalidTBS">Invalid userwise DEFAULT tablespace list</a> | <a href="#violation">Self-contained tablespace violations</a></td></tr></table>
107
+
108
+
PROMPT
109
+
prompt <a name="Database"><span style="font-size: 16px; color: rgb(51, 102, 153);"><strong> Database Information : </strong></span></a><a href="#top">Go To Main Menu</a>
110
+
SELECT (select DBid from v$database) DB_ID,
111
+
(select name from v$database) DB_NAME,
112
+
(select instance_number from v$instance) INSTANCE,
113
+
(select version from v$instance) DB_VERSION,
114
+
(select decode(count(*),3,'1/8th OR Quarter RAC',7,'Half RAC',14,'Full RAC','Non-Exadata') from (select distinct cell_name from gv$cell_state)) Exadata_Option,
115
+
(select HOST_NAME from v$instance) HOST_NAME,
116
+
(select PLATFORM_ID from v$database) PLATFORM_ID,
117
+
(select Platform_name from v$database) OS,
118
+
(select VERSION from V$TIMEZONE_FILE) TIMEZ_VER,
119
+
(select DECODE(regexp_substr(banner, '[^ ]+', 1, 4),'Edition','Standard',regexp_substr(banner, '[^ ]+', 1, 4)) from v$version where banner like'Oracle%') DB_EDITION,
120
+
(select CREATED from v$database) CREATED,
121
+
(Select to_char(startup_time, 'DD-MON-YY HH24:MI') from v_$instance) STARTUP_TIME,
122
+
(select round(((selectsum(bytes) from dba_data_files))/1024/1024/1024,4) ||' GB'from dual) DB_SIZE from dual;
123
+
124
+
prompt <a name="Additional"><span style="font-size: 16px; color: rgb(51, 102, 153);"><strong> Database Additional Information : </strong></span></a><a href="#top">Go To Main Menu</a>
SELECT INSTANCE_NUMBER, INSTANCE_NAME, STATUS FROM GV$INSTANCE;
127
+
128
+
prompt <a name="excludedTBS"><span style="font-size: 16px; color: rgb(51, 102, 153);"><strong> Tablespaces Excluded For XTTS Migration : </strong></span></a><a href="#top">Go To Main Menu</a>
129
+
Prompt Note : Defualt tablespaces are excluded from xTTS migration. Below is the list
130
+
select'SYSTEM,SYSAUX,TEMP,UNDOTBS1,UNDOTBS2' Tablespace_Name from dual;
131
+
132
+
prompt <a name="eligibleTBS"><span style="font-size: 16px; color: rgb(51, 102, 153);"><strong> Eligible Tablespace List For XTTS Migration : </strong></span></a><a href="#top">Go To Main Menu</a>
133
+
Prompt Note : Below is the list of eligible Tablespaces
134
+
select LISTAGG(tablespace_name, ',') WITHIN GROUP (ORDER BY tablespace_name) VALID_TABLESPACE_LIST_FOR_XTTS
135
+
from (
136
+
selectd.tablespace_name tablespace_name
137
+
from dba_tablespaces d
138
+
where (d.CONTENTS not in ('TEMPORARY','UNDO') andd.TABLESPACE_NAME NOT IN ('SYSTEM','SYSAUX','TEMP','UNDOTBS1','UNDOTBS2'))
139
+
union
140
+
select default_tablespace tablespace_name
141
+
from dba_users where default_tablespace in (select tablespace_name from dba_tablespaces where TABLESPACE_NAME NOT IN ('SYSTEM','SYSAUX','TEMP','UNDOTBS1','UNDOTBS2'))
Prompt Note : Below is the list of invalid userwise DEFUALT tablespace
147
+
select username,default_tablespace tablespace_name,'<span style="font-size: 14px; color: rgb(255,0,0);">This Tablespace does not exists/dropped.. Remap this user at Target</span>' TBS_Remarks
148
+
from dba_users where default_tablespace not in (select tablespace_name from dba_tablespaces)
149
+
order by1;
150
+
151
+
prompt <a name="violation"><span style="font-size: 16px; color: rgb(51, 102, 153);"><strong> Self-contained Tablespace Violations Status(IF ANY) : </strong></span></a><a href="#top">Go To Main Menu</a>
152
+
Prompt Note : Status of self-contained tablespace violations
153
+
prompt
154
+
DECLARE
155
+
tbs_list clob;
156
+
v_count number :=0;
157
+
BEGIN
158
+
159
+
select LISTAGG(tablespace_name, ',') WITHIN GROUP (ORDER BY tablespace_name) tablespace_name into tbs_list
160
+
from (
161
+
selectd.tablespace_name tablespace_name
162
+
from dba_tablespaces d
163
+
where (d.CONTENTS not in ('TEMPORARY','UNDO') andd.TABLESPACE_NAME NOT IN ('SYSTEM','SYSAUX','TEMP','UNDOTBS1','UNDOTBS2'))
164
+
union
165
+
select default_tablespace tablespace_name
166
+
from dba_users where default_tablespace in (select tablespace_name from dba_tablespaces where TABLESPACE_NAME NOT IN ('SYSTEM','SYSAUX','TEMP','UNDOTBS1','UNDOTBS2'))
SELECTcount(*) into v_count FROMsys.TRANSPORT_SET_VIOLATIONS;
178
+
If v_count=0 THEN
179
+
dbms_output.put_line('<span style="font-size: 14px; color: rgb(34,139,34);">Success... No violations found based on self-contained tablespace</span>');
180
+
END IF;
181
+
END;
182
+
/
183
+
184
+
prompt
185
+
prompt <a name="eor"><span style="font-size: 16px; color: rgb(51, 102, 153);"><strong> End Of Report: </strong></span></a><a href="#top">Go To Main Menu</a>
ZDM Discovery Utility for ORACLE Database is a SQL script-based utility that captures the necessary details of an Oracle On-Prem database in order to analyze the suitability of logical online migration using ZDM.
5
+
This utility runs on Oracle 11g onwards Non-Container database and helps in generating HTML reports with pre-check summaries with required action and other detailed descriptions.
6
+
7
+
## When to use this asset?
8
+
9
+
This script is to be executed in the discovery phase if it is identified the Oracle on-premises database is to be migrated using Zero Downtime Migration(ZDM) Tool.
10
+
11
+
## How to use this asset?
12
+
13
+
```
14
+
sqlplus "/ as sysdba" @oradb_zdmgg_discovery_v1_2.sql
15
+
```
16
+
17
+
This script needs to execute on an Oracle database server with a user who has `"/as sysdba"` access.
18
+
- Copy the oradb_zdmgg_discovery_v1_2.sql file to the server.
19
+
- Execute the script as ```sqlplus "/ as sysdba" @oradb_zdmgg_discovery_v1_2.sql ``` .
20
+
21
+
22
+
The above script will generate a .htm output file on the same location.
23
+
24
+
## License
25
+
Copyright (c) 2023 Oracle and/or its affiliates.
26
+
27
+
Licensed under the Universal Permissive License (UPL), Version 1.0.
0 commit comments