SQLPLUS NOLOG /
CONNECT / AS SYSDBA

create tablespace test datafile ‘D:\oracle\product\10.2.0\oradata\orcl\test.dbf’ size 10M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

create user orhan identified by o default tablespace test temporary tablespace temp;

grant dba,select_catalog_role,connect,resource to orhan;
grant create table,flashback any table to orhan;
grant create database link to orhan;
exec dbms_streams_auth.grant_admin_privilege(‘orhan’, true);

conn orhan/o@orcl

create table klinik(klinik_id number(4),klinik_adi varchar2(20),constraint const_pk_klinik_id primary key(klinik_id));

insert into klinik values(1,’dahiliye’);

select * from klinik;

commit;
sql>shutdown immediate;
sql>startup mount;

RMAN TARGET/
rman>backup database;
exit;

SQLPLUS NOLOG /
CONNECT / AS SYSDBA

SHUTDOWN IMMEDIATE;

STARTUP MOUNT;

ALTER DATABASE DATAFILE ‘D:\oracle\product\10.2.0\oradata\orcl\test.dbf’ OFFLINE DROP;

cmd -> rman target /

RMAN>RESTORE DATAFILE 8;
RMAN>RECOVER DATAFILE 8;

SQL>ALTER DATABASE OPEN;
SQL>ALTER DATABASE DATAFILE 8 ONLINE;

SQL>SELECT FILE#, NAME, STATUS FROM V$DATAFILE;