Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Hands-on-Lab Workshop
Contents
The Workshop ......................................................................................................................................................... 3
The Environment................................................................................................................................................. 3
Summary ........................................................................................................................................................... 78
7 Conclusions ................................................................................................................................................... 85
Oracle Page 2
The Workshop
The Environment
A virtual box VM image is provided along with this workbook to each attendee with a recommended laptop
having at least 100 GB of disk space and 8 GB of RAM.
OS Logons
Username Password
oracle oracle
root oracle
Oracle Installations
Oracle Page 3
1. In-place Upgrade of 10.2.0.5 to DB12c
This exercise will run through a simple in-place upgrade using the new catctl.pl script. The scenario will also
demonstrate how to roll back following an upgrade if required. The V102 database currently on 10gR2 will be
upgraded to 12c. The new Parallel Upgrade script, namely catctl.pl results in up to 40% faster upgrades. The
pre-upgrade script preupgrd.sql also generates automated fixup scripts that are ready to be run.
oracle@localhost:~$ . db10
[V102] oracle@localhost:~
$ sqlplus / as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing
options
SYS:V102>@/u01/app/oracle/product/12.1.0/rdbms/admin/preupgrd.sql
Loading Pre-Upgrade Package...
Executing Pre-Upgrade Checks...
Pre-Upgrade Checks Complete.
************************************************************
************************************************************
************************************************************
************************************************************
====>> USER ACTION REQUIRED <<====
************************************************************
The following are *** ERROR LEVEL CONDITIONS *** that must be addressed
prior to attempting your upgrade.
Failure to do so will result in a failed upgrade.
************************************************************
SYS:V102>
Oracle Page 4
Open a new terminal window to look at the contents of the pre-upgrade log.
oracle@localhost:~$ more
/u01/app/oracle/cfgtoollogs/V102/preupgrade/preupgrade.log
**********************************************************************
************ Summary ************
After your database is upgraded and open in normal mode you must run
rdbms/admin/catuppst.sql which executes several required tasks and completes
the upgrade process.
If needed you may want to upgrade your timezone data using the process
described in My Oracle Support note 977512.1
***********************************
oracle@localhost:~$
Now let us prepare the spfile for the 12c upgrade according to the recommendations from preupgrade.log.
Run the following commands from the first terminal window with sqlplus session.
Oracle Page 5
SYS:V102> alter system set processes=300 scope=spfile;
SYS:V102> alter system set COMPATIBLE='12.1.0' scope=spfile;
SYS:V102> EXECUTE dbms_stats.gather_dictionary_stats;
SYS:V102>
SYS:V102>
@/u01/app/oracle/cfgtoollogs/V102/preupgrade/preupgrade_fixups.sql
Pre-Upgrade Fixup Script Generated on 2014-03-04 03:29:14 Version: 12.1.0.1 Build: 006
Beginning Pre-Upgrade Fixups...
**********************************************************************
Check Tag: DEFAULT_PROCESS_COUNT
Check Summary: Verify min process count is not too low
Fix Summary: Review and increase if needed, your PROCESSES value.
**********************************************************************
Fixup Returned Information:
WARNING: --> Process Count may be too low
**********************************************************************
Check Tag: COMPATIBLE_PARAMETER
Check Summary: Verify compatible parameter value is valid
Fix Summary: "compatible" parameter must be increased manually prior to upgrade.
**********************************************************************
Fixup Returned Information:
ERROR: --> Compatible set too low
**********************************************************************
Check Tag: OCM_USER_PRESENT
Check Summary: Check for OCM schema
Fix Summary: Drop the ORACLE_OCM user.
**********************************************************************
Fixup Succeeded
**********************************************************************
**********************************************************************
[Pre-Upgrade Recommendations]
**********************************************************************
*****************************************
********* Dictionary Statistics *********
*****************************************
Oracle Page 6
^^^ MANUAL ACTION SUGGESTED ^^^
**************************************************
************* Fixup Summary ************
************************************************************
====>> USER ACTION REQUIRED <<====
************************************************************
**************************************************
You MUST resolve the above error prior to upgrade
**************************************************
SYS:ORCL>
Please note that the preupgrade_fixups.sql script still complains about COMPATIBLE and PROCESSES both set too low. This
is ok as the current parameter file the database has been started with does have COMPATIBLE=10.2.0.5 and PROCESSES
lower than 300. We have just changed the information in the spfile to copy the spfile into the new Oracle 12c Home.
SYS:V102> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[V102] oracle@localhost:~
Copy the new spfile and your password file into the Oracle 12c home’s dbs directory.
$ cp /u01/app/oracle/product/10.2.0/dbs/spfileV102.ora
/u01/app/oracle/product/12.1.0/dbs/
[V102] oracle@localhost:~
$ cp /u01/app/oracle/product/10.2.0/dbs/orapwV102
/u01/app/oracle/product/12.1.0/dbs/
[V102] oracle@localhost:~
Oracle Page 7
$
Now we will upgrade the V102 Database to Oracle Database 12c using the new parallel upgrade scripts.
Furthermore we will recompile and check for invalid objects before/after the upgrade.
$ . db10c
[V102] oracle@localhost:~
$ env |grep ORA
ORACLE_SID=V102
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.1.0
[V102] oracle@localhost:~
$ sqlplus / as sysdba
Start the new parallel upgrade – it will be driven by a PERL script catctl.pl outside of SQL*Plus and execute in 4
parallel threads. At a maximum 8 parallel threads can be used by specifying the parameter option -n 8
$ cd $ORACLE_HOME/rdbms/admin
[V102] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$ $ORACLE_HOME/perl/bin/perl catctl.pl catupgrd.sql
Analyzing file catupgrd.sql
Oracle Page 8
14 scripts found in file catupgrd.sql
Next path: catalog.sql
32 scripts found in file catalog.sql
Next path: catproc.sql
37 scripts found in file catproc.sql
Next path: catptabs.sql
61 scripts found in file catptabs.sql
Next path: catpdbms.sql
205 scripts found in file catpdbms.sql
Next path: catpdeps.sql
77 scripts found in file catpdeps.sql
Next path: catpprvt.sql
260 scripts found in file catpprvt.sql
Next path: catpexec.sql
26 scripts found in file catpexec.sql
Next path: cmpupgrd.sql
16 scripts found in file cmpupgrg.sql
:
:
:
:
:
:
:
:
Restart Phase #:39 Files: 1 Time: 1s
Parallel Phase #:40 Files: 10 Time: 24s
Restart Phase #:41 Files: 1 Time: 0s
Serial Phase #:42 Files: 1 Time: 10s
Restart Phase #:43 Files: 1 Time: 0s
Serial Phase #:44 Files: 1 Time: 57s
Serial Phase #:45 Files: 1 Time: 1s
Restart Phase #:46 Files: 1 Time: 0s
Serial Phase #:47 Files: 2 Time: 511s
Restart Phase #:48 Files: 1 Time: 1s
Serial Phase #:49 Files: 2 Time: 283s
Restart Phase #:50 Files: 1 Time: 1s
Serial Phase #:51 Files: 2 Time: 11s
Restart Phase #:52 Files: 1 Time: 0s
Serial Phase #:53 Files: 1 Time: 4s
Serial Phase #:54 Files: 1 Time: 329s
Serial Phase #:55 Files: 1 Time: 216s
Serial Phase #:56 Files: 1 Time: 36s
Grand Total Time: 2374s
[V102] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$
56 phases will be listed – some can act in parallel, other require serial execution. This will take up to 20
minutes – so you may take either a break and come back in about 15 minutes OR read on about Oracle
Multitenant (Pluggable Databases) in the presentation on your VBox image’s desktop beginning from slide
280. If you wonder about the RESTART phases: those happen if timing dependencies make it necessary to
rerun a certain script.The logfiles will be written by default into the directory catctl.pl started from – that’s
$ORACLE_HOME/rdbms/admin in this case. Once the upgrade is finished it will shutdown the database and in
the next phase you’ll restart it in normal mode.
Oracle Page 9
Post Upgrade Actions
Remove the dump parameters (background_dump_dest, user_dump_dest) and add the following:
$ . db10c
[V102] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$ sqlplus / as sysdba
SYS:V102> startup
ORACLE instance started.
Oracle Page 10
---------------------------
0
Function created.
Function dropped.
SYS:V102>
SYS:V102>
@/u01/app/oracle/cfgtoollogs/V102/preupgrade/postupgrade_fixups.sql
Post Upgrade Fixup Script Generated on 2014-03-04 03:29:14 Version: 12.1.0.1 Build: 006
Beginning Post-Upgrade Fixups...
**********************************************************************
Check Tag: INVALID_OBJECTS_EXIST
Check Summary: Check for invalid objects
Fix Summary: Invalid objects are displayed and must be reviewed.
**********************************************************************
Fixup Returned Information:
WARNING: --> Database contains INVALID objects prior to upgrade
**********************************************************************
Check Tag: OLD_TIME_ZONES_EXIST
Check Summary: Check for use of older timezone data file
Fix Summary: Update the timezone using the DBMS_DST package after upgrade is complete.
**********************************************************************
Fixup Returned Information:
INFORMATION: --> Older Timezone in use
**********************************************************************
[Post-Upgrade Recommendations]
**********************************************************************
Oracle Page 11
PL/SQL procedure successfully completed.
*****************************************
******** Fixed Object Statistics ********
*****************************************
**************************************************
************* Fixup Summary ************
SYS:V102>
$
Adjust Time Zone settings – you may look into these scripts taken from MOS before executing them:
SYS:V102> @/home/oracle/DST/DST_prepare.sql
Connected.
PROPERTY_NAME
VALUE
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
-------------------------
DST_PRIMARY_TT_VERSION
4
DST_SECONDARY_TT_VERSION
0
DST_UPGRADE_STATE
NONE
VERSION
----------
4
Connected.
Session altered.
Session altered.
PROPERTY_NAME
VALUE
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
-------------------------
Oracle Page 12
DST_PRIMARY_TT_VERSION
4
DST_SECONDARY_TT_VERSION
18
DST_UPGRADE_STATE
PREPARE
Table truncated.
Table truncated.
Table truncated.
no rows selected
no rows selected
no rows selected
no rows selected
no rows selected
PROPERTY_NAME
VALUE
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
-------------------------
DST_PRIMARY_TT_VERSION
4
DST_SECONDARY_TT_VERSION
0
DST_UPGRADE_STATE
NONE
SYS:V102> @/home/oracle/DST/DST_adjust.sql
Connected.
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.
PROPERTY_NAME
VALUE
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
-------------------------
DST_PRIMARY_TT_VERSION
4
DST_SECONDARY_TT_VERSION
0
Oracle Page 13
DST_UPGRADE_STATE
NONE
Table truncated.
Table truncated.
Table truncated.
Session altered.
Session altered.
PROPERTY_NAME
VALUE
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
-------------------------
DST_PRIMARY_TT_VERSION
18
DST_SECONDARY_TT_VERSION
4
DST_UPGRADE_STATE
UPGRADE
OWNER
TABLE_NAME
UPG
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
--------------------------------- ---
GSMADMIN_INTERNAL
AQ$_CHANGE_LOG_QUEUE_TABLE_L
YES
GSMADMIN_INTERNAL
AQ$_CHANGE_LOG_QUEUE_TABLE_S
YES
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.
Session altered.
Session altered.
Oracle Page 14
An upgrade window has been successfully ended.
Failures:0
PROPERTY_NAME
VALUE
----------------------------------------------------------------------------------------------------------------
---------------- -----------------------------------------------------------------------------------------------
-------------------------
DST_PRIMARY_TT_VERSION
18
DST_SECONDARY_TT_VERSION
0
DST_UPGRADE_STATE
NONE
TZ_VERSION
----------
4
1 row updated.
Commit complete.
oracle@localhost:~$
Oracle Page 15
2. PLUGIN A NON-CDB 12C DATABASE INTO A CDB
Now Plug-in the V102 database we have upgraded into the existing CDB12 container database.
Switch to the Oracle 12c V102 environment. Generate the XML description file – this file will contain the information
describing the database structure. To create it the database has to be in read only mode. Then Shut the database down.
oracle@localhost:~$ . db10c
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Oracle Page 16
Switch to the Oracle 12c CBD12 environment
$ . db12c
[CDB12] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Tue Mar 4 22:48:30 2014
SYS:CDB12> startup
ORACLE instance started.
SYS:CDB12>
Now plug in the database with its new name PDB1 – from this point there’s no V102 database anymore. In a real world
environment you would have a backup or use a backup/copy to plug in. In our lab the database V102 will stay in place and
become PDB1 inside the CDB12:
– Please use this name as the TNS setup has been already done
– Use the NOCOPY option for the lab – other options may be possible but would requiring extending VBox image files,
which could cause issues for other labs using the same systems.
Session altered.
SYS:CDB12> startup
SYS:CDB12>
SYS:CDB12>
Oracle Page 17
a. Optional: Remove the redundant dictionary data from PDB1
The reason for the error message is that there are sanity operations required inside the PDB to
connect the PDB with the CDB correctly. Therefore run the script noncdb_to_pdb.sql – this may take a approx 10-
20 minutes to complete due to recompilations. This is optional but is required for production migrations.
SYS:CDB12> @?/rdbms/admin/noncdb_to_pdb.sql
SYS:CDB12> SET SERVEROUTPUT ON
SYS:CDB12> SET FEEDBACK 1
SYS:CDB12> SET NUMWIDTH 10
SYS:CDB12> SET LINESIZE 80
SYS:CDB12> SET TRIMSPOOL ON
SYS:CDB12> SET TAB OFF
SYS:CDB12> SET PAGESIZE 100
SYS:CDB12>
SYS:CDB12> WHENEVER SQLERROR EXIT;
SYS:CDB12>
SYS:CDB12> DOC
DOC>#######################################################################
DOC>#######################################################################
DOC> The following statement will cause an "ORA-01403: no data found"
DOC> error if we're not in a PDB.
DOC> This script is intended to be run right after plugin of a PDB,
DOC> while inside the PDB.
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SYS:CDB12>
SYS:CDB12> VARIABLE cdbname VARCHAR2(128)
SYS:CDB12> VARIABLE pdbname VARCHAR2(128)
SYS:CDB12> BEGIN
2 SELECT sys_context('USERENV', 'CDB_NAME')
3 INTO :cdbname
4 FROM dual
5 WHERE sys_context('USERENV', 'CDB_NAME') is not null;
6 SELECT sys_context('USERENV', 'CON_NAME')
7 INTO :pdbname
8 FROM dual
9 WHERE sys_context('USERENV', 'CON_NAME') <> 'CDB$ROOT';
10 END;
11 /
:
:
:
:
7 RAISE;
8 END IF;
9 END;
10 END;
11 /
SYS:CDB12>
SYS:CDB12> WHENEVER SQLERROR CONTINUE;
SYS:CDB12>
SYS:CDB12>
Now our database is plugged in – but still opened in restricted mode. We will need to shut it down and start it up again.
Oracle Page 18
SYS:CDB12> shutdown immediate
Pluggable Database closed.
SYS:CDB12> startup
Pluggable Database opened.
SYS:CDB12> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDB1 READ WRITE NO
SYS:CDB12>
Well Done, you have now plugged in a non-container database into an existing container database !! You can
look at this visually through SQL Developer or using Oracle Enterprise Manager.
Oracle Page 19
3. Full Transportable Export/Import
Full Transportable Export/Import is a new Oracle Database 12c upgrade and migration feature combining
Transportable Tablespaces with Data Pump taking care on all objects which are not transportable.
Your task in this HOL Part 3 will be to use Full Transportable Export/Import to migrate the existing V112
database into a new PDB2 which will belong to the container database CDB12. Please stay with the proposed
names (PDB2) as the TNS setup has been set up already to allow connections.
Create an empty PDB by cloning the PDB$SEED. This will take 1-2 minutes.
$ . db12c
[CDB12] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Wed Mar 5 00:28:14 2014
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SYS:CDB12> shutdown;
Pluggable Database closed.
SYS:CDB12> alter session set container=CDB$ROOT;
Session altered.
Oracle Page 20
db_files integer 200
pdb_file_name_convert string /oradata/CDB12/pdbseed,
/orada
ta/CDB12/pdb2
SYS:CDB12> create pluggable database PDB2 admin user adm identified by adm;
Pluggable database created.
SYS:CDB12>
Start the new pluggable database PDB2 and create a directory object inside PDB2 to be used in the full
transport operation.
SYS:CDB12> startup
Pluggable Database opened.
SYS:CDB12> create directory mydir as '/oradata/CDB12/mydir';
Directory created.
SYS:CDB12> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[CDB12] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$
SYS:CDB12>
Oracle Page 21
$ . db11
[V112] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 5 00:45:59 2014
SQL> startup
ORACLE instance started.
Tablespace altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
[V112] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$
$ . db12c
[CDB12] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$ impdp system/oracle@pdb2 network_link=sourcedb version=12 full=y
transportable=always metrics=y exclude=statistics logfile=mydir:pdb2.log
transport_datafiles='/oradata/CDB12/pdb2/users01.dbf'
Import: Release 12.1.0.1.0 - Production on Wed Mar 5 00:54:07 2014
Oracle Page 22
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/********@pdb2 network_link=sourcedb version=12 full=y
transportable=always metrics=y exclude=statistics logfile=mydir:pdb2.log
transport_datafiles=/oradata/CDB12/pdb2/users01.dbf
[CDB12] oracle@localhost:/u01/app/oracle/product/12.1.0/rdbms/admin
$
Oracle Page 23
4. CREATE AND TEST A NEW PDB
Creating a new PDB is a simple task. It will be created using the PDB$SEED which acts as a blueprint scheme.
The dynamic parameter PDB_FILE_NAME_CONVERT=’string1’,’string2’ will define where the new PDB3 will be
created. In your environment the directory /oradata/CDB12/pdb3 is already created. We will reuse this
directory to create a new PDB3.
You need to re-point the PDB_FILE_NAME_CONVERT parameter and create the database.
oracle@localhost:~$ . db12c
[CDB12] oracle@localhost:~
$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Wed Mar 5 03:18:54 2014
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SYS:CDB12> commit;
Oracle Page 24
Commit complete.
Now connect to the ROOT container, it shows information about each PDB. The CDB$ROOT has information
about the object created earlier.
You can also look at the PDBs visually using SQL Developer, OEM or EM Express.
Oracle Page 25
Using the new EM Express
You can set/change the port for the CDB12 and for every PDB you want to monitor with EM Express:
User altered.
Oracle Page 26
Now Open the browser (Mozilla Firefox) from your desktop and connect to http://localhost:5501/em to check
out the EM Express functionality. If you get an error message “Security Token does not match, please login
again” - typically a RELOAD of the EM page will allow to login with the 2nd attempt. This is a known EM
Express issue which may be happen in relation with the Firefox browser or the version used in this VM only.
Oracle Page 27
5. Zero Downtime Upgrade
These exercises will run from two different console windows. One console will be connected to an 11g
instance, the other will be connected to a 12c instance.
Console 1
oracle@localhost:~/ogg$ cd
/oradata/software/fbo_ggs_Linux_x64_shiphome/Disk1
oracle@localhost:~/ogg$ ./runInstaller
Oracle Page 28
Oracle Page 29
Oracle Page 30
Oracle Page 31
Oracle Page 32
Similarly, install the software for the target, ie OGG 12.1.0 for DB12c.
oracle@localhost:/oradata/ogg/oracle$ cd
/oradata/software/fbo_ggs_Linux_x64_shiphome/Disk1
oracle@localhost:/oradata/ogg/11g$ ./runInstaller
Oracle Page 33
Oracle Page 34
Oracle Page 35
Oracle Page 36
Oracle Page 37
Oracle Page 38
Oracle Page 39
Setting Up Golden Gate Environment
The steps below will setup the environment for GoldenGate to share Oracle Libraries.
Console 1
oracle@localhost:/oradata/ogg/11g$ . oraenv
ORACLE_SID = [V112] ? V112
The Oracle base remains unchanged with value /u01/app/oracle
oracle@localhost:/oradata/ogg/11g$ cd /oradata/ogg/oracle/product/11.2.0
oracle@localhost$ ./ggsci
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights
reserved.
Oracle Page 40
already exists
Dump files /oradata/ogg/oracle/product/11.2.0/dirdmp:
already exists
oracle@localhost: $ cd /oradata/ogg/oracle/product/11.2.0
oracle@localhost: $ cp /oradata/ogg/backup/11g_GLOBALS.txt ./GLOBALS
oracle@localhost: $ cp /oradata/ogg/backup/11g_startup.oby ./startup.oby
oracle@localhost: $ cd dirprm
oracle@localhost: $ cp /oradata/ogg/backup/eora01.prm .
oracle@localhost: $ cp /oradata/ogg/backup/epmp01.prm .
oracle@localhost: $ cp /oradata/ogg/backup/rora02.prm .
Console 2
oracle@localhost:/oradata/ogg/product/12.1.0$ cd
/oradata/ogg/oracle/product/12.1.0
oracle@localhost$ . oraenv
ORACLE_SID = [CDB12] ? CDB12
The Oracle base remains unchanged with value
oracle@localhost:/oradata/ogg/product/12.1.0$ ./ggsci
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights
reserved.
Oracle Page 41
Process status files /oradata/ogg/oracle/product/12.1.0/dirpcs:
already exists
SQL script files /oradata/ogg/oracle/product/12.1.0/dirsql:
already exists
Database definitions files /oradata/ogg/oracle/product/12.1.0/dirdef:
already exists
Extract data files /oradata/ogg/oracle/product/12.1.0/dirdat:
already exists
Temporary files /oradata/ogg/oracle/product/12.1.0/dirtmp:
already exists
Credential store files /oradata/ogg/oracle/product/12.1.0/dircrd:
already exists
Masterkey wallet files /oradata/ogg/oracle/product/12.1.0/dirwlt:
already exists
Dump files /oradata/ogg/oracle/product/12.1.0/dirdmp:
already exists
Oracle Page 42
Configuring GoldenGate
Now that the software has been installed, the next stage is to configure GoldenGate to run the bi-directional
replication.
Open two additional console windows with the 10g and 11g instance and login as sysdba. Follow the below
steps to enable the databases for data capture.
Console 3
oracle@localhost:~$ . oraenv
ORACLE_SID = [oracle] ? V112
The Oracle base remains unchanged with value
oracle@localhost:~$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
SQL>
SQL> alter database add supplemental log data;
Database altered.
Database altered.
User created.
Grant succeeded.
System altered.
SQL>
Oracle Page 43
Console 4
oracle@localhost:~$ . oraenv
ORACLE_SID = [oracle] ? CDB12
The Oracle base remains unchanged with value
/u01/app/oracleoracle@localhost:~/ogg/gg11$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
Database altered.
Database altered.
SYS:CDB12> alter session set container=pdb1;
Session altered.
SYS:CDB12> startup
...
Grant succeeded.
Check the connectivity between both databases, and verify the configuration in tnsnames.ora.
Console 1
oracle@localhost:/oradata/ogg/11g$ cp
/u01/app/oracle/product/12.1.0/network/admin/tnsnames.ora
/u01/app/oracle/product/11.2.0/network/admin/
Oracle Page 44
23:23:49
Console 2
oracle@localhost:/oradata/ogg/product/12.1.0$ cat
$ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File:
/u01/app/oracle/product/12.1.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
V112 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = V112)
)
)
CDB12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CDB12)
)
)
V102 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = V102)
)
Oracle Page 45
)
PDB3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDB3)
)
)
PDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDB2)
)
)
PDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDB1)
)
)
##LISTENER_CDB12 =
##(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT =
1521))
LISTENER_CDB12=
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521
))(CONNECT_DATA=(SERVICE_NAME=CDB12)(SERVER=DEDICATED)))
Oracle Page 46
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = V112)))
OK (260 msec)
oracle@localhost:/oradata/ogg/product/12.1.0$
To create the startup files and manager, you must have copied the pre-configured parameter files into the
GoldenGate subdirectories previously. Verify GLOBALS file.
Console 1
oracle@localhost $ cd /oradata/ogg/oracle/product/11.2.0
oracle@localhost $ cat GLOBALS
CHECKPOINTTABLE gguser.ggschkpt
Do the same in the second console with the OGG for 12c.
Console 2
oracle@localhost $ cd /oradata/ogg/oracle/product/12.1.0
Oracle Page 47
Create HR schema in 11g database and populate it.
Note: When you run “@hr_main.sql” below you will be asked for the sys password. The password is “oracle”.
Console 3
oracle@localhost $ cd /oradata/samples
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
User dropped.
User created.
Directory created.
Grant succeeded.
SQL> @hr_main.sql
Enter @sys_password: oracle
:
:
1 row created.
Oracle Page 48
Table altered.
Commit complete.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
oracle@localhost $ expdp hr/hr dumpfile=hr.11g.dmp logfile=exp.hr11g.log
directory=exp_dir
Export: Release 11.2.0.4.0 - Production on Sat Apr 5 06:45:00 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "HR"."SYS_EXPORT_SCHEMA_01": hr/******** dumpfile=hr.11g.dmp
logfile=exp.hr11g.log directory=exp_dir
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 448 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "HR"."COUNTRIES" 6.367 KB 25 rows
. . exported "HR"."DEPARTMENTS" 7.007 KB 27 rows
. . exported "HR"."EMPLOYEES" 16.79 KB 107 rows
. . exported "HR"."JOBS" 6.984 KB 19 rows
. . exported "HR"."JOB_HISTORY" 7.054 KB 10 rows
. . exported "HR"."LOCATIONS" 8.273 KB 23 rows
. . exported "HR"."REGIONS" 5.476 KB 4 rows
Master table "HR"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for HR.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/hr.11g.dmp
Job "HR"."SYS_EXPORT_SCHEMA_01" successfully completed at Sat Apr 5 06:45:51 2014 elapsed
0 00:00:50
oracle@localhost:/oradata/samples$
Oracle Page 49
Import hr schema into 12c database – PDB1 and populate it.
Console 4
oracle@localhost $ cd /oradata/samples
oracle@localhost $ sqlplus / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Session altered.
SYS:CDB12> create directory imp_dir as '/home/oracle';
Directory created.
Grant succeeded.
...
...
...
Grant succeeded.
Grant succeeded.
Oracle Page 50
SYS:CDB12>exit
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights
reserved.
oracle@localhost:/oradata/samples$
Oracle Page 51
Oracle Page 52
Issue the commands below to start the GoldenGate command interpreter.
Console 1
oracle@localhost$ ./ggsci
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights
reserved.
Oracle Page 53
GGSCI (localhost.localdomain) 12> add checkpointtable
Console 4
oracle@localhost:~$ sqlplus / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Grant succeeded.
Session altered.
Grant succeeded.
SYS:CDB12>
Oracle Page 54
Repeat the manager configuration process in the second console.
Console 2
oracle@localhost:/oradata/ogg/product/12.1.0$ cd
/oradata/ogg/oracle/product/12.1.0
oracle@localhost $ ./ggsci
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights
reserved.
Oracle Page 55
No checkpoint table specified. Using GLOBALS specification
(pdb1.c##gguser.ggschkpt)...
Oracle Page 56
Configure Golden Gate for Data Replication (11g to 12c)
Data capture, also known as extract is done on the source side. A primary extract is required; a secondary
extract known as a data pump is optional but highly recommended. To configure data capture, perform the
following steps:
Console 1
oracle@localhost $ ./ggsci
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights
reserved.
# if this file does not exist, please setup eora01.prm under dirprm.
GGSCI (localhost.localdomain) 13> view param eora01
extract eora01
exttrail ./dirdat/aa
table hr.employees;
Oracle Page 57
The primary extract has now been created and configured, but not started. Leave GGSCI running for the next
step to configure data pump.
Console 1
GGSCI (localhost.localdomain) 16> view param epmp01
extract epmp01
passthru
rmthost localhost, mgrport 7810
rmttrail ./dirdat/ab
table hr.employees;
The data pump reads from the local trail file aa and writes to the remote trail file ab. The remote trail file that
will be created will be named dirdat/ab000000, then when that one fills up the next will be dirdat/ab000001,
then dirdat/ab000002, and so on. The different file name is chosen just to illustrate that the
parameter RmtTrail is creating a different trail file.
The secondary Extract has now been created and configured, but not started. Leave GGSCI running for the
next step.
Oracle Page 58
Verify the extract processes (Optional)
Make sure the Extract processes were created and registered correctly.
Console 1
MANAGER RUNNING
EXTRACT STOPPED EORA01 00:00:00 00:09:37
EXTRACT STOPPED EPMP01 00:00:00 00:04:34
Data delivery, also known as Replicat is done at the target side. To configure data delivery and verify, perform
the following steps:
Console 2
Oracle Page 59
GGSCI (localhost.localdomain) 12> info all
MANAGER RUNNING
REPLICAT STOPPED RORA01 00:00:00 00:00:44
The Map statement can be simple (as shown here), or very complex, transforming columns and fields. For
example, you could combine three source columns first_name, middle_init, last_name into a single target
column full_name.
Console 1
MANAGER RUNNING
EXTRACT RUNNING EORA01 00:00:00 00:00:06
EXTRACT RUNNING EPMP01 00:00:00 00:00:01
Oracle Page 60
Log Read Checkpoint File ./dirdat/aa000000
First Record RBA 1029
Console 2
GGSCI (localhost.localdomain) 8> view param rora01
replicat rora01
userid c##gguser@pdb1, password welcome1
assumetargetdefs
discardfile ./dirrpt/rora01.dsc, purge
map hr.employees, target pdb1.hr.employees;
MANAGER RUNNING
REPLICAT RUNNING RORA01 00:00:00 00:00:02
Oracle Page 61
Current directory /oradata/ogg/product/12.1.0
Everything should show a status of RUNNING. No data has flowed yet, nothing has replicated yet.
You can issue any update/insert statements on source and can observe the data replicated to the target
environment. Start a separate terminal and login into V112 oracle environment.
Console 3
oracle@localhost:~$ . oraenv
ORACLE_SID = [oracle] ? V112
The Oracle base remains unchanged with value /u01/app/oracle
oracle@localhost:~$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
SQL>
Oracle Page 62
SQL> update hr.employees set salary=98765 where employee_id=100;
1 row updated.
SQL> commit;
Commit complete.
1 row created.
SQL> commit;
Commit complete.
Oracle Page 63
You can observe now that data has started replicating to the 11g database environment. Startup a new
session and login into CDB12 Oracle database environment.
Console 4
oracle@localhost:~$ . oraenv
ORACLE_SID = [oracle] ? CDB12
The Oracle base remains unchanged with value /u01/app/oracle
oracle@localhost:~$ sqlplus / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Session altered.
SYS:CDB12> select employee_id, first_name, last_name, salary from
hr.employees where employee_id=100;
Oracle Page 64
Managing the Oracle GoldenGate environment
For running various adminstritative reports, you can test the following commands.
Console 1
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights
reserved.
Description:
:
:
:
***********************************************************************
* ** Run Time Statistics ** *
***********************************************************************
Oracle Page 65
Report at 2014-03-12 06:43:15 (activity since 2014-03-12 06:31:42)
Output to ./dirdat/aa:
***********************************************************************
** Run Time Warnings **
***********************************************************************
Console 2
GGSCI (localhost.localdomain) 17> send replicat rora01, report
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights
reserved.
Oracle Page 66
:
:
:
Continued : N (x00) RecCount : 1 (x01)
***********************************************************************
** Run Time Warnings **
***********************************************************************
The count of inserts/updates/deletes for the Replicat should match the number for the Extract. If there were
any discards, they should be examined for the reason why they were discarded.
Reports are generated when you ask for a report to be sent (as you just did), or when a process stops. Reports
are named/numbered processname.rpt for the most current one, and then
processname0.rpt, processname1.rpt, processname2.rpt for the most recent, up to processname9.rpt for the oldest. As
each new report is created, all the old reports "move down one" getting renamed/renumbered until the
oldest is discarded. No more than 11 (the most recent with no number and the previous 0-9) are kept at a
time.
Oracle Page 67
You can also view the number of rows inserted and other statistics with the following commands:
Console 1
GGSCI (localhost.localdomain) 18> send extract eora01, stats
Output to ./dirdat/aa:
End of Statistics.
Oracle Page 68
Similarly, you can run a statistics report on the target replicat process.
Console 2
GGSCI (localhost.localdomain) 11> send replicat rora01, stats
End of Statistics.
Oracle Page 69
Configuring bidirectional support (optional)
To configure bidirectional replication support, perform the following steps. Create the extract group and the
local Extract trail file.
Console 2
GGSCI (localhost.localdomain) 14> obey startup.oby
GGSCI (localhost.localdomain) 15> dblogin UserID c##gguser, Password welcome1
port 7810
MANAGER RUNNING
REPLICAT RUNNING RORA01 00:00:00 00:00:03
extract eora02
setenv (ORACLE_SID='CDB12')
SOURCECATALOG pdb1
userid c##gguser@cdb12, password welcome1
LOGALLSUPCOLS
exttrail ./dirdat/bb
sequence hr.employees_seq;
table hr.employees;
Oracle Page 70
Place the 12c database in archivelog mode using SQL Plus.
Console 4
oracle@localhost:~$ sqlplus / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Database altered.
Database altered.
Session altered.
Database altered.
System altered.
Oracle Page 71
SUPPLEME FORCE_LOGGING
-------- ---------------------------------------
YES YES
SYS:CDB12>
Login into CDB12 again from GGSCI and start the manager.
Console 2
GGSCI (localhost.localdomain) 26> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)?y
Manager started.
port 7810
Console 2
Oracle Page 72
GGSCI (localhost.localdomain) 38> add exttrail ./dirdat/bb, extract
eora02, megabytes 5
EXTTRAIL added.
extract epmp02
passthru
rmthost localhost, mgrport 7809
rmttrail ./dirdat/ba
sequence hr.employees_seq;
table hr.employees;
MANAGER RUNNING
EXTRACT STOPPED EORA02 00:00:00 00:01:43
EXTRACT STOPPED EPMP02 00:00:00 00:00:20
REPLICAT RUNNING RORA01 00:00:00 00:00:00
On 11g source, create the Replicat parameter file and start the replicat process on 11g database.
Console 1
GGSCI (localhost.localdomain) 20> view params rora02
replicat rora02
REPERROR (-1403, IGNORE);
userid gguser, password welcome1
assumetargetdefs
discardfile ./dirrpt/rora02.dsc, purge
map pdb1.hr.employees, target hr.employees;
Oracle Page 73
./dirdat/ba
REPLICAT added.
MANAGER RUNNING
EXTRACT RUNNING EORA01 00:00:00 00:00:08
EXTRACT RUNNING EPMP01 00:00:00 00:00:08
REPLICAT STOPPED RORA02 00:00:00 00:01:19
MANAGER RUNNING
EXTRACT RUNNING EORA01 00:00:00 00:00:02
EXTRACT RUNNING EPMP01 00:00:00 00:00:05
REPLICAT RUNNING RORA02 00:00:00 00:00:03
Console 2
GGSCI (localhost.localdomain) 13> info all
MANAGER RUNNING
EXTRACT STOPPED EORA02 00:00:00 00:16:25
EXTRACT STOPPED EPMP02 00:00:00 00:11:39
Oracle Page 74
REPLICAT RUNNING RORA01 00:00:00 00:00:02
MANAGER RUNNING
EXTRACT RUNNING EORA02 00:17:17 00:00:07
EXTRACT RUNNING EPMP02 00:00:00 00:00:03
REPLICAT RUNNING RORA01 00:00:00 00:00:00
All Extract and Replicat processes are configured and started from 12c to 11g. The earlier Extract and replicat
from 11g to 12c are still running.
Console 4
SYS:CDB12> alter session set container=pdb1;
Session altered.
SYS:CDB12> insert into hr.employees (employee_id, first_name,
last_name, email, phone_number, hire_date,job_id, salary) values
(998, 'Shane', 'Watson', 's.watson@s.com',
'',sysdate,'AD_VP',99500);
1 row created.
SYS:CDB12> commit;
Commit complete.
Oracle Page 75
EMPLOYEE_ID FIRST_NAME LAST_NAME
SALARY
----------- -------------------- ------------------------- ---------
-
998 Shane Watson
99500
Console 3
SYS:V102> select employee_id, first_name, last_name, salary from
hr.employees where employee_id=998;
You can do some further updates on data to make sure the bidirectional replication is working.
Optionally shutdown both 11g and 12c databases to conserve resources and if you completed the exercise
successfully.
Console 3
SYS:V102> update hr.employees set salary=192165 where
employee_id=998;
1 row updated.
SYS:V102> commit;
Commit complete.
Oracle Page 76
192165
Console 4
SYS:V112> select employee_id, first_name, last_name, salary from
hr.employees where employee_id=998;
Both 11g and 12c databases should have the same rows. This does not take into account the possibility of
collision detection and resolution (CDR), which is beyond the scope of this exercise.
Console 1
GGSCI (localhost.localdomain) 30> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
MANAGER STOPPED
Oracle Page 77
EXTRACT ABENDED EORA01 00:00:00 00:01:41
EXTRACT STOPPED EPMP01 00:00:00 00:00:04
REPLICAT ABENDED RORA02 00:00:00 00:01:55
Console 2
GGSCI (localhost.localdomain) 34> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
MANAGER RUNNING
EXTRACT ABENDED EORA02 00:00:00 00:01:28
EXTRACT STOPPED EPMP02 00:00:00 00:00:03
REPLICAT ABENDED RORA01 00:00:00 00:01:33
Summary
In this Hands-On-Lab, you have learned how to:
Oracle Page 78
6 Cross-Platform Transportable Tablespaces (xTTS)
In this exercise, we will transport a tablespace from a 11g database from a Solaris 64 bit machine (Big Endian
format) to DB12c. The source data contains a table created with data from dba_objects (hr.test_objects) . The
source tablespace has been turned read-only and the export dump containing a metadata information of the
tablespace has been generated and placed in /oradata/xtts directory. We will import them into the PDB1
pluggable database on CDB12. This is a simple scenario of a self-contained tablespace being migrated to a
different Endian format. If there are non-segmented user objects (such as triggers, sequences,packages etc)
they have to be dealt with separately using another export dump or alternatively fully transportable
expdp/impdp.
The tablespace UPGTEST has been turned read only on production and the copy of the datafiles have also
been copied to /oradata/xtts directory.
Following was the method used to generate read only datafile from 11g ORCL2 database environment on
Solaris 64 bit (SPARC T4-4).
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
FILE_NAME
--------------------------------------------------------------------------
------
+DATA/ora11g/datafile/upgtest.292.844181453
SQL> create table hr.test_objects tablespace upgtest as select * from
dba_objects;
Table created.
Tablespace altered.
SQL> exit
Oracle Page 79
Disconnected from Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights
reserved.
grid@t4-4-01:~$ . oraenv
ORACLE_SID = [+ASM] ? +ASM
The Oracle base has been set to /u01/app/grid
grid@t4-4-01:~$ whoami
grid
grid@t4-4-01:~$ asmcmd
ASMCMD> cp +DATA/ora11g/datafile/upgtest.292.844181453 /tmp
copying +DATA/ora11g/datafile/upgtest.292.844181453 ->
/tmp/upgtest.292.844181453
ASMCMD>
oracle@t4-4-01:~$ ls -lrt
total 204
drwxr-xr-x 3 oracle oinstall 3 Apr 1 18:22 oradiag_oracle
Oracle Page 80
drwxr-xr-x 2 oracle oinstall 9 Apr 6 15:05 old
-rw-r--r-- 1 oracle dba 1208 Apr 6 15:08 exp.upgtest.log
-rw-r----- 1 oracle dba 98304 Apr 6 15:08 upgtest.11g.dmp
Now start the RMAN conversion of the copies of the Big-Endian format datafiles to the Linux Little Endian
format.
oracle@localhost:~$ . oraenv
ORACLE_SID = [CDB12] ?
The Oracle base remains unchanged with value /u01/app/oracle
oracle@localhost:~$ sqlplus / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Session altered.
Directory created.
Grant succeeded.
SYS:CDB12> exit
oracle@localhost: $ cd /oradata/xtts
Oracle Page 81
RMAN> @3_convert.rcv
RMAN> **end-of-file**
RMAN> quit
At this point of time, the datafiles from the Big Endian source system (ASM format) have been converted to
the Linux O/S format (Non-ASM) . Now we will import 1) metadata of the datafiles into the target database. If
we had non-segmented user objects (sequences, triggers, etc), we would need to run another import with
those objects from the soruce. Run the following pre-prepared impdp shell scripts.
oracle@localhost:/oradata/xtts$ ./impdp.sh
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights
reserved.
Oracle Page 82
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 -
64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Master table "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully
loaded/unloaded
Source TSTZ version is 11 and target TSTZ version is 18.
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01": "sys/********@pdb1 AS
SYSDBA" directory=xtts dumpfile=upgtest.11g.dmp
transport_datafiles=/oradata/CDB12/pdb1/upgtest.292.844181453 nologfile=Y
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Sun Apr
6 05:37:27 2014 elapsed 0 00:00:17
oracle@localhost:~/xtts$
Now the tablespace UPGTEST, along with all the contained object is now part of the target PDB1 pluggable
database. Make sure the HR schema exists in the database (if not create it), and if necessary, set UPGTEST as
the default tablespace for HR, recompile objects to remove errors and verify the results.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options
Session altered.
COUNT(*)
----------
20
Oracle Page 83
SYS:CDB12> select count(*) from hr.test_objects;
COUNT(*)
----------
72627
User altered.
SYS:ORCL2>
Well Done !!! You have transported a self-contained tablespace from a Big Endian format Operating System
(Solaris) to a Little Endian Operating System.
Oracle Page 84
7 Conclusions
In this Hands-on Session you have performed hands on upgrade of databases with various scenarios. For
further information, you can visit : http://blogs.oracle.com/upgrade. You can also check My Oracle Support for
the latest Patching and Release information.
Lastly, do not hesitate to get in touch with your Oracle accounts team for any further help !!
Thank You !!
Oracle Page 85