1.ASM 软件包的安装及配置(dup02)
1.1安装ASM软件包
注意选择的软件包要与操作系统平台、内核版本选择一致。ASM软件包可以到Oracle官网下载。
在节点上装asm软件包。(5U7 内核:2.6.18-274)上传:
oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
[root@rac1 rpm]# rpm -qa |grep oracleasm
oracleasmlib-2.0.12-1.el6.x86_64
[root@rac1 ]# rpm –ivh oracleasmlib-2.0.12-1.el6.x86_64.rpm
[root@rac1 pm]# yum install oracleasm*
1.2配置ASM driver服务
在rac1上以root用户进行配置。在安装完上述步骤2.14.2节中的3个ASM RPM软件包之后,可以通过执行/usr/sbin/oracleasm命令来进行配置,也可以通过执行/etc/init.d/oracleasm命令来进行配置,后者命令是Oracle 10g中进行ASM配置的命令,Oracle推荐执行前者命令,不过后者命令保留使用。
① 查看ASM服务状态:
看到,默认情况下ASM服务并未开启。具体命令和相关参数可以直接执行下述命令来获取:
② 配置ASM服务:
查看oracleasm是否存在及启动时是否被加载
说明:/usr/sbin/oracleasm configure -i命令进行配置时,用户配置为oracle,组为oinstall,启动ASM library driver驱动服务,并且将其配置为随着操作系统的启动而自动启动。
配置完成后,记得执行 /usr/sbin/oracleasm init命令来加载oracleasm内核模块。
1.3 配置ASM磁盘
接下来,开始创建ASM磁盘:
- 执行/usr/sbin/oracleasm createdisk来创建ASM磁盘
2.手工建立ASM 实例
设备准备成功我们现在来创建ASM实例,ASM 是一个嵌入 Oracle 内核的专用集群文件系统,需要有CSS(集群同步服务)支持才能启动ASM实例,启动了ASM实例才能操作ASM磁盘组,有了磁盘组才可以创建数据库。
2.1启动集群同步服务(要在root用户下做):
#/u01/app/product/10.2.0/bin/localconfig add
2.2设置环境变量:(默认值是+ASM,可以随便该,这里用默认值)
$export ORACLE_SID=+ASM
2.3准备ASM实例口令文件
2.4准备ASM实例参数文件:init+ASM.ora
*.asm_diskgroups='GROUP1'
*.background_dump_dest='/u01/app/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/app/admin/+ASM/udump'
2.5 启动ASM实例,确认ORACLE_SID=+ASM
$sqlplus /nolog
Sql>conn / as sysdba
Sql>startup
--创建ASM磁盘组(这里采用的是外部冗余方法)
Sql>create diskgroup group1 external redundancy disk 'ORCL:DISK1';
标准冗余写法:
Sql>CREATE DISKGROUP GROUP1 NORMAL REDUNDANCY FAILGROUP failgroup1 DISK ' ORCL:DISK19' FAILGROUP failgroup2 DISK ' ORCL:DISK20';
冗余级别分三级:
External :外部冗余,将冗余交给RAID来做
Normal :标准冗余,一份镜像(需要至少两个故障组)
High :高冗余,两份镜像(需要至少三个故障组)
3、Duplicate 复制过程(远程duplicate过程)
3.1 备份及拷贝备份到dup02
重启数据库到归档模式(source库上执行)dup01上执行,保证有可用的备份
startup mount;
alter database archivelog;
alter database open;
设置备份参数
rman target /
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 8;
执行热备份
rman target /
run{
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql ' alter system archive log current ';
backup full database format '/u01/app/backup/full_%d_%T_%s' include current controlfile;
backup current controlfile format '/u01/app/backup/ctl_%d_%T_%s';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql ' alter system archive log current ';
backup archivelog all delete input format '/u01/app/backup/arch_%d_%T_%s';
}
ftp dup01 上的/u01/app/backup 备份文件到 dup02主机上/u01/app/backup
3.2.参数更改
复制及更改initdup02.ora (target 库上执行) dup02上执行
vi initdup02.ora(注意下面红色的部分)
dup02.__db_cache_size=343932928 dup02.__java_pool_size=4194304 dup02.__large_pool_size=4194304 dup02.__shared_pool_size=142606336 dup02.__streams_pool_size=0 *.audit_file_dest='/u01/app/admin/dup02/adump' *.background_dump_dest='/u01/app/admin/dup02/bdump' *.compatible='10.2.0.1.0' *.core_dump_dest='/u01/app/admin/dup02/cdump' *.db_block_size=8192 *.db_domain='' *.db_file_multiblock_read_count=8 *.db_name='dup02' *.dispatchers='(PROTOCOL=TCP) (SERVICE=dup01XDB)' *.job_queue_processes=10 *.open_cursors=300 *.pga_aggregate_target=165675008 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=497025024 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/u01/app/admin/dup02/udump' *.db_create_file_dest='+GROUP1' *.db_create_online_log_dest_1='+GROUP1' *.db_create_online_log_dest_2='+GROUP1' *.db_recovery_file_dest='+GROUP1' *.db_recovery_file_dest_size=3014M *.db_file_name_convert=('/u01/app/oradata/dup01', '+GROUP1') *.log_file_name_convert=('/u01/app/oradata/dup01', '+GROUP1') |
3.3配置监听
双方都的配置