Oracle 11g Linux set up table space user authorization database Import Export

Source: Internet
Author: User
Tags create directory sqlplus

Sqlplus


/as SYSDBA

--View DBF storage location
SELECT * from Dba_data_files; --View File location SELECT * from Dba_directories;

--New Table space
Create tablespace bp_oracle logging datafile '/u02/oradata/devdb/bp_oracle.dbf ' size 100m autoextend on next 50m maxsize 2 00m extent management Local;

--New user
Create user bp_oracle identified by bp_oracle default Tablespace bp_oracle;

--User Authorization
Grant Connect,resource to Bp_oracle; --The CMS system needs to increase grant create view to Bp_oracle views permissions


--Users can access Dump_dir for easy import and export operations
Grant Read,write on directory Dump_dir to Bp_oracle; --If no dump_dir can be established
Create directory Dump_dir as ' G:/oracle_dump_dir '; --View Directory select * from Dba_directories;

--Database Import 1: normal
IMPDP bp_oracle/bp_oracle Directory=dump_dir dumpfile=bp_oracle20120209.dmp

--Database Import 2: Mapping situation
IMPDP bp_oracle/bp_oracle directory=dump_dir dumpfile=ncp20120209.dmp remap_schema=ncp:bp_oracle remap_tablespace= Ncp:bp_oracle

--data export, can be with version
EXPDP bp_oracle/bp_oracle Directory=dump_dir dumpfile=bp_oracle.dmp version=10.2.0.1.0

--Remove Tablespace
Drop tablespace bp_oracle including CONTENTS and datafiles;

--delete the user, and execute the statement carefully, the Cascade deletes all objects under that user.
Drop user bp_oracle cascade;

--Modify User password
Alter user bp_oracle identified by bp_oracle;


--Export database with no version
EXPDP bp_oracle/bp_oracle schemas=bp_oracle dumpfile=bp_oracle20120221.dmp directory=dump_dir JOB_NAME=full

--Export Database with version
EXPDP bp_oracle/bp_oracle schemas=bp_oracle directory=dump_dir dumpfile=bp_oracle20120221.dmp version=10.2.0.1.0

--Export database with no version
EXPDP bp_oracle/bp_oracle schemas=bp_oracle dumpfile=bp_oracle20120221.dmp directory=dump_dir JOB_NAME=full

--Export Database with version
EXPDP bp_oracle/bp_oracle schemas=bp_oracle directory=dump_dir dumpfile=bp_oracle20120221.dmp version=10.2.0.1.0

--Export Data specify table name data
Exp NMSWXT_MHWZ/NMSWXT_MHWZ file=/home/oracle/dmp/nmswxt_mhwz_news_content.dmp tables=news_content

--Import data, with mapping relationship
Imp Nmswxt_mhzz/nmswxt_mhzz file=/home/oracle/dmp/nmswxt_mhwz_news_content.dmp fromuser=nmswxt_mhwz touser=nmswxt_ Mhzz

--Establishing materialized view authorization
GRANT CREATE materialized VIEW to NMSWXT_SW;


--timed task authorization
Grant create job to NMSWXT_SW;

#启动数据库

STARTUP #启动例程 Sqlplus/as SYSDBA

Lsnrctl Start #启用监听 default directory

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.