Get the App
SLTechnology News&Howtos  ›  Database  › 

Dataguard build-rac to stand-alone

Shulou Source: shulou.com Published: 2022-06-01 07:35:01 10月04日 Update

DG compatibility list:

Data Guard Support for Heterogeneous Primary and Physical Standbys in Same Data Guard Configuration (Doc ID 413484.1)

The heterogeneity of DG between IBM and sun:

Using Oracle Data Guard between IBM AIX on Power systems and Oracle Solaris on SPARC systems (Doc ID 1982638.1)

To put it simply, linux can go to windows/soloaris x64, IBM can be isomerous to solaris sparc, and hp unix can only play on its own.

Here is an example of a heterogeneous deployment from linux x86 to 64 rac to a stand-alone machine.

As soon as you check the source, open the archive

SQL > archivelog list;# if not open, close the database Shutdown immediate;# start to mount status Startup mount# open archiving SQL > alter database archivelog; Database altered. # Open the mandatory log, but do not open it, so that when the nologging option is enabled, the table of the standby database will report an error SQL > alter database force logging; Database altered.SQL > alter database open; Database altered.# check SQL > archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination / data/archOldest online log sequence 12Next log sequence to archive 14Current log sequence 14SQL > select force_logging from vested database

Change the parameters

Alter system set log_archive_config='DG_CONFIG= (db,standby) 'scope=both;alter system set log_archive_dest='' scope=both;alter system set log_archive_dest_1='location=/data/arch' scope=spfile;-- uses archiving to transfer alter system set log_archive_dest_2='service=standby arch valid_for= (online_logfiles,primary_role) db_unique_name=standby' scope=spfile -- alter system set log_archive_dest_2='service=standby lgwr sync affirm valid_for= (online_logfiles,primary_role) db_unique_name=standby' scope=both;SQL > alter system set log_archive_max_processes=4 scope=both;SQL > alter system set fal_server=standby scope=both;SQL > alter system set fal_client=db scope=both;SQL > alter system set standby_file_management=auto scope=both;SQL > alter system set db_file_name_convert='+data','/data' scope=spfile is the first choice for online log transmission. SQL > alter system set log_file_name_convert='+data','/data' scope=spfile;Sql > alter system set db_unique_name=db scope=spfile;# do not enable SQL > alter system set log_archive_dest_state_2=defer first

Three configurations of tnsnames

Server $ORACLE_HOME/network/admin/tnsnames.ora

Standby = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.84.17) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = standby))

Fourth, backup the main library:

Rman "target / nocatalog" run {configure default device type to disk;configure device type disk parallelism 1 nternal backup as compressed backupset database format'/ home/oracle/full_%s_%p_%T.bak' TAG fullbak_fordg;}

5. Create a standby controlfile:

Create a standby controlfile:

SQL > alter database create standby controlfile as'/ home/oracle/standby.ctl'

6. Create pfile

Create pfile='/data/backup/pfile.ora' from spfile

Mainly modify db_unique_name

Fal_server

Fal_client

References are as follows:

* .audit_file_dest='/opt/db/adump'*.audit_trail='none'*.cluster_database=false*.compatible='11.2.0.4.0'*.db_file_name_convert='+DATA','/data'*.log_file_name_convert='+DATA','/data'*.control_files='/u01/data/ctl_01.ctl'*.log_archive_config='DG_CONFIG= (db Standby)'* .db _ block_size=8192*.db_create_file_dest='/data'*.db_domain=''*.db_files=200*.db_name='db'*.db_unique_name='standby'*.db_recovery_file_dest_size=53477376000*.db_recovery_file_dest=''*.deferred_segment_creation=FALSE*.diagnostic_dest='/u01/app/oracle'*.dispatchers=' (PROTOCOL=TCP) (SERVICE=TCIS30XDB)'* .log _ archive_dest_1='location=/data/arch valid_for= (all_logfiles) All_roles) db_unique_name=standby'*.open_cursors=100*.pga_aggregate_target=50MB*.processes=100*.remote_login_passwordfile='exclusive'*.sessions=150*.sga_target=100MB*.undo_tablespace='UNDOTBS1'*.fal_server=db

