Oracle Database Backup and upgrade, oracle Database Backup

Source: Internet
Author: User

Oracle Database Backup and upgrade, oracle Database Backup

Log on to the server where the database is located as an oracle user. For example, the home directory is/home./oracle. Run the following command to back up the database.

Sqlplus/nolog

Connect/as sysdba

SQL> createdirectory dump_bx as 'specify a directory for storing dmp files ';

SQL> grantread, write on directory dump_bx to the User Name of the boss database;

SQL> exit

Oracle> expdp boss Database User Name/password directory = dump_bxdumpfile = boss121_dmp logfile = out_boss121_log schemas = boss Database User Name;

The following is an example of development and export:

 

Sqlplus/nolog

Connect/as sysdba

SQL> createdirectory dump_bx as '/home/oracle/db_backup20140715 ';

SQL> grantread, write on directory dump_bx to boss0923;

Oracle> expdpboss/bossnyl directory = dump_bx dumpfile = boss20140715.dmp logfile = in_boss20140715.log schemas = boss0923;


Assume that the script file to be upgraded has been uploaded to the database server. The script file is in the package update_db.zip and stored in the directory update_db20140715. Execute the following command to perform the upgrade.

$ Cd/home/oracle/update_db20140715

$ Unzip-o update_db.zip

$ Cd update_db

$ Export NLS_LANG = AMERICAN_AMERICA.UTF8

$ Sqlplus "User Name/password"

> @ UPDATE. SQL

> Exit



How to back up a database from an oracle database

Oracle user Export and Import
Export:
1. Find emp.exe in the bin directory of your Oracle installation location
For example, D: \ oracletools \ oracle \ product \ 10.2.0 \ db_1 \ BIN
2. Double-click to run and enter the user name and password you want to export (the password is invisible)
3. Enter the location where the exported file is stored
For example, d: \ crm. dmp [must be a bmp file]

Import:
1. Create a user, for example, crm. [if there is a crm user (which contains data, delete drop user crm cascade first )]
2. grant permissions to grant dba to crm for Import
3. Find imp.exe in the bin directory of your Oracle installation location.
4. Enter the location where you want to import the dmp File

Oracle Database Backup statement

After all, EXP also needs to connect to the database, that is, provide the user name and password. Therefore, you cannot export the database mode normally. However, you can use DBA user login to export the entire database.
Database mode:
Exp system/PASSWD @ oracle full = y file = 'db081222. DMP 'Log = 'db081222. Log'
User Mode:
Exp user/PASSWD @ oracle file = 'user081222. DMP 'Log = 'user081222. Log'
Table mode:
Exp user/PASSWD @ oracle file = 'user081222. DMP 'Log = 'user081222. log' TABLES = ('table _ 1', 'table _ 2 ')

In the IMP statement, replace 'exp' in the preceding three statements with 'Imp '.
If you still do not understand, enter EXP-HELP or IMP-HELP in the command line to view HELP!

Related Article

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.