日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

模拟行迁移试验

發布時間:2024/3/26 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 模拟行迁移试验 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、創建scott模式

[oracle@std dbs]$ sqlplus '/as sysdba'SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 17 14:59:02 2014Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining optionsSQL> select user_id,username from dba_users;USER_ID USERNAME ---------- ------------------------------11 OUTLN0 SYS5 SYSTEM24 DBSNMP21 TSMSYS19 DIP6 rows selected.SQL> @?/rdbms/admin/utlsampl.sql Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options

?

2、備份EMP表

[oracle@std dbs]$ sqlplus scott/tigerSQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 17 15:02:50 2014Copyright (c) 1982, 2005, Oracle. All rights reserved.Error accessing PRODUCT_USER_PROFILE Warning: Product user profile information not loaded! You may need to run PUPBLD.SQL as SYSTEMConnected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining optionsSQL> select * from tab;TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------- DEPT TABLE EMP TABLE BONUS TABLE SALGRADE TABLESQL> select constraint_name,constraint_type,table_name from user_constraints;CONSTRAINT_NAME C TABLE_NAME ------------------------------ - ------------------------------ FK_DEPTNO R EMP PK_DEPT P DEPT PK_EMP P EMPSQL> alter table emp drop constraints pk_emp;Table altered.

?

3、分析行連接

SQL> @?/rdbms/admin/utlchain.sqlTable created.SQL> select * from tab;TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------- DEPT TABLE EMP TABLE CHAINED_ROWS TABLE BONUS TABLE SALGRADE TABLE EMP2 TABLE6 rows selected.SQL> analyze table emp list chained rows into chained_rows;Table analyzed.SQL> select count(*) from chained_rows where table_name='EMP';COUNT(*) ----------0

4、模擬產生行連接

SQL> truncate table emp;Table truncated.SQL> alter table emp pctfree 0;Table altered.SQL> insert into emp select * from emp2;14 rows created.SQL> insert into emp select * from emp;14 rows created.SQL> /28 rows created.SQL> /56 rows created.SQL> /112 rows created.SQL> /224 rows created.SQL> /448 rows created.SQL> /896 rows created.SQL> /1792 rows created.SQL> commit;Commit complete.SQL> desc empName Null? Type----------------------------------------- -------- ----------------------------EMPNO NUMBER(4)ENAME VARCHAR2(10)JOB VARCHAR2(9)MGR NUMBER(4)HIREDATE DATESAL NUMBER(7,2)COMM NUMBER(7,2)DEPTNO NUMBER(2)SQL> update emp set ename='AAAAAAAAAA' where empno=7844;256 rows updated.SQL> commit;Commit complete.SQL> analyze table emp list chained rows into chained_rows;Table analyzed.SQL> select count(*) from chained_rows where table_name='EMP';COUNT(*) ----------30

5、消除行遷移

SQL> create table emp_old as select * from emp where rowid in2 (select head_rowid from chained_rows3 where table_name='EMP');Table created.SQL> delete from emp where rowid in 2 (select head_rowid from chained_rows3 where table_name='EMP');30 rows deleted.SQL> insert into emp select * from emp_old;30 rows created.SQL> drop table emp_old;Table dropped.SQL> delete from chained_rows where table_name='EMP';30 rows deleted.SQL> commit;Commit complete.SQL> analyze table emp list chained rows into chained_rows;Table analyzed.SQL> select count(*) from chained_rows where table_name='EMP';COUNT(*) ----------0

?

轉載于:https://www.cnblogs.com/myrunning/p/3989554.html

總結

以上是生活随笔為你收集整理的模拟行迁移试验的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。