Windows oracle11g Database Export Backup

Source: Internet
Author: User

Reference Source: https://jingyan.baidu.com/article/9113f81b2040862b3314c757.html

The first step:
1. Open the DOS window with administrator privileges

2, Login command:
Sqlplus Sys/oracle as Sysdba
----------------------------
Sqlplus System/[email protected]

Attention:
If the prompt command is not valid, it is that you have not configured the environment variables for Oracle (as I was plagued by this problem), configure the Oracle environment variables as follows:

1) Right click on "My Computer", select "Properties", select "Advanced", "Environment variables"

2) Select Path, click Edit, add a semicolon ":" to the last side of the Variable Value text box for "path", and then add the Sqlplus file after the semicolon
directory path, such as "C:\Program Files\oracle\product\10.2.0\db_1\bin", then click the "OK" button.

3) If you cannot find the variables "oracle_home" and "Oracle_sid" in the variables column under the System Variables list box, you need to do the following, otherwise you do not need to do this.

4) in the "System variables" click on the "New" button, in the "Variable name" enter "Oracle_home", the value of the variable input ORACLE installation directory path, such as "C:\Program files\oracle\product\10.2.0\db_1", Then click on the "OK" button.

5) Click the "New" button in "System Variables", enter "Oracle_sid" in "Variable name", enter the database instance name in the variable value, then click "OK" button.
installation directory of oracle_home:oracle database software
Oracle_sid:oracle the instance name of the database
Oracle DB Instance Name: The identity used to contact the operating system, that is, the exchange between the database and the operating system is represented by the database instance name.


Step Two: EXPDP backup command
1. Create the backup directory for Oracle:
This is only a directory set in Oracle and does not really create
Create directory Dbdata as ' E:\oracledatabase\dbdir ';

2, you can use this command to see this directory
Sql>select * from Dba_directories;

3, assigned to the owning user right to export the data table
Grant Read,write on directory dbdata to Netgeo;

4, well, to a key step, before a lot of detours, but the other is a small problem, in the online bits and a lot of information, and finally find the reason.
First, to switch back to the command window, do not run under sql>, and then enter the command:

5, it reported a mistake. ORA-39002: Invalid operation
The reason is D:\temp\dmp this directory does not exist, do not think that the creation directory will automatically generate folders, and do not think that after the execution of EXPDP automatically generated folders, you have to manually create this directory folder.
Create a new folder and try again, it's a success! Congratulations, you have successfully backed up!

Edit the export statement, reopen another DOS window, and perform the export directly.
EXPDP System/[email protected] directory=dbdata dumpfile=ahngrm.dmp logfile=ahngrm.log schemas=ahngrm
Export Full Library
EXPDP ahngrm/gxlu_sw2 directory=dbdata dumpfile=ahngrm.dmp logfile=ahngrm.log full=y compress=y


6, if you want to ask, the exported DMP file how to restore back. Well, to do the bottom, in order to save you find ways to trouble, here
I also do a demo (the data that is typically backed up is only used until the database has a problem).
First, log in to the database again Sqlplus System/[email protected]
Then, delete the target database users drop user AHNGRM cascade;

7, now to create the user again, you can create it with commands, or you can create it in Plsql, which is created in Plsql.
Log in to the database with system, then right-users--the new
Then fill in your account name, must be the same as the user at the time of backup, and assign the appropriate permissions
Finally click on the app to complete the user creation.

8, Return to DOS command window, no longer sql>
Enter import command: IMPDP system/[email protected] directory=dbdata dumpfile=ahngrm. DMP Logfile=ahngrm.log SCHEMAS=AHNGRM
Import Successful!

Windows oracle11g Database Export Backup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.