Chinaunix首页 | 论坛 | 博客
  • 博客访问: 621227
  • 博文数量: 139
  • 博客积分: 826
  • 博客等级: 少校
  • 技术积分: 1367
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-25 17:30
文章分类

全部博文(139)

文章存档

2016年(2)

2015年(2)

2014年(1)

2012年(15)

2011年(41)

2007年(33)

2006年(45)

分类: Oracle

2011-08-13 13:44:50

Aix5.3+oracle10g+Rman+DataGuard 技术文档
Dataguard技术文档
通过RMAN建立异构的Standby database
一、
环境描述
Primary database p561 aix5300-007
Standby database p550 aix5300-007
Oracle 10.2.0.1.0
Hacmp5.3
P561配置为:
Processor Type: PowerPC_POWER5
Number Of Processors: 8
Processor Clock Speed: 1499 MHz
Memory Size: 31936 MB
6块300G硬盘
P550配置为:
Processor Type: PowerPC_POWER5
Number Of Processors: 4
Processor Clock Speed: 1654 MHz
Memory Size: 7712 MB
4块146G硬盘
DS4700配置:16块300G硬盘
数据存放信息
类型
P561
P550
数据软件
/app/oracle
/app/oracle
数据存放设备
DS4700
本地
归档存放路径
/archlog/10gpri
/archlog2/10gstandby
控制文件
Stdy控制文件
/data1/oradata
/data2/oradata
/data3/oradata
/app/standby
/data13/standby
/data14/standby
/app/standby
Redolog
stdy_redolog
/data1/oradata/ora8
/data2/oradata/ora8
/data3/oradata/ora8
/app/redolog
/data13/oradata/ora8
/data14/oradata/ora8
/app/redolog
数据文件
/data1 /data2 /data3
目录
oradata/ora8
powererp
timms
olddata
/data13
目录
Oradata/Ora8
Powererp
oradata
olddata/data1
olddata/data2
第 1 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
/data4 /data5 /data5
目录
Powererp
Statspack
Olddata
olddata/data3
/data14
目录
Powererp
Statspack
Olddata
Dataguard模式
availability
修改模式需要重起数据库
二、
具体操作步骤
这是在P561所有的数据库都安装好并且HACMP也配置好以后做的。
1、
准备步骤
􀀹
P561数据库已经创建好,P550已经安装好oracle软件,安装目录为/app/oracle
􀀹
P550 建立/data13 /data14 /localbak 的mount点
P561(chown –R oracle.oinstall 以下目录)
􀀹
Mkdir –p /app/redolog
􀀹
Mkdir –p /app/standby
􀀹
Mkdir –p /localbak/rmanbak
P550(chown –R oracle.oinstall 以下目录)
􀀹
Mkdir –p /app/standby/adump
􀀹
Mkdir –p /app/standby/bdump
􀀹
Mkdir –p /app/standby/cdump
􀀹
Mkdir –p /app/standby/dpdump
􀀹
Mkdir –p /app/standby/udump
􀀹
Mkdir –p /app/redolog
􀀹
Mkdir –p /localbak/rmanbak
􀀹
Mkdir –p /data13/oradata/ora8
􀀹
Mkdir –p /data14/oradata/ora8
􀀹
Mkdir –p /data13/olddata/data1
􀀹
Mkdir –p /data13/olddata/data2
􀀹
Mkdir –p /data13/olddata/data3
􀀹
Mkdir –p /data14/olddata/data4
􀀹
Mkdir –p /data14/olddata/data5
􀀹
Mkdir –p /data14/olddata/data6
􀀹
Mkdir –p /data13/timms
􀀹
Mkdir –p /data13/powererp
􀀹
Mkdir –p /data14/powererp
􀀹
Mkdir –p /data14/statspack
2、
P561通过expdp备份数据库
#Su – oracle
$sqlplus / as sysdba;
SQL>create or replace directory expdir as '/localbak/eiipbak';
SQL>grant read, write on directory expdir to system;
第 2 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
SQL>select * from dba_directories;
SQL>exit;
$cd /localbak/eiipbak
$nohup sh dbbackup.sh 2>&1 1> 20080611.out &
Dbbackup.sh见附件一
3、
P561修改tnsnames.ora
$cd $ORACLE_HOME/net*/admin
$vi tnsnames.ora
DBPRI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora8)
)
)
DBSTANDBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.3)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora8)
)
)
catalog =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.9)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10)
)
)
4、
P561修改listener.ora
$vi listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PL***tProc)
(ORACLE_HOME = /app/oracle/product/10.2.0.1)
(PROGRAM = extproc)
)
(SID_DESC =
第 3 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
(GLOBAL_DBNAME = ora8)
(ORACLE_HOME = /app/oracle/product/10.2.0.1)
(SID_NAME = ora8)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.1)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
5、
P561启用归档模式
#su - oracle
$sqlplus / as sysdba
SQL>alter database force logging;
SQL>select force_logging from v$database;
FOR
---
YES
SQL>shutdown immediate;
SQL>startup mount;
SQL>alter database open;
SQL>alter database archivelog; (启用归档,关闭归档为noarchivelog)
SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION= /archlog/10gpri’;
SQL> alter system set log_archive_format='%t_%s.dbf' scope=spfile;
SQL> alter system set log_archive_start=true scope=spfile;
SQL> shutdown immediate;
SQL> startup
SQL> archive log list;
6、
P561修改pfile参数
$sqlplus / as sysdba;
SQL> create pfile=’/data3/20080611.ora’ from spfile;
SQL>shutdown immediate;
$cd /data3
$cp 20080611.ora 20080611bak.ora
$vi 20080611.ora
添加以下几个参数()
第 4 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
*.DB_UNIQUE_NAME=10gpri
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(10gpri,10gstandby)'
*.LOG_ARCHIVE_DEST_1='LOCATION=/archlog/10gpri/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=10gpri'
*.LOG_ARCHIVE_DEST_2='SERVICE=dbstandby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=10gstandby'
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
*.LOG_ARCHIVE_MAX_PROCESSES=20
*.FAL_SERVER=dbstandby
*.FAL_CLIENT=dbpri
*.DB_FILE_NAME_CONVERT=
'/data13/powererp/','/data1/powererp/',
'/data13/powererp/','/data2/powererp/',
'/data13/powererp/','/data3/powererp/',
'/data14/powererp/','/data4/powererp/',
'/data14/powererp/','/data5/powererp/',
'/data14/powererp/','/data6/powererp/',
'/data13/olddata/data1/','/data1/olddata/',
'/data13/olddata/data2/','/data2/olddata/',
'/data13/olddata/data3/','/data3/olddata/',
'/data14/olddata/data4/','/data4/olddata/',
'/data14/olddata/data5/','/data5/olddata/',
'/data14/olddata/data6/','/data6/olddata/',
'/data13/oradata/ora8/','/data1/oradata/ora8/',
'/data13/oradata/ora8/','/data2/oradata/ora8/',
'/data14/oradata/ora8/','/data3/oradata/ora8/',
'/data13/timms/','/data1/timms/',
'/data14/statspack/','/data6/statspack/'
*.LOG_FILE_NAME_CONVERT=
'/archlog2/10gstandby/','/archlog/10gpri/'
*.STANDBY_FILE_MANAGEMENT=AUTO
*.standby_archive_dest='/archlog2/10gstandby'
SQL>create spfile from pfile=’/data3/20080611.ora’
Sql>startup
Sql>select file#,name from v$datafile;
记录下来在做恢复脚本的时候需要用到
7、
P561创建控制文件
SQL>alter database create standby controlfile as '/app/standby/standby.ctl';
SQL>exit;
$exit;
第 5 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
#cd /app
#ls –l
#rcp * dbsrv2:/app/standby/
8、
P561密码文件
#rcp /app/oracle/product/10.2.0.1/dbs/orapwora8 dbsrv2:/ app/oracle/product/10.2.0.1/dbs/orapwora8
必须在P550上执行
Chown oracle.oinstall orapwora8
也可以通过下面命令创建密码文件
9、
创建catalog(在第三台机器上做如下操作)
#Su – oracle
$sqlplus / as sysdba
Sql>Create tablespace ts_rman datafile '/catalog/ts_rman.dbf' size 50M autoextend on next 640K ;
Sql>create user rman identified by rman default tablespace ts_rman temporary tablespace temp;
Sql>grant connect ,resource to rman;
Sql>grant RECOVERY_CATALOG_OWNER to rman;
10、
P561通过rman备份primary database
$Rman target rcvcat
Rman>create catalog
Rman>register database
Rman>exit;
$ cd /localbak/script
$nohup sh rmanbak.sh 2>&1 1> rmanbak.out &
$exit
#cd /localbak/rmanbak
#rcp * dbsrv2:/localbak/rmanbak/
必须在p550上执行 chown –R oracle.oinstall /localbak/
Rmanbak.sh(请见附件四)
11、
P550修改tnsnames.ora
$cd $ORACLE_HOME/net*/admin
$vi tnsnames.ora
DBPRI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora8)
)
)
DBSTANDBY =
第 6 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.3)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora8)
)
)
catalog =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.9)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10)
)
)
12、
P550修改listener.ora
LISTENER1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.3)(PORT = 1521))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PL***tProc)
(ORACLE_HOME = /app/oracle/product/10.2.0.1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ora8)
(ORACLE_HOME = /app/oracle/product/10.2.0.1)
(SID_NAME = ora8)
)
)
SID_LIST_LISTENER1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora8)
(ORACLE_HOME = /app/oracle/product/10.2.0.1)
(SID_NAME = ora8)
)
) 第 7 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.148.1)(PORT = 1521))
)
13、
P550创建控制文件
#cd /app/standby
#cp standby.ctl /data13/standby/control01.ctl
#cp standby.ctl /data13/standby/control02.ctl
#cp standby.ctl /data14/standby/control03.ctl
#chown –R oracle.oinstall /data13
#chown –R oracle.oinstall /data14
14、
P550创建密码文件
$orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle entries=10
Orapwd 说明请见附件三(如果从P561上copy过来了这步可以省去)
15、
P550启动监听
#su – oracle
$lsnrctl start LISTENER1
16、
P550创建pfile
#cd /data13
#vi 20080611.ora
*.audit_file_dest='/app/oracle/admin/ora8/adump'
*.background_dump_dest='/app/oracle/admin/ora8/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/data13/standby/control01.ctl','/data13/standby/control02.ctl','/data14/standby/control03.ctl'
*.core_dump_dest='/app/oracle/admin/ora8/cdump'
*.db_block_size=8192
*.db_cache_size=4294967296
*.db_domain=''
*.db_file_multiblock_read_count=32
*.db_name='ora8'
*.db_recovery_file_dest='/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora8XDB)'
*.java_pool_size=20971520
*.job_queue_processes=10
*.large_pool_size=16777216
*.open_cursors=300
*.pga_aggregate_target=1073741824
*.processes=1500
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=1655
第 8 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
*.shared_pool_size=536870912
*.star_transformation_enabled='TRUE'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/app/oracle/admin/ora8/udump'
*.DB_UNIQUE_NAME=10gstandby
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(10gpri,10gstandby)'
*.LOG_ARCHIVE_DEST_1='LOCATION=/archlog2/10gstandby/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=10gpri'
*.LOG_ARCHIVE_DEST_2='SERVICE=dbpri LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=10gpri'
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
*.STANDBY_ARCHIVE_DEST='/archlog2/10gstandby'
*.LOG_ARCHIVE_MAX_PROCESSES=20
*.FAL_SERVER=dbpri
*.FAL_CLIENT=dbstandby
*.DB_FILE_NAME_CONVERT=
'/data1/powererp/','/data13/powererp/',
'/data2/powererp/','/data13/powererp/',
'/data3/powererp/','/data13/powererp/',
'/data4/powererp/','/data14/powererp/',
'/data5/powererp/','/data14/powererp/',
'/data6/powererp/','/data14/powererp/',
'/data1/olddata/','/data13/olddata/data1/',
'/data2/olddata/','/data13/olddata/data2/',
'/data3/olddata/','/data13/olddata/data3/',
'/data4/olddata/','/data14/olddata/data4/',
'/data5/olddata/','/data14/olddata/data5/',
'/data6/olddata/','/data14/olddata/data6/',
'/data1/oradata/ora8/','/data13/oradata/ora8/',
'/data2/oradata/ora8/','/data13/oradata/ora8/',
'/data3/oradata/ora8/','/data14/oradata/ora8/',
'/data1/timms/','/data13/timms/',
'/data6/statspack/','/data14/statspack/'
*.LOG_FILE_NAME_CONVERT=
'/archlog/10gpri/','/archlog2/10gstandby/'
*.STANDBY_FILE_MANAGEMENT=AUTO
#su – oracle
$sqlplus / as sydba;
Sql>create spfile from pfile=‘/data13/20080611.ora’;
Sql>startup nomount;
17、
p561通过rman数据恢复到p550
第 9 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
# su – oracle
$cd /localbak/script
$nohup sh rmanimp.sh 2>1& 1> rmanimp.out &
Rmanimp.sh(请见附件五)
18、
归档复制
将P561上所有归档复制到P550上
P561
#cd /archlog/10gpri
#rcp * dbsrv2:/archlog2/10gstandby/
P550
#chown –R oracle.oinstall /archlog2/10gstandby/*
19、
p550recover standby database
#su – oracle
$sqlplus / as sysdba;
Sql>startup nomount
Sql>alter database mount standby database;
Sql>recover standby database;
注意查看上面归档文件的路径如果没有没有错误就直接AUTO
做完后cancel退出
20、
创建standby redolog\修改redolog路径\创建临时表空间
P561
Sql>alter database add standby LOGFILE GROUP 4 ('/app/redolog/stdy_redo04.log') size 10m;
Sql>alter database add standby LOGFILE GROUP 5 ('/app/redolog/stdy_redo05.log') size 10m;
Sql>alter database add standby LOGFILE GROUP 6 ('/app/redolog/stdy_redo06.log') size 10m;
Sql>alter database add standby LOGFILE GROUP 7 ('/app/redolog/stdy_redo07.log') size 10m;
P550
Sql>alter database open read only;
Sql>alter database add standby LOGFILE GROUP 4 ('/app/redolog/stdy_redo04.log') size 10m;
Sql>alter database add standby LOGFILE GROUP 5 ('/app/redolog/stdy_redo05.log') size 10m;
Sql>alter database add standby LOGFILE GROUP 6 ('/app/redolog/stdy_redo06.log') size 10m;
Sql>alter database add standby LOGFILE GROUP 7 ('/app/redolog/stdy_redo07.log') size 10m;
Sql>alter tablespace temp add tempfile '/data13/oradata/ora8/temp01.dbf' size 100M;
Sql>alter system set standby_file_management=manual scope=spfile;
Sql>shutdown immediate;
第 10 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
Sql>startup nomount
Sql>alter database mount standby database;
Sql> alter database rename file '/data1/oradata/ora8/redo01.log' to '/data13/oradata/ora8/redo01.log';
Sql> alter database rename file '/data2/oradata/ora8/redo02.log' to '/data13/oradata/ora8/redo02.log';
Sql>alter database rename file '/data3/oradata/ora8/redo03.log' to '/data14/oradata/ora8/redo03.log';
Sql>alter system set standby_file_management=auto scope=spfile;
Sql>shutdown immediate;
Sql>startup nomount;
Sql>alter database mount standby database;
三、
Data Guard管理
1、
启用standby database
Sql>startup nomount;
Sql>alter database mount standby database;
Sql>alter database recover managed standby database disconnect from session;
切换为read only 状态
Sql> alter database recover managed standby database cancel;
Sql>alter database open read only;
重新切换shutdown immediate 后重做以上步骤
Tail –f alert_ora8.log 实时查看数据库日志
2、
切换步骤
􀂾
在主库端
Sql>ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
Sql>shutdown immediate;
Sql>startup nomount;
Sql>alter database mount standby database;
Sql> alter database recover managed standby database disconnect from session;
􀂾
在备库端
Sql> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
Sql> shutdown immediate;
Sql> startup;
3、
删除过期归档
P550
#cd /archlog2/10gstandby
#touch rmlog.sh
#chown oracle.oinstall rmlog.sh
#chmod +x rmlog.sh
#cd /localbak/script
第 11 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
#touch get_archive_log.sql
#touch rm_archive_log.sh
#touch get_archive_log.sh
#chmod +x *
#chown oracle.oinstall *
#sh rm_archive_log.sh
P561
#cd /archlog/10gpri
#touch rmlog.sh
#chown oracle.oinstall rmlog.sh
#chmod +x rmlog.sh
#cd /localbak/script
#touch rm_archive_log.sh
#touch getrmlog.sh
#chown oracle.oinstall *
#chmod +x *
#sh rm_archive_log.sh
$rman target / catalog ;
Rman>crosscheck archivelog all;
Rman>delete expired archivelog all;
脚本内容见附件六
四、
附件
1、
附件一
Dbbackup.sh
PATH=/oracle/product/10/db/bin:/usr/bin:/usr/java14/jre:/etc:/usr/sbin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.
ORACLE_BASE=/app/oracle;
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1;
export ORACLE_HOME
ORACLE_SID=ora8;
export ORACLE_SID
ORACLE_TERM=vt100;
export ORACLE_TERM
TNS_ADMIN=$ORACLE_HOME/network/admin;
export TNS_ADMIN
NLS_LANG="simplified chinese"_china.zhs16GBK
export NLS_LANG
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data;
export ORA_NLS33
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib;
export LD_LIBRARY_PATH
LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib ;
第 12 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
export LIBPATH
ORA_DB=$ORACLE_HOME/dbs;
export ORA_DB
CLASSPATH=$ORACLE_HOME/JRE/lib:$ORACLE_HOME/JRE/lib/rt.jar:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
PATH=$ORACLE_HOME/bin:$PATH;
export PATH
export DISPLAY=127.0.0.1:0.0
umask 022
backuppath=/localbak/eiipbak
sdate=`date -u +%Y%m%d`
pre_filename=""
filename="${pre_filename}${sdate}"
#mkdir -p ${backuppath}/${filename}
find ${backuppath} -mtime +5 |grep dmp$ |xargs rm
date >>${backuppath}/${filename}.log
expdp system/password dumpfile=${filename}.dmp logfile=${filename}.log directory=expdir parallel=4 schemas=user1,user2,user3
date >>${backuppath}/${filename}.log
gzip ${backuppath}/${filename}.dmp
date >>${backuppath}/${filename}.log
2、
附件三
Usage: orapwd file= password= entries=
where file - name of password file (mand), password - password for SYS (mand), entries - maximum number of distinct DBA and OPERs (opt), There are no spaces around the equal-to (=) character.
3、
附件四
Rmanbak.sh
#!/bin/sh
Rman cmdfile=rmanbackup.rcv 第 13 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
msglog=/localbak/rmanbak/rmanbak.log
Rmanbackup.rcv
connect catalog
connect target /
run{
allocate channel d1 device type disk;
backup as compressed backupset
incremental level=0
format='/localbak/rmanbak/inc0_%d_%U'
tag='inc0'
channel=d1
database;
sql "alter system switch logfile";
backup as compressed backupset
format='/localbak/rmanbak/arch_%d_%U'
tag='arch'
channel=d1
archivelog all delete input;
backup as compressed backupset
format='/localbak/rmanbak/standby.ctl'
tag='standby'
channel=d1
current controlfile for standby reuse;
}
crosscheck backup;
resync catalog;
4、
附件五
Rmanimp.sh
#!/bin/sh
rman cmdfile=rmanimp.rcv msglog=/localbak/rmanbak/rmanimp.log
rmanimp.rcv
connect target /
connect auxiliary ;
run{
allocate auxiliary channel d1 device type disk;
set newname for datafile 1 to '/data13/oradata/ora8/system01.dbf';
set newname for datafile 2 to '/data13/oradata/ora8/undotbs01.dbf';
set newname for datafile 3 to '/data13/oradata/ora8/sysaux01.dbf';
set newname for datafile 4 to '/data13/oradata/ora8/users01.dbf';
set newname for datafile 9 to '/data14/powererp/app_bas_dat1.dbf';
set newname for datafile 10 to '/data14/powererp/app_bas_idx1.dbf';
set newname for datafile 39 to '/data13/timms/timms_data1.dbf'; 第 14 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
set newname for datafile 40 to '/data13/timms/timms_index1.dbf';
set newname for datafile 130 to '/data14/statspack/perfstat.dbf';
set newname for datafile 131 to '/data13/olddata/data1/olddata.dbf';
set newname for datafile 132 to '/data13/olddata/data2/olddata.dbf';
set newname for datafile 133 to '/data13/olddata/data3/olddata.dbf';
set newname for datafile 134 to '/data14/olddata/data4/olddata.dbf';
set newname for datafile 135 to '/data14/olddata/data5/olddata.dbf';
set newname for datafile 136 to '/data14/olddata/data6/olddata.dbf';
duplicate target database for standby;
}
5、
附件六
P550
rm_archive_log.sh
cd /localbak/script
./get_archive_log.sh
cd /archlog2/10gstandby
./rmlog.sh
Get_archive_log.sh
su - oracle "/localbak/script/get_archive_log.sql"
get_archive_log.sql
sqlplus -S /nolog <connect / as sysdba
set heading off
set echo off
set feedback off
spool /archlog2/10gstandby/rmlog.sh
SELECT 'rm -f '||'1_'||to_char(SEQUENCE#)||'*.arc' FROM v\$archived_log WHERE applied='YES';
spool off
P561
Rm_archive_log.sh
cd /localbak/script
./getrmlog.sh
cd /archlog/10gpri
./rmlog.sh
Getrmlog.sh
ftp -i -in <open dbsrv2ip
第 15 页共 16 页
Aix5.3+oracle10g+Rman+DataGuard 技术文档
第 16 页共 16 页
user root password
lcd /archlog/10gpri
cd /archlog2/10gstandby
get rmlog.sh
bye
阅读(1215) | 评论(0) | 转发(0) |
0

上一篇:Oracle日常性能查看

下一篇:ftp脚本

给主人留下些什么吧!~~