Online database / Recovery option


rrrrrr
SQL > SELECT file_id f#, file_name,
tablespace_name tablespace, status FROM dba_data_files;   
F# FILE_NAME TABLESPACE STATUS
--- ------------------------- ---------- ---------
1 /disk1/data/system01.dbf SYSTEM AVAILABLE
2 /disk2/data/df2.dbf USER_DATA AVAILABLE
3 /disk1/data/rbs01.dbf RBS AVAILABLE

SQL> SELECT d.file# f#, d.name, d.status, h.status
FROM v$datafile d, v$datafile_header h
WHERE d.file# = h.file#;
F# D.NAME D.STATUS H.STATUS

--- ------------------------- ---------- ---------
1 /disk1/data/system01.dbf SYSTEM ONLINE
2 /disk2/data/df2.dbf RECOVER OFFLINE
3 /disk1/data/rbs_01.dbf ONLINE ONLINE

UNIX : 
host cp /disk1/backup/df2.dbf /disk2/data/
WINDOWS : 
host copy c:\backup\df2.dbf d:\data\

SQL> recover datafile ‘/disk2/backup/df2.dbf‘; 
or
SQL> recover tablespace USER_DATA
SQL> alter database datafile ‘/disk2/data/df2.dbf‘
or
SQL> alter tablespace USER_DATA online;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: