Custom Search
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




Of Interest

Business Intelligence and Analytics



Oracle Training





Sybase » Administration » DBA » Sybase IQ

Sybase IQ: Copying users/logins between databases

     

With ASE, it's easy to BCP out syslogins data and copy to another server. With IQ, however, SYSUSERPERM is not available for direct updates. Thus, another tact is needed, to copy a login from on server to another, without knowing the password. Overall steps: a) Use SQL to select the necessary source data, b) run a Perl filter to build SQL statements, c) run the SQL into the target IQ server.
How to use the scripts listed below:
1) copy the Perl code to iq_encrypt.pl
2) copy the shell script to iq_encrypt.sh
3) chmod 700 .. for both files
4) Make sure your IQ DB client is accessible and working
5) Run the shell script: e.g. ./iq_encrypt.sh HELENA jsmith

 #!/usr/bin/perl
 #========================================
 #
 # iq_encrypt.pl
 #
 # Params: sourcefile  targetfile
 #========================================
 
 $fname1=$ARGV[0];
 $fname2=$ARGV[1];
 
 open(FILE1, "<$fname1") or die "Error .. FILE1" ;
 open(FILE2, ">$fname2") or die "Error .. FILE2" ;
 
 while ()
   {
   $line1 = $_ ;
 
   @line1 = split ' ', $line1 ;
 
   $user = shift @line1 ;
   $X    = shift @line1 ;
 
   $i = 0 ;
   $z = length($X);
   $Z = '' ;
 
   while ($i < $z)
     {
     $Z = $Z . '\x' . substr($X,$i,2) ;
 
     $i ++;
     $i ++;
     }
 
   print FILE2 "grant connect,resource to $user identified by \n " . "'" . $Z . "'" . "; \n\n"  ;
   }
 
 close(FILE1);
 close(FILE2);
 

 #!/bin/bash
 #========================================
 #
 # iq_encrypt.sh
 #
 # Parms:    
 #
 #========================================
 
 iqserver=$1
 iquser=$2
 iqisql=/opt/sybaseiq/util/scripts/iq_isql.sh
 tfile1=/opt/sybaseiq/util/temp/encrypt.dat
 tfile2=/opt/sybaseiq/util/temp/encrypt.sql
 
 cd /opt/sybaseiq/util/scripts
 pwd
 
 echo "SQL Prep ..."
 
 cat iq_encrypt.sql | sed "s|IQUSER|$iquser|" > _iq_encrypt.sql
 
 echo "Examining user ..."
 
 $iqisql $iqserver _iq_encrypt.sql | grep $iquser > $tfile1
 
 echo "Perl processing ..."
 
 ./iq_encrypt.pl $tfile1 $tfile2
 
 echo "Ready.  You can now run the SQL displayed below against the target IQ server."
 echo " " ; echo " "
 
 cat $tfile2
 
 







Sybase : Related Topics

Sybase : Administration : Post-installation check
Sybase : Administration : Device initialization
Sybase : Administration : Database Creation
Sybase : Administration : A backup routine
Sybase : Administration : Striping Dump Devices
Sybase : Administration : Moving the transaction log to another device
Sybase : Administration : Adding a segment to a database
Sybase : Administration : Configuring the cache
Sybase : Administration : Apply multiple transaction dumps
Sybase : Administration : Database maintenance procedure
Sybase : Administration : Database maintenance script
Sybase : Administration : Server configuration
Sybase : Administration : Dealing with a Corrupted Database
Sybase : Administration : Dealing with a Server Failure
Sybase : Administration : DBCC Notes
Sybase : Administration : Create proxy tables and external logins
Sybase : Administration : Renaming a database
Sybase : Administration : Reorg: rebuilding a table
Sybase : Administration : Sybase ASE 15 Enhancements
Sybase : Administration : Setting the thresholds
Sybase : Administration : Apply a transaction dump
Sybase : Administration : Security Tasks
Sybase : Administration : Setting Process Priorities
Sybase : Administration : Sybase ASE Architecture Overview
Sybase : Administration : Drop an alias, with objects linked to login
Sybase : Administration : Display grants, effective rights to objects
Sybase : Administration : Displaying access information from sysprotects
Sybase : Administration : Database Engines: Status and Settings
Sybase : Administration : Replication Server 15 Configuration
Sybase : Administration : Loading data into Sybase IQ from a Remote Server
Sybase : Administration : Sybase IQ Overview
Sybase : Administration : Sybase IQ Functions
Sybase : Administration : Sybase IQ - Remote Access From ASE
Sybase : Administration : Sybase IQ : Procedure Profiling / Monitoring
Sybase : Administration : Sybase IQ: Restoring a Database from Dump Files
Sybase : Administration : Sybase IQ: Minimize Storage option
Sybase : Administration : Sybase IQ: Index Types
Sybase : Administration : Sybase IQ: HUGEPAGE Support
Sybase : Administration : Sybase IQ: Database Creation (Raw Devices)
Sybase : Administration : Sybase IQ : Repairing Problems / Troubleshooting Corruption
Sybase : Administration : Sybase IQ : Moving / Re-allocating / Re-org
Sybase : Administration : Sybase IQ: Sysmon / System Performance Analysis
Sybase : Administration : Sybase IQ: Monitoring Connections / Processes
Sybase : Administration : Sybase ASE: Installing a new server via srvbuildres utility
Sybase : Administration : Sybase IQ: Managing User Accounts
Sybase : Administration : Sybase ASE: Database Schema Compare
Sybase : Administration : Sybase IQ: Listing tables, ordered by size allocated
Sybase : Administration : Sybase IQ : Comparing grants / permissions between servers
Sybase : Administration : Sybase ASE: Database page size
Sybase : Administration : Sybase ASE: Managing users and roles
Sybase : Administration : Sybase ASE: Setting resource limits for users
Sybase : Administration : Sybase ASE: Setting up user assigned custom tempdbs
Sybase : Administration : Sybase ASE: Setting up the transaction log cache using logiosize
Sybase : Administration : Sybase IQ: Server Startup Switches
Sybase : Administration : Sybase ASE: Managing Identity Columns
Sybase : Administration : Sybase IQ: Working with options and server settings
Sybase : Administration : Sybase IQ: Monitoring and Troubleshooting via System Procedures

Sybase Web Site
Sybase iAnywhere Mobile Web Site
Oracle Enterprise Web Site



Get the latest Rocket99 news and tech tips via






Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2016 Stoltenbar Inc All Rights Reserved.