7. Create a key file

Orapwd file=orapw$ORACLE_SID password=oracle

8. Create a standby library listener.ora

SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = / opt/product/11.2) (PROGRAM = extproc)) (SID_DESC = (GLOBAL_DBNAME = standby) (ORACLE_HOME = / opt/product/11.2) (SID_NAME = sid_name)

9 create a directory for the slave

Mkdir / data/arch

Mkdir / data/dg1

Mkdir-p / u01/app/oracle/admin/standby/adump

Change ~ / .bash_profile

Export ORACLE_SID=standby

10 start and restore

Cp standby.ctl / data/standby/ctl01.ctlSQL > startup nomount;SQL > alter database mount standby database;rman target / catalog start with'/ home/oracle/backup';Restore database;SQL > recover managed standby database disconnect from session

11 add standby log file to the standby library

Alter database recover managed standby database cancelalter database add standby logfile thread 1 group 10'+ data (flashfile) 'size 50m alter database add standby logfile thread 1 group 11' + data (flashfile) 'size 50m alter database add standby logfile thread 2 group 12' + data (flashfile) 'size 50m alter database add standby logfile thread 2 group 13' + data (flashfile) 'size 50m

# enable log shipping in the main library

SQL > alter system set log_archive_dest_state_2=enabled

# mode is maximum available

SQL > alter database set standby database to maximize availability;alter database recover managed standby database cancel;alter database open;alter database recover managed standby database using current logfile disconnect from session

12 check

Select process,client_process,sequence#,status from vested manageability standbycol current_scn for 999999999999 THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM select protection_mode,database_role,open_mode,current_scn from v$databasecol name for a50; col sequence# for 99999999 select name,sequence#,to_char (completion_time,'yyyy-mm-dd hh34:mi:ss') from v$archived_log order by 2 THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM select log, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM VANAGEDSTANDBYTRAN-main database query select sequence#,status from vault log; col value for a30; col name for a13 Col unit for a30; select name,value,unit,time_computed from vaindataguardstats potential select * FROM V$STANDBY_EVENT_HISTOGRAM WHERE NAME = 'apply lag' AND COUNT > 0; col checkpoint_change# for 999999999999; select name,checkpoint_change# from vastdatafile; select name,checkpoint_change# from v$datafile_header SELECT DBID, NAME, TO_CHAR (CREATED, 'DD-MON-YYYY HH24:MI:SS') CREATED, OPEN_MODE, LOG_MODE, TO_CHAR (CHECKPOINT_CHANGE#,' 99999999999999999') AS CHECKPOINT_CHANGE#, CONTROLFILE_TYPE, TO_CHAR (CONTROLFILE_CHANGE#, '99999999999999999') AS CONTROLFILE_CHANGE#, TO_CHAR (CONTROLFILE_TIME, 'DD-MON-YYYY HH24:MI:SS') CONTROLFILE_TIME TO_CHAR (RESETLOGS_CHANGE#, '99999999999999999') AS RESETLOGS_CHANGE#, TO_CHAR (RESETLOGS_TIME, 'DD-MON-YYYY HH24:MI:SS') RESETLOGS_TIME FROM V$DATABASE -- sofar unit is KBselect * from vastly recoveryrecoveryrecoveryThe STATUS-check the archiving application col name for A50; col sequence# for 999999910 select name,sequence#,to_char (completion_time,'yyyy-mm-dd hh34:mi:ss') from v$archived_log order by 2 * select PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM VANAGEDSTANDBYSTEN select thread#,max (sequence#) maxseq from gv$archived_log group by thread# order by thread#;select * from v$archive_gap -- check the appropriate value of net_timeout select frequency,duration from v$redo_dest_resp_histogram where dest_id=2 and frequency > 1 position select recovery_mode from v$archive_dest_status where dest_id=2

Tags: Check log between transfer application stand-alone maximum appropriate unit parameter backup real-time key that is situation data database file mode status Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB NVidia Xiaomi Apple