Oracle Database Password Reset, Import and Export command example application, oracle Import and Export

Source: Internet
Author: User

Oracle Database Password Reset, Import and Export command example application, oracle Import and Export

The reset method is as follows: Open the CMD command prompt and enter the following command to reset:

Enter sqlplus/nolog, and press ENTER

SQL> conn/as sysdba

Connected;

SQL> alter user system identified by "123456"; --- (123456 is the Reset Password)

SQL> alter user sys identified by "123456 ";

The following describes the Import and Export instances. You can import and export instances to the Import and Export instances, because the import and export operations are very simple.

Data export:

1. Export the database TEST completely, and the username system Password manager is exported to D: \ daochu. dmp.
Exp system/manager @ TEST file = d: \ daochu. dmp full = y
2. Export the tables of system users and sys users in the database
Exp system/manager @ TEST file = d: \ daochu. dmp owner = (system, sys)
3. Export tables table1 and table2 in the database
Exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1, table2)
4. Export the data with the field filed1 in table 1 in the database starting with "00"
Exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1) query = \ "where filed1 like '201312 '\"

The above is a commonly used export. I am not very concerned about compression. I can use winzip to compress the dmp file.
However, add compress = y to the command above.

Data Import

1. import data from D: \ daochu. dmp to the TEST database.
Imp system/manager @ TEST file = d: \ daochu. dmp
The above may be a problem, because some tables already exist, and then it will report an error, the table will not be imported.
Add ignore = y to the end.
2. Import table 1 in d: \ daochu. dmp
Imp system/manager @ TEST file = d: \ daochu. dmp tables = (table1)

The preceding import and export operations are sufficient. In many cases, I completely delete the table and then import it.

Data export:

Exp hkb/hkb @ boss_14 full = y file = c: \ orabackup \ hkbfull. dmp log = c: \ orabackup \ hkbfull. log;

Note: The data of the current user is exported. If the current user has DBA permissions, all data is exported!

Import data between users with the same name:
Imp hkb/hkb @ xe file = c: \ orabackup \ hkbfull. dmp log = c: \ orabackup \ hkbimp. log full = y

Data Import between different names:
Imp system/test @ xe fromuser = hkb touser = hkb_new file = c: \ orabackup \ hkbfull. dmp

Log = c: \ orabackup \ hkbimp. log;


Oracle Database Import/Export ???

The exported data is not only the user's table data, but also the user's indexes, views, sequences, etc. The user's SQL statements created by the database administrator certainly do not exist, because these table creation statements are not stored in the database;
During import, the corresponding user and authorization are not automatically created, because during import, the user name and password of the user to be imported must be written, in this way, all exported tables will be imported to this user, rather than the corresponding user;
As for the specific principles of import and export, the landlord can go to Baidu search and view, I just searched, there are a lot.

Commands used to export and import database backup files in oracle

Export: exp PECARD_HN/PECARD_HN@192.168.141.40: 1521/orcl file = E: \ work \ dmp \ PECARD_HN.dmp
Import: imp PECARD_HN/PECARD_HN@127.0.0.1: 1521/orcl file = E: \ work \ dmp \ PECARD_HN.dmp full = y

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.