Oracle Management of data objects and data in , No doubt it's all using PL/SQL Developer To manage , The tool also provides us with a lot of convenience 、 Quick operation , Make us no longer for Oracle Ugly in itself 、 Hard to use UI And complain . Because we usually build tables 、 The operation of checking data is in the majority , Less consideration will be given to the whole system Oracle Full backup operation of . But in some of our publishing operations , We have to think about how to put Oracle The object of 、 Export table data to Sql Script , And create Oracle Table space 、 establish Oracle The operation of the database is also put into the script , So we can quickly restore or deploy Oracle The database is on the new machine .

This article mainly introduces how to combine Sql Scripts and PL/SQL Developer Tool to create a table space 、 Create database 、 Backup database 、 Data export and other operations , Then implement Oracle objects creating 、 Import data and other operations , So that we can quickly understand 、 Create the required deployment Sql Scripts and database operations .

1、 Prepare the database creation script

create tablespace whc_tbs datafile 'E:\oracle\oradata\whcdb\whc.dbf' size 100M;
create user whc identified by whc default tablespace whc_tbs;
grant connect ,resource to whc;
grant dba to whc;
--Revoke dba from whc;

among -- The comment statement for is to delete the namespace and remove DBA The user's rights are .

The above scripts are for us to create a new table space and Oracle It's used in the database .

among E:\oracle\oradata\whcdb\whc.dbf The path is where we want to store the database data , Therefore, it is necessary to ensure that the path has enough space and sufficient access rights , Otherwise it will fail .

2、 Export database objects

stay PL/SQL Developer Menu for Tools=>Export User Objects A dialog interface appears in the , And then box it everywhere Oracle Database objects , Including table , Sequence , stored procedure , View , Function, etc. , And specify the name of the exported file , Do the following .

3) Export table data

After exporting table structure and other objects , Our next step is to export the table data of the database ,PL/SQL Developer The tool supports exporting data to PL/SQL In the database script , As shown below . The script exported like this , We can do it in PL/SQL Developer Tool import or own through Sql plus Tools to import .

thus , We've finished three scripts , Including creating database space and database scripts 、 establish Oracle Database objects ( surface 、 stored procedure 、 View 、 Sequence, etc )、 Create scripts to import data , So three in one , It's a complete database . The last step is how to import database objects and data .

4) Import database objects and data

Importing database objects is the same as importing data , Both can pass Import Tables Operation implementation , We specify the database script created in the above two steps , Execute to create database objects and database data in a new environment . As shown below .

The executed data interface is as follows .

Complete the above steps , We're in a new database environment , You have everything , Successfully complete the whole Oracle Database object and data migration .

It is worth noting that , We export Oracle Objects and data , Default or original Oracle Database table space and database user name , If we want to specify different table spaces and database user objects in the new database server , So we need to replace the generated sql Script , And in the first step, specify a reasonable table space and database user .

If it is Linux Database server under the platform , The first step is the same , The path name of the specified table space is slightly different , There is no difference in other operations .

Oracle How to create a database 、 Backup database and data import and export through-train operation of more related articles

  1. [ turn ]Oracle How to create a database 、 Backup database and data import and export through-train operation

    In this paper, from : Oracle Management of data objects and data in , No doubt it's all using PL/SQ ...

  2. Use SQL Server Management Studio Create a job backup database

    In the project , You often need to back up the database , If you can do it, just click a button (“ Start backing up the database ” Button ), And then nothing , The database is automatically backed up , Or the database on the server is automatically backed up every other period of time , How nice that would be . Sql server Of ...

  3. Oracle Database management: creating and deleting databases

    from : One . Overview of database management At the completion of Oracle After the software is installed ,DBA We should be responsible for organizing and managing the database , Its main task is ...

  4. Oracle Data Guard Create Physics Standby database

    Create a physical backup Library machine name                     a1                    a2                    IP:                    192 ...

  5. MongoDB Import and export as well as database backup and .dat data

    1. Export tool :mongoexport     1. Concept :         mongoDB Medium mongoexport A tool can turn a collection Export to JSON Format or CSV File format . You can refer to ...

  6. Database learning oracle11g Data pump import and export

    One . Check environmental consistency Need to check the database client and server character encoding , To avoid all kinds of subsequent problems Query the server code It's best to use sqlplus Inquire about , use plsql Sometimes there are query inconsistencies , As shown in the figure below, the same statement in plsql and s ...

  7. exp/imp Database data export / Import

    One .exp Export data 1. Export all data exp user name / password @ service name file= File storage path /xxx.dmp log= Log storage path /xxx.log full=y example : [oracle@dbservice ...

  8. oracle Data export import (exp/imp)

    1. Local database import and export 1. export ( function ---cmd In the operation )exp user name / password @ Database instance name file= Local storage path eg: exp jnjp/jnjp@ORCL file=C:/jnjp.dmp 2. ...

  9. Mysql Backup series (3)--innobackupex Backup mysql big data ( Total quantity + The incremental ) Operation record

    In everyday linux Operation and maintenance work , Massive data backup and restore , It's always a difficult point . About mysql Backup and restore , It's more traditional to use mysqldump Tools , Today we recommend another backup tool innobackupex.innobacku ...

Random recommendation

  1. HTTP Head

      General header ( It's called universal head ) Common header fields contain header fields that are supported by both request and response messages , The common header field contains Cache-Control. Connection.Date.Pragma.Transfer-Encoding.Upgra ...

  2. nginx location modular -- Matching rules

    Location Grammar :location [=|~|~*|^~] /uri/ { … } = --> The beginning indicates an exact match ^~ --> It begins with uri Starts with some regular string , To match url ...

  3. js Use regular expressions to verify the security of users and passwords , Generate random verification code

    Made a form , The form validates the user . password . Random verification code html page

  4. JavaScript To open the link page ( Reprint )

    In addition to the normal way of linking on the page , If you use javascript, There are many other ways , Here are some uses javascript, Several ways to open a link : 1. Use window Of open Method to open the link , Here's the development page ...

  5. Based on Huawei Java Programming is standard Eclipse checkStyle.xml

    It is found that there is a big problem in the code specification of project team members , So, this is based on Huawei's programming specifications checkStyle.xml file , as for Eclipse How to install checkStyle Plug in and how to use it Google And . ...

  6. jsonp Cross domain access details

    jsonp yes " For cross domain " The same-origin policy First, for security reasons , Browsers have the same origin policy , The same origin policy prevents a document or script loaded from one source from obtaining or setting the properties of a document loaded from another source . 1. Just build two networks ...

  7. IOS--UITextFiled How to use

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for ...

  8. Simple factory VS Factory method VS Abstract factory

    When it comes to design patterns . It's natural to have a simple factory model . The three sisters of factory method and abstract factory . They have their own advantages , My specialty is ! This blog simply combs the relationship among the three . So what does factory mean ? Combining the characteristics of the three , I think it's possible ...

  9. sql Exercises and answers

    sql exercises : The answers to the exercises are as follows : ...

  10. leetcode Sum of two numbers python

       Sum of two numbers     Given an array of integers and a target value , Find the two numbers in the array that are the target values . You can assume that each input corresponds to only one answer , And the same elements cannot be reused . Example : Given nums = [2, 7, 11, 1 ...