oracle database backup and recovery

backup database

 

Formal server export database

aix go in and switch to oracle below backup export

wxzy1-> expdp system/kingdee schemas=adminnew directory=DMPDIR exclude=statistics parallel=2 dumpfile=yk20120525p.dmp logfile=yk20120525p.txt

 

 expdp system/123456@orcl schemas=yneerp directory=hzback exclude=statistics parallel=2 dumpfile=yne20160225p.dmp logfile=yne20160225p.txt

system/123456@orcl Database administrator username and password Password and instance name of the administrator system

schemas username to export

directory virtual directory Since oracle only recognizes virtual directories and does not recognize actual logical directories, it is necessary to create virtual directories

 

 

 

Official server import user test01;

 

1 drop user wxzy cascade; delete user

2 impdp system/oracle remap_schema=wxzy:test01 parallel=2 directory=expdp_dump dumpfile=wxzy09**p.dmp logfile=wxzy09**p.txt remap_tablespace=eas_d_wxzy_standard:eas_d_test01_standard,eas_d_wxzy_temp2:eas_d_test01_temp2,eas_t_wxzy_standard:eas_t_test01_standard

3 After importing, user name: test01 password: wxzy instance name:

 

Operate locally (take local test as an example)

 

Do not close the database, stop the user;

 

SQL>col machine format a10;

SQL>select sid,serial#,username,machine from v$session;

SQL>alter system kill session '144,238';

 

Create tablespace

 

SQL> create tablespace eas_d_admin_standard datafile 'E:\20131012orcl\eas_d_admin_standard.dbf' size 7024m

Tablespace has been created.

 

SQL> create tablespace eas_d_admin_temp2 datafile 'E:\20131012orcl\eas_d_admin_temp2.dbf' size 1024m;

Tablespace has been created.

 

SQL> create temporary tablespace eas_t_admin_standard tempfile 'E:\20131012orcl\eas_t_admin_standard.dbf' size 1024m;

 

Tablespace has been created.

 

1. Create a logical directory. This command will not create a real directory in the operating system (please create a real directory first). It is best to create a logical directory with an administrator such as system.

Created with dba user,

SQL> create directory hzback as 'E:\oracleback20160225'; (database import and export storage directory)

Directory has been created.

SQL> grant read on directory dpdump to system;

Authorization succeeded.

Then grant connect, resource to test_user; 

 

2. Check the administrator directory (also check whether the operating system exists, because oracle does not care whether the directory exists, if it does not exist, an error occurs)

SQL>select * from dba_directories;

 

create user hdwm identified 

3. Import data with impdp (you need to exit the SQL interface)

 

 Import by different users:

 impdp system/123456@orcl remap_schema=ynrerp:ynetest parallel=2 directory=hzback dumpfile=yne20160225p.dmp logfile=yne20160225p.txt remap_tablespace=eas_d_yneerp_standard:eas_d_ynetest_standard

,eas_d_yneerp_temp2:eas_d_ynetest_temp2,eas_t_yneerp_standard:eas_t_ynetest_standard

 

 

impdp system/ynerp@orcl  

directory=db_bak2  dumpfile=yne20131012.dmp REMAP_TABLESPACE=MIDDLE_D_JCUSER_STANDARD

:MIDDLE_D_HDWM_STANDARD

,MIDDLE_T_JCUSER_STANDARD:MIDDLE_T_HDWM_STANDARD 

logfile=yne20131012.txt 

 

 

Same user import: impdp system/ORCL parallel=2 directory=DYLTEM dumpfile=expdp_east_20140623_patch.dmp logfile=expdp_east_20140623_patch.log

 

system password is orcl

0racle 10g import 

exp system/manager@TEST file=d:\daochu.dmp full=y

imp yneerp / kingdee @ orcl file = E: \ oracledate \ data \ 20120105.dmp fromuser = yneerp touser = yneerp ignore = y

 

imp system/ORCL@orcl file=D:\app\Administrator\oracledata\easyui.dmp ignore=y full=y fromuser=pmsystem touser=eas ignore=y

 

select * from nls_database_parameters query database character set

 

 

imp system/oracle666@orcl file=E:\oracledate\data\0207.dmp fromuser=auto0207 touser=auto0207 ignore=y

 

 

wk

 

 

 

create tablespace data logging datafile 'D:\oracledate\date\zjk\DATA01.ora' SIZE 500m autoextend on next 200m maxsize unlimited;

 

create tablespace INDEXE logging datafile 'D:\oracledate\date\zjk\INDEXE02.ora' SIZE 500m autoextend on next 200m maxsize unlimited;

 

impdp hdwm/hdwm@hdwm dumpfile=ykzjk20120217p.dmp directory=zjk_dpdump CONTENT=METADATA_ONLY remap_schema=jcuser:hdwm logfile=ykzjk20120217p.txt

 

CREATE USER hdwm PROFILE default IDENTIFIED BY hdwm DEFAULT TABLESPACE MIDDLE_D_HDWM_STANDARD TEMPORARY TABLESPACE MIDDLE_T_HDWM_STANDARD ACCOUNT UNLOCK;

 

 

 

Non-temporary tablespace:

select file_id from dba_data_files where tablespace_name='EAS_T_WXZY_STANDARD';

 

alter database datafile 9 autoextend on next 2024M maxsize 20G; 

Temporary tablespace:

select file_id from dba_temp_files where tablespace_name='EAS_T_WXZY_STANDARD';

 

alter database tempfile 3 autoextend on next 10M maxsize 20G;

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326396213&siteId=291194637