Oracle Data Migration backup, authorization, and create a table space, the user


1.Oracle backup data migration (cmd mode)

  1. Export data from Oracle to a local computer

    C: \ the Users \ Bobo> exp Scott / Tiger @ = ORCL Tables EMP, Dept rows = Y = File D: \ the emp_dept. Dmp log = D: \ emp_dept.log
    -rows row, y Representative Yes
    - format data to dmp
    Here Insert Picture Description

  2. Import data from local computer to Oracle

    emp_dept.dmp source data file into a user scott

    C: \ the Users \ Bobo> IMP Scott / Tiger TOUSER Scott @ ORCL FROMUSER = = = D Scott File: \ the emp_dept. DMP rows = log Y = D: \ imp_emp_dept.log
    -fromuser which is derived from the user
    -touser is introduced into the under which users
    Here Insert Picture Description
    will be able to see the imported data in a table of tables Oracle client folder
    Here Insert Picture Description

  3. .Sql import data from the local computer to Oracle

    Use the keyword @ + file Address
    Here Insert Picture Description

2.Oracle user authorization

Preparation:
Open cmd window, enter sqlplus scott / tiger @ orcl connect to the Oracle database
or
in PLSQL Developer client, open sql composition window, enter the following command can be authorized.


  1. Authorization / revoke authorized user DBA role
    Authorization: grant dba to scott;
    revoked: revoke dba from scott;

  2. Authorization table space
    to create the table space: grant create tablespace to scott;
    modify the table space: grant alter tablespace to scott;
    delete the table space: grant drop tablespace to scott;

    Once this is done, you can view the licensing information on the client, the client can also directly edit add permissions.
    Here Insert Picture Description

  3. Authorized users
    create a user: grant create user to scott;
    modify user: grant alter user to scott;
    delete a user: grant drop user to scott;
    Here Insert Picture Description

3. Create a table space and user

There is generally the first database, and then creates N table space, and then create a user, the user can specify the table space, this table space to store N tables.

  1. 创建表空间
    create tablespace test
    datafile ‘D:\oracle\product\10.2.0\oradata\orcl\test.dbf
    size 10m [autoextend on] [next 1M] [maxsize 2G];

    -Datafile route database transactions to be present
    -.dbf (database file) database file
    -size initial table space, K or M units of
    whether -autoextend automatically extended, is on or OFF
    -next file after full expansion size
    -maxsize maximum file size, value or values Unlimited (not represented size)

  2. Delete table space
    drop tablespace table space name;

    Delete empty table space, including the creation of a database file
    drop tablespace test including contents and datafiles;

  3. 创建用户
    create user test01 identified by test01
    default tablespace test
    temporary tablespace temp;

    -Identified by: creating a user name password password
    - the default table space with the Test
    - temporary space with temp

  4. Test01 authorized users to connect to the database

    After creating a user in the Users folder could see test01 user, but the user wants to log test01 showed no permission to connect to the database.
    Here Insert Picture Description
    Test01 authorized user is required in the database connection system user.
    Here Insert Picture Description
    By session log in again, the user will be able to successfully log on test01.
    Here Insert Picture Description
    test01 user specifies a test table space, create a table stored in the test table space.
    Here Insert Picture Description

Published 56 original articles · won praise 34 · views 3659

Guess you like

Origin blog.csdn.net/MicoOu/article/details/103522464