Criar Instância e Banco do Sybase IQ pela linha de comando

[sybase@SybaseIQ01 cliente]$ pwd
/home/sybase/cliente
[sybase@SybaseIQ01 cliente]$ ls -lh
total 12K
-rw-rw-r--. 1 sybase sybase 147 Aug 30 18:16 cliente01.sql
-rw-rw-r--. 1 sybase sybase 368 Aug 30 18:22 cliente02.sql
-rw-rw-r--. 1 sybase sybase 541 Aug 30 16:48 iqcliente.cfg
[sybase@SybaseIQ01 cliente]$ cat iqcliente.cfg
# iqdemo.cfg
# ------------------------------------------------------------
# Default startup parameters for the ASIQ demo database
# ------------------------------------------------------------

-n  SybaseIQ01_iqcliente
-x  tcpip{port=2638}

# The following parameters are also found in the configuration file
# /opt/sybase/IQ-15_4/scripts/default.cfg.  Any parameters not specified below
# and not in the start up parameter list, will be added by start_iq
# using default.cfg as a guide.

-c  256m
-gc 20
-gd all
-gl all
-gm 10
-gp 4096
[sybase@SybaseIQ01 cliente]$ start_iq @iqcliente.cfg

Starting server SybaseIQ01_iqcliente on SybaseIQ01 at port 2638 (08/30 18:23:28)

Run Directory       : /home/sybase/cliente
Server Executable   : /opt/sybase/IQ-15_4/bin64/iqsrv15
Server Output Log   : /opt/sybase/IQ-15_4/logfiles/SybaseIQ01_iqcliente.0007.srvlog
Server Version      : 15.4.0.6567/GA
Open Client Version : N/A
User Parameters     : '@iqcliente.cfg'
Default Parameters  : -ti 4400 -gn 25

I. 08/30 18:23:30. Sybase IQ
I. 08/30 18:23:30. Version 15.4
I. 08/30 18:23:30. (64bit mode)
I. 08/30 18:23:30. Copyright 1992-2011 by Sybase, Inc. All rights reserved
I. 08/30 18:23:30. Copyright (c) 2001-2011, Sybase, Inc.
I. 08/30 18:23:30. Portions copyright (c) 1988-2011, iAnywhere Solutions, Inc. All rights reserved.
I. 08/30 18:23:30. Use of this software is governed by the Sybase License Agreement.
I. 08/30 18:23:30. Refer to http://www.sybase.com/softwarelicenses.
I. 08/30 18:23:30.
I. 08/30 18:23:30. Processors detected: 1
I. 08/30 18:23:30. Maximum number of physical processors the server will use: 1
I. 08/30 18:23:30. Running Linux 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 on X86_64
I. 08/30 18:23:30. Server built for X86_64 processor architecture
I. 08/30 18:23:30. 262144K of memory used for caching
I. 08/30 18:23:30. Minimum cache size: 262144K, maximum cache size: 262144K
I. 08/30 18:23:30. Using a maximum page size of 4096 bytes

=============================================================
IQ server starting with:
     10 connections         (       -gm )
     12 cmd resources       ( -iqgovern )
     76 threads             (     -iqmt )
    512 Kb thread stack size   (   -iqtss  )
  38912 Kb thread memory size ( -iqmt * -iqtss )
      1 IQ number of cpus  ( -iqnumbercpus )
      0 MB maximum size of IQMSG file ( -iqmsgsz )
      0 copies of IQMSG file archives ( -iqmsgnum )
=============================================================

I. 08/30 18:23:30. Database server started at Thu Aug 30 2012 18:23
I. 08/30 18:23:30. Trying to start SharedMemory link ...
I. 08/30 18:23:30.     SharedMemory link started successfully
I. 08/30 18:23:30. Trying to start TCPIP link ...
I. 08/30 18:23:30. Starting on port 2638
I. 08/30 18:23:35.     TCPIP link started successfully
I. 08/30 18:23:35. Now accepting requests
New process id is 5770

Server started successfully
[sybase@SybaseIQ01 cliente]$ cat cliente01.sql
CREATE DATABASE '/home/sybase/cliente/cliente.db' IQ PATH '/dev/raw/raw1' MESSAGE PATH 'home/sybase/cliente/cliente.iqmsg' TEMPORARY PATH '/dev/raw/raw2';
[sybase@SybaseIQ01 cliente]$ dbisqlc -q -c "uid=DBA;pwd=sql;eng=SybaseIQ01_iqcliente;dbn=utility_db;links=tcpip{host=SybaseIQ01;port=2638}" cliente01.sql
[sybase@SybaseIQ01 cliente]$
[sybase@SybaseIQ01 cliente]$ cat cliente02.sql
CREATE DBSPACE iq_main USING FILE iq_main '/dev/raw/raw3' IQ STORE;

GRANT CREATE ON iq_main to PUBLIC ;
REVOKE CREATE ON IQ_SYSTEM_MAIN from PUBLIC ;
set option PUBLIC.default_dbspace='iq_main' ;

GRANT CONNECT TO "DBA" IDENTIFIED BY "sql";
GRANT RESOURCE, DBA TO "DBA";
COMMENT ON USER "DBA" IS 'The database administrator. The DBA can alter schema.';

