oracle backup and recovery

1. Export the database

exp 用户名/密码@ORCL file=D:\data.dmp owner=用户名
plsql的使用:
    1、登录你要导出的数据库;
    2、工具→导出表:

export table

2. Import the database:

 1、创建表空间:
     create tablespace AJBG datafile 'F:\oracleData\AJBG.dbf' size 100m autoextend on next 50m;

write picture description here
2. Create users and allocate tablespaces:
create userusernameidentified bypassworddefault tablespacetablespacetemporarytablespacetemporary tablespace;
write picture description here
permissions to users:
grant connect, resource, dba to username, [username 2];
4 , Import database:
imp kang/123456@localhost/ORACLE file=”C:\daochu.dmp” full=y ignore=y”
Import using plsql:
1. Log in to other users;
2. Create tablespace:
create tablespace AJBG datafile ' F:\oracleData\AJBG.dbf' size 100m autoextend on next 50m;
Note: When creating a tablespace, it should be the same as the tablespace name of the imported data, if you don't know, open the dmp file with Notepad, and then search for the tablespace.
3. Find the user table:
write picture description here
right-click to add and
write picture description here
assign the tablespace you just created to the user you want to create;
click role permissions:
write picture description here
assign these three permissions, click Apply;
then log out of the currently logged-in user and log in to the user you just created:
click Tools →Import table
write picture description here
Click Import, the database is imported successfully!
**Note: After the database is imported, if you want to check whether the import is suitable, use:
select * from user_table; this is the number of tables in the query database; **

Guess you like

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