nsp搭建同城dg
rman > backup database format '/tmp/nsp_%U.full';java
SQL> create pfile='/tmp/nsp.init' from spfile;
alter database create standby controlfile as '/tmp/nsp_sty.ctl';sql
cd $ORACLE_BASE
mkdir -p admin/$ORACLE_SID數據庫
cd $ORACLE_BASE
mkdir diag diag/rdbms diag/tnslsnrsession
cd admin/$ORACLE_SID
mkdir adump pfile bdump cdump udumporacle
nsp.__db_cache_size=62008590336
nsp.__java_pool_size=939524096
nsp.__large_pool_size=536870912
nsp.__oracle_base='/crbank/nsp/app/product/database'#ORACLE_BASE set from environment
nsp.__pga_aggregate_target=8g
nsp.__sga_target=12g
nsp.__shared_io_pool_size=0
nsp.__shared_pool_size=4831838208
nsp.__streams_pool_size=0
*._use_adaptive_log_file_sync='FALSE'
*.audit_file_dest='/crbank/nsp/app/product/database/admin/nsp/adump'
*.audit_trail='NONE'
*.compatible='11.2.0.4.0'
*.control_files='/crbank/nsp/data/nsp/control01.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_files=1024
*.db_name='nsp'
*.db_recovery_file_dest='/crbank/nsp/fra'
*.db_recovery_file_dest_size=60129542144
*.db_securefile='ALWAYS'
*.db_writer_processes=4
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/crbank/nsp/app/product/database/diag'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=nspXDB)'
*.enable_goldengate_replication=TRUE
*.filesystemio_options='SETALL'
*.job_queue_processes=1000
*.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST'
*.log_archive_format='nsp_%t_%s_%r.arc'
*.log_buffer=33554432
*.open_cursors=300
*.optimizer_capture_sql_plan_baselines=FALSE
*.optimizer_secure_view_merging=FALSE
*.parallel_execution_message_size=32768
*.parallel_max_servers=16
*.processes=2048
*.recyclebin='OFF'
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.resource_manager_plan=''
*.sec_case_sensitive_logon=FALSE
*.sessions=1105
*.shared_pool_reserved_size=167772160app
--====Standby端nomount:
sqlplus '/as sysdba'
SQL> startup nomountdom
cp /tmp/nsp_sty.ctl /crbank/nsp/data/nsp/control01.ctl
SQL> alter databae mount;async
增長standby redologfile:
alter database add standby logfile group 9 '/crbank/nsp/data/nsp/redolog09.log' size 1024m;
alter database add standby logfile group 10 '/crbank/nsp/data/nsp/redolog10.log' size 1024m;
alter database add standby logfile group 11 '/crbank/nsp/data/nsp/redolog11.log' size 1024m;
alter database add standby logfile group 12 '/crbank/nsp/data/nsp/redolog12.log' size 1024m;
alter database add standby logfile group 13 '/crbank/nsp/data/nsp/redolog13.log' size 1024m;
alter database add standby logfile group 14 '/crbank/nsp/data/nsp/redolog14.log' size 1024m;
alter database add standby logfile group 15 '/crbank/nsp/data/nsp/redolog15.log' size 1024m;
alter database add standby logfile group 16 '/crbank/nsp/data/nsp/redolog16.log' size 1024m;
alter database add standby logfile group 17 '/crbank/nsp/data/nsp/redolog17.log' size 1024m;
alter database add standby logfile group 18 '/crbank/nsp/data/nsp/redolog18.log' size 1024m;tcp
select group#,status,bytes/1024/1024 from v$standby_log;spa
select 'set newname for datafile '||file#||' to '''|| '/crbank/nsp/data/nsp/'||substr(name,instr(name,'/',1,5)+1)||'''' from v$datafile ;
select 'set newname for datafile '||file#||' to '''|| '/crbank/nsp/data/nsp/'||substr(name,instr(name,'/',1,5)+1)||'''' from v$tempfile ;
rman target /
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
配置監聽:
lnsp =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 25.8.1.33)(PORT = 1528))
)
)
)
配置TNS:
cat11g =(description =(address = (protocol = tcp)(host = 10.200.8.35)(port = 1528))(connect_data = (sid = cat11g)))
nsp=(description =(address = (protocol = tcp)(host = 10.198.217.153)(port = 1528))(connect_data = (sid = nsp)))
lnsp=(description =(address = (protocol = tcp)(host = 25.8.1.33)(port = 1528))(connect_data = (sid = nsp)))
alter system set log_archive_dest_2 = 'SERVICE=nsp lgwr async noaffirm reopen=60 valid_for=(online_logfiles,primary_role) db_unique_name=nsp' scope = both;
alter system set fal_server = nsp scope = both;
alter system set fal_client = lnsp scope = both;
alter system set log_archive_config = 'DG_CONFIG=(nsp,lnsp)' scope = both;
alter system set db_unique_name=lnsp scope=both;
alter system set service_names = nsp scope= spfile;
alter system set standby_file_management = auto scope = both;
alter system set db_recovery_file_dest_size = 32G scope=spfile;
alter system set db_recovery_file_dest= '/crbank/nsp/fra' scope=spfile;
alter system set standby_archive_dest ='' scope=spfile;
alter system set log_archive_dest_1 = '' scope=spfile;
alter system set open_links=0 scope=spfile;
alter system set open_links_per_instance=0 scope=spfile;
alter system set parallel_execution_message_size=32768 scope=spfile;
alter system set disk_asynch_io=TRUE scope=spfile;
alter system set db_writer_processes=4 scope=spfile;
alter database recover managed standby database cancel;
shutdown immediate;
startup mount;
alter database open;
alter database recover managed standby database using current logfile disconnect;
----主庫配置:
alter system set log_archive_config = 'DG_CONFIG=(nsp,lnsp)' scope = both;
配置log_archive_dest_n:
alter system set log_archive_dest_2 = 'SERVICE=lnsp lgwr async noaffirm reopen=60 valid_for=(online_logfiles,primary_role) db_unique_name=lnsp' scope = both;
配置fal:
alter system set fal_server = lnsp scope = both;
alter system set fal_client = nsp scope = both;
修改standby_file_management = auto
alter system set standby_file_management = auto scope = both;
檢查:
select process,status,thread#,sequence#,block#,blocks from v$managed_standby where process!='ARCH';
select name,SEQUENCE#,ARCHIVED,APPLIED,STATUS,to_char(COMPLETION_TIME,'yyyy-mm-dd hh24:mi:ss') data from v$archived_log order by data;
錯誤收集:
一、
alter database recover managed standby database using current logfile disconnect
*
ERROR at line 1:
ORA-38500: USING CURRENT LOGFILE option not available without standby redo logs
使用'using current logfile' 須要建立stanby logfile
解決:
alter database add standby logfile group 10 '/crbank/nsp/data/nsp/redolog10.log' size 1024m;
二、
三、
ORA-00313: open failed for members of log group 8 of thread 1
ORA-00312: online log 8 thread 1: '/crbank/nsp/data/nsp/redo08.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
select l.group#,l.SEQUENCE#,lg.member,l.status,lg.type from v$logfile lg,v$log l where lg.group#=l.group#;
alter database drop logfile group 2;
alter database clear unarchived logfile '/crbank/nsp/data/nsp/redo02.log';
v$log有記錄,可是物理文件不存在,刪除或者清除都出問題,
解決:設置logfile_name_convert參數就能夠自動建立。
四、
ORA-01186: file 1025 failed verification tests
ORA-01122: database file 1025 failed verification check
ORA-01110: data file 1025: '/crbank/nsp/data/nsp/temp01.dbf'
ORA-01205: not a data file - type number in header is 3
解決:物理刪除掉temp臨時文件,數據庫在打開的時候會自動建立。