Import and Export Oracle databases, copy tables, and clear tables

Source: Internet
Author: User

Oracle export steps:
1. Click "start"-"run"-Enter "cmd" and press Enter.
2. Enter "exp" and press Enter.
3. Enter "xxx/YYY @ xlpt239" and press ENTER // here XXX is the user name to export the database, YYY is the user password to export the database, and xlp239 is the connection string of the database.
4. Enter "E:/database. dmp" and press Enter. Note: The exported database is placed on the edisk and named database. dmp.
5. Press enter until you enter the User name: Enter "test" and press Enter. Note: test is the user name of the database you just created.
6. Press enter to start exporting data.

Oracle export steps:
1. Click "start"-"run"-Enter "cmd" and press Enter.
2. Enter "Imp" and press Enter.
3. Enter "test1/pwd @ xlpt238" and press Enter. Note: test1 is the username in the 238 database.
4. Enter "E:/database. dmp" and press Enter. Note: The file path and file name of the database to be imported here.
5. Press enter until the user name is required: Enter "test" and press Enter. Note: "test" is the user name before the database file, that is, the user who exported the database.
6. Press enter to start data import.

Quickly clear the table content: truncate table xxxx/truncate table user. xxxx note: the user is the database user, which is to clear the user's XXXX table content.

Copy data from a table to another table: Create Table YYY as select * From uuu. Copy the data in the uuu table to yyy.

It can also be copied to other users in Oracle on the same server (using user as an example): Create Table user. YYY as select * From uuu

Create user code:

String SQL = "create user" + usename + "identified by" + PWD + "default tablespace users temporary tablespace users"; // create

String sql2 = "Grant connect, resource, DBA to" + usename; // authorization

Delete A User:

String SQL = "Drop user" + usename + "cascade ";

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.