Sponsored Content
Full Discussion: Script for database task.
Top Forums Shell Programming and Scripting Script for database task. Post 302999045 by Maddy123 on Monday 12th of June 2017 05:35:35 PM
Old 06-12-2017
Hi RudiC,

1. Here is the content of script.

Code:
oracle@testserver:~> cat usercreation.sh
echo "Enter the username to create"
  read Username
   echo "enter the password for the user"
    read Password
     echo "Enter the SID "
      read SID
       echo "create user $Username identified by $Password;
        grant connect,resource to $Username;
         exit
          " | sqlplus / as sysdba@$SID



2. This is how I execute the script.

Code:
oracle@testserver:~> ./usercreation.sh
Enter the username to create
maddy                              -- Here I enter the username 
enter the password for the user
maddy123                           --- Here I enter the new password 
Enter the SID
Demo                                --- Here I enter the database name

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 12 14:24:56 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
User created.                      --- Here the user got created.

SQL>
Grant succeeded.                   --- Here it grants privileges (connect,resource) to user.

Regards,
Maddy
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

2. Shell Programming and Scripting

Parse an XML task list to create each task.xml file

I have an task definition listing xml file that contains a list of tasks such as <TASKLIST <TASK definition="Completion date" id="Taskname1" Some other <CODE name="Code12" <Parameter pname="Dog" input="5.6" units="feet" etc /Parameter> <Parameter... (3 Replies)
Discussion started by: MissI
3 Replies

3. Shell Programming and Scripting

last task for my script

hi, infile- create table salary ( occupation_code char(40), earnings decimal(10,2), occ_yearend integer ); outfile- salary:create table salary salary:( occupation_code char(40), salary: earnings decimal(10,2), salary: occ_yearend integer salary:); Thanks. (4 Replies)
Discussion started by: dvah
4 Replies

4. Shell Programming and Scripting

command task script

ksh $CODE/dis/scripts/IS_BTEQ_LZ_TABLE_AUDIT.sh DIS_BTEQ LZ_DIS_LOAD_LOG_KEY > $CODE/dis/logs/lz_table_audit_`date '+%Y%m%d_%H%M%S'`.log 2>&1 Can some one tell me what the above script is doing? As per my understanding we are executing the script and sending the output to a log file. The... (4 Replies)
Discussion started by: karthikkasarla
4 Replies

5. Shell Programming and Scripting

Running the calling script/task as per day

Hello all.. i have few task to do on specific day ar per weekday or weekend... for example i have 3 tasks: task1 task2 task3 Now i need to create a shell script If it is weekday it will change the status of these tasks as below sendevent -E CHANGE_STATUS -s SUCCESS -J task1... (4 Replies)
Discussion started by: j_panky
4 Replies

6. Shell Programming and Scripting

Can any programmer do this task in shell script...

input file's one set header is this, ----------------------------------------------------- OUTPUT FROM ASCII FILE: CAST #1 ----------------------------------------------------- CC Cruise Latitude Longitude YYYY MM DD Time Cast #Levels CA 8504 50.083 -144.883 1970 1 2... (6 Replies)
Discussion started by: Akshay Hegde
6 Replies

7. Shell Programming and Scripting

Whether Shell script can do this task ???

In following attached 748phy.xls file, fifth column is ST_Date, which contains time and dates in this format 22-11-2012 7:54:54 PM in single column I want it to split in this format either 1st column 22/11/2012 and in second column 7:54:54 PM Or like this in separate... (13 Replies)
Discussion started by: Akshay Hegde
13 Replies

8. Shell Programming and Scripting

Run a task in a script at a particular time

I have an ETL process that triggers a shell script. This script picks the files created by the ETL process and does an SFTP. These are huge files. Due to infrastructure limitations, we need to trigger the actual SFTP part only during the 2nd, 16th, 31st and 46th minute of an hour. Please let me... (2 Replies)
Discussion started by: vskr72
2 Replies

9. Homework & Coursework Questions

Script performs the right task but fails against check

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a script checkFiles.sh that takes an arbitrary number of file paths from the command line and carries ... (5 Replies)
Discussion started by: Ezraek
5 Replies

10. Shell Programming and Scripting

Windows Task with Bash script

Hello I have a problem with use bash script in windows task. If I use script by cygwin it's working well. If I use it by Windows task I'm get error Error : ERROR 2 (HY000) at line 2: File '.\xxx.csv' not found (Errcode: 2) Code Line : load data local infile './xxx.csv' REPLACE into... (16 Replies)
Discussion started by: karp
16 Replies
BAK2DB.PL(8)						      System Manager's Manual						      BAK2DB.PL(8)

NAME
bak2db.pl - Directory Server perl script for restoring a backup SYNOPSIS
bak2db.pl -a archivedir [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-t dbtype] [-n backendname] [-P protocol] [-v] [-h] DESCRIPTION
Restores a database from a backup. The Directory Server must be started prior to running this script. OPTIONS
A summary of options is included below: -a archivedir The directory of the archived database. -Z Server Identifier The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped. -D Root DN The Directory Manager DN, or root DN. If not specified, the script will search the server instance configuration for the value. -w password The rootdn password. -w - Prompt for the rootdn password. -j password filename The name of the file that contains the root DN password. -t database type The backend database type (default: ldbm database). -n Backend Name The name of the LDBM database to restore. Example: userRoot -P Protocol The connection protocol to connect to the Directory Server. Protocols are STARTTLS, LDAPS, LDAPI, and LDAP. If this option is skipped, the most secure protocol that is available is used. For LDAPI, AUTOBIND is also available for the root user. -v Display verbose ouput -h Display usage EXAMPLE
bak2db.pl -a /LDAP/backups/20130305/ -D 'cn=directory manager' -w password -n userRoot -P LDAPS Note: security must be enabled to use protocol LDAPS. If LDAPS is not available it will default to next strongest/available proto- col automatically. bak2db.pl -a /LDAP/backups/20130305/ -Z instance2 -w password -n example -P LDAPI DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. AUTHOR
bak2db.pl was written by the 389 Project. REPORTING BUGS
Report bugs to http://bugzilla.redhat.com. COPYRIGHT
Copyright (C) 2013 Red Hat, Inc. Mar 5, 2013 BAK2DB.PL(8)
All times are GMT -4. The time now is 10:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy