Thursday, November 23, 2006

Create Tables and Add Constraints -- Oracle

Here's an easy way to create, configure and populate Oracle tables. It can be done from the command line but that can be quite cumbersome, especially if you need to make changes.

Open up a new file in Notepad
Populate it with your create, constraint, drop, insert and etc statements.
Save the file as filename.sql (don't forget the .sql extention)

e.g.
#sqlplus
**you will be prompt for login/password information**
SQL>@/home/esofthub/filename.sql;
--The "@" symbol executes the contents in the filename.sql file
--If you have errors/modifications, simply open the filename.sql in Notepad and make the necessary changes
--Then rerun the file using the "@" symbol

Friday, November 17, 2006

Drop Database Table Command -- Oracle

When a table is no longer needed in the database, you may want to drop it. But if it has referential integrity, a simple "drop table tablename" won't suffice.

You will need to do the following:

SQL>drop table tablename cascade constraints (which removes the referential constraints)

Monday, November 13, 2006

How to Mount and Eject a Floppy

How to mount and dismount a floppy on a Solaris box.

#volcheck -v (to mount)
#cd /floppy (check contents)
To eject
#cd /
#eject (to remove floppy or CDROM)

You can also use the filemanager (GUI based) to do the same as the aforementioned.

Saturday, November 11, 2006

How to Add a Disk (hard drive)?

For Solaris 7 and below...

You can add the hardware and issue the following commands depending on driver:
#drvconfig -i sd
or
#drvconfig -i dad
#disks

OR

You can reboot the system after adding the hardware.
#touch /reconfigure
#init 6

OR

At the OBP
boot -r

You can use the same commands for Solaris 8 but you can also use the following command:
#devfsadm (it automatically detects the hardware)

Add a Tape Drive

For Solaris 7 and below...

You can add the hardware and issue the following commands:
#drvconfig -i st
#tapes

OR

You can reboot the system after adding the hardware.
#touch /reconfigure
#init 6

OR

At the OBP
boot -r

You can use the same commands for Solaris 8 but you can also use the following command:
#devfsadm (it automatically detects the hardware)

Tuesday, November 07, 2006

How to get Files From a Remote Server

You will be asked for login/password information following the first step unless anonymous.

#ftp esofthub.com
ftp>cd /tmp/TEMP (on remote workstation)
ftp>bin
ftp>ls (on remote--file named filename)
ftp>lcd /tmp/MYLOCAL (on local workstation)
ftp>get filename (places filename into /tmp/MYLOCAL)
ftp>quit

Use mget (multiple files) instead of get if you want to FTP everything from the remote directory into the local directory

Wednesday, November 01, 2006

How to FTP Local File(s) to a Remote Server

You will be asked for login/password information following the first step unless anonymous.

#ftp esofthub.com
ftp>cd /tmp/TEMP (on remote workstation)
ftp>bin
ftp>lcd /tmp/MYLOCAL (on local workstation)
ftp>!ls (on local--file named filename)
ftp>put filename (puts filename into remote's directory, /tmp/TEMP)
ftp>quit

Use mput (multiple files) instead of put if you want to FTP everything from the local directory into the remote directory