任務描述:將資料表空間wy的內容全部拷貝到資料表空間tietong中去。
具體步驟:
1.首先,本地安裝Oracle。
2.其次,通過Net Configuration Assistant,建立到位於10.153.246.149的資料庫CMSTEST的本地Net服務,使用者名稱和密碼是wy/123456,本地Net服務名是wy。
3.進入dos視窗,使用命令exp wy/123456@wy file=c:\wy.dmp owner=(wy) 來匯出資料。
4.採取以下措施建立資料表空間及使用者:
4.1:通過Telnet串連到資料庫所在機器
>telnet 10.153.246.149
之後輸入使用者名稱root,密碼root
4.2:通過su命令切換到Oracle使用者
>su – oracle
4.3:啟動SqlPlus
>sqlplus
之後輸入使用者名稱cms_test,密碼password123
4.4:輸入以下SQL語句建立資料表空間及使用者
4.4.1 建立資料表空間CREATE TABLESPACE tietong DATAFILE 'tietong2.dbf' SIZE 1000m;(若需空間請改變size,若tietong已經建立好可用 drop tablesapce tietong 刪除它)
4.4.2 建立使用者 CREATE user tietong identified by "123" default tablespace tietong
temporary tablespace TEMP profile DEFAULT;
4.4.3 更改密碼 alter user tietong identified by "123456";
4.4.4 給使用者加上DBA許可權 grant dba to tietong with admin option;
4.4.5 最後輸入Exit退出sqlplus環境。
5.接下來,通過Net Configuration Assistant,建立到位於10.153.246.149的資料庫CMSTEST的本地Net服務,使用者名稱和密碼是tietong/123456,本地Net服務名是teitong(此名本該是tietong,但敲的時候筆誤了,後來也懶得改)。
6.進入dos視窗,使用命令imp tietong/123456@teitong file=c:\wy.dmp ignore=y full=y來匯入
資料,雖然有報錯,但沒有影響資料正常匯出
7.進入資料表空間tietong檢查,初驗表,資料,預存程序,索引,序列都完好,具體待進一步測試。