ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Solaris 10下迁移10G RAC (六)

Solaris 10下迁移10G RAC (六)

原创 Linux操作系统 作者:space6212 时间:2019-03-29 20:12:05 0 删除 编辑

最近做了一个rac数据库的迁移,中间涉及到很多部分内容,包括rac环境的搭建、ASM的设置、数据库的迁移、升级等。
本文是这次迁移工作的第六部分:恢复数据库。


6 恢复数据库

6.1 备份数据库

首先需要从原来数据库备份,过程不说了,备份完成后将备份集传送到本地上。

6.2 准备相关目录并授权

由于源库的目录结构与当前库不一致,为了可以正常用rman恢复,需要做一个link来保持两边路径的一致性。

在其中一个节点创建如下目录和链接(pre1):

mkdir –p /data/backup
ln -s  /backup /data/backup/tradedb

在所有节点创建相关目录并授权:

mkdir -p /oracle/app/admin/pre/{bdump,udump,adump}

6.3 ASM中创建对应目录

pre1上以oracle用户运行:
bash-3.00$ export ORACLE_SID=+ASM1
bash-3.00$ asmcmd
ASMCMD> ls
DATA/
ASMCMD> cd data
ASMCMD> mkdir onlinelog
ASMCMD> mkdir archivelog
ASMCMD> mkdir datafile
ASMCMD> mkdir pfile
ASMCMD> mkdir controlfile
ASMCMD> ls
archivelog/
controlfile/
datafile/
onlinelog/
pfile/

6.4 创建密码文件

分别在两个节点创建密码文件:

pre1:
bash-3.00$ cd $ORACLE_HOME/dbs
bash-3.00$ orapwd file=orapwprerac1 password=testpass entries=10
pre2:
bash-3.00$ cd $ORACLE_HOME/dbs
bash-3.00$ orapwd file=orapwprerac2 password=testpass entries=10

两端密码保持一致。

6.5 配置tnsnames文件

在所有节点的tnsnames.ora都添加如下内容:

LISTENER_PRE2 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = vip-pre1)(PORT = 1521))
LISTENER_PRE1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = vip-pre2)(PORT = 1521))
LISTENERS_PRE =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vip-pre1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = vip-pre2)(PORT = 1521))
  )
PRE2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vip-pre1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pre.us.oracle.com)
      (INSTANCE_NAME = prerac2)
    )
  )
PRE1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vip-pre2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pre.us.oracle.com)
      (INSTANCE_NAME = prerac1)
    )
  )

6.6 创建参数文件

首先从源库创建一个pfile
create pfile from spfile;
然后把创建得到的pfile传送到其中一个节点上(pre1)
bash-3.00$ sftp 172.0.2.11
Connecting to 172.0.2.11...
Password: 
sftp> get  pfile.ora
Fetching /export/home/oracle/pfile.ora to pfile.ora
sftp> exit
编辑pfile.ora,修改后的参数如下:
*.audit_file_dest='/oracle/app/admin/pre/adump'
*.background_dump_dest='/oracle/app/admin/pre/bdump'
*.cluster_database=true
*.cluster_database_instances=2
*.compatible='10.2.0.1.0'
*.control_files='+DATA/controlfile/control1','+DATA/controlfile/control2','+DATA/controlfile/control3'
*.core_dump_dest='/opt/oracle/admin/prerac/cdump'
*.db_block_size=16384
*.db_domain='us.oracle.com'
*.db_file_multiblock_read_count=16
*.db_name='tradedb'
*.global_names=TRUE
prerac1.instance_number=1
prerac2.instance_number=2
*.job_queue_processes=50
#填写VIP地址
prerac1.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 172.0.2.2)(PORT = 1521))'
prerac2.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 172.0.2.4)(PORT = 1521))'
*.log_archive_dest_1='LOCATION=+DATA//archivelog'
*.log_archive_format='%t_%s_%r.dbf'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=5000
*.pga_aggregate_target=495630592
*.processes=300
*.remote_listener='LISTENERS_PRE'
*.remote_login_passwordfile='EXCLUSIVE'
*.session_max_open_files=20
*.sessions=335
*.sga_target=1474836480
*.streams_pool_size=50331648
prerac1.thread=1
prerac2.thread=2
*.undo_management='AUTO'
*.undo_retention=10800
prerac1.undo_tablespace='UNDOTBS1'
prerac2.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/oracle/app/admin/pre/udump'
把该参数文件放到ASM上,让所有节点共享一个spfile
在其中一个节点上执行如下命令(prerac1)
bash-3.00$ export ORACLE_SID=prerac1
bash-3.00$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on 星期三 9 26 23:10:35 2007
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> create spfile='+DATA/pfile/spfile.ora' from pfile='/export/home/oracle/pfile.ora';
File created.
在所有节点添加一个pfile,指向刚才创建的spfile
Prerac1
bash-3.00$ more initprerac1.ora 
spfile=+DATA/pfile/spfile.ora
prerac2:
bash-3.00$ more initprerac2.ora
spfile=+DATA/pfile/spfile.ora
这样就实现了多个节点共享一个spfile了。

