1.dbf USERS
依次对表空间进行备份:
ORCLPRE >alter tablespace example begin backup;
Tablespace altered.
ORCLPRE >host cp /u01/app/oracle/oradata/orcl/example01.dbf /u01/dg/data
ORCLPRE >alter tablespace example end backup;
Tablespace altered.
ORCLPRE >alter tablespace rmantbs begin backup;
Tablespace altered.
ORCLPRE >host cp /u01/rec_catalog/rmantbs.dbf /u01/dg/data;
ORCLPRE >alter tablespace rmantbs end backup;
Tablespace altered.
ORCLPRE >alter tablespace sysaux begin backup;
Tablespace altered.
ORCLPRE >host cp /u01/app/oracle/oradata/orcl/sysaux01.dbf /u01/dg/data
ORCLPRE >alter tablespace sysaux end backup;
Tablespace altered.
ORCLPRE >alter tablespace system begin backup;
Tablespace altered.
ORCLPRE >host cp /u01/app/oracle/oradata/orcl/system01.dbf /u01/dg/data
ORCLPRE >alter tablespace system end backup;
Tablespace altered.
ORCLPRE >alter tablespace undotbs1 begin backup;
Tablespace altered.
ORCLPRE >host cp /u01/app/oracle/oradata/orcl/undotbs01.dbf /u01/dg/data
ORCLPRE >alter tablespace undotbs1 end backup;
Tablespace altered.
ORCLPRE >alter tablespace users begin backup;
Tablespace altered.
ORCLPRE >host cp /u01/app/oracle/oradata/orcl/users01.dbf /u01/dg/data
ORCLPRE >alter tablespace users end backup;
Tablespace altered.
从Primary复制数据库文件到Standby
[oracle@localhost dg]$ scp oracle@192.168.1.222:/u01/dg/data/example01.dbf /u01/dg/data/example01.dbf
oracle@192.168.1.222's password:
example01.dbf 100% 100MB 5.3MB/s 00:19
[oracle@localhost dg]$ scp oracle@192.168.1.222:/u01/dg/data/rmantbs.dbf /u01/dg/data/rmantbs.dbf
oracle@192.168.1.222's password:
rmantbs.dbf 100% 50MB 8.3MB/s 00:06
[oracle@localhost dg]$ scp oracle@192.168.1.222:/u01/dg/data/sysaux01.dbf /u01/dg/data/sysaux01.dbf
oracle@192.168.1.222's password:
sysaux01.dbf 100% 250MB 8.6MB/s 00:29
[oracle@localhost dg]$ scp oracle@192.168.1.222:/u01/dg/data/system01.dbf /u01/dg/data/system01.dbf
oracle@192.168.1.222's password:
system01.dbf 100% 490MB 8.2MB/s 01:00
[oracle@localhost dg]$ scp oracle@192.168.1.222:/u01/dg/data/undotbs01.dbf /u01/dg/data/undotbs01.dbf
oracle@192.168.1.222's password:
undotbs01.dbf 100% 30MB 15.0MB/s 00:02
[oracle@localhost dg]$ scp oracle@192.168.1.222:/u01/dg/data/users01.dbf /u01/dg/data/users01.dbf
oracle@192.168.1.222's password:
users01.dbf 100% 16MB 16.3MB/s 00:01
复制到数据文件目录下面:
Standby只安装了软件,没安装数据库
[oracle@localhost orclstd]$ cp /u01/dg/data/* /u01/app/oracle/oradata/orclstd/
[oracle@localhost orclstd]$ ls
example01.dbf sysaux01.dbf undotbs01.dbf
rmantbs.dbf system01.dbf users01.dbf
环境准备:
[oracle@localhost admin]$ mkdir orclstd
[oracle@localhost admin]$ ls
orclstd
[oracle@localhost admin]$ pwd
/u01/app/oracle/admin
[oracle@localhost orclstd]$ pwd
/u01/app/oracle/oradata/orclstd
[oracle@localhost orclstd]$ cp /u01/dg/*.ctl /u01/app/oracle/oradata/orclstd
[oracle@localhost orclstd]$ ls
example01.dbf orclstd02.ctl rmantbs.dbf system01.dbf users01.dbf
orclstd01.ctl orclstd03.ctl sysaux01.dbf undotbs01.dbf
6.配置监听和网络服务名
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /u01/app/oracle/10.2.0/db_1)
#### (PROGRAM = orcl)
(GLOBAL_DBNAME = orcl)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.222)(PORT = 1521))
)
重启监听服务:
[oracle@linux5 admin]$ lsnrctl stop
LSNRCTL