Data Protector软件(以下简称:DP软件)是以Server ( Cell Manager ) --- Client( Agent ) 方式工作的,Cell Manager一般是指DP软件的管理端,包含所有的配置信息和备份信息(这些信息都存在DP的内置数据库IDB中)。
环境:原端和目标端都是HPUX
Clusterware version 11R2
Rdbms version 11R1
满足的要求:
1.对原端没有什么要求。
2.目标端需要安装好RAC,并安装好Rdbms软件。
3.两端都可以连接同一个DP控制台。
4.原端使用dp备份完毕。
5.确保目标服务器和原服务器的ORACLE_HOME一致(如果不一致可以通过建一个软链接)。
准备工作
创建一个密码文件
该密码文件是DP恢复控制文件时是必需的。因为dp端要通过网络描述符合sys密码来连接到目标端。
$ id orasrm
uid=1005(orasrm) gid=1010(oinstall)
$ cat .profile
umask 022
export TMP=/tmp
export TMPDIR=/tmp
export GRID_HOME=/pmsdb/11.2.0/grid
export ORACLE_BASE=/pmsdb/oracle
export ORACLE_HOME=$ORACLE_BASE/11.1.0
export PATH=$PATH
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export ORACLE_SID=ZKFP1
export ORACLE_OWNER=orasrm
$ cd $ORACLE_HOME/dbs
$ ll
total 44
-rw-r--r-- 1 orasrm oinstall 8385 Sep 11 1998 init.ora
-rw-r--r-- 1 orasrm oinstall 12920 May 3 2001 initdw.ora
$ orapwd file=orapwZKFP1 password=system entries=5 force=y
在目标机器造一个listener
这里由于是从dp备份软件方面将数据恢复到目标机器,所以需要在目标机器上配置好监听,并提供服务,这样,dp才可以连接到目标机器。我的目标机器之前一直都是同版本的RAC,也有rdbms软件,但一直没有建库。所以这里不需要我再按照rdbms,只需要手动配置监听文件即可。
需要说明的时,这里的监听配置是在oracle用户下配置的,而非grid用户。因为此时我们需要的时静态监听,因为我们要恢复的是控制文件,那如果是动态监听的话,在db没有mount时dp是不可以链接到目标机器的,所有必须配置静态监听才可以。
在oracle用户下编辑listener.ora和tnsnames.ora:
$ cd $ORACLE_HOME/network/admin
$ ll
total 2
drwxr-xr-x 2 orasrm oinstall 96 Sep 19 2012 samples
-rw-r--r-- 1 orasrm oinstall 187 May 7 2007 shrept.lst
$ cat listener.ora
# listener.ora.i2prddb5 Network Configuration File: /pmsdb/oracle/11.1.0/network/admin/listener.ora.i2prddb5
# Generated by Oracle configuration tools.
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME=PMSZKFDB)(ORACLE_HOME=/pmsdb/oracle/11.1.0)(SID_NAME=ZKFP1)))
LISTENER_I2PRDDB3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = I2PRDDB3-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.79.44)(PORT = 1521)(IP = FIRST))
)
)
PMSZKFDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = I2PRDDB3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PMSZKFDB)
)
)
$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /pmsdb/oracle/11.1.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_DB=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.42)(PORT=1521))))
LISTENER_SCAN=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.39)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.40)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.41)(PORT=1521)))
PMSZKFDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.79.44)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PMSZKFDB)
)
)
随后启动监听,启动时会报错,说grid下的监听已经启动,那使用srvctl stop listener关闭grid下的监听,然后再启动oracle用户下的监听。
$ lsnrctl start
LSNRCTL for HPUX: Version 11.1.0.6.0 - Production on 24-MAR-2016 11:36:25
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /pmsdb/oracle/11.1.0/bin/tnslsnr: please wait...
TNSLSNR for HPUX: Version 11.1.0.6.0 - Production
System parameter file is /pmsdb/oracle/11.1.0/network/admin/listener.ora
Log messages written to /pmsdb/oracle/diag/tnslsnr/I2PRDDB3/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=I2PRDDB3)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for HPUX: Version 11.1.0.6.0 - Production
Start Date 24-MAR-2016 11:36:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /pmsdb/oracle/11.1.0/network/admin/listener.ora
Listener Log File /pmsdb/oracle/diag/tnslsnr/I2PRDDB3/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=I2PRDDB3)(PORT=1521)))
Services Summary...
Service "PMSZKFDB" has 1 instance(s).
Instance "ZKFP1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
$ tnsping pmszkfdb
TNS Ping Utility for HPUX: Version 11.1.0.6.0 - Production on 24-MAR-2016 11:46:15
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.79.44)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PMSZKFDB)))
OK (0 msec)
$ sqlplus sys/system@pmszkfdb as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 24 10:15:39 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> exit
Disconnected
恢复控制文件
将控制文件从磁带库恢复到目标服务器
该步操作在DP界面完成。
首先是要确定需要恢复的控制文件在哪个session里。因为备份控归档的同时会备份一个控制文件,所以可以在归档的备份里将控制文件恢复回来。这里我们找到了3月10日的备份,将从这里恢复控制文件。
登录备份服务器,运行/opt/omni/bin/xomni
打开restore选项卡,选择Oracle Server,在Source选项卡选择Perform RMAN Repository Restore. 在下方选中CONTROL FILE FROM DP MANAGED BACKUP
在options里选择client,即要恢复的目标机器。如果选错或者不选问题也不严重,因为控制文件会被DP默认恢复到/var/opt/omni/tmp下,而不会直接覆盖数据库的控制文件。在username和user group中填写目标机器中的oracle数据库的用户名和用户组,这里是orasrm和oinstall. 此外选择session ID, 这个可以由上面DP界面获得。默认是最新的session ID。
上面界面的settings按钮点开,如下图所示。这里填写创造的密码文件里的密码和sys,service填写造出来的listener里的servicename
在Devices选项卡选择要使用的磁带机,也可以不选让其自己选择。然后点击restore.
以下就开始恢复了:
需要等待大概几分钟的时间,最后会提示回复成功。
此时在目标机器的/var/opt/omni/tmp下已经有了恢复出来的控制文件。如下所示:
$ ll /var/opt/omni/tmp
-rw-r----- 1 1000 oinstall 20529152 Mar 10 14:16 ctrl_PMSZKFDB_20910.dbf
将数据库启动到nomount状态
对于spfile,可以从dp恢复,也可以直接用原库的(如果原库还可以连接的话)。我这里就直接将原库的spfile来过来使用了。
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA_ZKF/pmszkfdb/spfilezkfp.
ora
SQL> create pfile='/home/oraZKF/bak0324.ora' from spfile='+DATA_ZKF/pmszkfdb/spfilezkfp.ora';
File created.
scp bak0324.ora 到目标机器。
$ cat bak0324.ora--将涉及到磁盘组名称的地方改掉。
*.audit_file_dest='/pmsdb/oracle/admin/PMSZKFDB/adump'
*.audit_trail='db'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='11.1.0.0.0'
*.control_files='+DATA_SRM/pmszkfdb/controlfile/current.268.760189917'
*.db_block_size=8192
*.db_cache_advice='OFF'
*.db_create_file_dest='+DATA_SRM'
*.db_domain=''
*.db_name='PMSZKFDB'
*.db_recovery_file_dest='+DATA_SRM'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='/pmsdb/oracle'
ZKFP1.instance_number=1
ZKFP2.instance_number=2
*.local_listener='LISTENER_DB'
*.log_archive_dest_1='LOCATION=+DATA_SRM/'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_max_target=20401094656
*.memory_target=20401094656
*.open_cursors=300
*.processes=2500
*.remote_listener='LISTENER_SCAN'
*.remote_login_passwordfile='exclusive'
*.sessions=2755
*.sga_max_size=0
ZKFP2.thread=2
ZKFP1.thread=1
ZKFP1.undo_tablespace='UNDOTBS1'
ZKFP2.undo_tablespace='UNDOTBS2'
两边都创建目录:
$ mkdir -p /pmsdb/oracle/admin/PMSZKFDB/adump
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Mar 23 16:31:32 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL>SQL> create spfile='+DATA_SRM/PMSZKFDB/spfilezkfp.ora' from pfile='/home/orasrm/bak0324.ora';
File created.
编辑本地init参数文件。内如如下:
$ vi initZKFP1.ora
"initZKFP1.ora" 1 line, 43 characters
SPFILE='+DATA_SRM/PMSZKFDB/spfilezkfp.ora'
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 24 12:06:23 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1.2239E+10 bytes
Fixed Size 2229552 bytes
Variable Size 1666849488 bytes
Database Buffers 1.0565E+10 bytes
Redo Buffers 4362240 bytes
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA_SRM/pmszkfdb/spfilezkfp.
ora
将控制文件恢复到参数文件制定的位置
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA_SRM/pmszkfdb/controlfile
/current.268.760189917
$ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Thu Mar 24 12:09:30 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PMSZKFDB (not mounted)
RMAN> restore controlfile from '/var/opt/omni/tmp/ctrl_PMSZKFDB_20910.dbf';
Starting restore at 24-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1832 instance=ZKFP1 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA_SRM/pmszkfdb/controlfile/current.284.907330239
Finished restore at 24-MAR-16
切换到grid用户下查看:
$ asmcmd
ASMCMD> pwd
+DATA_SRM/PMSZKFDB/CONTROLFILE
ASMCMD> ls
current.284.907330239
将数据库启动到mount状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
恢复数据文件和归档
查看数据文件的备份
RMAN> list backup of database completed between "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2016-03-16 14:00:00','YYYY-MM-DD HH24:MI:SS')";
RMAN> list backup of database summary completed after "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')";
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
53743 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
53744 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
53745 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
53746 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
查看归档的备份
RMAN> list backup of archivelog all completed between "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2016-03-16 14:00:00','YYYY-MM-DD HH24:MI:SS')";
RMAN> list backup of archivelog all summary completed after "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')";
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
53731 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53732 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53733 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53734 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53735 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53737 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53738 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53739 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53740 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53741 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53747 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53748 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53749 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53750 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53754 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
53755 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
53756 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
53757 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
可以得出我们之前恢复的控制文件是3月10号的,是随归档一起备份的控制文件。而全库的备份最近的一次是发生在3月4号的。
恢复归档文件
先恢复归档文件还是数据文件,全屏个人喜好,先恢复哪个都是可以的。
RMAN>run{
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=PMSZKFDB. scan_cluster01.com';
restore archivelog time between "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2016-03-16 00:00:00','YYYY-MM-DD HH24:MI:SS')";
release channel 'dev_0';
release channel 'dev_1';
release channel 'dev_2';
release channel 'dev_3';
}
ASMCMD> pwd
+DATA_SRM/PMSZKFDB/ARCHIVELOG
ASMCMD> ls -l
Type Redund Striped Time Sys Name
Y 2016_03_24/
ASMCMD> ls 20*
thread_1_seq_18434.334.907340379
thread_1_seq_18435.333.907340379
thread_1_seq_18436.331.907340379
thread_1_seq_18437.329.907340379
thread_1_seq_18438.330.907340379
thread_1_seq_18439.332.907340379
thread_1_seq_18440.354.907340629
thread_1_seq_18441.353.907340629
............................................................
恢复数据文件
异机恢复,磁盘组不一样,故而需要使用set newname
在数据库mount状态下可以看到有哪些数据文件,只取file#列。写set newname命令时可以这样写: set newname form datafile file# to ‘+DATA_ZKF’;不需要制定目标文件名即可。
SQL> set pagesize 0
SQL> select 'set newname for datafile '||file#||' to ''+DATA_SRM'';' from v$datafile;
set newname for datafile 1 to '+DATA_SRM';
.................省略.......................................
set newname for datafile 39 to '+DATA_SRM';
24 rows selected.
我的操作如下:
run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=pmszkfdb. scan_cluster01.com ';
set newname for datafile 1 to '+DATA_SRM';
set newname for datafile 2 to '+DATA_SRM';
set newname for datafile 3 to '+DATA_SRM';
set newname for datafile 4 to '+DATA_SRM';
set newname for datafile 5 to '+DATA_SRM';
set newname for datafile 6 to '+DATA_SRM';
set newname for datafile 7 to '+DATA_SRM';
set newname for datafile 8 to '+DATA_SRM';
set newname for datafile 24 to '+DATA_SRM';
set newname for datafile 25 to '+DATA_SRM';
set newname for datafile 26 to '+DATA_SRM';
set newname for datafile 27 to '+DATA_SRM';
set newname for datafile 28 to '+DATA_SRM';
set newname for datafile 29 to '+DATA_SRM';
set newname for datafile 30 to '+DATA_SRM';
set newname for datafile 31 to '+DATA_SRM';
set newname for datafile 32 to '+DATA_SRM';
set newname for datafile 33 to '+DATA_SRM';
set newname for datafile 34 to '+DATA_SRM';
set newname for datafile 35 to '+DATA_SRM';
set newname for datafile 36 to '+DATA_SRM';
set newname for datafile 37 to '+DATA_SRM';
set newname for datafile 38 to '+DATA_SRM';
set newname for datafile 39 to '+DATA_SRM';
restore database from tag 'TAG20160304T122358';
switch datafile all;
release channel 'dev_0';
release channel 'dev_1';
release channel 'dev_2';
release channel 'dev_3';
}
查看DP,可以看到虽然恢复命令是从rman发起的,但是恢复的任务其实已经交给了DP,下图是恢复过程中的截图。
恢复中
恢复完成后的截图如下:
进行数据库还原
RMAN> run {
set until time "to_date('2016-03-10 10:00:00','YYYY-MM-DD HH24:MI:SS')";
recover database;
}
打开数据库
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 03/24/2016 15:37:29
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 630194176 bytes disk space from 2147483648 limit
RMAN> exit
这是由于我没有改变redo的信息,数据库重建redo的时候需要用到flash recovery area. 为了简单,在这里直接将flash recovery area放大。
$ sqlplus / as sysdba
SQL> show parameter db_r
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +DATA_SRM
db_recovery_file_dest_size big integer 2G
db_recycle_cache_size big integer 0
dbwr_io_slaves integer 0
SQL> alter system set db_recovery_file_dest_size=10G;
System altered.
SQL> alter database open resetlogs;
Database altered.
将另一个RAC节点启动:
配置参数文件
$ vi initZKFP2.ora
SPFILE='+DATA_SRM/PMSZKFDB/spfilezkfp.ora'
$ export ORACLE_SID=ZKFP2
$ sqlplus / as sysdba
SQL> startup
ORACLE instance started.
Total System Global Area 1.2239E+10 bytes
Fixed Size 2229552 bytes
Variable Size 1666849488 bytes
Database Buffers 1.0565E+10 bytes
Redo Buffers 4362240 bytes
Database mounted.
Database opened.
将db信息和instance信息注册到crs中
由于我的clusterware的版本是11.2,而db的版本是11.1,所以注册方式可能和都是11.2的rac会不同。
#su – orasrm
$srvctl add database -d PMSZKFDB -o /pmsdb/oracle/11.1.0 -p '+DATA_SRM/pmszkfdb/spfilezkfp.ora' -s 'open' -y AUTOMATIC -r PRIMARY
$srvctl add instance -d PMSZKFDB -i ZKFP1 -n I2PRDDB3
$srvctl add instance -d PMSZKFDB -i ZKFP2 -n I2PRDDB4
修改第一个节点的监听
在我们用dp恢复控制文件时,需要在第一个节点配置监听,所以那时候我将grid下面的监听关闭,在oracle用户下手动配置的监听,现在db恢复完毕后,需要将监听交给grid来管理,那就需要删除之前配置的监听。关闭即可。
I2PRDDB3#[/]su - orasrm
$ lsnrctl stop
I2PRDDB3#[/pmsdb/11.2.0/grid/bin]./srvctl start listener
$ sqlplus sys/system@11.12.79.40:1521/pmszkfdb as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 24 16:38:01 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24500180/viewspace-2071827/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24500180/viewspace-2071827/