Some time we need to copy one schema from one DB machine to another machine or copy one schema as schema (i.e. remap schema) in same DB. The simplest way is to
(a) export required schema, move dump to remote DB and import [copy in 2 DB]
(b) export required schema and import the dump with schema replace option [copy in same DB]
Scenario ONE
Suppose the source schema is too small (say 1-3 GB) the above process is time consuming and labours compare with task requirements.
Scenario TOW
Suppose the source schema is too big (say 100 GB+) and there is not enough disk space to store the 100G size dump.
In above cases you can use the option of network import. But you need to consider that network import is a slower process because all the data should be travel in connection cable if your target is coping a schema in two different DB machine.
Lets describe how we can achieve this. we move user_info schema from source db to remote db.
STEP 1: grant exp_full_database role to socre shcema [IN REMOTE DB]
conn system/pass;
GRANT EXP_FULL_DATABASE to user_info;
STEP 2: [IN DESTINATION DB] Create destination user and grant necessary roles
conn system/pass;
CREATE USER user_info
IDENTIFIED BY pass
DEFAULT TABLESPACE USER
TEMPORARY TABLESPACE TEMP;
GRANT CONNECT , RESOURCE TO user_info;
STEP 3: [IN DESTINATION DB] grant read/write on dump directory
conn system/pass;
GRANT read,write on DIRECTORY dump_directory to user_info;
Network import does not requer any dump file. This directory is only requer to write the import log file.
STEP 4: [IN DESTINATION DB] create public DB Link
conn system/pass;
CREATE PUBLIC DATABASE LINK SATURN
connect to user_info identified by pass
using '(DESCRIPTION=(
ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=remote_db)
(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=orcl.oracle.com)
(server=DEDICATED)))';
STEP 5: [IN DESTINATION DB MACHINE] execute impdp
impdp user_info/pass directory=dump_dir network_link=SATURN logfile=net_import_proddev.log EXCLUDE=GRANT,STATISTICS,SYNONYM,DB_LINK REMAP_SCHEMA=USER_INFO:USER_INFO
Saturday, July 2, 2011
Wednesday, May 4, 2011
Multiplex online Redo Logfile
It is important to have multiple (at list two) copy of each online redo logfile. To avoid the disaster of disk failure, it is recommended to place each member of a specific online redo logfile group in different disk.
To view to current online redo logfile group members
SELECT GROUP#,STATUS,MEMBER FROM V$LOGFILES;
Suppose we have disk01 (mount point /u01 ) that contains current online redolog files .To add member in redo logfile group 1,2 and 3 in disk02 ( mount point /u02 )
ALTER DATABASE ADD LOGFILE MEMBER '/u02/redo01.log' TO GROUP 1;
ALTER DATABASE ADD LOGFILE MEMBER '/u02/redo02.log' TO GROUP 2;
ALTER DATABASE ADD LOGFILE MEMBER '/u02/redo03.log' TO GROUP 3;
To view to current online redo logfile group members
SELECT GROUP#,STATUS,MEMBER FROM V$LOGFILES;
Suppose we have disk01 (mount point /u01 ) that contains current online redolog files .To add member in redo logfile group 1,2 and 3 in disk02 ( mount point /u02 )
ALTER DATABASE ADD LOGFILE MEMBER '/u02/redo01.log' TO GROUP 1;
ALTER DATABASE ADD LOGFILE MEMBER '/u02/redo02.log' TO GROUP 2;
ALTER DATABASE ADD LOGFILE MEMBER '/u02/redo03.log' TO GROUP 3;
Subscribe to:
Posts (Atom)