欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 培训 > Oracle RMAN克隆数据库(同主机)

Oracle RMAN克隆数据库(同主机)

2024/11/29 17:22:27 来源:https://blog.csdn.net/hf191850699/article/details/144022056  浏览:    关键词:Oracle RMAN克隆数据库(同主机)

Oracle RMAN克隆数据库(同主机)

介绍

通过使用数据库备份,DBA 可以在同一服务器或其它服务器上建立副本数据库。

这个副本数据库可以和主数据库有相同的名称(拷贝)或与主数据库名称不同(克隆)。

ORACLE 在数据库拷贝和数据库克隆之间唯一不同的是拷贝的数据库不能更改名称

克隆数据库

创建目录

[oracle@hfzcdb91:/home/oracle]$mkdir /oradata/hfzctest

[oracle@hfzcdb91:/home/oracle]$mkdir -p /oracle/app/oracle/admin/hfzctest/adump

创建pfile文件

[oracle@hfzcdb91:/home/oracle]$cd $ORACLE_HOME

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$sqlplus / as sysdba

SYS@hfzcdb> create pfile from spfile;

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$mv inithfzcdb.ora inithfzctest.ora

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$vi inithfzctest.ora

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$cat inithfzctest.ora

*.audit_file_dest='/oracle/app/oracle/admin/hfzctest/adump'  #修改
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/hfzctest/control01.ctl','/oradata/hfzctest/control02.ctl'# 修改  #修改Restore Controlfile
*.db_block_size=16384
*.db_name='hfzctest'    #修改
*.db_recovery_file_dest_size=107374182400
*.db_recovery_file_dest='/archive'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=hfzctestXDB)'  #修改
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=500m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1800m
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert=('/oradata/hfzcdb/','/oradata/hfzctest/')  #修改
*.log_file_name_convert=('/oradata/hfzcdb/','/oradata/hfzctest/')  #修改【转换的路径】

创建密码文件

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$cp orapwhfzcdb orapwhfzctest

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$export ORACLE_SID =hfzctest

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/dbs]$sqlplus “/as sysdba”

SQL> startup nomount; --报错

--ORA-27125: unable to create shared memory segment
--Linux-x86_64 Error: 28: No space left on device
--Additional information: 4549
--Additional information: 1879048192

[root@hfzcdb91 ~]# vi /etc/sysctl.conf

For more details see sysctl(8).
[root@hfzcdb91 ~]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 6355443200  #增加一倍
kernel.shmall = 1519200     #增加一倍  
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.ip_forward = 1
vm.nr_hugepages = 7500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.panic_on_oops = 1
vm.swappiness = 5
vm.min_free_kbytes = 204800

启动数据库到nomount

[root@hfzcdb91 ~]# su - oracle

Last login: Sun Apr 2 19:00:50 CST 2023 on pts/3

[oracle@hfzcdb91:/home/oracle]$export ORACLE_SID=hfzctest

[oracle@hfzcdb91:/home/oracle]$sqlplus “/as sysdba”

SYS@hfzcdb> create pfile from spfile;

SYS@hfzcdb> exit

SQL> startup nomount

修改listener.ora

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin/samples]$vi listener.ora

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$vi listener.ora

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$vi tnsnames.ora

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$lsnrctl reload

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$cat listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/19c/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = hfzcdb91)(PORT = 1521))(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME= hfzctest)(SID_NAME= hfzctest)(ORACLE_HOME=/oracle/app/oracle/product/19c/db_1)))
[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$cat tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/app/oracle/product/19c/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.HFZCDB =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = hfzcdb91)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = hfzcdb)))LISTENER_HFZCDB =(ADDRESS = (PROTOCOL = TCP)(HOST = hfzcdb91)(PORT = 1521))HFZCTEST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = hfzcdb91)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = hfzctest)))

使用rman克隆数据

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$rman target sys/oracle@hfzcdb auxiliary sys/oracle@hfzctest 【同时连接两个库】