6.7 还原数据库:

下面就可以正式还原数据库了:
还原数据库的时候需要启动实例,并且只需要启动一个就可以:
Ø         prerac1上启动实例:
bash-3.00$ export ORACLE_SID=prerac1
bash-3.00$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 9 27 00:10:17 2007
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1476395008 bytes
Fixed Size                  2030200 bytes
Variable Size             385877384 bytes
Database Buffers         1073741824 bytes
Redo Buffers               14745600 bytes
SQL> exit
Ø         RMAN还原控制文件
bash-3.00$ export ORACLE_SID=prerac1
bash-3.00$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on 星期四 9 27 00:35:47 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: tradedb (not mounted)
--还原控制文件
RMAN> restore controlfile from '/data/backup/tradedb/62isntt2_1_1';
Starting restore at 27-9 -07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=316 instance=prerac1 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:17
output filename=+DATA/controlfile/control1
output filename=+DATA/controlfile/control2
output filename=+DATA/controlfile/control3
Finished restore at 27-9 -07
RMAN>      
--mount数据库
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
Ø        修改联机日志路径和名称
退出RMAN,在sqlplus中修改联机日志的路径和名称,以免在后面的open resetlogs报错:
具体命令如下:
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_1_1_1g' to  '+DATA/onlinelog/redo1_1_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_1_2_1g' to  '+DATA/onlinelog/redo1_1_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_2_1_1g' to  '+DATA/onlinelog/redo1_2_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_2_2_1g' to  '+DATA/onlinelog/redo1_2_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_3_1_1g' to  '+DATA/onlinelog/redo1_3_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_3_2_1g' to  '+DATA/onlinelog/redo1_3_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_4_1_1g' to  '+DATA/onlinelog/redo1_4_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo1_4_2_1g' to  '+DATA/onlinelog/redo1_4_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_1_1_1g' to  '+DATA/onlinelog/redo2_1_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_1_2_1g' to  '+DATA/onlinelog/redo2_1_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_2_1_1g' to  '+DATA/onlinelog/redo2_2_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_2_2_1g' to  '+DATA/onlinelog/redo2_2_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_3_1_1g' to  '+DATA/onlinelog/redo2_3_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_3_2_1g' to  '+DATA/onlinelog/redo2_3_2.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_4_1_1g' to  '+DATA/onlinelog/redo2_4_1.log';
alter database rename file '/dev/vx/rdsk/datadg/tradedb_redo2_4_2_1g' to  '+DATA/onlinelog/redo2_4_2.log';
Ø         在源数据库中生成重新命名数据文件的rman脚本
SQL> SELECT 'set newname for datafile ''' || FILE_NAME ||
  2  ''' to ''+DATA/datafile/' ||lower(TABLESPACE_NAME)||
  3  row_number() over (partition by tablespace_name order by file_id)|| '.ora'';' sql
  4  FROM DBA_DATA_FILES;
SQL
------------------------------------------------------------------------------------------------------------------------
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_1' to '+DATA/datafile/anhui1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_2' to '+DATA/datafile/anhui2.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_3' to '+DATA/datafile/anhui3.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_4' to '+DATA/datafile/anhui4.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_gpo_1_4g' to '+DATA/datafile/gpo1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_gpo_2_4g' to '+DATA/datafile/gpo2.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_ndmain_1_4g' to '+DATA/datafile/ndmain1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_ndmain_2_4g' to '+DATA/datafile/ndmain2.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_ndmain_3_4g' to '+DATA/datafile/ndmain3.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_sysaux_1_1g' to '+DATA/datafile/sysaux1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_sysaux_2_1g' to '+DATA/datafile/sysaux2.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_system_1_4g' to '+DATA/datafile/system1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_1_4g' to '+DATA/datafile/undotbs11.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_2_4g' to '+DATA/datafile/undotbs12.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_3_4g' to '+DATA/datafile/undotbs13.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_4_4g' to '+DATA/datafile/undotbs14.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_5_4g' to '+DATA/datafile/undotbs15.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_1_4g' to '+DATA/datafile/undotbs21.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_2_4g' to '+DATA/datafile/undotbs22.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_3_4g' to '+DATA/datafile/undotbs23.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_4_4g' to '+DATA/datafile/undotbs24.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_5_4g' to '+DATA/datafile/undotbs25.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_users_1_200m' to '+DATA/datafile/users1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_1_4g' to '+DATA/datafile/zhejiang1.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_2_4g' to '+DATA/datafile/zhejiang2.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_3_4g' to '+DATA/datafile/zhejiang3.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_4_4g' to '+DATA/datafile/zhejiang4.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_5_4g' to '+DATA/datafile/zhejiang5.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_6_4g' to '+DATA/datafile/zhejiang6.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_7_4g' to '+DATA/datafile/zhejiang7.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_8_4g' to '+DATA/datafile/zhejiang8.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_9_4g' to '+DATA/datafile/zhejiang9.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_10_4g' to '+DATA/datafile/zhejiang10.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_11_4g' to '+DATA/datafile/zhejiang11.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_12_4g' to '+DATA/datafile/zhejiang12.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_13_4g' to '+DATA/datafile/zhejiang13.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_14_4g' to '+DATA/datafile/zhejiang14.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_15_4g' to '+DATA/datafile/zhejiang15.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_16_4g' to '+DATA/datafile/zhejiang16.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_17_4g' to '+DATA/datafile/zhejiang17.ora';
set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_18_4g' to '+DATA/datafile/zhejiang18.ora';
Ø         prerac1上注册备份信息
由于备份的时候出了点问题,导致还原的控制文件中没有最新一次备份的信息,这里利用10g rman的新功能把最近一次备份集的信息写到控制文件中,使恢复可以正常进行:
bash-3.00$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on 星期四 9 27 01:38:39 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: TRADEDB (DBID=4181457554, not open)
RMAN> catalog start with '/data/backup/tradedb/6*';
using target database control file instead of recovery catalog
searching for all files that match the pattern /data/backup/tradedb/6*
no files found to be unknown to the database
RMAN> catalog start with '/data/backup/tradedb/6';
searching for all files that match the pattern /data/backup/tradedb/6
List of Files Unknown to the Database
=====================================
File Name: /data/backup/tradedb/61isntt1_1_1
File Name: /data/backup/tradedb/62isntt2_1_1
File Name: /data/backup/tradedb/64isnvm0_1_1
File Name: /data/backup/tradedb/65iso00i_1_1
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /data/backup/tradedb/61isntt1_1_1
File Name: /data/backup/tradedb/62isntt2_1_1
File Name: /data/backup/tradedb/64isnvm0_1_1
File Name: /data/backup/tradedb/65iso00i_1_1
Ø         正式还原
RMAN>  run
2> {
3> ALLOCATE CHANNEL c1 TYPE DISK CONNECT sys/testpass@pre1;
4> ALLOCATE CHANNEL c2 TYPE DISK CONNECT sys/testpass@pre2;
5> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_1' to '+DATA/datafile/anhui1.ora';
6> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_2' to '+DATA/datafile/anhui2.ora';
7> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_3' to '+DATA/datafile/anhui3.ora';
8> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_anhui_4' to '+DATA/datafile/anhui4.ora';
9> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_gpo_1_4g' to '+DATA/datafile/gpo1.ora';
10> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_gpo_2_4g' to '+DATA/datafile/gpo2.ora';
11> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_ndmain_1_4g' to '+DATA/datafile/ndmain1.ora';
12> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_ndmain_2_4g' to '+DATA/datafile/ndmain2.ora';
13> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_ndmain_3_4g' to '+DATA/datafile/ndmain3.ora';
14> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_sysaux_1_1g' to '+DATA/datafile/sysaux1.ora';
15> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_sysaux_2_1g' to '+DATA/datafile/sysaux2.ora';
16> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_system_1_4g' to '+DATA/datafile/system1.ora';
17> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_1_4g' to '+DATA/datafile/undotbs11.ora';
18> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_2_4g' to '+DATA/datafile/undotbs12.ora';
19> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_3_4g' to '+DATA/datafile/undotbs13.ora';
20> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_4_4g' to '+DATA/datafile/undotbs14.ora';
21> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs1_5_4g' to '+DATA/datafile/undotbs15.ora';
22> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_1_4g' to '+DATA/datafile/undotbs21.ora';
23> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_2_4g' to '+DATA/datafile/undotbs22.ora';
24> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_3_4g' to '+DATA/datafile/undotbs23.ora';
25> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_4_4g' to '+DATA/datafile/undotbs24.ora';
26> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_undotbs2_5_4g' to '+DATA/datafile/undotbs25.ora';
27> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_users_1_200m' to '+DATA/datafile/users1.ora';
28> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_1_4g' to '+DATA/datafile/zhejiang1.ora';
29> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_2_4g' to '+DATA/datafile/zhejiang2.ora';
30> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_3_4g' to '+DATA/datafile/zhejiang3.ora';
31> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_4_4g' to '+DATA/datafile/zhejiang4.ora';
32> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_5_4g' to '+DATA/datafile/zhejiang5.ora';
33> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_6_4g' to '+DATA/datafile/zhejiang6.ora';
34> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_7_4g' to '+DATA/datafile/zhejiang7.ora';
35> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_8_4g' to '+DATA/datafile/zhejiang8.ora';
36> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_9_4g' to '+DATA/datafile/zhejiang9.ora';
37> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_10_4g' to '+DATA/datafile/zhejiang10.ora';
38> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_11_4g' to '+DATA/datafile/zhejiang11.ora';
39> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_12_4g' to '+DATA/datafile/zhejiang12.ora';
40> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_13_4g' to '+DATA/datafile/zhejiang13.ora';
41> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_14_4g' to '+DATA/datafile/zhejiang14.ora';
42> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_15_4g' to '+DATA/datafile/zhejiang15.ora';
43> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_16_4g' to '+DATA/datafile/zhejiang16.ora';
44> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_17_4g' to '+DATA/datafile/zhejiang17.ora';
45> set newname for datafile '/dev/vx/rdsk/datadg/tradedb_zhejiang_18_4g' to '+DATA/datafile/zhejiang18.ora';
46> restore database;
47> switch datafile all;
48> recover database;
49> release channel c1;
50> release channel c2;
51> }
allocated channel: c1
channel c1: sid=316 instance=prerac1 devtype=DISK
allocated channel: c2
channel c2: sid=310 instance=prerac2 devtype=DISK
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 27-9 -07
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to +DATA/datafile/undotbs11.ora
restoring datafile 00003 to +DATA/datafile/undotbs12.ora
restoring datafile 00005 to +DATA/datafile/undotbs14.ora
restoring datafile 00007 to +DATA/datafile/sysaux1.ora
restoring datafile 00008 to +DATA/datafile/undotbs21.ora
restoring datafile 00010 to +DATA/datafile/undotbs23.ora
restoring datafile 00012 to +DATA/datafile/undotbs25.ora
restoring datafile 00013 to +DATA/datafile/users1.ora
restoring datafile 00015 to +DATA/datafile/ndmain2.ora
restoring datafile 00017 to +DATA/datafile/anhui1.ora
restoring datafile 00019 to +DATA/datafile/anhui3.ora
restoring datafile 00021 to +DATA/datafile/zhejiang1.ora
restoring datafile 00023 to +DATA/datafile/zhejiang3.ora
restoring datafile 00025 to +DATA/datafile/zhejiang5.ora
restoring datafile 00027 to +DATA/datafile/zhejiang7.ora
restoring datafile 00029 to +DATA/datafile/zhejiang9.ora
restoring datafile 00031 to +DATA/datafile/zhejiang11.ora
restoring datafile 00033 to +DATA/datafile/zhejiang13.ora
restoring datafile 00035 to +DATA/datafile/zhejiang15.ora
restoring datafile 00037 to +DATA/datafile/zhejiang17.ora
restoring datafile 00040 to +DATA/datafile/gpo1.ora
channel c1: reading from backup piece /data/backup/tradedb/61isntt1_1_1
                                                                   channel c1: restored backup piece 1
piece handle=/data/backup/tradedb/61isntt1_1_1 tag=TAG20070924T093632
channel c1: restore complete, elapsed time: 02:15:44
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DATA/datafile/system1.ora
restoring datafile 00004 to +DATA/datafile/undotbs13.ora
restoring datafile 00006 to +DATA/datafile/undotbs15.ora
restoring datafile 00009 to +DATA/datafile/undotbs22.ora
restoring datafile 00011 to +DATA/datafile/undotbs24.ora
restoring datafile 00014 to +DATA/datafile/ndmain1.ora
restoring datafile 00016 to +DATA/datafile/ndmain3.ora
restoring datafile 00018 to +DATA/datafile/anhui2.ora
restoring datafile 00020 to +DATA/datafile/anhui4.ora
restoring datafile 00022 to +DATA/datafile/zhejiang2.ora
restoring datafile 00024 to +DATA/datafile/zhejiang4.ora
restoring datafile 00026 to +DATA/datafile/zhejiang6.ora
restoring datafile 00028 to +DATA/datafile/zhejiang8.ora
restoring datafile 00030 to +DATA/datafile/zhejiang10.ora
restoring datafile 00032 to +DATA/datafile/zhejiang12.ora
restoring datafile 00034 to +DATA/datafile/zhejiang14.ora
restoring datafile 00036 to +DATA/datafile/zhejiang16.ora
restoring datafile 00038 to +DATA/datafile/zhejiang18.ora
restoring datafile 00039 to +DATA/datafile/sysaux2.ora
restoring datafile 00041 to +DATA/datafile/gpo2.ora
channel c1: reading from backup piece /data/backup/tradedb/62isntt2_1_1
                                                           channel c1: restored backup piece 1
piece handle=/data/backup/tradedb/62isntt2_1_1 tag=TAG20070924T093632
channel c1: restore complete, elapsed time: 01:57:55
Finished restore at 27-9 -07
datafile 17 switched to datafile copy
input datafile copy recid=42 stamp=634370267 filename=+DATA/datafile/anhui1.ora
datafile 18 switched to datafile copy
input datafile copy recid=43 stamp=634370267 filename=+DATA/datafile/anhui2.ora
datafile 19 switched to datafile copy
input datafile copy recid=44 stamp=634370268 filename=+DATA/datafile/anhui3.ora
datafile 20 switched to datafile copy
input datafile copy recid=45 stamp=634370268 filename=+DATA/datafile/anhui4.ora
datafile 40 switched to datafile copy
input datafile copy recid=46 stamp=634370268 filename=+DATA/datafile/gpo1.ora
datafile 41 switched to datafile copy
input datafile copy recid=47 stamp=634370269 filename=+DATA/datafile/gpo2.ora
datafile 14 switched to datafile copy
input datafile copy recid=48 stamp=634370269 filename=+DATA/datafile/ndmain1.ora
datafile 15 switched to datafile copy
input datafile copy recid=49 stamp=634370269 filename=+DATA/datafile/ndmain2.ora
datafile 16 switched to datafile copy
input datafile copy recid=50 stamp=634370269 filename=+DATA/datafile/ndmain3.ora
da
                                                            

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/231499/viewspace-63867/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2005-01-25

  • 博文量
    245
  • 访问量
    168800