好文档 - 专业文书写作范文服务资料分享网站

oracle data grard

天下 分享 时间: 加入收藏 我要投稿 点赞

1.主节点备份并生成备用数据库控制文件

设置主节点为force Logging模式(为了双向切换,建议备用节点也设置为force logging模式) ALTER DATABASE FORCE LOGGING;

设置主节点为归档模式

登陆主节点,进行数据库备份,并生成备用数据库控制文件

Last login: Mon Aug 9 16:46:47 2004 from 172.16.32.65 [root@standby root]# su - oracle

[oracle@standby oracle]$ sqlplus \

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Aug 16 10:16:18 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 135337420 bytes Fixed Size 452044 bytes Variable Size 109051904 bytes Database Buffers 25165824 bytes Redo Buffers 667648 bytes Database mounted. Database opened.

SQL> select name from v$datafile;

NAME

------------------------------------------------------------ /opt/oracle/oradata/primary/system01.dbf

/opt/oracle/oradata/primary/undotbs01.dbf /opt/oracle/oradata/primary/users01.dbf

SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning option

JServer Release 9.2.0.4.0 - Production [oracle@standby oracle]$ ls

admin dictionary.ora jre oradata oraInventory oui product soft

[oracle@standby oracle]$ tar -cvf oradata.tar oradata 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@standby oracle]$ ls -l *.tar

-rw-r--r-- 1 oracle dba 576512000 Aug 16 10:22 oradata.tar [oracle@standby oracle]$ id

uid=800(oracle) gid=800(dba) groups=800(dba) [oracle@standby oracle]$ hostname standby

[oracle@standby oracle]$ sqlplus \

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Aug 16 10:27:54 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 135337420 bytes Fixed Size 452044 bytes Variable Size 109051904 bytes Database Buffers 25165824 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> archive log list;

Database log mode Archive Mode Automatic archival Enabled

Archive destination /opt/oracle/oradata/primary/archive Oldest online log sequence 88 Next log sequence to archive 90 Current log sequence 90

SQL> alter database create standby controlfile as '/opt/oracle/stdcotrl.ctl';

Database altered.

SQL> !

ls[oracle@standby oracle]$ ls

admin dictionary.ora jre oradata oradata.tar oraInventory oui product soft stdcotrl.ctl

2.从主节点创建pfile文件

SQL> create pfile from spfile; File created.

SQL> !

[oracle@standby oracle]$ cd $ORACLE_HOME/dbs [oracle@standby dbs]$ ls

initdw.ora init.ora initprimary.ora lkPRIMARY orapwprimary spfileprimary.ora sqlnet.log

3.登陆备用节点,ftp获得数据库文件、备用控制文件及参数文件

Last login: Mon Aug 16 08:47:58 2004 from 172.16.32.65 [root@eygle root]# su - oracle [oracle@eygle oracle]$ ls

admin doc jre oradata oraInventory oui product [oracle@eygle oracle]$ df -k

Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 5154852 3360600 1532396 69% / /dev/sda7 101089 25744 70126 27% /home /dev/sda5 4127076 2686152 1231280 69% /opt none 515296 0 515296 0% /dev/shm

/dev/sda2 4127108 2218172 1699288 57% /usr /dev/sda6 2063504 107744 1850940 6% /var

[oracle@eygle oracle]$ ftp 172.16.33.58 Connected to 172.16.33.58 (172.16.33.58). 220 (vsFTPd 1.2.0)

Name (172.16.33.58:root): oracle 331 Please specify the password. Password:

230 Login successful. ftp> ls

227 Entering Passive Mode (172,16,33,58,222,252) 150 Here comes the directory listing.

drwxr-xr-x 3 800 800 4096 Jun 30 07:02 admin

-rw-r--r-- 1 800 800 5422222 Jul 13 11:58 dictionary.ora -rw-r--r-- 1 800 800 1165 Aug 16 02:51 initprimary.ora drwxrwxr-x 4 800 800 4096 Jun 30 06:29 jre

drwxrwxr-x 12 800 800 4096 Jun 30 06:44 oraInventory drwxr-xr-x 3 800 800 4096 Jul 01 06:15 oradata

-rw-r--r-- 1 800 800 576512000 Aug 16 02:22 oradata.tar drwxrwxr-x 6 800 800 4096 Jun 30 06:29 oui drwxr-xr-x 3 800 800 4096 Jun 30 05:18 product drwxr-xr-x 6 800 800 4096 Jun 30 04:24 soft

-rw-r----- 1 800 800 1662976 Aug 16 02:37 stdcotrl.ctl 226 Directory send OK. ftp> bin

200 Switching to Binary mode. ftp> mget oradata.tar mget oradata.tar? y

227 Entering Passive Mode (172,16,33,58,238,132)

150 Opening BINARY mode data connection for oradata.tar (576512000 bytes). 226 File send OK.

576512000 bytes received in 49.2 secs (1.1e+04 Kbytes/sec)

oracle data grard

1.主节点备份并生成备用数据库控制文件设置主节点为forceLogging模式(为了双向切换,建议备用节点也设置为forcelogging模式)ALTERDATABASEFORCELOGGING;设置主节点为归档模式登陆主节点,进行数据库备份,并生成备用数据库控制文件Lastlog
推荐度:
点击下载文档文档为doc格式
7359n5ld6d9lpyv23wwc1symv1jox50079i
领取福利

微信扫码领取福利

微信扫码分享