Oracle數(shù)據(jù)庫備份和恢復(fù)的基本命令
以下的文章主要是介紹Oracle數(shù)據(jù)庫備份和恢復(fù)的基本命令的實(shí)際操作步驟的相關(guān)介紹,以及在Oracle數(shù)據(jù)庫備份和恢復(fù)的基本命令中的三種不同的工作方式的詳細(xì)介紹,以下就是內(nèi)容的相關(guān)介紹。
Oracle數(shù)據(jù)庫備份與恢復(fù)基本命令
1、 獲取幫助
$ exp help=y
$ imp help=y
2、三種工作方式
(1)交互式方式
$ exp 然后按提示輸入所需要的參數(shù)
(2)命令行方式
$ exp user/pwd@dbname file=/oracle/test.dmp full=y
命令行中輸入所需的參數(shù)
(3)Oracle數(shù)據(jù)庫備份與恢復(fù)中我們要走涉及到參數(shù)文件方式
$ exp parfile=username.par
在參數(shù)文件中輸入所需的參數(shù)
參數(shù)文件 username.par 內(nèi)容 userid=username/userpassword buffer=8192000
compress=n grants=y
file=/oracle/test.dmp full=y
3、三種模式
(1)表方式,將指定表的數(shù)據(jù)導(dǎo)出/導(dǎo)入。
導(dǎo)出:導(dǎo)出一張或幾張表:$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2
導(dǎo)出某張表的部分?jǐn)?shù)據(jù)
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1 query=\“where col1=\‘…\’and col2 \<…\”
導(dǎo)入:導(dǎo)入一張或幾張表
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,
table2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
(2)用戶方式,將指定用戶的所有對象及數(shù)據(jù)導(dǎo)出/導(dǎo)入。
導(dǎo)出:$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=(xx, yy)
只導(dǎo)出數(shù)據(jù)對象,不導(dǎo)出數(shù)據(jù) (rows=n )
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=user rows=n
導(dǎo)入:$ imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
commit=y ignore=y
(3)全庫方式,將數(shù)據(jù)庫中的所有對象導(dǎo)出/導(dǎo)入導(dǎo)出:
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log full=ycommit=y ignore=y
導(dǎo)入:$ imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
以上就是對Oracle數(shù)據(jù)庫備份與恢復(fù)基本命令相關(guān)的內(nèi)容的介紹,望你會(huì)有所收獲。
【編輯推薦】