Target DB Operations

The chapters in this part explain the procedures for installing target DB, Tibero 7.

The steps for the operations are as follows :

  1. Installation

  2. Execution of Import

  3. Post-processing

1. Installation

The installation process for Tibero 7 is as follows:

1) Basic procedure

Refer to “Tibero Installation Guide” for basic procedure.

2) File configuration

Tibero Initial Parameter(tip file)

The TIP is under the file name $TB_SID.tip in $TB_HOME/config.

Some parameters used in Tibero 6 may have been changed or removed, so it is necessary to check their applicability in Tibero 7.

Additionally, if hidden parameters starting with _ are being used, their applicability in Tibero 7 should also be verified.

tbdsn.tbr

The basic syntax of tbdsn.tbr is the same as in Tibero 6, and previously used aliases should be added.

tb6=(
(INSTANCE=(HOST=192.168.1.129) 
(PORT=8629)
(DB_NAME=tb6) 
)
hidden=(
(INSTANCE=(HOST=192.168.1.129) 
(PORT=8630)
(DB_NAME=tb6) 
)

Additional files

If the following configuration files are used in the Source DB, they should also be applied to the corresponding configuration files in Tibero 7.

  • ESQL

$TB_HOME/client/config/tbpc.cfg
$TB_HOME/client/config/tbpcb.cfg

  • C/JAVA External Procedure

$TB_HOME/client/epa/java/config/tbepa.cfg
(For Tibero 6: $TB_HOME/client/epa/java/config/epa.cfg)

  • DB Link related Gateway

$TBGW_HOME/oracle/config/tbgw.cfg
$tbJavaGW/tbgw.cfg(For Tibero 6: $tbJavaGW/jgw.cfg)

  • External Procedure (Copy so or class file) If the OS and BIT of the source DB and target DB are the same, copy them, and if they are different, recompile using the original source.

  • Directory related file Copy the files from the query result of "Check Directory” in Checklist and Check Methods.

3) Creating Database

Modify settings to align with the settings of Tibero6 referring to "Checklist and Check Methods", and create database. Post-processing should be applied in Archivelog mode.

create database
user sys identified by tibero
character set MSWIN949 
national character set UTF16
logfile group 0 ('log001.log','log002.log') size 50M,
group 1 ('log011.log','log012.log') size 50M,
group 2 ('log021.log','log022.log') size 50M
maxdatafiles 8192
maxlogfiles 100
maxlogmembers 8
noarchivelog
datafile 'system001.dtf' size 1G autoextend on next 256M maxsize unlimited 
default tablespace USR
datafile 'usr001.dtf' size 1G autoextend on next 256M maxsize unlimited    
default temporary tablespace TEMP
tempfile 'temp001.dtf' size 1G autoextend off
undo tablespace UNDO
datafile 'undo001.dtf' size 1G autoextend off
SYSSUB datafile 'syssub001.dtf' size 1G autoextend on next 32M maxsize unlimited;

4) Executing system.sh

$TB_HOME/scripts/system.sh


2. Import

The steps for importing is as follows.

1) Creating User Tablespace

Open the tibero6_exp.log file, which was generated from tbexport, and refer to CREATE TABLESPACE syntaxes to adjust the data file paths and size. However, the SYSTEM, UNDO, TEMP, USR parts created in CREATE DATABASE will not be created.

2) Creating User

Open the tibero6_exp.log file, which was generated from tbexport,, and refer to CREATE USER syntaxes to adjust the USER’s password, default_tablespace, and other settings.

3) Executing tbimport

Copy the exported data file, and import them in Database(FULL) mode of tbimport.

The following command is for using tbimport on Target DB server.

tbimport username={sys | dba account} password=<password> port=<port_no> sid=<SID>
file=<file name> log=<log-file name> full=y script=y ignore=y
Category
Details

Username

The account for importing DB (Choose one from Sys or DBA account.)

Password

The password for importing DB account

port

The port number for importing DB

sid

The name for importing DB

file

The name for imorted file in Tibero 6

log

The name for created log

The following is an example of tbimport usage for Tibero 7 on Source DB server.

tbimport username=sys password=pwd port=8629 sid=tb7 
file=tibero6_all.dat log=tibero7_imp.log full=y ignore=y


3. Post-processing

1) Processing for Unsupported lists

Execute the following syntaxes in a form of Source DB script for unsupported lists.

JOB

DECLARE
job_no number;
BEGIN
DBMS_JOB.SUBMIT(job_no,'dbms_output.put_line(''ok'');',SYSDATE,'SYSDATE+1');
END;
/

CREATE DATABASE LINK olink CONNECT TO scott IDENTIFIED BY 'tiger' USING 'oragw';

External Procedure - Library

CREATE OR REPLACE LIBRARY extproc IS '/home/tibero/cepa/libextproc.so';

External Procedure – JAVA SOURCE

CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "JavaExtproc" AS
public class SimpleMath {
public static int findMax(int x, int y) {
if (x >= y) return x;
else return y;
}
}
/

Wrapped PL/SQL

CREATE OR REPLACE PROCEDURE wrap_test WRAPPING
IS
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello World');
END;
/

Change the path of the directory

CREATE OR REPLACE DIRECTORY dir_ext AS '/home/tibero/t7/work/external/external'
/

2) Applying Archive mode

Apply this mode if the Tibero 6 was in Archive mode, or if Archive operation is required.

Exiting DB

tbdown immediate

Booting Mount mode

tbboot -t mount

Changing mode

tbsql sys/tibero
SQL> alter database archivelog;

Exiting DB and booting DB

tbdown immediate
tbboot

Confirming

tbsql sys/tibero
SQL> SHOW PARAM LOG_ARCHIVE_DEST
NAME                    TYPE     VALUE
----------------------- -------- --------------------------------------------
LOG_ARCHIVE_DEST        DIRNAME  /home/tibero/t7/tibero7/database/t7/archive/

SQL> alter system switch logfile;
System altered.

SQL> !ls -la /home/tibero/t7/tibero7/database/t7/archive/
total 23572
-rw-------. 1 tibero dba 24126976 Apr 4 22:40 log-t0-r0-s1.arc

SQL> select log_mode from v$database;
LOG_MODE
-------------- -
ARCHIVELOG

Last updated