分享
 
 
 

创建物理备用数据库

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

创建物理备用数据库

在创建物理备用数据库之前先查看主数据库的一些信息和对主数据库做好配置.

将主数据库置为FORCE LOGGING模式.在主数据库创建之后做如下操作:

SQL>ALTER DATABASE FORCE LOGGING;

确认主数据库是归档的并定义好本地归档.如下:

SQL >ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=e:\oracle\oradata\orcl\archive MANDATORY' SCOPE=BOTH;

在主节点a确认主数据库的数据文件的位置和文件名.

SQL>select name from v$datafile;

NAME

-----------------------------------------------------------------------------------------------------------

E:\ORACLE\ORA92\ORCL\SYSTEM01.DBF

E:\ORACLE\ORA92\ORCL\UNDOTBS01.DBF

E:\ORACLE\ORA92\ORCL\CWMLITE01.DBF

E:\ORACLE\ORA92\ORCL\DRSYS01.DBF

E:\ORACLE\ORA92\ORCL\EXAMPLE01.DBF

E:\ORACLE\ORA92\ORCL\INDX01.DBF

E:\ORACLE\ORA92\ORCL\ODM01.DBF

E:\ORACLE\ORA92\ORCL\TOOLS01.DBF

E:\ORACLE\ORA92\ORCL\USERS01.DBF

E:\ORACLE\ORA92\ORCL\XDB01.DBF

做上面查询得出来的数据文件的物理备份.将其备份到一个临时的位置中.

SQL>SHUTDOWN IMMEDIATE;

SQL>EXIT

将E:\ORACLE\ORA92\ORCL整个目录COPY到a节点的F盘的oracle目录下.

在拷贝完之后再启动数据库

SQL>STARTUP;

SQL>ARCHIVE LOG LIST;

在主节点a为备用数据库创建备用控制文件

SQL>ALTER DATABASE CREATE STANDBY CONTROLFILE AS ‘f:\oracle\stdbycon.ctl’;

创建初始化参数文件

SQL>CREATE PFILE=’f:\oracle\initstdbyorcl.ora’ FROM SPFILE;

将上面几步所得到的文件从主节点a拷贝到备用节点b上.

修改并添加一些参数后如下:

*.aq_tm_processes=1

*.background_dump_dest='e:\oracle\admin\orcl\bdump'

*.compatible='9.2.0.0.0'

*.control_files='e:\oracle\ora92\STANDBY\STDBYCON.CTL','e:\oracle\ora92\STANDBY\STDBYCON02.CTL','e:\oracle\ora92\STANDBY\STDBYCON03.CTL'

*.core_dump_dest='e:\oracle\admin\STANDBY\cdump'

*.db_block_size=16384

*.db_cache_size=137363456

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='orcl'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.fast_start_mttr_target=300

*.hash_join_enabled=TRUE

*.instance_name='orcl2'

*.java_pool_size=33554432

*.job_queue_processes=10

*.large_pool_size=27262976

*.log_archive_dest_1='LOCATION=e:\oracle\oradata\STANDBY\archive MANDATORY'

*.log_archive_format='log%d_%t_%s.arc'

*.log_archive_start=true

*.open_cursors=300

*.pga_aggregate_target=80000000

*.processes=150

*.query_rewrite_enabled='FALSE'

*.remote_login_passwordfile='EXCLUSIVE'

*.shared_pool_size=45088768

*.sort_area_size=524288

*.sql_trace=FALSE

*.star_transformation_enabled='FALSE'

*.timed_statistics=TRUE

*.undo_management='AUTO'

*.undo_retention=10800

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='e:\oracle\admin\STANDBY\udump'

*.workarea_size_policy='AUTO'

*.standby_file_management='AUTO'

*.fal_server='ORCL'

*.fal_client='ORCL2'

*.standby_archive_dest='e:\oracle\oradata\standby\stdarch'

*.utl_file_dir='e:\oracle'

*.remote_archive_enable='TRUE'

在备用数据库一端创建一个新的实例.如下操作:

c:\>oradim –new –sid orcl2 –startmode m

将拷贝过来的文件放到e:\oracle\ora92底下,并修改文件夹名为orcl2

修改e:\oracle\ora92\orcl2下的控制文件,将其中的control01.ora, control02.ora, control03.ora删掉,将f:\oracle\stdbycon01.ora文件拷贝到e:\oracle\ora92\orcl2目录下.并复制和修改其名为stdbycon02.ora, stdbycon03.ora

在e:\oracle\admin下建立orcl2文件夹,并在其底下建立三个文件夹,分别叫bdump,cdump,udump

在主节点a配置listner.ora和tnsnames.ora , sqlnet.ora配置后文件内容分别如下:

listener.ora文件为:

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.0.122)(PORT = 1521))

)

)

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

)

)

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = e:\oracle\ora92)

(PROGRAM = extproc)

)

(SID_DESC =

(GLOBAL_DBNAME = orcl)

(ORACLE_HOME = e:/oracle/ora92)

(SID_NAME = orcl)

)

)

tnsnames.ora文件为:

ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.0.122)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

STANDBY =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.0.222)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

EXTPROC_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

(CONNECT_DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

sqlnet.ora文件为:

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (HOSTNAME,TNSNAMES, ONAMES)

在备用节点b配置listner.ora和tnsnames.ora,sqlnet.ora配置后文件内容分别如下:

其中配置sqlnet.ora文件中的参数sqlnet.expire_time是enable死连接侦测

listener.ora文件为:

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))

)

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.0.222)(PORT = 1521))

)

)

)

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = orcl2)

(ORACLE_HOME = e:\oracle\ora92)

(SID_NAME = ORCL)

)

(SID_DESC =

(PROGRAM = extproc)

(SID_NAME = PLSExtProc)

(ORACLE_HOME = e:\oracle\ora92)

)

)

tnsnames.ora文件为:

ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.0.122)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

STANDBY =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.0.222)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

EXTPROC_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

(CONNECT_DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

sqlnet.ora文件为:

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (HOSTNAME,TNSNAMES, ONAMES)

SQLNET.EXPIRE_TIME=2

为备用数据库创建Server Parameter File

create spfile from pfile;

启动备用数据库为MOUNT状态

SQL>startup nomout

SQL>alter database mount standby database;

初始log apply services

SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

在主节点设置远程归档目录:

SQL>ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=STANDBY’ SCOPE=BOTH;

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE SCOPE=BOTH;

启动远程归档:

SQL>ALTER SYSTEM ARCHIVE LOG CURRENT;

确认远程归档成功:

SQL>SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME

2 FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# FIRST_TIME NEXT_TIME

---------- ------------------ ------------------

8 11-JUL-02 17:50:45 11-JUL-02 17:50:53

9 11-JUL-02 17:50:53 11-JUL-02 17:50:58

10 11-JUL-02 17:50:58 11-JUL-02 17:51:03

3 rows selected.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有