Shell script from batch file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script from batch file
# 1  
Old 03-31-2014
Shell script from batch file

Hi,

I am a junior dba and started carrier very new. I have a batch file to create some script of db creation. I want that batch file to convert in .sh file so that I can directly run that in the AIX box to generate those files.

Please help me with the code for AIX. Batch file is here:

__________________________________________________________
Code:
@echo off
set db_sid=%1%
echo "Enter db_sid"
set /p db_sid=
set mem_target=%2%
echo "Enter Mem_target"
set /p mem_target=
set hostname=%3%
echo "Enter Hostname in Uppercase"
set /p hostname=
set domainname=%4%
echo "Enter Domain Name"
set /p domainname=
Set srvnmb=%5%
echo "Enter Server Number"
set /p srvnmb=
if [%db_sid%]==[] goto Blank
if [%mem_target%]==[] goto Blank
if [%hostname%]==[] goto Blank
if [%domainname%]==[] goto Blank
if [%srvnmb%]==[] goto Blank
rem if not exist[%cd%\%db_sid%] 
@echo --Generating respose file for oracle software installation--
@echo oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0>> DB_INST_%db_sid%.rsp
@echo oracle.install.option=INSTALL_DB_SWONLY>> DB_INST_%db_sid%.rsp
@echo ORACLE_HOSTNAME=unxa%srvnmb%>> DB_INST_%db_sid%.rsp
@echo UNIX_GROUP_NAME=dba>> DB_INST_%db_sid%.rsp
@echo INVENTORY_LOCATION=/oracle/oraInventory>> DB_INST_%db_sid%.rsp
@echo SELECTED_LANGUAGES=en,en_GB>> DB_INST_%db_sid%.rsp
@echo ORACLE_HOME=/oracle/%db_sid%/112_64>> DB_INST_%db_sid%.rsp
@echo ORACLE_BASE=/oracle/%db_sid%>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.InstallEdition=EE>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.EEOptionsSelection=true>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.DBA_GROUP=dba>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.OPER_GROUP=oper>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.CLUSTER_NODES=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.isRACOneInstall=false>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.racOneServiceName=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.type=GENERAL_PURPOSE>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.globalDBName=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.SID=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.characterSet=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.memoryOption=false>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.memoryLimit=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.installExampleSchemas=false>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.enableSecuritySettings=true>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.password.ALL=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.password.SYS=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.password.SYSTEM=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.password.SYSMAN=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.password.DBSNMP=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.control=DB_CONTROL>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.automatedBackup.enable=false>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.automatedBackup.osuid=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.automatedBackup.ospwd=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.storageType=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.asm.diskGroup=>> DB_INST_%db_sid%.rsp
@echo oracle.install.db.config.asm.ASMSNMPPassword=>> DB_INST_%db_sid%.rsp
@echo MYORACLESUPPORT_USERNAME=>> DB_INST_%db_sid%.rsp
@echo MYORACLESUPPORT_PASSWORD=>> DB_INST_%db_sid%.rsp
@echo SECURITY_UPDATES_VIA_MYORACLESUPPORT=false>> DB_INST_%db_sid%.rsp
@echo DECLINE_SECURITY_UPDATES=true>> DB_INST_%db_sid%.rsp
@echo PROXY_HOST=>> DB_INST_%db_sid%.rsp
@echo PROXY_PORT=>> DB_INST_%db_sid%.rsp
@echo PROXY_USER=>> DB_INST_%db_sid%.rsp
@echo PROXY_PWD=>> DB_INST_%db_sid%.rsp
@echo PROXY_REALM=>> DB_INST_%db_sid%.rsp
@echo COLLECTOR_SUPPORTHUB_URL=>> DB_INST_%db_sid%.rsp
@echo oracle.installer.autoupdates.option=SKIP_UPDATES>> DB_INST_%db_sid%.rsp
@echo oracle.installer.autoupdates.downloadUpdatesLoc=>> DB_INST_%db_sid%.rsp
@echo AUTOUPDATES_MYORACLESUPPORT_USERNAME=>> DB_INST_%db_sid%.rsp
@echo AUTOUPDATES_MYORACLESUPPORT_PASSWORD=>> DB_INST_%db_sid%.rsp
@echo --Respose file generation for oracle software installation is now complete--
 
 

