Dataguard配置Step by Step.docx
- 文档编号:5234492
- 上传时间:2022-12-14
- 格式:DOCX
- 页数:14
- 大小:19.52KB
Dataguard配置Step by Step.docx
《Dataguard配置Step by Step.docx》由会员分享,可在线阅读,更多相关《Dataguard配置Step by Step.docx(14页珍藏版)》请在冰豆网上搜索。
Dataguard配置StepbyStep
1.主节点备份并生成备用数据库控制文件
设置主节点为forceLogging模式(为了双向切换,建议备用节点也设置为forcelogging模式)
ALTERDATABASEFORCELOGGING;
设置主节点为归档模式
登陆主节点,进行数据库备份,并生成备用数据库控制文件
Lastlogin:
MonAug916:
46:
472004from172.16.32.65[root@standbyroot]#su-oracle
[oracle@standbyoracle]$sqlplus"/assysdba"
SQL*Plus:
Release9.2.0.4.0-ProductiononMonAug1610:
16:
182004
Copyright(c)1982,2002,OracleCorporation.Allrightsreserved.
Connectedtoanidleinstance.
SQL>startup
ORACLEinstancestarted.
TotalSystemGlobalArea135337420bytes
FixedSize452044bytes
VariableSize109051904bytes
DatabaseBuffers25165824bytes
RedoBuffers667648bytes
Databasemounted.
Databaseopened.
SQL>selectnamefromv$datafile;
NAME
------------------------------------------------------------
/opt/oracle/oradata/primary/system01.dbf
/opt/oracle/oradata/primary/undotbs01.dbf
/opt/oracle/oradata/primary/users01.dbf
SQL>shutdownimmediate
Databaseclosed.
Databasedismounted.
ORACLEinstanceshutdown.
SQL>exit
DisconnectedfromOracle9iEnterpriseEditionRelease9.2.0.4.0-Production
WiththePartitioningoption
JServerRelease9.2.0.4.0-Production
[oracle@standbyoracle]$ls
admindictionary.orajreoradataoraInventoryouiproductsoft
[oracle@standbyoracle]$tar-cvforadata.taroradata
oradata/
oradata/primary/
oradata/primary/archive/
oradata/primary/control01.ctl
oradata/primary/control02.ctl
oradata/primary/control03.ctl
oradata/primary/redo01.log
oradata/primary/redo02.log
oradata/primary/redo03.log
oradata/primary/system01.dbf
oradata/primary/undotbs01.dbf
oradata/primary/temp01.dbf
oradata/primary/users01.dbf
[oracle@standbyoracle]$ls-l*.tar
-rw-r--r--1oracledba576512000Aug1610:
22oradata.tar
[oracle@standbyoracle]$id
uid=800(oracle)gid=800(dba)groups=800(dba)
[oracle@standbyoracle]$hostname
standby
[oracle@standbyoracle]$sqlplus"/assysdba"
SQL*Plus:
Release9.2.0.4.0-ProductiononMonAug1610:
27:
542004
Copyright(c)1982,2002,OracleCorporation.Allrightsreserved.
Connectedtoanidleinstance.
SQL>startup
ORACLEinstancestarted.
TotalSystemGlobalArea135337420bytes
FixedSize452044bytes
VariableSize109051904bytes
DatabaseBuffers25165824bytes
RedoBuffers667648bytes
Databasemounted.
Databaseopened.
SQL>archiveloglist;
DatabaselogmodeArchiveMode
AutomaticarchivalEnabled
Archivedestination/opt/oracle/oradata/primary/archive
Oldestonlinelogsequence88
Nextlogsequencetoarchive90
Currentlogsequence90
SQL>alterdatabasecreatestandbycontrolfileas'/opt/oracle/stdcotrl.ctl';
Databasealtered.
SQL>!
ls[oracle@standbyoracle]$ls
admindictionary.orajreoradataoradata.taroraInventoryouiproductsoftstdcotrl.ctl
2.从主节点创建pfile文件
SQL>createpfilefromspfile;
Filecreated.
SQL>!
[oracle@standbyoracle]$cd$ORACLE_HOME/dbs
[oracle@standbydbs]$ls
initdw.orainit.orainitprimary.oralkPRIMARYorapwprimaryspfileprimary.orasqlnet.log
3.登陆备用节点,ftp获得数据库文件、备用控制文件及参数文件
Lastlogin:
MonAug1608:
47:
582004from172.16.32.65
[root@eygleroot]#su-oracle
[oracle@eygleoracle]$ls
admindocjreoradataoraInventoryouiproduct
[oracle@eygleoracle]$df-k
Filesystem1K-blocksUsedAvailableUse%Mountedon
/dev/sda151548523360600153239669%/
/dev/sda7101089257447012627%/home
/dev/sda541270762686152123128069%/opt
none51529605152960%/dev/shm
/dev/sda241271082218172169928857%/usr
/dev/sda6206350410774418509406%/var
[oracle@eygleoracle]$ftp172.16.33.58
Connectedto172.16.33.58(172.16.33.58).
220(vsFTPd1.2.0)
Name(172.16.33.58:
root):
oracle
331Pleasespecifythepassword.
Password:
230Loginsuccessful.
ftp>ls
227EnteringPassiveMode(172,16,33,58,222,252)
150Herecomesthedirectorylisting.
drwxr-xr-x38008004096Jun3007:
02admin
-rw-r--r--18008005422222Jul1311:
58dictionary.ora
-rw-r--r--18008001165Aug1602:
51initprimary.ora
drwxrwxr-x48008004096Jun3006:
29jre
drwxrwxr-x128008004096Jun3006:
44oraInventory
drwxr-xr-x38008004096Jul0106:
15oradata
-rw-r--r--1800800576512000Aug1602:
22oradata.tar
drwxrwxr-x68008004096Jun3006:
29oui
drwxr-xr-x38008004096Jun3005:
18product
drwxr-xr-x68008004096Jun3004:
24soft
-rw-r-----18008001662976Aug1602:
37stdcotrl.ctl
226DirectorysendOK.
ftp>bin
200SwitchingtoBinarymode.
ftp>mgetoradata.tar
mgetoradata.tar?
y
227EnteringPassiveMode(172,16,33,58,238,132)
150OpeningBINARYmodedataconnectionfororadata.tar(576512000bytes).
226FilesendOK.
576512000bytesreceivedin49.2secs(1.1e+04Kbytes/sec)
ftp>mget*.ctl
mgetstdcotrl.ctl?
y
227EnteringPassiveMode(172,16,33,58,73,35)
150OpeningBINARYmodedataconnectionforstdcotrl.ctl(1662976bytes).
226FilesendOK.
1662976bytesreceivedin0.14secs(1.2e+04Kbytes/sec)
ftp>mgetinitprimary.ora
mgetinitprimary.ora?
y
227EnteringPassiveMode(172,16,33,58,194,239)
150OpeningBINARYmodedataconnectionforinitprimary.ora(1165bytes).
226FilesendOK.
1165bytesreceivedin0.000325secs(3.5e+03Kbytes/sec)
ftp>bye
221Goodbye.
[oracle@eygleoracle]$ls
admindocinitprimary.orajreoradataoradata.taroraInventoryouiproductstdcotrl.ctl
[oracle@eygleoracle]$mvinitprimary.ora$ORACLE_HOME/dbs
[oracle@eygleoracle]$cd$ORACLE_HOME/dbs
[oracle@eygledbs]$ls
a.sqlinitdw.orainit.orainitprimary.orainitrac1.orainitrac2.orainitrac.oraorapw
orapwrac1orapwrac2spfilerac.ora
解包数据文件
[oracle@eygleoracle]$ls
admindocjreoradataoradata.taroraInventoryouiproductstdcotrl.ctl
[oracle@eygleoracle]$tar-xvforadata.tar
oradata/
oradata/primary/
oradata/primary/archive/
oradata/primary/control01.ctl
oradata/primary/control02.ctl
oradata/primary/control03.ctl
oradata/primary/redo01.log
oradata/primary/redo02.log
oradata/primary/redo03.log
oradata/primary/system01.dbf
oradata/primary/undotbs01.dbf
oradata/primary/temp01.dbf
oradata/primary/users01.dbf
修改initprimary.ora文件
修改控制文件名称及路径(如果和原配置不同),增加几个参数,修改后如下:
[oracle@eygledbs]$catinitprimary.ora
*.aq_tm_processes=1
*.background_dump_dest='/opt/oracle/admin/primary/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/opt/oracle/oradata/primary/stdcotrl.ctl'
*.core_dump_dest='/opt/oracle/admin/primary/cdump'
...
*.log_archive_dest_1='LOCATION=/opt/oracle/oradata/primary/archive'
*.log_archive_dest_2=''*.log_archive_format='%t_%s.dbf'
*.log_archive_start=true
...
*.user_dump_dest='/opt/oracle/admin/primary/udump'
*.utl_file_dir='/opt/oracle'
*.standby_archive_dest='/opt/oracle/oradata/primary/stdarch'
*.fal_server='PRIMARY'
*.fal_client='STANDBY'
*.standby_file_management='AUTO'
创建必要的目录
[oracle@eygleoracle]$cd$ORACLE_BASE/admin
[oracle@eygleadmin]$mkdirprimary
[oracle@eygleadmin]$ls
primaryrac
[oracle@eygleadmin]$cdprimary/
[oracle@eygleprimary]$ls
[oracle@eygleprimary]$mkdirbdumpcdumpudump
4.配置主节点监听器及tnsnames.ora文件
配置后如下:
[oracle@standbyoracle]$cd/opt/oracle/product/9.2.0/network/admin/
[oracle@standbyadmin]$catlistener.ora
#LISTENER.ORANetworkConfigurationFile:
/opt/oracle/product/9.2.0/network/admin/listener.ora
#GeneratedbyOracleconfigurationtools.
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))
)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=standby)(PORT=1521))
)
)
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=PLSExtProc)
(ORACLE_HOME=/opt/oracle/product/9.2.0)
(PROGRAM=extproc)
)
(SID_DESC=
(GLOBAL_DBNAME=primary)
(ORACLE_HOME=/opt/oracle/product/9.2.0)
(SID_NAME=primary)
)
)
[oracle@standbyadmin]$cattnsnames.ora
#TNSNAMES.ORANetworkConfigurationFile:
/opt/oracle/product/9.2.0/network/admin/tnsnames.ora
#GeneratedbyOracleconfigurationtools.
STANDBY=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.46)(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=primary)
)
)
PRIMARY=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.33.58)(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=primary)
)
)
[oracle@standbyadmin]$lsnrctlstart
LSNRCTLforLinux:
Version9.2.0.4.0-Productionon16-AUG-200410:
46:
31
Copyright(c)1991,2002,OracleCorporation.Allrightsreserved.
Starting/opt/oracle/product/9.2.0/bin/tnslsnr:
pleasewait...
TNSLSNRforLinux:
Version9.2.0.4.0-Production
Systemparameterfileis/opt/oracle/product/9.2.0/network/admin/listener.ora
Logmessageswrittento/opt/oracle/product/9.2.0/network/log/listener.log
Listeningon:
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listeningon:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1521)))
Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUSoftheLISTENER
------------------------
AliasLISTENER
VersionTNSLSNRforLinux:
Version9.2.0.4.0-Production
StartDate16-AUG-200410:
46:
31
Uptime0days0hr.0min.0sec
TraceLeveloff
SecurityOFF
SNMPOFF
ListenerParameterFile/opt/oracle/product/9.2.0/network/admin/listener.ora
ListenerLogFile/opt/oracle/product/9.2.0/network/log/listener.log
ListeningEndpointsSummary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1521)))
ServicesSummary...
Service"PLSExtProc"has1instance(s).
Instance"PLSExtProc",statusUNKNOWN,has1handler(s)forthisservice...
Service"primary"has1instance(s).
Instance"primary",statusUNKNOWN,has1handler(s)forthisservice...
Thecommandcompletedsuccessfully
5.配置备用数据库监听器及tnsnames.ora文件
配置后文件如下:
[oracle@eygleadmin]$cd$ORACLE_HOME/network/admin
[oracle@eygle
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Dataguard配置Step by Step Dataguard 配置
![提示](https://static.bdocx.com/images/bang_tan.gif)