Reuse old/configured server for new purpose problems.

Greetings.

First of all I consider myself a newbe in Linux, that's why I'm seeking your help so please be patient!

I was given an old server (Solaris) that has Oracle (10.2.0) installed with a few databases. I'm supposed to reuse this server for this new application which will process data and create reports with a web interface (so Ill have to install tomcat,glassfish etc..)

My problems:

  1. The server has been previously configured for something else, so I have no password for Oracle.
  2. I thought of reinstalling Oracle but I have no idea how because of the way things have been partitioned
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d10         15G    13G   1.2G    93%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   6.7G   1.7M   6.7G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/SUNW,T5240/lib/libc_psr/libc_psr_hwcap2.so.1
                        15G    13G   1.2G    93%    /platform/sun4v/lib/libc_psr.so.1
/platform/SUNW,T5240/lib/sparcv9/libc_psr/libc_psr_hwcap2.so.1
                        15G    13G   1.2G    93%    /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   6.7G    64K   6.7G     1%    /tmp
swap                   6.7G    72K   6.7G     1%    /var/run
app                    667G    44K   748M     1%    /app
app/backup              40G    45K    40G     1%    /backup
oslocal/export_home     60G    15G    45G    26%    /export/home
app/home_app            12G   3.5G   8.5G    30%    /home/app
app/oradata_smart_ora1
                        13G   1.1G    12G     9%    /oradata/SMART/ora1
app/oradata_smart_ora2
                        18G   7.1G    11G    40%    /oradata/SMART/ora2
app/oradata_smart_ora3
                        36G    20G    16G    56%    /oradata/SMART/ora3
app/oradata_smart_ora4
                       166G   136G    30G    82%    /oradata/SMART/ora4
app/oradata_smart_ora5
                        55G    12G    43G    22%    /oradata/SMART/ora5
app/oradata_smart_ora6
                        75G    47G    28G    63%    /oradata/SMART/ora6
app/oradata_smart_ora7
                       147G   122G    25G    84%    /oradata/SMART/ora7
app/oradata_smart_redo1
                       3.0G   601M   2.4G    20%    /oradata/SMART/redo1
app/oradata_smart_redo2
                       3.0G   601M   2.4G    20%    /oradata/SMART/redo2
app/oradata_smart_redo3
                       3.0G   601M   2.4G    20%    /oradata/SMART/redo3
oslocal                100G    20K    25G     1%    /oslocal
app/smart               95G    45K    95G     1%    /smart

  1. I will need to maximize space for the application since I theres q requirement of 400GB+

  2. I really really really want to avoid wiping the server and configuring from scratch...

What are your thoughts of this? What approach should I take? If you need more information let me know...

Thanks in advance

You don't need to wipe the server, but you should probably recreate the application ZFS pool in a way that will suit your new application. To list ZFS pools and check their sizes:

zpool list

To check what filesystems are created there:

zfs list

Next you should confirm that all of those filesystems are not needed anymore. After that you should unmount all of them (zfs umount). Then you can list disks used by ZFS pools:

zpool status

And destroy them:

zpool destroy pool_name

Now you will have some spare disks that can be used by your application. You should choose enough disks from destroyed pools to meet your application's requirements. With the disk list at hand, you can combine them into ZFS pool:

zpool create new_pool disk1 disk2 ...

If your application needs disk failure protection, then you should use mirroring or RAIDZ, described here: Creating a ZFS Storage Pool (Solaris ZFS Administration Guide)After that you can start creating application specific filesystems, using

zfs create new_pool/new_fs

To change their mountpoints use:

zfs set mountpoint=/new_mountpoint new_pool/new_fs
3 Likes

Okay! In the first two steps I got this:

