I am reading/testing RMAN to recover the datafiles and have questions:

basically, I am trying to resotre the datafiles or tablespaces that were lost, so obviously, the database will be crashed and you can only MOUNT the database.

Below is what Oracle advises to do and I am not clear:

Restore & Recover A Subset Of The Database
A subset of the database can be restored in a similar fashion:
run {
sql 'ALTER TABLESPACE users OFFLINE IMMEDIATE';
restore tablespace users;
recover tablespace users;
sql 'ALTER TABLESPACE users ONLINE';
}



question: you have to mount the database rights??? but I got an error:



RMAN> run {
2> sql "alter tablespace test_data offline";
3> restore tablespace test_data;
4> recover tablespace test_data;
5> sql "alter tablespace test_data online";
6> }

sql statement: alter tablespace test_data offline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 08/30/2005 16:47:32
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace li
s_data_01 offline
ORA-01109: database not open

RMAN>


why do I get the error??? b/c the lost of the datafiels , that's only state I can get to and restore the database.