<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: shell script help needed. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647022#M879604</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Add an error checking condition. &lt;BR /&gt;&lt;BR /&gt;=========================================&lt;BR /&gt;echo "How many rows that you want to insert into the table ? \c"&lt;BR /&gt;read total_size&lt;BR /&gt;if [ "$total_size" != "" ]&lt;BR /&gt;then&lt;BR /&gt;  total_size=$(expr $total_size / 1048576)&lt;BR /&gt;  echo $total_size &lt;BR /&gt;else&lt;BR /&gt;  echo No values entered...exiting&lt;BR /&gt;fi&lt;BR /&gt;=========================================&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 18 Jan 2002 09:18:47 GMT</pubDate>
    <dc:creator>Steven Sim Kok Leong</dc:creator>
    <dc:date>2002-01-18T09:18:47Z</dc:date>
    <item>
      <title>shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647011#M879593</link>
      <description>Hai all,&lt;BR /&gt;&lt;BR /&gt;I have some calculation of creating a tablespaces.&lt;BR /&gt;&lt;BR /&gt;The details are like this:&lt;BR /&gt;###################&lt;BR /&gt;I have a table "users_data".I have assigned a tablespace named "user_tbl_data" while creating a table.The row size for this table is exactly "106 bytes" .If i insert the 1000000 rows the tablesize will be 106*1000000=106 MB.I have hardcoded the 106 MB to the tablespace size.Now i need to do it as parameterized.&lt;BR /&gt;&lt;BR /&gt;I used a create a complete database by running a file "install.sh" which will be calling all the database scripts to create a database.&lt;BR /&gt;&lt;BR /&gt;Suppose if i run the "install.sh" file it should as &lt;BR /&gt;"How many rows that you want to insert into the table ? "&lt;BR /&gt;&lt;BR /&gt;if i enter a value of "2000000" this value should be multipied with " 106 " and that OUTPUT value should be repaced for the tablespace size which is in another script(create_tablespace.sh) for creating a tablespaces.&lt;BR /&gt;&lt;BR /&gt;The following are the contents in the following files.&lt;BR /&gt;&lt;BR /&gt;#Install.sh&lt;BR /&gt;-----------------&lt;BR /&gt;./create_database.sh&lt;BR /&gt;./create_dict.sh&lt;BR /&gt;./create_tablespaces.sh etc...........&lt;BR /&gt;&lt;BR /&gt;#create_tablespace.sh&lt;BR /&gt;----------------------------&lt;BR /&gt;CREATE TABLESPACE USERS_TBL_DATA&lt;BR /&gt;DATAFILE '/oracle/invent/users_tbl_data.dbf' SIZE &amp;lt;106&amp;gt; M &lt;BR /&gt;DEFAULT STORAGE (INITIAL 512K NEXT 512K MINEXTENTS 1 &lt;BR /&gt;MAXEXTENTS 500 PCTINCREASE 1);&lt;BR /&gt;-------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;The value in the "&amp;lt; &amp;gt;" should be relaced with the result value.&lt;BR /&gt;&lt;BR /&gt;Is it possible of doing that way???&lt;BR /&gt;&lt;BR /&gt;Can any one can help me??&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;ra</description>
      <pubDate>Thu, 17 Jan 2002 08:01:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647011#M879593</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2002-01-17T08:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647012#M879594</link>
      <description>Hi Rajkumar,&lt;BR /&gt;&lt;BR /&gt;In install.sh, have something like:&lt;BR /&gt;&lt;BR /&gt;"How many rows do you want to insert into the table ? " &lt;BR /&gt;read NROWS&lt;BR /&gt;NROWS=$((NROWS * 106))&lt;BR /&gt;export NROWS&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and in your create_tablespace.sh:&lt;BR /&gt;&lt;BR /&gt;DATAFILE '/oracle/invent/users_tbl_data.dbf' SIZE &amp;lt;$NROWS&amp;gt; M &lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Thu, 17 Jan 2002 08:26:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647012#M879594</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-17T08:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647013#M879595</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;install.sh:&lt;BR /&gt;========================================&lt;BR /&gt;echo "How many rows that you want to insert into the table ? \c"&lt;BR /&gt;read total_rows&lt;BR /&gt;./create_tablespaces.sh $total_rows&lt;BR /&gt;========================================&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;create_tablespaces.sh&lt;BR /&gt;========================================&lt;BR /&gt;total_size=$(expr 2000000 \* $1)&lt;BR /&gt;&lt;BR /&gt;svrmgrl &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;CREATE TABLESPACE USERS_TBL_DATA &lt;BR /&gt;DATAFILE '/oracle/invent/users_tbl_data.dbf' SIZE $total_size M &lt;BR /&gt;DEFAULT STORAGE (INITIAL 512K NEXT 512K MINEXTENTS 1 &lt;BR /&gt;MAXEXTENTS 500 PCTINCREASE 1); &lt;BR /&gt;EOF&lt;BR /&gt;========================================&lt;BR /&gt;&lt;BR /&gt;Is this what you are looking for? &lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 17 Jan 2002 08:28:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647013#M879595</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-17T08:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647014#M879596</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Typo error. &lt;BR /&gt;&lt;BR /&gt;Replace: total_size=$(expr 2000000 \* $1) &lt;BR /&gt;&lt;BR /&gt;With: total_size=$(expr 106 \* $1)&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 17 Jan 2002 08:36:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647014#M879596</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-17T08:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647015#M879597</link>
      <description>hai all,&lt;BR /&gt;&lt;BR /&gt;Thank you for your replies.The solution which you have given is correct but there is some problem in that also.&lt;BR /&gt;&lt;BR /&gt;When i run the script i have entered 1000000 rows .&lt;BR /&gt;and the output in the $NROWS=53000000.when this value is substituting at the run time I got an oracle error saying that :INVALID FILE SIZE.&lt;BR /&gt;&lt;BR /&gt;Because the oracle datablock size=4194303 blocks.&lt;BR /&gt;now the output is more than that.So when we enter the value it should convert the size in MB.so the problem will be solved.&lt;BR /&gt;I mean $NROWS=53000000 bytes.If we divide it by 1000000 we will get the $NROWS=53 &lt;BR /&gt;&lt;BR /&gt;can you please tell me how to How to convert it through script.&lt;BR /&gt;&lt;BR /&gt;Ra</description>
      <pubDate>Thu, 17 Jan 2002 10:48:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647015#M879597</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2002-01-17T10:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647016#M879598</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Replace: &lt;BR /&gt;&lt;BR /&gt;total_size=$(expr 106 \* $1) &lt;BR /&gt;&lt;BR /&gt;With: &lt;BR /&gt;&lt;BR /&gt;total_size=${expr 106 \* $1)&lt;BR /&gt;total_size=$(expr $total_size / 1048576)&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 17 Jan 2002 13:06:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647016#M879598</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-17T13:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647017#M879599</link>
      <description>Hi sim Kok,&lt;BR /&gt;&lt;BR /&gt;I executed as said above but i am getting syntax error.&lt;BR /&gt;I am just testing it one script.&lt;BR /&gt;&lt;BR /&gt;Script:&lt;BR /&gt;-------&lt;BR /&gt;echo "How many rows that you want to insert into the table ? \c" &lt;BR /&gt;read total_size&lt;BR /&gt;total_size=$(expr 106 \* $1)&lt;BR /&gt;total_size=$(expr $total_size / 1048576)&lt;BR /&gt;echo $total_size&lt;BR /&gt;&lt;BR /&gt;Can you please solve it.&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Fri, 18 Jan 2002 02:53:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647017#M879599</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2002-01-18T02:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647018#M879600</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Notice that I use $1 in createtablespaces.sh. If you use it in the parent script, you need to use the variable total_size instead.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Test output:&lt;BR /&gt;=====================================&lt;BR /&gt;$ cat ./test.sh&lt;BR /&gt;echo "How many rows that you want to insert into the table ? \c" &lt;BR /&gt;read total_size &lt;BR /&gt;total_size=$(expr 106 \* $total_size)&lt;BR /&gt;total_size=$(expr $total_size / 1048576)&lt;BR /&gt;echo $total_size &lt;BR /&gt; &lt;BR /&gt;$ ./test.sh&lt;BR /&gt;How many rows that you want to insert into the table ? 4000000&lt;BR /&gt;404&lt;BR /&gt;=====================================</description>
      <pubDate>Fri, 18 Jan 2002 03:24:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647018#M879600</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-18T03:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647019#M879601</link>
      <description>Hi Kok,&lt;BR /&gt;&lt;BR /&gt;Its creating now ,But only problem in the calculation only.&lt;BR /&gt;&lt;BR /&gt;what is this value "1048576" used for? From where you got this value??&lt;BR /&gt;&lt;BR /&gt;If i enter 10000 instead of 1 million its creating with 10 MB ,but as per the calculation it should create with 1 MB.&lt;BR /&gt;&lt;BR /&gt;Allways the input may not be 1 million it may more or very less.According to that is it possible to make it out.&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Fri, 18 Jan 2002 05:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647019#M879601</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2002-01-18T05:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647020#M879602</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;1048476 is 1 MB.&lt;BR /&gt;&lt;BR /&gt;You mentioned that&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; So when we enter the value it should convert the size in MB.so the problem will be solved. &lt;BR /&gt;&amp;gt;&amp;gt; I mean $NROWS=53000000 bytes.If we divide it by 1000000 we will get the $NROWS=53 &lt;BR /&gt;&lt;BR /&gt;It depends on your definition of 1 MB, replace 1048476 with 1000000 if appropriate.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Fri, 18 Jan 2002 06:28:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647020#M879602</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-18T06:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647021#M879603</link>
      <description>Hi Kok,&lt;BR /&gt; &lt;BR /&gt;Thank you for the information.&lt;BR /&gt;I have done some modifications in the scripts.Its working now.&lt;BR /&gt;&lt;BR /&gt;#I used the following script: &lt;BR /&gt;&lt;BR /&gt;echo "How many rows do you want to insert into the table ? "&lt;BR /&gt;read NROWS&lt;BR /&gt;NROWS=$((NROWS * 106))&lt;BR /&gt;NROWS=$((NROWS / 2 ))&lt;BR /&gt;export NROWS&lt;BR /&gt;echo $NROWS&lt;BR /&gt;&lt;BR /&gt;I divided NROWS /2 because i assigned 2 tablespaces while creating that table which contains HASH PARTITIONED tablespaces.The output result should be divided into 2 tablespaces,I havent specified MB there.I removed the (MB) while creating a tablespace.&lt;BR /&gt;&lt;BR /&gt;#The following is the tablespace scipt which i used.&lt;BR /&gt;&lt;BR /&gt;CREATE TABLESPACE GATE_DATA_PARTITION&lt;BR /&gt;DATAFILE '/inventory/gate_data_partition.dbf' SIZE $NROWS&lt;BR /&gt;DEFAULT STORAGE (INITIAL 20K NEXT 20K MINEXTENTS 2 MAXEXTENTS 100 PCTINCREASE 1)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;CREATE TABLESPACE GATE_DATA_PARTITION1&lt;BR /&gt;DATAFILE '/inventory/gate_data_partition1.dbf' SIZE $NROWS&lt;BR /&gt;DEFAULT STORAGE (INITIAL 20K NEXT 20K MINEXTENTS 2 MAXEXTENTS 100 PCTINCREASE 1)&lt;BR /&gt;;&lt;BR /&gt;##########&lt;BR /&gt;&lt;BR /&gt;If i havent entered any values while it prompts its returning an error.&lt;BR /&gt;Is it possible to terminate the entire script if i wont enter any thing????&lt;BR /&gt;&lt;BR /&gt;R</description>
      <pubDate>Fri, 18 Jan 2002 08:07:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647021#M879603</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2002-01-18T08:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: shell script help needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647022#M879604</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Add an error checking condition. &lt;BR /&gt;&lt;BR /&gt;=========================================&lt;BR /&gt;echo "How many rows that you want to insert into the table ? \c"&lt;BR /&gt;read total_size&lt;BR /&gt;if [ "$total_size" != "" ]&lt;BR /&gt;then&lt;BR /&gt;  total_size=$(expr $total_size / 1048576)&lt;BR /&gt;  echo $total_size &lt;BR /&gt;else&lt;BR /&gt;  echo No values entered...exiting&lt;BR /&gt;fi&lt;BR /&gt;=========================================&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Jan 2002 09:18:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help-needed/m-p/2647022#M879604</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-18T09:18:47Z</dc:date>
    </item>
  </channel>
</rss>

