0% found this document useful (0 votes)
63 views14 pages

11.aexport Eng

Uploaded by

CSK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views14 pages

11.aexport Eng

Uploaded by

CSK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

♦ Located in $ALTIBASE_HOME/bin

♦ A tool for automated data migration between databases


♦ Saves a script file in SQL form for creating ALTIBASE HDB
objects

$ aexport
-----------------------------------------------------------
Altibase Export Script Utility.
Release Version 6.1.1.0
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------
Write Server Name (default:127.0.0.1) :
Write UserID : sys
Write Password : manager
 The aexport.properties file
♦ $ALTIBASE_HOME/conf/aexport.properties
♦ File must exist before this utility can be executed.
• Otherwise, the following error will occur:
• [ERR-91066 : Property File Loading Error.(conf/aexport.properties)]
♦ The symbol "#“ indicates a comment inside the configuration file
♦ Two options for setting delimiters when creating an iLoader script:
• - ILOADER_FIELD_TERM = ^
• - ILOADER_ROW_TERM = %n
• Maximum 10 characters long
• Ensure that they do not appear in the data.
• If the above options are commented out, the iLoader shell script created
in aexport will export data in CSV format.
 aexport options
Option Description

-s The IP of the ALTIBASE HDB Server to which to connect


ALTIBASE HDB User name (For accounts other than sys, only
-u
information pertaining to that user is output)
-p The password for the user

-port The port number with which to connect to ALTIBASE HDB

-object The name(s) of objects to export and their owners

-tserver The server to which the exported data will later be uploaded

-tport The port number with which to access the destination server
ALTIBASE HDB Character set information
-nls_use (An appropriate character set should be specified if it is expected
that Korean characters are used in comments, etc.)

※–tserver and -tport are not for the local server, but for the destination server,
to which data are uploaded when the script is subsequently executed
 Example
♦ Execution in Full DB Mode
$ aexport -s 127.0.0.1 –u sys –p manager
-------------------------------------------------------------
Altibase Export Script Utility.
Release Version 6.1.1.0
Copyright 2000, ALTIBASE Corporation or its
subsidiaries.
All Rights Reserved.
-------------------------------------------------------------

##### TBS #####


##### USER #####
** input user USER1's password(default - same with USER_NAME):
USER1

※ Executes automatically after the password of each user is input


 Example
♦ Execution in Full DB Mode
##### SYNONYM #####
##### DIRECTORY ##### Database structure
and contents can
##### TABLE #####
be output using
##### QUEUE #####
created script files
##### SEQUENCE #####
##### DATABASE LINK #####
##### VIEW #####
##### STORED PROCEDURE #####
##### TRIGGER #####
##### REPLICATION #####
-------------------------------------------------------
##### Follow script files are Generated. #####
1. run_il_out.sh : [ iloader formout, data-out script ]
2. run_is.sh : [ isql table-schema script ]
3. run_il_in.sh : [ iloader data-in script ]
4. run_is_index.sh : [ isql table-index script ]
5. run_is_fk.sh : [ isql table-foreign key script ]
6. run_is_repl.sh : [ isql replication script ]
-------------------------------------------------------
 Example
♦ Execution in Full DB Mode
$ ls –al
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_DIR.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_FK.sql
-rw-r--r-- 1 jjl3 staff 1175 Mar 22 13:55 ALL_CRT_INDEX.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_LINK.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_REP.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_SEQ.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_SYN.sql
-rw-r--r-- 1 jjl3 staff 5175 Mar 22 13:55 ALL_CRT_TBL.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_TBS.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_TRIG.sql
-rw-r--r-- 1 jjl3 staff 412 Mar 22 13:55 ALL_CRT_USER.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 13:55 ALL_CRT_VIEW_PROC.sql
-rw-r--r-- 1 jjl3 staff 1596 Mar 22 13:55 run_il_in.sh
-rw-r--r-- 1 jjl3 staff 2323 Mar 22 13:55 run_il_out.sh
-rw-r--r-- 1 jjl3 staff 448 Mar 22 13:55 run_is.sh
-rw-r--r-- 1 jjl3 staff 110 Mar 22 13:55 run_is_fk.sh
-rw-r--r-- 1 jjl3 staff 57 Mar 22 13:55 run_is_index.sh
-rw-r--r-- 1 jjl3 staff 55 Mar 22 13:55 run_is_repl.sh
 Example
♦ Execution in User Mode
$ aexport -s 127.0.0.1 -u user1 -p user1
---------------------------------------------------------------
Altibase Export Script Utility.
Release Version 6.1.1.0
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
---------------------------------------------------------------
##### USER #####
##### SYNONYM #####
##### TABLE #####
##### QUEUE #####
##### SEQUENCE #####
##### DATABASE LINK #####
##### VIEW #####
##### STORED PROCEDURE #####
##### TRIGGER #####
Database structure
and contents can
 Example be output using
created script files
♦ Execution in User Mode
-------------------------------------------------------
##### Follow script files are Generated. #####
1. run_il_out.sh : [ iloader formout, data-out script ]
2. run_is.sh : [ isql table-schema script ]
3. run_il_in.sh : [ iloader data-in script ]
4. run_is_index.sh : [ isql table-index script ]
5. run_is_fk.sh : [ isql table-foreign key script ]
6. run_is_repl.sh : [ isql replication script ]
-------------------------------------------------------
 Example
