In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Https://community.oracle.com/blogs/Sir.DBaaSJoelPerez/2017/09/25/oracle-cloud-dbaas-migrating-databases-to-oracle-cloud-using-rman-backup
Now, Let's continue with this one:
The method to be worked in this article is based on the tradicional backup/restore/recover database. It has been one of the methods most effective to migrate/move an Oracle Database from one host to another host or even in the same host. The advantages of this method are several, one of them is that the downtime normally is almost zero, depending on the archive redo log generation of the "On-prem" or source database.
When to use this method?
No Cross-EndianNo structural changesNo upgrade to a new versionSource version 11.2.0.4, 12.1.0.2, 12.2.0.1
The objective of this article is not highlight the typical advantages of the method, since is very well known, the objective of this article is to realise how we can use it to move a database to Cloud.
Please use following steps to migrate on-premise database to Oracle cloud.
Backup source Database
1. Backup the source database
[oracle@PREMISE premise] $rman target /
Recovery Manager: Release 11.2.0.4.0-Production on Tue Aug 8 04:34:16 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to target database: ORCL (DBID=1478563967)
RMAN > run
{
Allocate channel C1 type DISK FORMAT'/ u01ax bkpqqpremiseAccording to the premiseAccording to FULLLGULLTHANGDISKS% checking% slots% p'
Allocate channel c2 type DISK FORMAT'/ u01ax bkpqqpremiseAccording to premiseAccording to FULLLCONTERDISKS% payment% slots% p'
Allocate channel c3 type DISK FORMAT'/ u01ax bkpqqpremiseAccording to the premiseAccording to FULLLGULLTHANGDISKS% checking% slots% p'
Allocate channel c4 type DISK FORMAT'/ u01ax bkpqqpremiseAccording to the premiseAccording to FULLLCONTERDISKS% payment% slots% p'
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG
Backup spfile format'/ u01amp bkpplash premiseUnitable spfileholders% dudes% slots% Treaddbidders% I.rman`
Backup current controlfile format'/ u01qqbkpAccording to premiseUniverse Control fileholders% dudes% qualified bidders% Iames% swatches% p'
Release channel c1
Release channel c2
Release channel c3
Release channel c4
}
Using target database control file instead of recovery catalog
Allocated channel: c1
Channel c1: SID=146 device type=DISK
Allocated channel: c2
Channel c2: SID=33 device type=DISK
Allocated channel: c3
Channel c3: SID=150 device type=DISK
Allocated channel: c4
Channel c4: SID=17 device type=DISK
Starting backup at 08-AUG-17
Current log archived
Skipping archived logs of thread 1 from sequence 7 to 8; already backed up
Channel c1: starting compressed archived log backup set
Channel C1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=9 RECID=9 STAMP=951453273
Channel c1: starting piece 1 at 08-AUG-17
Channel c1: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_9_1 tag=TAG20170808T043433 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-17
Starting backup at 08-AUG-17
Channel c1: starting compressed full datafile backup set
Channel C1: specifying datafile (s) in backup set
Input datafile file number=00001 name=/u02/app/oracle/oradata/ORCL/system01.dbf
Channel c1: starting piece 1 at 08-AUG-17
Channel c2: starting compressed full datafile backup set
Channel c2: specifying datafile (s) in backup set
Input datafile file number=00002 name=/u02/app/oracle/oradata/ORCL/sysaux01.dbf
Input datafile file number=00004 name=/u02/app/oracle/oradata/ORCL/users01.dbf
Channel c2: starting piece 1 at 08-AUG-17
Channel c3: starting compressed full datafile backup set
Channel c3: specifying datafile (s) in backup set
Input datafile file number=00005 name=/u02/app/oracle/oradata/ORCL/example01.dbf
Input datafile file number=00003 name=/u02/app/oracle/oradata/ORCL/undotbs01.dbf
Channel c3: starting piece 1 at 08-AUG-17
Channel c3: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_12_1 tag=TAG20170808T043434 comment=NONE
Channel c3: backup set complete, elapsed time: 00:00:07
Channel c1: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_10_1 tag=TAG20170808T043434 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:25
Channel c2: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_11_1 tag=TAG20170808T043434 comment=NONE
Channel c2: backup set complete, elapsed time: 00:00:25
Finished backup at 08-AUG-17
Starting backup at 08-AUG-17
Current log archived
Channel c1: starting compressed archived log backup set
Channel C1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=10 RECID=10 STAMP=951453301
Channel c1: starting piece 1 at 08-AUG-17
Channel c1: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_13_1 tag=TAG20170808T043501 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-17
Starting backup at 08-AUG-17
Channel c1: starting full datafile backup set
Channel C1: specifying datafile (s) in backup set
Including current SPFILE in backup set
Channel c1: starting piece 1 at 08-AUG-17
Channel c1: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/spfile_ORCL_14_20170808_dbid1478563967.rman tag=TAG20170808T043502 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-17
Starting backup at 08-AUG-17
Channel c1: starting full datafile backup set
Channel C1: specifying datafile (s) in backup set
Including current control file in backup set
Channel c1: starting piece 1 at 08-AUG-17
Channel c1: finished piece 1 at 08-AUG-17
Piece handle=/u01/bkp/premise/Controlfile_ORCL_20170808_dbid1478563967_s15_p1 tag=TAG20170808T043503 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-17
Starting Control File and SPFILE Autobackup at 08-AUG-17
Piece handle=/u03/app/oracle/fast_recovery_area/ORCL/autobackup/2017_08_08/o1_mf_s_951453306_drlhvton_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 08-AUG-17
Released channel: c1
Released channel: c2
Released channel: c3
Released channel: c4
RMAN >
RMAN > exit
Recovery Manager complete.
[oracle@PREMISE premise] $
2. Check the backup sets
[oracle@PREMISE premise] $cd / u01/bkp/premise
[oracle@PREMISE premise] $ls
Controlfile_ORCL_20170808_dbid1478563967_s15_p1 ORCL_FULL_C_DISK_20170808_11_1 ORCL_FULL_C_DISK_20170808_13_1 spfile_ORCL_14_20170808_dbid1478563967.rman
ORCL_FULL_C_DISK_20170808_10_1 ORCL_FULL_C_DISK_20170808_12_1 ORCL_FULL_C_DISK_20170808_9_1
[oracle@PREMISE premise] $
Create the new Cloud Database Service
A) Login to your Oracle cloud services account, go to the "Oracle Database Cloud Service" page and create a new service.
For Service Name, select PREMISE. From the Service Level list, select Oracle Database Cloud Service. From the Metering Frequency list, select whatever frequency is appropriate for your environment. From the Software Release list, select Oracle Database 11g Release2. From the Software Edition list, select Enterprise Edition. From the Database Type list, select Single Instance.
Then click Next to continue.
Figure1. Creating a new service (PREMISE)
B) In the Service Details screen, do the following:
For DB Name (SID), enter ORCL. Set an administrative password of your choice and confirm the password (this will be your sys password). For Usable Database Storage (GB), enter 25. From the Compute Shape list, select OC3-1 OCPU, 7.5GB RAM (this is the bare minimum required). For SSH Public Key, enter rsa-key-20170111.pub.
Then click Next to continue.
Figure 2. Specifying the service details
C) Finally, review the configuration and click Create to create your cloud database.
Figure 3. Creating the cloud database instance
After a few minutes, the cloud database instance has been created successfully.
Figure 4. The cloud database has been created
D) Click the service name (PREMISE) to open the main page of the database.
Figure 5. Main page of the cloud database
Connect the Cloud Database
1. Open the instance of the PuTTY executable and connect to the machine using SSH public key.
Figure 6. Connecting to machine using PuTTY
Copy backup to Oracle Cloud compute Node
1. Copy the backup set to cloud database
[oracle@Cloud] $mkdir-p / u01/app/premise/
[oracle@PREMISE ~] $scp-I rsa-key-20170111.ssh / u01 rsa-key-20170111.ssh App * oracle@141.144.32.52:/u01/app/premise
2. Delete the dummy database of cloud
[oracle@Cloud ~] $sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 8 04:37:45 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Partitioning and Real Application Testing options
SQL > shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL > startup mount exclusive restrict
ORACLE instance started.
Total System Global Area 2755870720 bytes
Fixed Size 2256432 bytes
Variable Size 637534672 bytes
Database Buffers 2030043136 bytes
Redo Buffers 86036480 bytes
Database mounted.
SQL > drop database
Database dropped.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Partitioning and Real Application Testing options
SQL >
Restore backup to Oracle Cloud Instance
1. Startup database in nomount mode
[oracle@Cloud] $mkdir-p / u01/app/oracle/admin/ORCL/adump
[oracle@Cloud ~] $sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 8 04:41:09 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL > startup nomount
ORACLE instance started.
Total System Global Area 2755870720 bytes
Fixed Size 2256432 bytes
Variable Size 637534672 bytes
Database Buffers 2030043136 bytes
Redo Buffers 86036480 bytes
SQL > exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Partitioning and Real Application Testing options
[oracle@Cloud ~] $ps-ef | grep pmon
Oracle 23518 1 0 04:41? 00:00:00 ora_pmon_ORCL
Oracle 23649 18890 0 04:41 pts/0 00:00:00 grep pmon
2. Restore control file and mount database
[oracle@Cloud ~] $rman target /
Recovery Manager: Release 11.2.0.4.0-Production on Tue Aug 8 04:42:34 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to target database: ORCL (not mounted)
RMAN > RESTORE CONTROLFILE from'/ u01amp bkpqqpremisecontrol fileORCL20170808 contract biddbid1478563967 characters s15roomp1'
Starting restore at 08-AUG-17
Using channel ORA_DISK_1
Channel ORA_DISK_1: restoring control file
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Output file name=/u02/app/oracle/oradata/ORCL/control01.ctl
Output file name=/u03/app/oracle/fast_recovery_area/ORCL/control02.ctl
Finished restore at 08-AUG-17
RMAN >
RMAN > alter database mount
Database mounted
Released channel: ORA_DISK_1
RMAN >
3. Catalog backup if location is different
RMAN > catalog start with'/ u01qqbkpUniqqpremiseUniple'
Starting implicit crosscheck backup at 08-AUG-17
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID=134 device type=DISK
Crosschecked 14 objects
Finished implicit crosscheck backup at 08-AUG-17
Starting implicit crosscheck copy at 08-AUG-17
Using channel ORA_DISK_1
Finished implicit crosscheck copy at 08-AUG-17
Searching for all files in the recovery area
Cataloging files...
Cataloging done
List of Cataloged Files
=
File Name: / u03/app/oracle/fast_recovery_area/ORCL/autobackup/2017_08_08/o1_mf_s_951453306_drlhvton_.bkp
Searching for all files that match the pattern / u01/bkp/premise/
List of Files Unknown to the Database
= =
File Name: / u01/bkp/premise/Controlfile_ORCL_20170808_dbid1478563967_s15_p1
Do you really want to catalog the above files (enter YES or NO)? Y
Cataloging files...
Cataloging done
List of Cataloged Files
=
File Name: / u01/bkp/premise/Controlfile_ORCL_20170808_dbid1478563967_s15_p1
RMAN >
4. Restore Database
RMAN > RUN {
SET NEWNAME FOR DATABASE TO'/ u02Gap appAccord oradata Oracle% U'
RESTORE DATABASE
SWITCH DATAFILE ALL
}
Executing command: SET NEWNAME
Starting restore at 08-AUG-17
Using channel ORA_DISK_1
Channel ORA_DISK_1: starting datafile backup set restore
Channel ORA_DISK_1: specifying datafile (s) to restore from backup set
Channel ORA_DISK_1: restoring datafile 00003 to / u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-UNDOTBS1_FNO-3
Channel ORA_DISK_1: restoring datafile 00005 to / u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-EXAMPLE_FNO-5
Channel ORA_DISK_1: reading from backup piece / u01/bkp/premise/ORCL_FULL_C_DISK_20170808_12_1
Channel ORA_DISK_1: piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_12_1 tag=TAG20170808T043434
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Channel ORA_DISK_1: starting datafile backup set restore
Channel ORA_DISK_1: specifying datafile (s) to restore from backup set
Channel ORA_DISK_1: restoring datafile 00002 to / u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-SYSAUX_FNO-2
Channel ORA_DISK_1: restoring datafile 00004 to / u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-USERS_FNO-4
Channel ORA_DISK_1: reading from backup piece / u01/bkp/premise/ORCL_FULL_C_DISK_20170808_11_1
Channel ORA_DISK_1: piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_11_1 tag=TAG20170808T043434
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Channel ORA_DISK_1: starting datafile backup set restore
Channel ORA_DISK_1: specifying datafile (s) to restore from backup set
Channel ORA_DISK_1: restoring datafile 00001 to / u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-SYSTEM_FNO-1
Channel ORA_DISK_1: reading from backup piece / u01/bkp/premise/ORCL_FULL_C_DISK_20170808_10_1
Channel ORA_DISK_1: piece handle=/u01/bkp/premise/ORCL_FULL_C_DISK_20170808_10_1 tag=TAG20170808T043434
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 08-AUG-17
Datafile 1 switched to datafile copy
Input datafile copy RECID=6 STAMP=951454265 file name=/u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-SYSTEM_FNO-1
Datafile 2 switched to datafile copy
Input datafile copy RECID=7 STAMP=951454266 file name=/u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-SYSAUX_FNO-2
Datafile 3 switched to datafile copy
Input datafile copy RECID=8 STAMP=951454266 file name=/u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-UNDOTBS1_FNO-3
Datafile 4 switched to datafile copy
Input datafile copy RECID=9 STAMP=951454266 file name=/u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-USERS_FNO-4
Datafile 5 switched to datafile copy
Input datafile copy RECID=10 STAMP=951454266 file name=/u02/app/oracle/oradata/ORCL/data_D-ORCL_TS-EXAMPLE_FNO-5
RMAN >
5. Recover database and open it with resetlogs
RMAN > recover database
Starting recover at 08-AUG-17
Using channel ORA_DISK_1
Starting media recovery
Archived log for thread 1 with sequence 10 is already on disk as file / u03/app/oracle/fast_recovery_area/ORCL/archivelog/2017_08_08/o1_mf_1_10_drlhvnw3_.arc
Archived log file name=/u03/app/oracle/fast_recovery_area/ORCL/archivelog/2017_08_08/o1_mf_1_10_drlhvnw3_.arc thread=1 sequence=10
Unable to find archived log
Archived log thread=1 sequence=11
RMAN-03002: failure of recover command at 08/08/2017 05:01:05
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 11 and starting SCN of 2519715
RMAN > alter database open resetlogs
Database opened
RMAN > exit
Recovery Manager complete.
[oracle@Cloud ~] $
6. Check the database instance
[oracle@Cloud ~] $ps-ef | grep smon
Oracle 945 18890 0 05:01 pts/0 00:00:00 grep smon
Oracle 31545 1 0 04:57? 00:00:00 ora_smon_ORCL
[oracle@Cloud ~] $sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 8 05:02:14 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Partitioning and Real Application Testing options
SQL > select name,open_mode from v$database
NAME OPEN_MODE
--
ORCL READ WRITE
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.