# zpool list
NAME      SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
app       816G   422G   394G    51%  ONLINE  -
oslocal   102G  15.8G  86.2G    15%  ONLINE  -
# zfs list
NAME                      USED  AVAIL  REFER  MOUNTPOINT
app                       666G   749M  44.8K  /app
app/backup               44.8K  40.0G  44.8K  /backup
app/home_app             3.54G  8.46G  3.54G  /home/app
app/oradata_smart_ora1   1.09G  11.9G  1.09G  /oradata/SMART/ora1
app/oradata_smart_ora2   7.07G  10.9G  7.07G  /oradata/SMART/ora2
app/oradata_smart_ora3   19.8G  16.2G  19.8G  /oradata/SMART/ora3
app/oradata_smart_ora4    136G  30.1G   136G  /oradata/SMART/ora4
app/oradata_smart_ora5   11.8G  43.2G  11.8G  /oradata/SMART/ora5
app/oradata_smart_ora6   47.0G  28.0G  47.0G  /oradata/SMART/ora6
app/oradata_smart_ora7    122G  24.9G   122G  /oradata/SMART/ora7
app/oradata_smart_redo1   601M  2.41G   601M  /oradata/SMART/redo1
app/oradata_smart_redo2   601M  2.41G   601M  /oradata/SMART/redo2
app/oradata_smart_redo3   601M  2.41G   601M  /oradata/SMART/redo3
app/smart                44.8K  95.0G  44.8K  /smart
oslocal                  75.0G  25.4G    20K  /oslocal
oslocal/export_home      15.4G  44.6G  15.4G  /export/home
oslocal/swap_file          15G  40.1G   354M  -

In the second step, how I determine whats the "pool_name"

app as it holds the oracle filesystems.

Excellent. I'm awaiting for a response to continue with this process in the next hours. Please stay in touch cause I will need your support!
And thanks a lot sir!!!!!

HI!

I desisted on wiping everything because I'm pretty sure I wasn't going to be able to get the Oracle license easily. Instead I found the password for Oracle so I'm not going to wipe it, instead I'm trying to make some clean up.

I have a few questions:

 /platform/SUNW,T5240/lib/libc_psr/libc_psr_hwcap2.so.1
                        15G    13G   1.2G    93%    /platform/sun4v/lib/libc_psr.so.1

That's about to get full, I realize that if I install or uninstall stuff from /opt it decreases/increases accordingly. What other places I should look into to make some space ? (if possible)

Can you explain me this? I thought these were separate databases but not. There's only one database in there. Verified with (select * from v$database;)

 app/oradata_smart_ora1   1.09G  11.9G  1.09G  /oradata/SMART/ora1
app/oradata_smart_ora2   7.07G  10.9G  7.07G  /oradata/SMART/ora2
app/oradata_smart_ora3   19.8G  16.2G  19.8G  /oradata/SMART/ora3
app/oradata_smart_ora4    136G  30.1G   136G  /oradata/SMART/ora4
app/oradata_smart_ora5   11.8G  43.2G  11.8G  /oradata/SMART/ora5
app/oradata_smart_ora6   47.0G  28.0G  47.0G  /oradata/SMART/ora6
app/oradata_smart_ora7    122G  24.9G   122G  /oradata/SMART/ora7
app/oradata_smart_redo1   601M  2.41G   601M  /oradata/SMART/redo1
app/oradata_smart_redo2   601M  2.41G   601M  /oradata/SMART/redo2
app/oradata_smart_redo3   601M  2.41G   601M  /oradata/SMART/redo3

Bartus: Halp!

This is only one database instance (probably called "SMART"). What you see here are are just different filesystems, holding tablespaces, redo-logs and controlfiles.

A little explanation about what an Oracle database comprises. Sorry in advance if some parts are only vague. I am a Sysadmin, not a DBA, and have only a passing knowledge of databases:

An Oracle database (more correctly: database instance) first has space to store data and index them. This is the DB equivalent of a filesystem. It is called "tablespaces" and from an OS POV it is one or several file(s). Usually one creates - one or more - filesystem(s) for these files because if I/O issues arise one wants to be able to balance the I/O-operations across the involved hardware (disks, adapters, ...).

Where (in the filesystem) all these tablespaces are to be found, how big they are and several other information - name of the instance, used codepage, .... - is stored in a set of "controlfiles". In fact these files are created first when the instance is initially created. These control files are relatively small (just a few MB), but are vital to the operation of the database. Without a fitting set of control files backups of the tablespaces are unusable.

This all is completed by a third class of files: redo-logs. As the database is under load, data get stored in it. Every such transaction is written to the redo log as it happens. Once such a redo-log is full it is moved to a certain location and called "archive-log" and a new redo-log is started. It is possible to have several redo-logs and use them round-robin (seems to be the case here), but the principle is always the same. With these logs it is possible to either reverse already done transactions (="roll back") or, using a previous version of the tablespaces and reapplying the transactions to duplicate them (="roll forward"). The redo-log in principle consists of 4 informations for every transaction:

