1. Import Oracle database data into test library environment
172.15.1.51 root kic@test
172.15.1.52 root
Generally, the data is imported into the environment of 52 (the configuration is relatively low), and then the data is imported into the environment of 51 (the environment used in this document)
[root@NC-TEST ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_nctest-lv_root 196G 142G 45G 76% / tmpfs 16G 8.5G 7.2G 55% /dev/shm /dev/sda1 485M 39M 421M 9% /boot /dev/mapper/vg_nctest-lv_home 51G 34G 14G 72% /home //172.16.1.101/backup 8.1T 3.9T 4.3T 48% /mnt/win [root@NC-TEST ~]# cd /home/nc_data_backup/ [root@NC-TEST nc_data_backup]# ll total 19623748 -rw-r-----. 1 oracle oinstall 444667 Sep 19 2017 export.log -rwxr-x--x. 1 oracle oinstall 450379 Nov 9 10:45 import.log -rwxr-xr-x. 1 oracle oinstall 20093812736 Nov 9 10:00 nc63demo_v633_80_version_11_2_0_4_0_20181108.dmp [root@NC-TEST nc_data_backup]# rm -rf nc63demo_v633_80_version_11_2_0_4_0_20181108.dmp # Last imported".dmp"File deletion [root@NC-TEST nc_data_backup]# cp /mnt/win/Database/nc63demo_v633_80_version_11_2_0_4_0_20190411.* /home/nc_data_backup/ # Pull the backup file from the remote server (oracle data file is saved on windows server 2008) to the local directory [root@NC-TEST nc_data_backup]# ll total 22829376 -rw-r-----. 1 oracle oinstall 444667 Sep 19 2017 export.log -rwxr-x--x. 1 oracle oinstall 450379 Nov 9 10:45 import.log -rwxr-xr-x. 1 root root 23375937536 Apr 15 12:18 nc63demo_v633_80_version_11_2_0_4_0_20190411.dmp -rwxr-xr-x. 1 root root 435563 Apr 15 12:18 nc63demo_v633_80_version_11_2_0_4_0_20190411.log
2. Establish oracle database user in test environment and give nc table space permission
[root@NC-TEST nc_data_backup]# su - oracle # Switch to oracle user [oracle@NC-TEST ~]$ sqlplus / as sysdba # Log in to the database with the highest permission SQL> select username, default_tablespace, temporary_tablespace from dba_users; # View user name, default tablespace, temporary tablespace, SQL> set linesize 200; SQL> / USERNAME DEFAULT_TABLESPACE TEMPORARY_TABLESPACE ------------------------------ ------------------------------ ------------------------------ SYS SYSTEM TEMP DBSNMP SYSAUX TEMP SYSMAN SYSAUX TEMP NC63_B2B USERS TEMP TEST USERS TEMP NC633KIC102 NNC_DATA01 TEMP NC633KIC006 NNC_DATA01 TEMP NC633KIC202 NNC_DATA01 TEMP NC633KIC001 NNC_DATA01 TEMP SYSTEM SYSTEM TEMP OUTLN SYSTEM TEMP SQL> create user NC0412 identified by NC0412 default tablespace NNC_DATA01 temporary tablespace temp; # Create user NC0412,Tablespace is NNC_DATA01,Temporary tablespaces are generally temp
User created. SQL> select username, default_tablespace, temporary_tablespace from dba_users; USERNAME DEFAULT_TABLESPACE TEMPORARY_TABLESPACE ------------------------------ ------------------------------ ------------------------------ SYS SYSTEM TEMP DBSNMP SYSAUX TEMP SYSMAN SYSAUX TEMP NC63_B2B USERS TEMP TEST USERS TEMP NC0412 NNC_DATA01 TEMP # User creation complete SYSTEM SYSTEM TEMP SQL> grant connect,dba to NC0412; # Give users connection and dba permission Grant succeeded. SQL> select * from dba_role_privs where grantee='NC0412'; GRANTEE GRANTED_ROLE ADM DEF ------------------------------ ------------------------------ --- --- NC0412 DBA NO YES NC0412 CONNECT NO YES
3. Use the data pump impdp to import the database backup file (expdp is the export command)
SQL> SELECT total.tablespace_name,
Round(total.MB, 2) AS Total_MB,
Round(total.MB - free.MB, 2) AS Used_MB,
Round(( 1 - free.MB / total.MB ) * 100, 2)
|| '%' AS Used_Pct
FROM (SELECT tablespace_name,
Sum(bytes) / 1024 / 1024 AS MB
FROM dba_free_space
GROUP BY tablespace_name) free,
(SELECT tablespace_name,
Sum(bytes) / 1024 / 1024 AS MB
FROM dba_data_files
GROUP BY tablespace_name) total
WHERE free. Tablespace name = total. Tablespace name; view tablespace usage
2 3 4 5 6 7 8 9 10 11 12 13 14
TABLESPACE_NAME TOTAL_MB USED_MB USED_PCT
------------------------------ ---------- ---------- -----------------------------------------
SYSAUX 4990 4745.94 95.11%
UNDOTBS1 32767.98 31693.05 96.72%
USERS 7.5 6 80%
SYSTEM 1800 1793.5 99.64%
NNC_INDEX01 10108 9517.31 94.16%
NNC_DATA01 52474 39853.13 75.95%
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[Oracle @ nc-test ~] $impdp nc0412 / nc0412 (user / password) $dumpfile = nc63demo > v633 > version > 11 > 2 > 0 > 4 > 0 > 20190411.dmp (import file name) directory = dump > dir remap > schema = nc63demo: nc0412
4. Reopen a window (or run the program in the background) to view the import log
Note: generally, the content displayed when importing the log will be slow, subject to the content displayed on the command line
[root@NC-TEST ~]# tail -f /home/nc_data_backup/import.log Import: Release 11.2.0.4.0 - Production on Mon Apr 15 13:11:47 2019 # Backup start time Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "NC0412"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting "NC0412"."SYS_IMPORT_FULL_01": NC0412/******** dumpfile=nc63demo_v633_80_version_11_2_0_4_0_20190411.dmp directory=dump_dir remap_schema=nc63demo:NC0412 Processing object type SCHEMA_EXPORT/USER ORA-31684: Object type USER:"NC0412" already exists # Because users have been created in advance, there will be an error report, which can be ignored Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE # This position in the log will stay for a period of time, loading the table, which is a normal phenomenon. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA # After that, I will stay here for a while . . imported "NC0412"."SM_FILESTOREVIEW" 11.88 GB 17912 rows . . imported "NC0412"."IUFO_TASK_DATA_INSTANCE" 2.417 GB 20093 rows . . imported "NC0412"."SM_BUSILOG_DEFAULT" 741.5 MB 272905 rows . . imported "NC0412"."PUB_WORKINGTASKLOG" 132.7 MB 28595 rows . . imported "NC0412"."IA_DETAILLEDGER" 256.0 MB 214877 rows . . imported "NC0412"."COF_PLANEXECDOC" 234.9 MB 597579 rows #A lot of similar displays will appear later, omitted in the middle . . . . . . . . . . . . . . . . . . ORA-01653: unable to extend table NC0412.IA_I5BILL_B by 128 in tablespace NNC_DATA01 #ORA-01653 reports an error. It is found that the table space is full, but the capacity cannot be expanded
#Solutions
SQL> alter tablespace NNC_DATA01 add datafile '/opt/oracle/oradata/ncerpd/NNC_DATA03.DBF' size 500M autoextend on; # Tablespace expansion command Tablespace altered. . . imported "NC0412"."XX_EXSYSTEMDOC" 0 KB 0 rows . . imported "NC0412"."XX_XSYSREGISTER" 0 KB 0 rows Processing object type SCHEMA_EXPORT/TABLE/COMMENT Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX # Because this location needs to load index, it will stay for a long time and wait patiently Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS # Sure df -h See if disk space is decreasing, or using top Command and iostat,see information Processing object type SCHEMA_EXPORT/VIEW/VIEW Processing object type SCHEMA_EXPORT/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT ORA-39082: Object type VIEW:"NC0412"."KIC_TT_2" created with compilation warnings Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/TRIGGER Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS # So far, it will take a long time to load, but it is near the end. Now we can start to configure ERP data Job "NC0412"."SYS_IMPORT_FULL_01" completed with 20 error(s) at Mon Apr 15 16:05:50 2019 elapsed 0 02:53:46
# So far, the data import is completed, lasting for 02:53:46,It is mainly the time taken to solve the error in the middle. The previous record is 30-40 About minutes
5. Use the visualizer to configure the sysConfig.sh file and start the UFIDA program
xmanager visualizer installation: https://jingyan.baidu.com/article/39810a239e70feb636fda6c6.html
[root@NC-TEST Desktop]# vim /etc/profile # View the java environment variables at the end [root@NC-TEST Desktop]# ulimit -n # Set the maximum number of open files 1024 [root@NC-TEST Desktop]# ulimit -n 65535 [root@NC-TEST Desktop]# ulimit -n 65535 [root@NC-TEST Desktop]# cd /NC633/ [root@NC-TEST NC633]# vim ./startup.sh [root@NC-TEST NC633]# vim ./stop.sh [root@NC-TEST NC633]# vim bin/sysConfig.sh # View the environment variables defined by java in the above three script files [root@NC-TEST NC633]# cd bin/ [root@NC-TEST bin]# ./sysConfig.sh # Start the script of UFIDA software, which must be operated in the visual interface JAVA_HOME environment variable is undefined.Please set it. example: export JAVA_HOME=/opt/jdk1608 export PATH=$JAVA_HOME/bin:$PATH # Error reported, no environment variables loaded [root@NC-TEST bin]# source /etc/profile # Reload environment variables [root@NC-TEST bin]# ./sysConfig.sh # Startup script PLATFORM=Linux x86_64 . JAVA_HOME=/data/javaibm/java . NC_HOME=/NC633 . WAS_HOME= IS_CLUSTER_INSTALL=false WAS_PROFILE= WAS_PROFILE_PATH=/profiles/ Buildfile: /NC633/bin/buildmisc.xml sysConfig: [java] log4j:WARN No appenders could be found for logger (org.java.plugin.boot.DefaultApplicationInitializer). [java] log4j:WARN Please initialize the log4j system properly.