RMAN> duplicate database to hfzctest from active database nofilenamecheck;   
Recovery Manager: Release 19.0.0.0.0 - Production on Fri Dec 29 16:39:58 2023
Version 19.3.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.connected to target database: HFZCDB (DBID=797496974)
connected to auxiliary database: HFZCTEST (not mounted)RMAN> duplicate database to hfzctest from active database nofilenamecheck;Starting Duplicate Db at 2023-12-29 16:41:27
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=246 device type=DISK
current log archivedcontents of Memory Script:
{sql clone "create spfile from memory";
}
executing Memory Scriptsql statement: create spfile from memorycontents of Memory Script:
{shutdown clone immediate;startup clone nomount;
}
executing Memory ScriptOracle instance shut downconnected to auxiliary database (not started)
Oracle instance startedTotal System Global Area    1895822688 bytesFixed Size                     8897888 bytes
Variable Size                436207616 bytes
Database Buffers            1442840576 bytes
Redo Buffers                   7876608 bytescontents of Memory Script:
{sql clone "alter system set  db_name =''HFZCDB'' comment=''Modified by RMAN duplicate'' scope=spfile";sql clone "alter system set  db_unique_name =''hfzctest'' comment=''Modified by RMAN duplicate'' scope=spfile";shutdown clone immediate;startup clone force nomountrestore clone from service  'hfzcdb' primary controlfile;alter clone database mount;
}
executing Memory Scriptsql statement: alter system set  db_name =  ''HFZCDB'' comment= ''Modified by RMAN duplica                                                                          te'' scope=spfilesql statement: alter system set  db_unique_name =  ''hfzctest'' comment= ''Modified by RMA                                                                          N duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area    1895822688 bytesFixed Size                     8897888 bytes
Variable Size                436207616 bytes
Database Buffers            1442840576 bytes
Redo Buffers                   7876608 bytesStarting restore at 2023-12-29 16:42:55
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=245 device type=DISKchannel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/oradata/hfzctest/control01.ctl
output file name=/oradata/hfzctest/control02.ctl
Finished restore at 2023-12-29 16:43:05database mountedcontents of Memory Script:
{set newname for datafile  1 to"/oradata/hfzctest/system01.dbf";set newname for datafile  2 to"/oradata/hfzctest/sysaux01.dbf";set newname for datafile  3 to"/oradata/hfzctest/undotbs01.dbf";set newname for datafile  4 to"/oradata/hfzctest/users01.dbf";set newname for datafile  5 to"/oradata/hfzctest/fgedu01.dbf";restorefrom  nonsparse   from service'hfzcdb'   clone database;sql 'alter system archive log current';
}
executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 2023-12-29 16:43:11
using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata/hfzctest/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oradata/hfzctest/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata/hfzctest/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata/hfzctest/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /oradata/hfzctest/fgedu01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2023-12-29 16:43:42sql statement: alter system archive log current
current log archivedcontents of Memory Script:
{restore clone force from service  'hfzcdb'archivelog from scn  1439945;switch clone datafile all;
}
executing Memory ScriptStarting restore at 2023-12-29 16:43:43
using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=11
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=12
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=13
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service hfzcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2023-12-29 16:44:19datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=1156869860 file name=/oradata/hfzctest/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=1156869860 file name=/oradata/hfzctest/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=1156869860 file name=/oradata/hfzctest/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=1156869860 file name=/oradata/hfzctest/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=1156869860 file name=/oradata/hfzctest/fgedu01.dbfcontents of Memory Script:
{set until scn  1440086;recoverclone databasedelete archivelog;
}
executing Memory Scriptexecuting command: SET until clauseStarting recover at 2023-12-29 16:44:20
using channel ORA_AUX_DISK_1starting media recoveryarchived log for thread 1 with sequence 2 is already on disk as file /archive/HFZCTEST/arc                                                                          hivelog/2023_12_29/o1_mf_1_2_lrx1p6h3_.arc
archived log for thread 1 with sequence 3 is already on disk as file /archive/HFZCTEST/arc                                                                          hivelog/2023_12_29/o1_mf_1_3_lrx1p7nl_.arc
archived log file name=/archive/HFZCTEST/archivelog/2023_12_29/o1_mf_1_2_lrx1p6h3_.arc thr                                                                          ead=1 sequence=2
archived log file name=/archive/HFZCTEST/archivelog/2023_12_29/o1_mf_1_3_lrx1p7nl_.arc thr                                                                          ead=1 sequence=3
media recovery complete, elapsed time: 00:00:01
Finished recover at 2023-12-29 16:44:24contents of Memory Script:
{delete clone force archivelog all;
}
executing Memory Scriptreleased channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3415 device type=DISK
deleted archived log
archived log file name=/archive/HFZCTEST/archivelog/2023_12_29/o1_mf_1_1_lrx1p2x2_.arc REC                                                                          ID=3 STAMP=1156869826
deleted archived log
archived log file name=/archive/HFZCTEST/archivelog/2023_12_29/o1_mf_1_2_lrx1p6h3_.arc REC                                                                          ID=6 STAMP=1156869830
deleted archived log
archived log file name=/archive/HFZCTEST/archivelog/2023_12_29/o1_mf_1_3_lrx1p7nl_.arc REC                                                                          ID=7 STAMP=1156869831
deleted archived log
archived log file name=/archive/HFZCTEST/archivelog/2023_12_29/o1_mf_1_1_lrx1p8vq_.arc REC                                                                          ID=8 STAMP=1156869832
Deleted 4 objectsOracle instance startedTotal System Global Area    1895822688 bytesFixed Size                     8897888 bytes
Variable Size                436207616 bytes
Database Buffers            1442840576 bytes
Redo Buffers                   7876608 bytescontents of Memory Script:
{sql clone "alter system set  db_name =''HFZCTEST'' comment=''Reset to original value by RMAN'' scope=spfile";sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Scriptsql statement: alter system set  db_name =  ''HFZCTEST'' comment= ''Reset to original valu                                                                          e by RMAN'' scope=spfilesql statement: alter system reset  db_unique_name scope=spfile
Oracle instance startedTotal System Global Area    1895822688 bytesFixed Size                     8897888 bytes
Variable Size                436207616 bytes
Database Buffers            1442840576 bytes
Redo Buffers                   7876608 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "HFZCTEST" RESETLOGS ARCHIVELOGMAXLOGFILES     16MAXLOGMEMBERS      3MAXDATAFILES     8192MAXINSTANCES     8MAXLOGHISTORY      292LOGFILEGROUP     1 ( '/oradata/hfzctest/redo01.log' ) SIZE 200 M  REUSE,GROUP     2 ( '/oradata/hfzctest/redo02.log' ) SIZE 200 M  REUSE,GROUP     3 ( '/oradata/hfzctest/redo03.log' ) SIZE 200 M  REUSEDATAFILE'/oradata/hfzctest/system01.dbf'CHARACTER SET AL32UTF8contents of Memory Script:
{catalog clone datafilecopy  "/oradata/hfzctest/sysaux01.dbf","/oradata/hfzctest/undotbs01.dbf","/oradata/hfzctest/users01.dbf","/oradata/hfzctest/fgedu01.dbf";switch clone datafile all;
}
executing Memory Scriptcataloged datafile copy
datafile copy file name=/oradata/hfzctest/sysaux01.dbf RECID=1 STAMP=1156869902
cataloged datafile copy
datafile copy file name=/oradata/hfzctest/undotbs01.dbf RECID=2 STAMP=1156869902
cataloged datafile copy
datafile copy file name=/oradata/hfzctest/users01.dbf RECID=3 STAMP=1156869903
cataloged datafile copy
datafile copy file name=/oradata/hfzctest/fgedu01.dbf RECID=4 STAMP=1156869903datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=1156869902 file name=/oradata/hfzctest/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1156869902 file name=/oradata/hfzctest/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1156869903 file name=/oradata/hfzctest/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=1156869903 file name=/oradata/hfzctest/fgedu01.dbfcontents of Memory Script:
{Alter clone database open resetlogs;
}
executing Memory Scriptdatabase opened
Cannot remove created server parameter file
Finished Duplicate Db at 2023-12-29 16:45:24

查看数据实例

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$ps -ef |grep smon

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$export ORACLE_SID=hfzctest

[oracle@hfzcdb91:/oracle/app/oracle/product/19c/db_1/network/admin]$sqlplus / as sysdba

SYS@hfzctest> select status from v$instance;STATUS------------OPENSYS@hfzctest> select name from v$datafile;
NAME
----------------------------------------
/oradata/hfzctest/system01.dbf
/oradata/hfzctest/sysaux01.dbf
/oradata/hfzctest/undotbs01.dbf
/oradata/hfzctest/users01.dbf
/oradata/hfzctest/hefei01.dbf

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com