1) What was the data before the operation;
2) What was the data after the operation;
3) a timestamp;
4) a transaction-ID so that the succession of the transactions is distinct.

OK, so far a (very incomplete) introduction to Oracle workings.

What you can do to free space:

1) check the tablespaces. It might be that they are not full at all. It is possible to resize them, just like filesystems, thereby freeing space. By moving them around you can maybe empty one of the filesystems in use so that you can scratch it. Ask a DBA about how you do that inside Oracle, i just know this is possible but not how it is done.

2) check the archive logs. Archive-logs are not necessary for the running database. Backup them and remove them afterwards, freeing space. If this is not a productive DB instance you might not need them altogether. It is possible to switch off the loging completely, which is done typically in test instances and for initial loads of new database instances, so that archive-logs and redologs are not created at all.

I hope this helps.

bakunin

1 Like

bakunin thanks for your response!

At the moment I dont care for anything inside this database. Dropping it will automatically free all the space used?

If you don't care for the database then just scratch the filesystems it takes. This way you create space for your new application, no?

Shutdown th database first, fastest way (if you delete it anyways, afterwards) is with

lsnrctl stop # stop all listeners, then, "connect / as sysdba" and
shutdown abort;

I hope this helps

bakunin

I'll give some further details for the shutdown, as it may be important (there are some posts on this site that demonstrate what happens when you delete a file at os level with processes still having it open).

1) Check if a database is running by looking if there are database processes. The most important process for a Oracle-database is pmon, and looking at the process owner you find out which user you should use to perform the actions below.

ps -eaf |grep pmon

If there is no pmon process the database is already shut down. If there is more than one you have to do the steps below for each of them. ( select * from v$database does NOT show how many databases are installed)

2) Identify the system-ID
There should be a file /etc/oratab (on solaris maybe /var/opt/oracle/oratab). This file tells you how many databases are installed on your system. The structure of this file is:

<ORACLE_SID>:<ORACLE_HOME>:<AutomaticStart>

<ORACLE_SID> is the "databasename" and <ORACLE_HOME> is the place where the software is installed. There should be a line in this file for each database the server houses.

3) Set up the environment
Switch user to the software owner and set the environment variables ORACLE_HOME and ORACLE_SID (with the values found in /etc/oratab)

su - oracle
ORACLE_HOME=/path/shown/in/etc/oratab
ORACLE_SID=most_likely_smart

4) Shut down the database:

lsnrctl stop
sqlplus /nolog
connect / as sysdba;
shutdown abort;
exit
1 Like

Bakunin thanks for your explanation! You have no idea how it helped me!!

Now... I have another question. The ex-server admin (that I hope he is in a special place in hell for not documenting ANYTHING!:mad:) has DB control files in ora1, ora2 and ora3 and redo files in their respective redo pools. What I would like to do is to destroy ora4-ora7 and create just 1 zfs pool from all to them. I was checking zfs commands and in order to create a new pool I need to know which disks will be used to create it. Problem is I dont know which disks form ora4-7 pools. How can I find that out? How can I find out which disks are available after destroying a zfs pools?

Thanks in advance

 
app/oradata_smart_ora1   1.09G  11.9G  1.09G  /oradata/SMART/ora1
app/oradata_smart_ora2   7.07G  10.9G  7.07G  /oradata/SMART/ora2
app/oradata_smart_ora3   19.8G  16.2G  19.8G  /oradata/SMART/ora3
app/oradata_smart_ora4    136G  30.1G   136G  /oradata/SMART/ora4
app/oradata_smart_ora5   11.8G  43.2G  11.8G  /oradata/SMART/ora5
app/oradata_smart_ora6   47.0G  28.0G  47.0G  /oradata/SMART/ora6
app/oradata_smart_ora7    122G  24.9G   122G  /oradata/SMART/ora7
app/oradata_smart_redo1   601M  2.41G   601M  /oradata/SMART/redo1
app/oradata_smart_redo2   601M  2.41G   601M  /oradata/SMART/redo2
app/oradata_smart_redo3   601M  2.41G   601M  /oradata/SMART/redo3