Create table spaces, users, Dblink, let users hold dblink, create views, establish synonyms, and export data

Source: Internet
Author: User
First step the path required to create a tablespace file_name: Log on as Administrator system/admin, query data file name, size, and path information

Select Tablespace_name,file_id,bytes,file_name from Dba_data_files;

Second step create tablespace: Log in as Administrator system/admin, create tablespace

CREATE tablespace mytbspace         

LOGGING 
datafile ' d:/installsoftware/myoracle/app/administrator/oradata/ Lworcl/mytbspace.dbf ' 
SIZE m 

autoextend on 
NEXT m MAXSIZE 2048 m 

EXTENT MANAGEMENT Local; 



Step three Create user leiwei: Log on as Administrator system/admin, create users, and grant users Reiwei create Dblink (required permissions see step Fourth) and view permissions

   --Create              

            the user create user Leiwei 

            identified by "Leiwei" 

            default tablespace mytablespace 

            Temporary Tablespace TEMP profile 

            DEFAULT 

            password expire; 

           --Grant/revoke role Privileges 

            Grant connect to Leiwei; 

            Grant resource to Leiwei; 

           --Grant/revoke System privileges 

            Grant create any view to Leiwei 

            ; Grant CREATE database link to Leiwei; 

            Grant create public database link to Leiwei; 

            Grant drop public database link to Leiwei; 

            Grant unlimited tablespace to Leiwei; 


Step fourth to see what permissions are required for Dblink: Log on as an administrator system/admin to see what permissions are required to create Dblink and assign those permissions to the corresponding users such as: Leiwei

    SELECT * from User_sys_privs t 

    where t.privilege like Upper ('%link% '); 


Step Fifth Create Dblink: Log in as a regular user Leiwei/leiwei, create Dblink

             --Create DATABASE link 

                  Create DATABASE link Dblink2area 

                   connect to Ypdoor identified by Ypdoor 

                   using ' (DESCRI Ption= (address_list= ( 

                              address= (protocol=tcp) (host=172.23.1.30) (port=1521)) 

                            (Connect_data= 

                              ( SERVICE_NAME=ORCL))) 

                      '; 


Step Sixth Create a view: Log on as a normal user Leiwei/leiwei, create view get data from any table (EMP) in the Dblink object (172.23.1.30) database (ORCL)

    Create or replace view Dblinkview as 

    select * 

    


Seventh query view: Log in as normal user Leiwei/leiwei, query view dblinkview Verify data Link success


Viii. Establishment of synonyms

--Create the synonym 
Create or replace synonym tele_note_groups for
  puser. Tele_note_groups@dblink_portal. Regress. Rdbms. DEV. US. oracle.com;


IX. Export the data under the corresponding user in the library

Exp YPDOOR/YPDOOR@172.18.27.146/LWORCL file=d:/20111231ypdoor.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.