暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片
rac搭建单实例dg
2336
5页
161次
2020-07-08
免费下载
步骤:
1、主库
主库打开强制日志
select name,force_logging from v$database;
alter database force logging;
使用 rman 备份数据库
#!/bin/bash
rman target / log=/home/oracle/enmo/cx/rman01.log<<EOF
run{
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR
LOAD TRUE;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
crosscheck backup;
sql 'alter system archive log current';
backup as compressed backupset
skip inaccessible
filesperset 15
format '/rman/db_%d_%T_%s_%p'
database;
sql 'alter system archive log current';
backup as compressed backupset
skip inaccessible
filesperset 2
format '/rman/arclog_%s_%p_%t_%d'
archivelog all;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
exit
EOF
echo "****************backup is over!
****************">>/home/oracle/enmo/cx/rman01.log
sqlplus / as sysdba <<EOF
spool /home/oracle/enmo/cx/st.log
alter database create standby controlfile as '/home/oracle/enmo/cx/st.ctl';
spool off
exit;
EOF
###以备库方式备份控制文件
2、修改主库参数
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(ctcore,ctcoredg)' scope=both sid
= '*';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DATADG
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ctcore' scope=both sid = '*';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=ctcoredg lgwr async affirm
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ctcoredg' scope=both
sid = '*';
alter system set FAL_SERVER=ctcoredg scope=both sid = '*';
alter system set FAL_CLIENT=proctcore scope=both sid = '*';
alter system set
DB_FILE_NAME_CONVERT='/ctdg/app/oracle/oradata/ctcore/datafile','+DATADG/ctcore/
datafile','/ctdg/app/oracle/oradata/ctcore/tempfile','+DATADG/ctcore/tempfile'
scope=spfile sid = '*';
alter system set
LOG_FILE_NAME_CONVERT='/ctdg/app/oracle/oradata/ctcore/onlinelog','+DATADG/ctcor
e/onlinelog' scope=spfile sid = '*';
alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both sid = '*';
alter system set log_archive_dest_state_1=enable scope=both sid = '*';
alter system set log_archive_dest_state_2=enable scope=both sid = '*';
3、修改备库参数
在主库中使用
create pfile='/xxxx/xxx/xxx.ora' from spfile;
将参数文件拷贝出来到备库
scp xxx.ora oracle@ip:/xx/xx/xx
修改参数
cp xxx.ora xxx.ora.bak
*._shared_io_pool_size=0
*.archive_lag_target=0
*.compatible='11.2.0.0.0'
*.control_files='/ctdg/app/oracle/oradata/control01.dbf','/ctdg/app/oracle/orada
ta/control02.dbf'
*.db_block_size=8192
*.db_domain=''
*.db_flashback_retention_target=60
*.db_name='ctcore'
*.db_recovery_file_dest='/ctdg/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=50g
*.diagnostic_dest='/ctdg/app/oracle'
*.audit_file_dest='/ctdg/app/oracle/admin/ctcore/adump'
*.open_cursors=300
*.pga_aggregate_target=3096m
*.processes=1500
*.remote_login_passwordfile='exclusive'
*.sessions=1655
*.sga_max_size=13300m
*.sga_target=13300m
*.sql_trace=FALSE
*.undo_retention=21600
*.undo_tablespace='UNDOTBS1'
*.DB_UNIQUE_NAME='ctcoredg'
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(ctcore,ctcoredg)'
*.LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ctcoredg'
*.LOG_ARCHIVE_DEST_2='SERVICE=proctcore lgwr async affirm
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ctcore'
*.FAL_SERVER=proctcore
*.FAL_CLIENT=ctcoredg
*.DB_FILE_NAME_CONVERT='+DATADG/ctcore/datafile','/ctdg/app/oracle/oradata/ctcor
e/datafile','+DATADG/ctcore/tempfile','/ctdg/app/oracle/oradata/ctcore/tempfile'
*.LOG_FILE_NAME_CONVERT='/ctdg/app/oracle/oradata/ctcore/onlinelog','+DATADG/ctc
ore/onlinelog'
*.STANDBY_FILE_MANAGEMENT=AUTO
4、配置监听
监听使用静默监听,1522 端口,使用 vip
of 5
免费下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