测试是否同步
1、在主库rename datafile
先在主库创建表空间
SQL> create tablespace shraon datafile'+DATA/rac/sharon.dbf' size 10M;
Tablespace created.
主库切换日志
SQL> alter system switch logfile;
System altered.
等待备库应用,再打开备库查看是否添加了相应的表空间
SQL> alter database recover managedstandby database cancel;
Database altered.
SQL> alter database open;
Database altered.
SQL> select name,status from v$datafile;
NAME STATUS
---------------------------------------------------------------------------------
/soft/oradata/standby/sharon.dbf ONLINE
7 rows selected.
主库rename datafile+DATA/rac/sharon.dbf
用ftp连接,到相应的目录下载文件,改名后再上传
oel57t1:oracle:rac2 > ftp 192.168.0.51 7777
Connected to 192.168.0.51.
ftp> binary //注意要用二进制binary模式接受与上传
200 Type set to I.
ftp> get sharon.dbf sharon01.dbf
local: sharon01.dbf remote: sharon.dbf
227 Entering Passive Mode(192,168,0,51,87,181)
150 BIN Data Connection
226 BIN Transfer Complete
10493952 bytes received in 0.25 seconds(4e+04 Kbytes/s)
oel57t1:oracle:rac2 > ll
total 31136
-rw-r--r-- 1 oracle oinstall 8204 Apr 18 13:01 0417.dd
drwxrwxr-x 2 oracle oinstall 4096 Nov 9 2005 4679769
drwxr-xr-x 2 oracle oinstall 4096 Feb 21 07:10 arch2
-rw-r--r-- 1 oracle oinstall 16384 Apr 8 10:43 expdat.dmp
-rw-r--r-- 1 oracle oinstall 6910 Apr 17 09:45 guangbiaoxplan.txt
-rw-r--r-- 1 oracle oinstall 22996 Jan 4 15:55 libXp-1.0.0-8.1.el5.i386.rpm
drwxrwx--- 5 oracle oinstall 4096 Feb 20 10:42 oraInventory
-rw-r--r-- 1 oracle oinstall 266391 Jan 5 10:18 p4679769_10201_Linux-x86-64.zip
-rw-r--r-- 1 oracleoinstall 10493952 Apr 23 14:56 sharon01.dbf //下载成功!
drwxr-xr-x 4 oracle oinstall 4096 Apr 18 14:43 test
-rw-r--r-- 1 oracle oinstall 16384 Apr 8 10:44 test.dmp
ftp> put sharon01.dbf
local: sharon01.dbf remote: sharon01.dbf
227 Entering Passive Mode(192,168,0,51,181,126)
150 BIN Data Connection
226 BIN Transfer Complete
10493952 bytes sent in 0.38 seconds(2.7e+04 Kbytes/s)
SQL> alter tablespace shraon rename datafile'+DATA/rac/sharon.dbf' to '+DATA/rac/sharon01.dbf';
Tablespace altered.
SQL> alter tablespace shraon online;
Tablespace altered.
SQL> select name ,status fromv$datafile;
NAME STATUS
----------------------------------------------------------------
+DATA/rac/sharon01.dbf ONLINE
主库修改了了,切换日志看备库应用日志之后是否数据文件也修改成功
SQL> alter database recover managed standbydatabase cancel;
Database altered.
SQL> alter database open;
Database altered.
SQL> select name from v$datafile;
NAME
---------------------------------------------------------------------------------------------------------------------------------
/soft/oradata/standby/system01.dbf
/soft/oradata/standby/undotbs01.dbf
/soft/oradata/standby/sysaux01.dbf
/soft/oradata/standby/users01.dbf
/soft/oradata/standby/example01.dbf
/soft/oradata/standby/undotbs02.dbf
/soft/oradata/standby/sharon.dbf
7 rows selected.
没有修改数据文件名!
2、在主库创建的TEMP 表空间
主库创建TEMP 表空间
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/rac/temp01.dbf
SQL> CREATE TEMPORARY TABLESPACE temp2 tempfile'+DATA/rac/temp02.dbf' size 10M;
Tablespace created.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/rac/temp01.dbf
+DATA/rac/temp02.dbf
切换日志,看备库应用日志之后是否也创建了相应的临时表空间
SQL> select name from v$tempfile;
NAME
-----------------------------------------------------------------------
/soft/oradata/standby/temp01.dbf
没有创建!