Oracle Database Migration

Source: Internet
Author: User
Tags dba

1 in the data migration, the user first has the right to modify the database, and make table space creation, deletion and other rights such as: SELECT * from Dba_tab_privs where grantee= ' SCOT '; ---View Scott permissions (SYS user login) The result is:   select * from Dba_role_privs where grantee= ' SCOT '; --View Scott role display results for:  (1) If the user is locked out by the following statement to unlock the table alter user Scott account unlock; --Unlock table (2) Grant user privileges grant connect to Scott; --Connect Database Permissions grant resource to Scott; Grant DBA to Scott for basic permissions such as creating tables; --Grant DBA Authority  2 establish table space strictly in the first place the following command instead of directly starting to create a tablespace drop tablespace tablespace name; and then start creating tablespace creation tablespace xx_bp;datafile ' f:\ App\xx_bp.ora '-local location of table space size 50Mautoextend on next 1m;  attached: datafile for table space corresponding data file, followed by data file path and data file name size The initial size of the data file Autoextend on indicates that the data increases automatically as the amount of data is increased the table is created with more than one table space to hold a variety of data, such as we typically create history table space (HS), index tablespace, and so on. Create a table space first, and then point to this tablespace when the user is set up, or Oracle will default to the SYS table space  3 creates the user user create username indentified by password tablespace xx_bp,xx_hs,xx_ indx; : Identified by is the keyword that creates the user's password, followed by the user's password  4 authorize the user of the database grant Connect,resource to user name connect and resource Roles grant users   see what roles the current user has select * from user_role_privs; 5 building data structures, stored procedures, views, sequences (1) CREATE tableTable XX. BP_OPER_DETAIL_TB (task_id VARCHAR2 () not null,flow_id number (a) not null,task_no VARCHAR2 (a) not Null,flow_node VARCHAR2 (4) Not null,workitemid number (a) not null,trans_id VARCHAR2 (Ten) Not Null,trans_no CHAR (6) Not Null,vouch_group V ARCHAR2 (+) not null,teller_no VARCHAR2 ("Default", User_no VARCHAR2 () not null,organ_no VARCHAR2 (Ten) not NULL,AREAC Ode VARCHAR2 (5) Default ", Create_time char () not null,checkout_time char (+) not null,checkin_time char (+) Default ', Suspend_time char (+) Default ', Resume_time char ' default ', trans_time integer default 0,release_time integer defaul T 0,state INTEGER not Null,result VARCHAR2 (Ten) Default ", Reason VARCHAR2 (+) Default ') tablespace xx_bp pctfree Init Rans 1 Maxtrans 255 storage (initial 64K next 8K minextents 1 maxextents Unlimited);  create an index constraint adjustment such as ALTER TABLE XX. BP_OPER_DETAIL_TB add constraint BP_OPER_DETAIL_PK primary key (task_id, Workitemid, Flow_node) using index tablespace xx_ BP Pctfree Initrans 2 Maxtrans255 Storage (initial 64K next 1M minextents 1 Maxextents Unlimited);  6 Import data  insert into SM_FIELD_PARENT_TB (FIELD _id, Parent_field, last_modi_date) VALUES (' VH0007 ', ' VH0000 ', ' 20160420074707 '); insert into SM_FIELD_PARENT_TB (field_ ID, Parent_field, last_modi_date) VALUES (' VH0008 ', ' VH0000 ', ' 20160420074729 '); insert into SM_FIELD_PARENT_TB (field_ ID, Parent_field, last_modi_date) VALUES (' VH0010 ', ' VH0000 ', ' 20160420074818 '); insert into SM_FIELD_PARENT_TB (field_ ID, Parent_field, last_modi_date) VALUES (' VH0012 ', ' VH0000 ', ' 20160420074914 '); insert into SM_FIELD_PARENT_TB (field_ ID, Parent_field, last_modi_date) VALUES (' VH0016 ', ' VH0000 ', ' 20160420075055 '); insert into SM_FIELD_PARENT_TB (field_ ID, Parent_field, last_modi_date) VALUES (' VH0017 ', ' VH0000 ', ' 20160420075129 '); insert into SM_FIELD_PARENT_TB (field_ ID, Parent_field, last_modi_date) VALUES (' VH0021 ', ' VH0000 ', ' 20160420075305 ');commit;  finally re-login to the database to verify the new migration database

Oracle Database Migration

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.