Anda di halaman 1dari 2

When STANDBY_FILE_MANAGEMENT Is Set to AUTO The following example shows the steps required to add a new datafile to the

primary and standby databases when the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO. 1. Add a new tablespace to the primary database:
2. SQL> CREATE TABLESPACE new_ts DATAFILE '/disk1/oracle/oradata/payroll/t_db2.dbf' 3. 2> SIZE 1m AUTOEXTEND ON MAXSIZE UNLIMITED;

4. Archive the current online redo log file so the redo data will be transmitted to and applied on the sta ndby database:
5. SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

6. Verify the new datafile was added to the primary database:


7. SQL> SELECT NAME FROM V$DATAFILE; 8. NAME 9. --------------------------------------------------------------------10. /disk1/oracle/oradata/payroll/t_d b1.dbf 11. /disk1/oracle/oradata/payroll/t_db2.dbf

12. Verify the new datafile was added to the standby database:
13. 14. 15. SQL> SELECT NAME FROM V$DATAFILE; NAME --------------------------------------------------------------------16. /disk1/oracle/oradata/payroll/s2t_db1.db f 17. /disk1/oracle/oradata/payroll/s2t_db2.dbf

Adding a Tablespace and a Datafile When STANDBY_FILE_MANAGEMENT Is Set to MANUAL

The following example shows the steps required to add a new datafile to the primary and standby database when the STANDBY_FILE_MANAGEMENT initialization parameter is set to MANUAL . You must set the STANDBY_FILE_MANAGEMENT initialization parameter to MANUAL when the standby datafiles reside on raw devices. 1. Add a new tablespace to the primary database:
2. SQL> CREATE TABLESPACE new_ts DATAFILE '/disk1/oracle/oradata/payroll/t_db2.dbf' 3. 2> SIZE 1m AUTOEXTEND ON MAXSIZE UNLIMITED;

2. Verify the new datafile was added to the primary database:


3. SQL> SELECT NAME FROM V$DATAFILE; 4. NAME 5. 6. --------------------------------- -----------------------------------7. /disk1/oracle/oradata/payroll/t_db1.dbf 8. /disk1/oracle/oradata/payroll/t_db2.dbf

3. Perform the following steps to copy the tablespace to a remote standby location: a. Place the new tablespace offline:
b. SQL> ALTER TABLESPACE new_ts OFFLINE; c.

d. Copy the new tablespace to a local temporary location using an operating system utility copy command. Copying the files to a temporary location will reduce the amount of time the tablespace must remain offline. The following example copies the tablespace using the UNIX cp command:
e. % cp /disk1/oracle/oradata/payroll/t_db2.dbf f. /disk1/oracle/oradata/payroll/s2t_db2.dbf g.

h. Place the new tablespace back online:


i. SQL> ALTER TABLESPACE new_ts ONLINE; j.

k. Copy the local copy of the tablespace to a remote standby location using an operating system utility command. The following example uses the UNIX rcp command:
l. %rcp /disk1/oracle/oradata/payroll/s2t_db2.dbf m. standby_location

4. Archive the current online redo log file on the primary database so it will get transmitted to the standby database:
5. SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

5. Use the following query to make sure that Redo Apply is running. If the MRP or MRP0 process is returned, Redo Apply is being performed.
6. SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY; 7.

6. Verify the datafile was added to the standby database after the archived redo log file was applied to the standby database:
7. SQL> SELECT NAME FROM V$DATAFILE; 8. NAME 9. 10. --------------------------------------------------------------------11. /disk1/oracle/oradata/payroll/s2t_db1.dbf 12. /disk1/oracle/oradata/payroll/s2t_db2.dbf