Documente Academic
Documente Profesional
Documente Cultură
4. Duplicate database
Oracle 10g
Oracle 11g
Oracle 12c
Create 3 tablespaces :
APP_DATA
HR_DATA
REPORTING_DATA
Put all tablespaces to READ ONLY mode, or you will get the following error during export:
SQL>
Transportable tablespaces
DECLARE
db_ready BOOLEAN;
BEGIN
db_ready :=
DBMS_TDB.CHECK_DB('Microsoft Windows IA (32-bit)',
DBMS_TDB.SKIP_READONLY);
END;
/
Cross Platform Database Conversion
Run transport script to create a new database based on the converted files:
SQL> @trans.sql
3. Cross Platform Transportable tablespace
with incremental backups
Transportable tablespace with incremental backup
11G - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 1389592.1)
12C - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2005729.1)
Transportable tablespace with incremental backup
Move last incremental backup and dump file to the cloud machine
Transportable tablespace with incremental backup
TABLESPACE_NAME STATUS
-------------------- ---------
TBS_MIGRATE ONLINE
Transportable tablespace with incremental backup
rman_xttconvert_v3.zip
12C - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup
(Doc ID 2005729.1)
Transportable tablespace with incremental backup
Solaris[tm] OE (64-bit) Put the tablespace to READ ONLY mode Linux IA (64-bit)
Big endian Little endian
RMAN> BACKUP
TO PLATFORM 'Linux x86 64-bit'
FORMAT '/tmp/xplat_backups/trans_ts.bck'
DATAPUMP FORMAT '/tmp/xplat_backups/trans_ts_dmp.bck'
TABLESPACE test1;
RMAN> RESTORE
FOREIGN TABLESPACE TEST1 to NEW
FROM BACKUPSET '/u01/app/oracle/oradata/test/trans_ts.bck'
DUMP FILE FROM BACKUPSET
'/u01/app/oracle/oradata/test/trans_ts_dmp.bck';
Perform Cross-Platform Database Transport to different Endian
Platform with RMAN Backup Sets (Oracle 12c new feature)
ALLOW INCONSISTENT
The first inconsistent backup is a level 0 incremental backup. Subsequently, you can create
multiple cross-platform level 1 incremental backups. The final cross-platform incremental backup
must be a consistent backup that is created when the tablespaces are read-only. When you
create this final incremental backup, use the DUMP FILE clause in the BACKUP command to
create the dump file containing the tablespace metadata.
Perform Cross-Platform Database Transport to different Endian
Platform with RMAN Backup Sets (Oracle 12c new feature)
Move incremental backup and dump file to the Cloud Machine and restore
- db_name
- db_block_size
- Instance_name
- control_files
- db_file_name_convert
- log_file_name_convert
- undo_management
- undo_tablespace
From Cloud database connect to the both instances and duplicate the database:
- Download and install Oracle Database Cloud Backup Module from the
following link:
http://www.oracle.com/technetwork/database/availability/oracle-cloud-
backup-2162729.html
Perform a disaster recovery of On-Premise database to Oracle
Cloud using backups stored in Oracle Public Cloud Storage
Create folder to store wallets and lib file, extract the zip file and install it:
Download complete.
[oracle@ocm11g tmp]$
Perform a disaster recovery of On-Premise database to Oracle
Cloud using backups stored in Oracle Public Cloud Storage
Configure the channel to use SBT library which enable to store backups to
the cloud
RMAN>
Perform a disaster recovery of On-Premise database to Oracle
Cloud using backups stored in Oracle Public Cloud Storage
Create a new cloud instance, drop the database, configure SSH, download and
install Cloud Backup Module and clone the database
RMAN> run
{
ALLOCATE CHANNEL t1 TYPE ‘SBT_TAPE’
PARMS ‘SBT_LIBRARY=/home/oracle/lib/libopc.so
ENV=(OPC_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/opcPROD.ora)’;
SET DBID=345613202;
RESTORE SPFILE TO PFILE ‘/tmp/pfile.ora’ FROM AUTOBACKUP;
STARTUP NOMOUNT FORCE;
RESTORE CONTROLFILE FROM AUTOBACKUP;
SET NEWNAME FOR DATABASE TO ‘/u04/app/oracle/oradata/datafile_%t.dbf’;
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}
Perform Active Database Duplication of On-Premise database to
Oracle Cloud
Create parameter file in the Cloud host, start instance in NOMOUNT mode
Configure network parameters and password file in both On-Premise and Cloud host
- When running RMAN, use the service name in the connect string for the “target”
parameter.
- Create password file and parameter file in the Standby side and start the instance in
NOMOUNT mode
If the standby database is at Version 12.1 or higher copy the password file to ASM.
For Example:
$asmcmd -p
ASMCMD [+] > cd +DATA
AMSCMD [+DATA] >mkdir NEWPROD/PASSWORD
ASMCMD [+DATA] >pwcopy
/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/orapwnewprod1
+DATA/NEWPROD/PASSWORD/pwnewprod
ASMCMD [+DATA] > exit
Migrate On-Premise database to Oracle Cloud using
Standby database
On standby host create an initnewprod1.ora file that points to the spfile created in the
above step and start the instance in MOUNT mode
$cat initnewprod1.ora
spfile='+DATA/NEWPROD/spfilenewprod
To create an Oracle RAC database in Database Cloud Service, make the following choices in
the Create Service wizard
Cloud Tooling – raccli utility for backup, recovery, patch apply and administrative tasks
Network access – all ports except 22 are disabled. Port 22 is open for paswordless, key-based SSH
access by opc user
Database file storage – storage for database files, controlfiles and redo log files is created and
managed using ASM and ACFS
ASM to Non-ASM conversion
Cloud Machine
RMAN Backup
+DATA/system01.dbf
+DATA/users01.dbf
+DATA/redo01.log
RMAN Backup
/u02/system01.dbf
/u02/users01.dbf
/u02/redo01.log
Golden Gate is used to extract and replicate data from on database to another
Unidirectional Bidirectional
Migrate database using GoldenGate replication
Peer-to-Peer Broadcast
Migrate database using GoldenGate replication
Consolidation Cascading
Migrate database using GoldenGate replication
cd $GGHOME
./ggsci
GGSCI> create subdirs
Connect to the source database and disable recycle bin. Make sure the database is running in
archivelog mode.
Execute the following scripts to create required objects for the golden gate
SQL> @marker_setup.sql
SQL> @ddl_setup.sql
SQL> @role_setup.sql
SQL> GRANT ggs_ggsuser_role to ggadmin;
SQL> @ddl_enable.sql
SQL> @ddl_pin.sql
Migrate database using GoldenGate replication
./ggsci
GGSCI> dblogin userid ggadmin password ggadmin
GGSCI> add trandata hr.mytable01;
Create a manager parameter file and add the default port number
PORT 7809
EXTRACT DPUMP
Userid ggadmin,password ggadmin
RMTHOST target01.test.com,mgrport 7809
rmttrail /u01/goldengate/dirdat/rt
TABLE hr.mytable01;
REPLICAT REP1
userid ggadmin,password ggadmin
ASSUMETARGETDEFS
MAP hr.mytable01, TARGET hr.mytable01;
- db_name
- db_block_size
- Instance_name
- control_files
- db_file_name_convert
- log_file_name_convert
- undo_management
- undo_tablespace
Converting single instance On-Premises to RAC in Cloud
Configure network parameters in both machines and start the instance in the cloud
host in NOMOUNT mode
Take backup of On-Premises database using RMAN and move them to Cloud machine
RMAN> RUN {
SET NEWNAME FOR DATAFILE 1 TO ‘/u01/oradata/user01.dbf’;
DUPLICATE TARGET DATABASE TO proddb
pfile=‘/tmp/pfile.ora’ logfile
group 1 (‘/u01/oradata/redo/redo01.log’) size 50m reuse,
group 1 (‘/u01/oradata/redo/redo02.log’) size 50m reuse
}
Converting single instance On-Premises to RAC in Cloud
Transportable tablespace
- Faster than Data Pump - Requires partly downtime
- Platform, version must be same
- Extra conversion required for Cross
Platform migration
Thank you!
http://www.kamranagayev.com
http://www.ocmguide.com
http://www.oraclevideotutorials.com