Move a Tablespace

This may be pointless, but maybe some of the SQL may help someone.  It is an attempt at boiling all the steps from another post into one SQL script.  The rename at the end didn’t seem to work for some reason, and I didn’t want to put any more time into it.


declare

  tblName varchar(25);

  tempName varchar(25);

  segmentCount number(10);

  osOutput number(3);

begin

   tblName := 'AAAPP';

   dbms_output.put_line('Moving tablespace: ' || tblName);

   tempName := tblName || 'NEW';

   dbms_output.put_line('Using temporary tablespace: ' || tempName);

   select count(*) into segmentCount from dba_segments

   where tablespace_name = tblName;

   dbms_output.put_line('Currently ' || segmentCount || ' segments');

   execute immediate 'create tablespace ' || tempName ||

       ' datafile ''e:\oradata\HCM90\' || tempName || '.DBF''' ||

       ' size 10m ' ||

       ' extent management local autoallocate ' ||

       ' segment space management auto ';

   execute immediate 'ALTER DATABASE DATAFILE ''e:\oradata\HCM90\' ||

      tempName || '.DBF'' AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED';

   for index_rec in (select owner, segment_name

                     from dba_segments

                     where segment_type = 'TABLE'

                     and tablespace_name = tblName)

   loop

      execute immediate 'alter table ' || index_rec.owner || '.' ||

          index_rec.segment_name || ' move tablespace ' || tempName;

   end loop;

   for index_rec in (select owner, table_name, column_name

                     from dba_lobs

                     where tablespace_name = tblName)

   loop

      execute immediate 'alter table ' || index_rec.owner || '.' ||

          index_rec.table_name || ' move lob(' || index_rec.column_name ||

          ') store as (tablespace ' || tempName || ')';

   end loop;

   select count(*) into segmentCount from dba_segments

   where tablespace_name = tblName;

   dbms_output.put_line('Now ' || segmentCount || ' segments');

   execute immediate 'alter tablespace ' || tblName || ' offline';

   execute immediate 'drop tablespace ' || tblName;

   execute immediate 'alter tablespace ' || tempName || ' rename to ' || tblName;

   dbms_output.put_line('Renaming ' || tempName || ' to ' || tblName);

   dbms_pipe.pack_message('cmd /c del e:\oradata\HCM90\' || tblName || '.DBF');

   osOutput := dbms_pipe.send_message('HOST_PIPE');

   dbms_output.put_line('Deleted e:\oradata\HCM90\' || tblName || '.DBF -- ' || osOutput);

end;

HCM90: More Tablespace Sizing

There is a fix out to reduce the database size:

  • Financials: 704935
  • HRMS: 704332
  • Portal: 704763

The only difference between the changes in the fix and what I had previously done,  is the blocksize setting.  As far as I could tell, it really didn’t make a sizeable impact.  What did make a difference was changing the properties on the other tablespaces besides the index tablespace.

Below I have listed some SQL and such that I used to shrink the database and move segments from the tablespaces.

Read More

Updated: PeopleTools Tables

Here is just a quick post to let you know that I have added a few more tables to the PeopleTools Tables page:

  • PSCONTENT
  • PSCONTDEFN

These tables are related to HTML definitions.  I was using them to check to make sure that I have all of the HTML definitions that I have created in my project.

Here is a link to the page:

http://psst0101.wordpress.com/peopletools-tables/

HowTo: Creating IScripts

Step 1: WEBLIB_ record

You must put your PeopleCode on a record that begins with “WEBLIB_”. You can either create one or add onto an existing record that meets that naming convention.

Step 2: Create the PeopleCode Function

The function name should start with “IScript_”.

%Response

You can use the %Response to create the output HTML, XML, or other format. The Write function is the main function that you will use:

%Response.Write("<b>Hello, World</b>");

%Request

You can use the %Request object to read parameters that were sent to the script. For example, if the URL had “?EMPLID=00001” at the end of it, you could use the following PeopleCode to read it:

&emplid = %Request.GetParameter("EMPLID");

Step 3: Security

You must grant security to your IScript before you can view it. This is done on the Permission List just like the security for a regular page.

Nagivation to the Permission Online:

PeopleTools > Security > Permissions & Roles > Permission Lists

Go to the WebLibraries page/tab.

On that page, you will need to enter the record name of the script. Then, click on the Edit link to choose the specific IScript that you wish to grant access.

Step 4: Determine the URL

The URL for a component looks something like this:

… /c/MenuName.ComponentName.Market

The URL for an IScript looks something like this:

… /s/RecordName.FieldName.Event.FunctionName

See PeopleBooks for more information.

Step 5: Register Your IScript

If an end-user should access the IScript, you need to put a content reference in the menu for easy access. You can do so, by registering your script through the registration wizard. If you just intend to access the script via code, you don’t need to do this step.

When you open a record that begins with “WEBLIB_”, you will notice a new button on the toolbar for the registration wizard. Just click that button and follow the steps.

See PeopleBooks for more information.

Resources

These resources may not be as relevant:

Question: Single JVM for Web Server

I am having trouble with memory on my VMWare instance of PeopleSoft.  I think a lot of the memory is going to the java virtual machine.  If I look in task manager, I find multiple javaw.exe listings.  Each one takes up at least 50M of memory.  When I use the process explorer, I find that they are all launched by the oracle application server, which is the web server for PeopleSoft.  I can understand having that many instances for production use, but this is just for development and testing.

Does anyone know how I can get the system to consolidate and use only one JVM instance?

Making All Tablespaces Autoextend

During an install of Financials 8.9, I had trouble with some of my tablespaces not autoextending. When I went to load the PPLTLS84CUR project, Application Designer failed saying the PTTBL tablespace was full.

Here is some SQL that I used:

This showed me all of the data files that were not auto-extending:

SELECT * FROM DBA_DATA_FILES

WHERE AUTOEXTENSIBLE = 'NO';

This generated the SQL required to make all of the tablespaces auto-extending

SELECT 'ALTER DATABASE DATAFILE ''' || file_name || ''' AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED;' FROM DBA_DATA_FILES

WHERE AUTOEXTENSIBLE = 'NO';

Blog Update

I have updated the PeopleTools Tables page and changed the theme for the site.

Theme:

I chose the Rubric theme because it offers better width for the content.  Especially with programming examples, this width comes in handy.  I am open to suggestions though.  I am a little disappointed with the WordPress tools.  The editor works great and is easy to use, but it does not have many features for formatting code examples.

PeopleTools Tables:

I added some descriptions to the change control tables.  I am finding those tables handy for tracking changes that I am making.  Also, I added the tables for Application Engines.  They can help find App Engines that use a particular state record or actions that call a particular section.  View the page here.