[Mo Jin original] Oracle clone empty database to build exactly the same database without data
Background
Due to the amount of data brought by the development of platform data, the response time of the platform is slowed down. The technical team decided to enable the database partitioning feature!
target
Partition according to date and month, realize the function of automatic monthly partition of later data, and solve the problem of procrastination of system response caused by data accumulation.
Scheme
1. Add Sql with partition function
2. Whether the existing database can automatically cut historical data
3. Clone empty library
4. Import the old data into the new database
5. Switch to hard work
Realize
1 、...
.
.
3. Clone empty library
-- 301Exporting library (without data) exp CEN_NORM/CEN_NORM@10.16.175.50:1521/xaptdb file=d:/cen_norm.dmp rows=n consistent=y OWNER=CEN_NORM
Core: rows=n consistent=y
Restore to the new library imp CEN_NORM_PART/CEN_NORM_PART@10.16.175.50:1521/xaptdb file=d:/cen_norm.dmp full=y--303 to check consistency select * from dba_constraints where owner='CEN_NORM' and table_name='TB_HIS_MZ_Reg';select * from dba_indexes where owner='CEN_NORM' and table_name='TB_HIS_MZ_Reg'