@echo --Generating PFILE script--
@echo %log_archive_format%
@echo *.archive_lag_target=3600 >init%db_sid%.ora
@echo *.audit_file_dest='/oracle/%db_sid%/admin/%db_sid%/adump' >>init%db_sid%.ora
@echo *.audit_trail='DB' >>init%db_sid%.ora
@echo *.audit_sys_operations=TRUE >>init%db_sid%.ora
@echo *.compatible='11.2.0.0.0' >>init%db_sid%.ora
@echo *.control_file_record_keep_time=30 >>init%db_sid%.ora
@echo *.control_files='/oracle/%db_sid%/origlogA/cntrl/cntrl%db_sid%.dbf','/oracle/%db_sid%/origlogB/cntrl/cntrl%db_sid%.dbf','/oracle/%db_sid%/mirrlogA/cntrl/cntrl%db_sid%.dbf' >>init%db_sid%.ora
@echo *.db_block_size=8192 >>init%db_sid%.ora
@echo *.db_domain='world' >>init%db_sid%.ora
@echo *.db_name='%db_sid%' >>init%db_sid%.ora
@echo *.db_create_file_dest='/oracle/%db_sid%/oradata001' >>init%db_sid%.ora
@echo *.db_recovery_file_dest='/oracle/%db_sid%/oraflash' >>init%db_sid%.ora
@echo *.db_recovery_file_dest_size=19000M >>init%db_sid%.ora
@echo *.deferred_segment_creation = TRUE >>init%db_sid%.ora
@echo *.diagnostic_dest='/oracle/%db_sid%' >>init%db_sid%.ora
@echo *.dispatchers='(PROTOCOL=TCP) (SERVICE=%db_sid%XDB)' >>init%db_sid%.ora
@echo *.event='' >>init%db_sid%.ora
@echo *.log_archive_dest_1='LOCATION=/oracle/%db_sid%/oraflash' >>init%db_sid%.ora
@echo *.log_archive_format='%db_sid%_%%t_%%r_%%s.dbf' >>init%db_sid%.ora
@echo *.memory_max_target=%mem_target%M >>init%db_sid%.ora
@echo *.memory_target=%mem_target%M >>init%db_sid%.ora
@echo *.nls_language='AMERICAN' >>init%db_sid%.ora
@echo *.nls_territory='AMERICA' >>init%db_sid%.ora
@echo *.nls_length_semantics='CHAR' >>init%db_sid%.ora
@echo *.open_cursors=1000 >>init%db_sid%.ora
@echo *.processes=300 >>init%db_sid%.ora
@echo *.remote_login_passwordfile='EXCLUSIVE' >>init%db_sid%.ora
@echo *.SEC_CASE_SENSITIVE_LOGON=TRUE >>init%db_sid%.ora
@echo *.sec_max_failed_login_attempts=6 >>init%db_sid%.ora
@echo *.sessions=472 >>init%db_sid%.ora
@echo *.undo_retention=10800 >>init%db_sid%.ora
@echo *.undo_tablespace='UNDOTBS1' >>init%db_sid%.ora
@echo --PFILE script has been generated--
@echo --Generating Create Database Script--
@echo CREATE DATABASE %db_sid% > %db_sid%.sql
@echo CONTROLFILE REUSE >> %db_sid%.sql
@echo USER SYS IDENTIFIED BY Gm0ku%db_sid% >> %db_sid%.sql
@echo USER SYSTEM IDENTIFIED BY Gm0ku%db_sid% >> %db_sid%.sql
@echo LOGFILE  >> %db_sid%.sql
@echo GROUP 1 ('/oracle/%db_sid%/origlogA/log_g11_m1.dbf', '/oracle/%db_sid%/mirrlogA/log_g11_m2.dbf')  SIZE 200M reuse, >> %db_sid%.sql
@echo GROUP 2 ('/oracle/%db_sid%/origlogB/log_g12_m1.dbf', '/oracle/%db_sid%/mirrlogB/log_g12_m2.dbf')  SIZE 200M reuse, >> %db_sid%.sql
@echo GROUP 3 ('/oracle/%db_sid%/origlogA/log_g13_m1.dbf', '/oracle/%db_sid%/mirrlogA/log_g13_m2.dbf')  SIZE 200M reuse, >> %db_sid%.sql
@echo GROUP 4 ('/oracle/%db_sid%/origlogB/log_g14_m1.dbf', '/oracle/%db_sid%/mirrlogB/log_g14_m2.dbf')  SIZE 200M reuse >> %db_sid%.sql
@echo MAXLOGFILES 16 >> %db_sid%.sql
@echo MAXLOGMEMBERS 5 >> %db_sid%.sql
@echo MAXLOGHISTORY 1 >> %db_sid%.sql
@echo MAXDATAFILES 512 >> %db_sid%.sql
@echo CHARACTER SET AL32UTF8 >> %db_sid%.sql
@echo NATIONAL CHARACTER SET AL16UTF16 >> %db_sid%.sql
@echo EXTENT MANAGEMENT LOCAL DATAFILE '/oracle/%db_sid%/oradata001/system01.dbf' SIZE 1024M >> %db_sid%.sql
@echo SYSAUX DATAFILE '/oracle/%db_sid%/oradata001/sysaux01.dbf' SIZE 1024M  >> %db_sid%.sql
@echo DEFAULT TABLESPACE users DATAFILE '/oracle/%db_sid%/oradata001/users01.dbf' SIZE 512M >> %db_sid%.sql
@echo DEFAULT TEMPORARY TABLESPACE TEMP01 TEMPFILE '/oracle/%db_sid%/oradata001/temp01.dbf' SIZE 1024M>> %db_sid%.sql
@echo UNDO TABLESPACE undotbs1 DATAFILE '/oracle/%db_sid%/oradata001/undotbs01.dbf' SIZE 2048M;>> %db_sid%.sql
@echo --Create Database Script has been generated--
@echo --Generating Create oracle profile Script--
@echo umask 022 >>profile.txt
@echo set -o vi >>profile.txt
@echo export EDITOR=vi >>profile.txt
@echo export PS1="$(whoami)@$(hostname)(\$PWD)$" >>profile.txt
@echo export ORAENV_ASK=NO >>profile.txt
@echo export ORACLE_SID=%db_sid% >>profile.txt
@echo export ORACLE_BASE=/oracle/%db_sid% >>profile.txt
@echo export ORACLE_HOME=/oracle/%db_sid%/112_64 >>profile.txt
@echo export PATH=$PATH:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/java6_64/jre/bin:/usr/java14_64/jre/bin:/support/unix/bin:/usr/local/bin:/usr/local/sbin:/oracle/%db_sid%/112_64/bin:/oracle/%db_sid%/112_64/OPatch:. >>profile.txt
@echo export RMAN_HOME=/usr/backup/rman_home >>profile.txt
@echo export AGENT_BASE_DIR=/oracle/agent_%srvnmb%/agent12c >>profile.txt
@echo export AGENT_HOME=/oracle/agent_%srvnmb%/agent12c/core/12.1.0.3.0 >>profile.txt
@echo export ADR_HOME=$ORACLE_BASE/diag/rdbms/*/$ORACLE_SID >>profile.txt
@echo . /oracle/%db_sid%/112_64/bin/oraenv >>profile.txt
@echo export TEMP=/tmp >>profile.txt
@echo export TEMPDIR=/tmp >>profile.txt
@echo export TMP=/tmp >>profile.txt
@echo if [ -s "$MAIL" ]           # This is at Shell startup.  In normal >>profile.txt
@echo then echo "$MAILMSG"        # operation, the Shell checks >>profile.txt
@echo fi                          # periodically. >>profile.txt
@echo TMOUT=43200 ; TIMEOUT=43200 >>profile.txt
@echo export readonly TMOUT TIMEOUT >>profile.txt
@echo --Create oracle profile Script has been generated--
@echo 1. Create profile for oracle user. >>How_to_%db_sid%.txt
@echo ============================================== >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo Check all environment variable are set: >>How_to_%db_sid%.txt
@echo echo $ORACLE_SID;echo $ORACLE_BASE;echo $ORACLE_HOME;echo $TNS_ADMIN;echo $ORACLE_BASE/OraInventory;echo $PATH >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 2. Create control file and Audit directory structure. >>How_to_%db_sid%.txt
@echo ======================================================= >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo mkdir -p /oracle/%db_sid%/origlogA/cntrl >>How_to_%db_sid%.txt
@echo mkdir -p /oracle/%db_sid%/origlogB/cntrl >>How_to_%db_sid%.txt
@echo mkdir -p /oracle/%db_sid%/mirrlogA/cntrl >>How_to_%db_sid%.txt
@echo mkdir -p /oracle/%db_sid%/admin/%db_sid%/adump >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 3. Create password file in $ORACLE_HOME/dbs for UNIX and LINUX >>How_to_%db_sid%.txt
@echo ============================================================== >>How_to_%db_sid%.txt
rem @echo.>>How_to_%db_sid%.txt
rem @echo Go to $ORACLE_HOME/dbs for UNIX & LINUX>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo orapwd file=orapw%db_sid% password=Gm0ku%db_sid% entries=30 >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 4. Create parameter file in $ORACLE_HOME/dbs for UNIX and LINUX. File name should be init%db_sid%.ora >>How_to_%db_sid%.txt
@echo ============================================================== >>How_to_%db_sid%.txt
rem @echo In $ORACLE_HOME/dbs for UNIX & LINUX >>How_to_%db_sid%.txt
rem @echo  >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 5. Connect to oracle instance using below command >>How_to_%db_sid%.txt
@echo ============================================================== >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo $ sqlplus /nolog >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo CONNECT SYS AS SYSDBA >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 6. Create a Server Parameter File >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo CREATE SPFILE FROM PFILE; >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 7. Start the Instance >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo STARTUP NOMOUNT >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 8. Issue create database statement from %db_sid%.sql file>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt

@echo 9. Generating dictionary : >>How_to_%db_sid%.txt
@echo ============================ >>How_to_%db_sid%.txt
@echo Run the following scrripts >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo @?/rdbms/admin/catalog.sql >>How_to_%db_sid%.txt
@echo @?/rdbms/admin/catproc.sql >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo -- Below script needs to be Run as SYSTEM not SYS ---- >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo @?/sqlplus/admin/pupbld.sql >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 10. Open database in archive log mode : >>How_to_%db_sid%.txt
@echo ======================================== >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo SHUTDOWN IMMEDIATE >>How_to_%db_sid%.txt
@echo STARTUP MOUNT >>How_to_%db_sid%.txt
@echo ALTER DATABASE ARCHIVELOG; >>How_to_%db_sid%.txt
@echo ALTER DATABASE OPEN; >>How_to_%db_sid%.txt
@echo To verify type --- archive log list>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 11. Make and entry in oratab : >>How_to_%db_sid%.txt
@echo =============================== >>How_to_%db_sid%.txt
@echo Close SQL Plus and issue below command. >>How_to_%db_sid%.txt
@echo "echo $ORACLE_SID:$ORACLE_HOME:N: >>/etc/oratab" >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 12. Enabling BCT : >>How_to_%db_sid%.txt
@echo ==================== >>How_to_%db_sid%.txt
@echo Create a BCT location: mkdir –p  /oracle/%db_sid%/BCT >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo Enable BCT by using following command: >>How_to_%db_sid%.txt
@echo ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/oracle/%db_sid%/BCT/%db_sid%_BCT.dbf'; >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo To check the status of BCT file: >>How_to_%db_sid%.txt
@echo set linesize 121 >>How_to_%db_sid%.txt
@echo col filename format a60 >>How_to_%db_sid%.txt
@echo SELECT filename, status, bytes/1024/1024 size_mb FROM v$block_change_tracking; >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 13. Delete Datapump Directories and change DBSNMP pwd and lock SYSTEM and OUTLN users: >>How_to_%db_sid%.txt
@echo ======================================================================================= >>How_to_%db_sid%.txt
@echo select * from dba_directories; >>How_to_%db_sid%.txt
@echo drop directory ORACLE_OCM_CONFIG_DIR; >>How_to_%db_sid%.txt
@echo drop directory DATA_PUMP_DIR; >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo ALTER USER DBSNMP IDENTIFIED BY sn1ck3rs ACCOUNT UNLOCK; >>How_to_%db_sid%.txt
@echo alter user OUTLN account lock; >>How_to_%db_sid%.txt
@echo alter user SYSTEM account lock; >>How_to_%db_sid%.txt
@echo set lines 200 pages 60 >>How_to_%db_sid%.txt
@echo select USERNAME,ACCOUNT_STATUS,LOCK_DATE,EXPIRY_DATE,PROFILE from dba_users where username in ('OUTLN','SYSTEM'); >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo 14. Create Listener : >>How_to_%db_sid%.txt
@echo ========================== >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo Make sure the listener does not register a server as .world also no DB name should be mentioned as .world >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo L_%hostname% = >>How_to_%db_sid%.txt
@echo   (DESCRIPTION = >>How_to_%db_sid%.txt
@echo     (ADDRESS = (PROTOCOL = TCP)(HOST = %hostname%.%domainname%)(PORT = 1527)) >>How_to_%db_sid%.txt
@echo   ) >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo SID_LIST_L_%hostname% = >>How_to_%db_sid%.txt
@echo   (SID_LIST = >>How_to_%db_sid%.txt
@echo     (SID_DESC = >>How_to_%db_sid%.txt
@echo       (GLOBAL_DBNAME = %db_sid%) >>How_to_%db_sid%.txt
@echo       (ORACLE_HOME = /oracle/%db_sid%/112_64) >>How_to_%db_sid%.txt
@echo       (SID_NAME = %db_sid%) >>How_to_%db_sid%.txt
@echo    ) >>How_to_%db_sid%.txt
@echo    ) >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo ENABLE_GLOBAL_DYNAMIC_ENDPOINT_L_%hostname% = ON >>How_to_%db_sid%.txt
@echo ADR_BASE_L_%hostname% = /oracle/%db_sid% >>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo.>>How_to_%db_sid%.txt
@echo Configure RMAN Backup, Apply LATEST PSU, Perform Security hardening, Deploy housekeeping Scripts, Deploy 12c agent, make a CMDB entry, change sys / system / oracle user passwords and note them down in the password agent after the database creation>>How_to_%db_sid%.txt
@echo --How to create database %db_sid% has been generated--
echo F|xcopy "%cd%\How_to_%db_sid%.txt" "%cd%\%db_sid%\How_to_%db_sid%.txt" /I /Y
del "%cd%\How_to_%db_sid%.txt"
echo F|xcopy "%cd%\init%db_sid%.ora" "%cd%\%db_sid%\init%db_sid%.ora" /I /Y
del "%cd%\init%db_sid%.ora"
echo F|xcopy "%cd%\%db_sid%.sql" "%cd%\%db_sid%\%db_sid%.sql" /I /Y
del "%cd%\%db_sid%.sql"
echo F|xcopy "%cd%\profile.txt" "%cd%\%db_sid%\profile.txt" /I /Y
del "%cd%\profile.txt"
echo F|xcopy "%cd%\DB_INST_%db_sid%.rsp" "%cd%\%db_sid%\DB_INST_%db_sid%.rsp" /I /Y
del "%cd%\DB_INST_%db_sid%.rsp"
goto End
 
rem #init%db_sid%.ora
:Blank
@echo 1. Enter database SID in BLOCK letter
@echo 2. memory_target and memory_max_target. It should be 60%% of available main memory 
@echo 3. Enter hostname in UPPERCASE
@echo 4. Enter domainname in UPPERCASE
@echo 5. Enter 4 digit Server Number [for UNXS0432 it will be 0432]
goto End
:End
@echo Script generation ends

____________________________________________________

Your help is much appreciated.
# 2  
Old 03-31-2014
# 3  
Old 04-01-2014
What about starting your work yourself? Do not hesitate when you encounter problems but do not think the people here do all the work for you.
It's a good training to get familiar with the basics of shell scripting which can't harm in your new job too.
Also there is nothing AIX specific so this thread is moved to the shell scripting area.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Converting the following batch script to Linux shell

I am currently migrating to ubuntu from my windows system. Now I am learing to convert all my batch scripts into linux shell. Although the common commands are more or less similar, but I found it difficult for the following set of commands in windows cmd: setlocal :PROMPT SET /P... (2 Replies)
Discussion started by: net.genere
2 Replies

2. Shell Programming and Scripting

Batch to shell script conversion

Hi All, I have a small tool which is currently configured in batch scripts only. But my need is to run it on Linux platform, so I have been trying to convert a batch script to shell script. below is the batch script: @echo off IF "%1"== "" GOTO ARGERR REM UPDATE THESE PROPERTIES TO... (2 Replies)
Discussion started by: sukhdip
2 Replies

3. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

4. Shell Programming and Scripting

To run a shell script in remote server from windows batch file

Hi all, i need to run a shell script on remote server. I have created file .bat file in windows server with following code, c:\Users\Desktop\putty.exe -ssh -pw password user@server ./script.sh i need to run the script.sh in my remote server Above command is not working, any... (4 Replies)
Discussion started by: rammm
4 Replies

5. Shell Programming and Scripting

Converting DOS Batch file to Shell Script

Hi, This is my DOS Batch file. @echo off echo "Program Name :" %0 rem echo "Next param :" %1 echo "Next param :" "Username/Password" echo "User Id :" %2 echo "User Name :" %3 echo "Request ID ... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

6. Shell Programming and Scripting

Conversion batch shell script

while converting batch file to shell script ...dis command is ther i dunno how to change...can anyone knws how to change into shell script rm !(D:\temp\XX.txt) (3 Replies)
Discussion started by: monisha
3 Replies

7. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

8. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

9. Shell Programming and Scripting

Change the Windows Batch script to UNIX shell script.

Hi, When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script... Script: REM :: File Name : Refresh_OTL.bat REM :: Parameters : %1 - Region REM :: : %2 - Cube Type REM ::... (5 Replies)
Discussion started by: tomailraj
5 Replies

10. UNIX for Dummies Questions & Answers

batch command in a shell script

How do I execute a batch command from a script, which "waits" with the next command until the first one has finished? ======= A piece of my script looks like this: #!/bin/sh (...) # run a long batch job: ./run_calculation.sh # then rename resulting file: mv output.dat backup.dat (...) ... (7 Replies)
Discussion started by: ivvo
7 Replies
Login or Register to Ask a Question