♦ Execution in User Mode

$ ls –al
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_DIR.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_FK.sql
-rw-r--r-- 1 jjl3 staff 117 Mar 22 15:13 USER1_CRT_INDEX.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_LINK.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_SEQ.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_SYN.sql
-rw-r--r-- 1 jjl3 staff 560 Mar 22 15:13 USER1_CRT_TBL.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_TRIG.sql
-rw-r--r-- 1 jjl3 staff 197 Mar 22 15:13 USER1_CRT_USER.sql
-rw-r--r-- 1 jjl3 staff 0 Mar 22 15:13 USER1_CRT_VIEW_PROC.sql
-rw-r--r-- 1 jjl3 staff 134 Mar 22 15:13 run_il_in.sh
-rw-r--r-- 1 jjl3 staff 193 Mar 22 15:13 run_il_out.sh
-rw-r--r-- 1 jjl3 staff 407 Mar 22 15:13 run_is.sh
-rw-r--r-- 1 jjl3 staff 114 Mar 22 15:13 run_is_fk.sh
-rw-r--r-- 1 jjl3 staff 59 Mar 22 15:13 run_is_index.sh
-rw-r--r-- 1 jjl3 staff 57 Mar 22 15:13 run_is_repl.sh
 Example
♦ Execution in Object Mode
$ aexport -s 127.0.0.1 -u user1 -p user1 -object user1.t1
-----------------------------------------------------------------
Altibase Export Script Utility.
Release Version 6.1.1.0
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------------
##### TABLE #####
$ ls
user1_t1_CRT.sql
$ aexport -s 127.0.0.1 -u user1 -p user1 -object
user1.t1,user1.v1,user1.proc1
-----------------------------------------------------------------
Altibase Export Script Utility.
Release Version 6.1.1.0
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------------
##### TABLE #####
##### VIEW #####
##### STORED PROCEDURE #####
 SQL scripts created using aexport
♦ Full DB Mode: Can only be executed by the SYS user
File Name Description
SYS_CRT_DIR.sql SQL script for creating all directory objects
SYS_CRT_USER.sql SQL script for creating all DB users
SYS_CRT_REP.sql SQL script for creating replication objects
SYS_CRT_SYNONYM.sql SQL script for creating all synonym objects
ALL_CRT_VIEW_PROC.sql SQL script for creating all views and procedures
ALL_CRT_TBS.sql SQL script for creating all tablespaces
ALL_CRT_TBL.sql SQL script for creating all user tables
ALL_CRT_INDEX.sql SQL script for creating all user indexes
ALL_CRT_FK.sql SQL script for creating all user foreign keys
ALL_CRT_TRIG.sql SQL script for creating all user triggers
ALL_CRT_SEQ.sql SQL script for creating all user sequences
SQL script for creating all user Database Link
ALL_CRT_LINK.sql
objects
 SQL scripts created using aexport
♦ User Mode: Can be executed by SYS or the designated user
File Name Description
(user_name)_CRT_TBL.sql For creating all of the user’s tables
(user_name)_CRT_INDEX.sql For creating all of the user’s indexes
(user_name)_CRT_FK.sql For creating all of the user’s foreign keys
(user_name)_CRT_TRIG.sql For creating all of the user’s triggers
(user_name)_CRT_SEQ.sql For creating all of the user’s sequences
(user_name)_CRT_LINK.sql For creating all of the user’s Database Link objects

♦ Object Mode: Can be executed by SYS or the designated user


File Name Description

(user_name)_(obj_name)_CRT.sql For creating the designated user object


 Executable shell files created by aexport
File name Description
Creates tablespaces, DB users, tables, procedures, and views
run_is.sh
Grants permissions to users
Creates indexes, foreign keys, triggers??, and replication
run_is_con.sh objects
Created when the TWO_PHASE_SCRIPT property is set to ON
Creates foreign keys
run_is_fk.sh
Not created when the TWO_PHASE_SCRIPT property is ON
Creates indexes
run_is_index.sh
Not created when the TWO_PHASE_SCRIPT property is ON
Creates replication objects
run_is_repl.sh
Not created when the TWO_PHASE_SCRIPT property is ON
run_il_in.sh Uploads data
run_il_out.sh Downloads data
※ When using the –tserver and –tport options, the server IP information in run_il_out.sh
must be changed to that of the local server (the server from which to output data)
 Procedure for Copying a Database using aexport
1. On source: back up object information to script files using aexport
2. On source: execute run_il_out.sh (created by aexport) to back up data
3. Transfer all files created in steps 1 and 2 from source to destination
4. Create and start up database on destination
5. Execute run_is.sh on destination (creates tablespaces, DB users and tables)
6. Execute run_il_in.sh on destination (uploads data)
7. Execute run_is_index.sh on destination (creates indexes)
8. Execute run_is_fk.sh on destination (creates foreign keys)

※ If the same DB objects already exist on the destination machine


- Omit step no.5
- TRUNCATE all the tables on the destination machine before uploading data

※ If the TWO_PHASE_SCRIPT property is set to ON, execute run_is_con.sh in


place of steps 7 and 8

You might also like