commit work;
[sybase@SybaseIQ01 cliente]$ dbisqlc -q -c "uid=DBA;pwd=sql;eng=SybaseIQ01_iqcliente;dbn=cliente;dbf=cliente;links=tcpip{host=SybaseIQ01;port=2638}" cliente02.sql
[sybase@SybaseIQ01 cliente]$
[sybase@SybaseIQ01 cliente]$ ls -lh
total 4.5M
-rw-rw-r--. 1 sybase sybase  147 Aug 30 18:16 cliente01.sql
-rw-rw-r--. 1 sybase sybase  368 Aug 30 18:22 cliente02.sql
-rw-rw-r--. 1 sybase sybase  724 Aug 30 18:27 cliente03.sql
-r--r--r--. 1 sybase sybase 3.6M Aug 30 18:53 cliente.db
-rw-r--r--. 1 sybase sybase 573K Aug 30 18:53 cliente.iqmsg
-rw-rw-r--. 1 sybase sybase  409 Aug 30 18:24 cliente.lmp
-r--------. 1 sybase sybase 320K Aug 30 18:53 cliente.log
-rw-rw-r--. 1 sybase sybase  541 Aug 30 16:48 iqcliente.cfg
[sybase@SybaseIQ01 cliente]$
[sybase@SybaseIQ01 cliente]$ stop_iq

Checking system ...

The following 1 server(s) are owned by 'sybase'

## Owner          PID   Started  CPU Time  Additional Information
-- ---------  -------  --------  --------  ------------------------------------
1: sybase        5770     18:23  00:03:12  SVR:SybaseIQ01_iqcliente DB:none PORT:2638
              /opt/sybase/IQ-15_4/bin64/iqsrv15 @iqcliente.cfg -ti 4400 -gn 25 -o /opt/sybase/IQ-15_4/logfiles/SybaseIQ01_iqcliente.0007.srvlog -hn 5
--

        Please note that 'stop_iq' will shut down a server completely
        without regard for users, connections, or load process status.
        For more control, use the 'dbstop' utility, which has options
        that control stopping servers based on active connections.

Do you want to stop the server displayed above ? Y

Shutting down server (5770) ...
Checkpointing server (5770) ...
Server shutdown.

[sybase@SybaseIQ01 cliente]$ start_iq @iqcliente.cfg cliente.db

Starting server SybaseIQ01_iqcliente on SybaseIQ01 at port 2638 (08/30 19:03:11)

Run Directory       : /home/sybase/cliente
Server Executable   : /opt/sybase/IQ-15_4/bin64/iqsrv15
Server Output Log   : /opt/sybase/IQ-15_4/logfiles/SybaseIQ01_iqcliente.0008.srvlog
Server Version      : 15.4.0.6567/GA
Open Client Version : N/A
User Parameters     : '@iqcliente.cfg' 'cliente.db'
Default Parameters  : -ti 4400 -gn 25

I. 08/30 19:03:13. Sybase IQ
I. 08/30 19:03:13. Version 15.4
I. 08/30 19:03:13. (64bit mode)
I. 08/30 19:03:13. Copyright 1992-2011 by Sybase, Inc. All rights reserved
I. 08/30 19:03:13. Copyright (c) 2001-2011, Sybase, Inc.
I. 08/30 19:03:13. Portions copyright (c) 1988-2011, iAnywhere Solutions, Inc. All rights reserved.
I. 08/30 19:03:13. Use of this software is governed by the Sybase License Agreement.
I. 08/30 19:03:13. Refer to http://www.sybase.com/softwarelicenses.
I. 08/30 19:03:13.
I. 08/30 19:03:13. Processors detected: 1
I. 08/30 19:03:13. Maximum number of physical processors the server will use: 1
I. 08/30 19:03:13. Running Linux 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 on X86_64
I. 08/30 19:03:13. Server built for X86_64 processor architecture
I. 08/30 19:03:13. 262144K of memory used for caching
I. 08/30 19:03:13. Minimum cache size: 262144K, maximum cache size: 262144K
I. 08/30 19:03:13. Using a maximum page size of 4096 bytes

=============================================================
IQ server starting with:
     10 connections         (       -gm )
     12 cmd resources       ( -iqgovern )
     76 threads             (     -iqmt )
    512 Kb thread stack size   (   -iqtss  )
  38912 Kb thread memory size ( -iqmt * -iqtss )
      1 IQ number of cpus  ( -iqnumbercpus )
      0 MB maximum size of IQMSG file ( -iqmsgsz )
      0 copies of IQMSG file archives ( -iqmsgnum )
=============================================================

I. 08/30 19:03:13. Starting database "cliente" (/home/sybase/cliente/cliente.db) at Thu Aug 30 2012 19:03
I. 08/30 19:03:13. Transaction log: cliente.log
I. 08/30 19:03:13. Starting checkpoint of "cliente" (cliente.db) at Thu Aug 30 2012 19:03
I. 08/30 19:03:13. Finished checkpoint of "cliente" (cliente.db) at Thu Aug 30 2012 19:03
I. 08/30 19:03:14. Database "cliente" (cliente.db) started at Thu Aug 30 2012 19:03
I. 08/30 19:03:14. IQ Server SybaseIQ01_iqcliente.
I. 08/30 19:03:14. Database server started at Thu Aug 30 2012 19:03
I. 08/30 19:03:14. Trying to start SharedMemory link ...
I. 08/30 19:03:14.     SharedMemory link started successfully
I. 08/30 19:03:14. Trying to start TCPIP link ...
I. 08/30 19:03:14. Starting on port 2638
I. 08/30 19:03:19.     TCPIP link started successfully
I. 08/30 19:03:19. Now accepting requests
New process id is 6262

Server started successfully
[sybase@SybaseIQ01 cliente]$

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.