oracle 備份與恢復

1.創建表空間

sqlplus /nolog;

sql>conn sys/sys as sysdba;

sql>create tablespace test123 datafile 'd:\test123' size 500m;


2. 創建用戶並指向表空間
sql>create user test123() iddentified by test123 default tablespace test123;


3 用戶

3.1 用戶解鎖

alter user test123(用戶) account unlock

3.2 用戶授權

sql>grant dba ,source,connect to test123;

sql>alter user scott account unlock; grant connect,resource,unlimited tablespace to scott;


4 導出數據

exp

導入數據

imp

1. 獲取幫助

 imp help=y

2. 導入一個完整數據庫

 imp system/manager file=bible_db log=dible_db full=y ignore=y

3. 導入一個或一組指定用戶所屬的全部表、索引和其他對象

 imp system/manager file=seapark log=seapark fromuser=seapark imp 
 system/manager file=seapark log=seapark fromuser=(seapark,amy,amyc,harold)

4. 將一個用戶所屬的數據導入另一個用戶

 imp system/manager file=tank log=tank fromuser=seapark touser=seapark_copy
 imp system/manager file=tank log=tank fromuser=(seapark,amy)
 touser=(seapark1, amy1)

5. 導入一個表

 imp system/manager file=tank log=tank fromuser=seapark TABLES=(a,b)

6. 從多個文件導入

 imp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4) 
log=paycheck, filesize=1G full=y

7. 使用參數文件

 imp system/manager parfile=bible_tables.par

bible_tables.par參數文件:

 #Import the sample tables used for the Oracle8i Database Administrator's 
Bible. fromuser=seapark touser=seapark_copy file=seapark log=seapark_import

8. 增量導入

 imp system./manager inctype= RECTORE FULL=Y FILE=A
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章