.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> ADO.NET >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Restore oracle DB

Posted By:Athira Sreejith       Posted Date: February 05, 2009    Points: 10    Category: ADO.NET    URL: http://www.dotnetspark.com  
 

Restore oracle DB. SQL statement to show how to Take back up and restore Oracle database.

BACKUP

exp userid=system/system file=CUSTDB.dmp log=CUSTDB.log owner=HAMSER direct=y statistics=none
---------------------------------------------------------------------------------------------
RESTORE

select tablespace_name from dba_tablespaces;
select username from dba_users;
select file_name from dba_data_files;
select file_name,tablespace_name  from dba_data_files;
 To check wether th tabl spacee ceated is alrerady present or not


CREATE TABLESPACE CUSTDB
DATAFILE 'C:\ORACLE\ORADATA\"Global Database name"\CUSTDB.DBF' SIZE 2500M;
--Global Database Name -the Database name created while installing the oracle

CREATE USER CUSTDB identified by ssc
DEFAULT TABLESPACE CUSTDB
QUOTA 0 ON SYSTEM
QUOTA UNLIMITED ON CUSTDB
TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED ON TEMP;

GRANT CREATE SESSION , CONNECT ,EXP_FULL_DATABASE, IMP_FULL_DATABASE TO CUSTDB;
imp userid=system/manager file=CUSTDB.dmp log=CUSTDB.log fromuser=CUSTDB touser=CUSTDB statistics=none


Same needs to be done for sports Database


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend