How do we know the size of CentOS repository before download it all? I'm sure there are many ways to do that by using yum / yast2 or other tool.
I'll try to achieve the same using "simple" commands presented in almost any Linux distribution. I let you here the script. It's not 100% perfect, in fact isn't, but I think is a nice starting point, feel free to improve it.
The script can be possible applied to RHEL, Oracle Linux and Fedora but I haven't test it against such distros.
Enjoy it!
I got the following results:
Summary [Feb, 9 2012] (Considering only the x86_64 architecture)
DISTRO SUMMARY http://mirror.centos.org/centos 5.7 : ~ 11 GB
DISTRO SUMMARY http://mirror.centos.org/centos 6.2 : ~ 10 GB
TOTAL SIZE: ~22 GB
Talking about design & implementation of solutions using modern OSS frameworks, tools, open standards and cutting-edge technology
Thursday, February 9, 2012
Wednesday, February 8, 2012
What are the size of Ubuntu and Debian repositories?
Before mirroring a complete Ubuntu / Debian repository on your hard drive, you want for sure have an estimation of the "weight" of all packages.
This script computes the total size of various Debian-based repositories by means of downloading the Packages.gz and making a sum of the size of every package. Of course, there are many shared packages between different versions of the same Linux distro. So this script will compute the max possible size.
Enjoy it!
I got the following results:..
Summary [Feb 9, 2012]
UBUNTU TOTAL SIZE = 466993 MB [456 GB] *
DEBIAN TOTAL SIZE = 184712 MB [180 GB] **
DEBIAN-SECURITY TOTAL SIZE = 22148 MB [21 GB] **
DEBIAN-VOLATILE TOTAL SIZE = 489 MB [0 GB] **
TOTAL SIZE: ~658 GB
* Considering lucid, maverick, natty, oneiric and precise, with i386 and amd64 architectures, and the components main, multiverse, restricted and universe
** Considering lenny and squeeze with i386, amd64, armel and arm architectures, and the components main, contrib and non-free
This script computes the total size of various Debian-based repositories by means of downloading the Packages.gz and making a sum of the size of every package. Of course, there are many shared packages between different versions of the same Linux distro. So this script will compute the max possible size.
Enjoy it!
I got the following results:..
Summary [Feb 9, 2012]
UBUNTU TOTAL SIZE = 466993 MB [456 GB] *
DEBIAN TOTAL SIZE = 184712 MB [180 GB] **
DEBIAN-SECURITY TOTAL SIZE = 22148 MB [21 GB] **
DEBIAN-VOLATILE TOTAL SIZE = 489 MB [0 GB] **
TOTAL SIZE: ~658 GB
* Considering lucid, maverick, natty, oneiric and precise, with i386 and amd64 architectures, and the components main, multiverse, restricted and universe
** Considering lenny and squeeze with i386, amd64, armel and arm architectures, and the components main, contrib and non-free
Booting Oracle 11g R2 Database Server on CentOS 6.2
This is a how to autostart the Oracle 11g R2 Database Server on CentOS 6.2. I assume you have done the following:
So, it's time to run the three installed components as Linux daemons. These components are: listener, database and enterprise manager. The main programs concerning the start and stop tasks for these components can be found at $ORACLE_HOME/bin, and they are:
- Install an Oracle-ready CentOS 6.2 Linux box
- Install the Oracle 11g R2 Database Server on the CentOS 6.2 Linux box
- Configure a network listener for Oracle 11g R2 Database Server on the CentOS 6.2 Linux box
- Create a fresh Oracle 11g R2 database on the CentOS 6.2 Linux box
So, it's time to run the three installed components as Linux daemons. These components are: listener, database and enterprise manager. The main programs concerning the start and stop tasks for these components can be found at $ORACLE_HOME/bin, and they are:
- listener: lsnrctl {start|stop|...}
- database: dbstart / dbshut
- ent. manager: emctl {start|stop|...}
- Login as the bozz user (a sudoer) in the server and create the archive /etc/init.d/oracle with the following content:
- First, ensure that the init.d script can be executed manually:
- Use chkconfig to register the init.d script on runlevels 3, 4 and 5:
then verify if is marked as on in the runleves 3, 4 and 5:$ sudo chkconfig --add oracle
$ chkconfig --list oracle oracle 0:off 1:off 2:off 3:on 4:on 5:on 6:off
- Reboot and enjoy!
#!/bin/bash
# oracle: Start/Stop Oracle Database 11g R2
#
# chkconfig: 345 90 10
# description: The Oracle Database Server is an RDBMS created by Oracle Corporation
#
# processname: oracle
. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1/
ORACLE_USER=oracle
case "$1" in
'start')
if [ -f $LOCKFILE ]; then
echo $0 already running.
exit 1
fi
echo -n $"Starting Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
touch $LOCKFILE
;;
'stop')
if [ ! -f $LOCKFILE ]; then
echo $0 already stopping.
exit 1
fi
echo -n $"Stopping Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
rm -f $LOCKFILE
;;
'restart')
$0 stop
$0 start
;;
'status')
if [ -f $LOCKFILE ]; then
echo $0 started.
else
echo $0 stopped.
fi
;;
*)
echo "Usage: $0 [start|stop|status]"
exit 1
esac
exit 0
if so, then stop it:$ sudo chmod +x /etc/init.d/oracle $ sudo /etc/init.d/oracle start
$ sudo /etc/init.d/oracle stop
Monday, February 6, 2012
Configuring a network listener for Oracle on CentOS 6.2
You require to configure and run a network listener before creating a database with the Oracle's Database Configuration Assistant (dbca) tool. This is a how to configure such a listener.
I assume you already install a Oracle 11g Database Server on CentOS 6.2 with SSH X11 Forwarding and you are using a Linux client with a Desktop Environment like Gnome or KDE.
I assume you already install a Oracle 11g Database Server on CentOS 6.2 with SSH X11 Forwarding and you are using a Linux client with a Desktop Environment like Gnome or KDE.
- Login on the server using oracle user with SSH X11 Forwarding:
- You already had the $ORACLE_HOME/bin on the PATH environment variable (see ~/.bash_profile here) so you can issue:
- Choose Listener Configuration on the Welcome panel:
- Select Add as the action:
- Type a listener name, I recommend the default "LISTENER":
- Select protocols among the available, I choose TCP only:
- Choose a listening port, I recommend the default "1521" but you can change it if you want. NOTE: Remember to open this port on iptables if you want remote database access, otherwise you won't be able to use it:
- On More Listeners panels, choose No.
- If you finish gracefully the wizard, you should be able to see this on the standard output. Observe that the listener is running.
- One final step is to add the ORACLE_HOME_LISTNER environment variable to oracle's ~/.bash_profile. Login to the server as oracle user and edit:
$ ssh -Y oracle@SERVER
$ netca
$ netca
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
you can manually stop the listener by issuing: then start the listener by:$ lsnrctl stop LISTENER
and check the listener status:$ lsnrctl start LISTENER
or verify if the listener is alive and locally reachable via TNS ping:$ lsnrctl status LISTENER LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-FEB-2012 16:53:04 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myserver)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 06-FEB-2012 16:49:47 Uptime 0 days 0 hr. 3 min. 17 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/app/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /opt/app/oracle/diag/tnslsnr/soabpm/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=soabpm)(PORT=1521))) The listener supports no services The command completed successfully
to ensure the same thing remotely you must issue. NOTE: Remember to configure iptables to allow remote access.$ tnsping localhost 1521 TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 06-FEB-2012 16:55:34 Copyright (c) 1997, 2009, Oracle. All rights reserved. Used parameter files: Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))) OK (0 msec) ... OK (0 msec)
NOTE: Remember you must a have a running listener before creating a database.$ tnsping myserver 1521
then append:$ nano ~/.bash_profile
at the end the ~/.bash_profile archive should look like:export ORACLE_HOME_LISTNER=LISTENER
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin umask 022 export TMPDIR=$TMP export ORACLE_BASE=/opt/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export PATH=$ORACLE_HOME/bin:$PATH # The SID for a database, See http://eduardo-lago.blogspot.com/2012/02/creating-new-oracle-11g-r2-database-on.html export ORACLE_SID=demo export ORACLE_HOME_LISTNER=LISTENER
What to do next?
- Creating a new Oracle 11g R2 Database on CentOS 6.2
- Run Oracle 11g R2 Database as a Linux daemon on CentOS 6.2
- An excellent article about IPTABLES by Mokhtar Ebrahim, Linux iptables Firewall Simplified Examples
Creating a new Oracle 11g R2 Database on CentOS 6.2
Once you installed an Oracle 11g R2 Database Server on CentOS 6.2 the next step is to create a new empty and fresh database for your own use. You must have a running listener before creating a database.
I assume you are using a Linux client (CentOS, Ubuntu, ...) with a desktop environment installed (Gnome, KDE, ...).
The steps are straightforward and I gonna choose a simple deployment configuration.
I assume you are using a Linux client (CentOS, Ubuntu, ...) with a desktop environment installed (Gnome, KDE, ...).
The steps are straightforward and I gonna choose a simple deployment configuration.
- Login on the server with oracle user with SSH X11 Forwarding:
- You already had the $ORACLE_HOME/bin on the PATH environment variable (see ~/.bash_profile here) so you can issue:
- An X11 windows should be launched on your Linux desktop, on the Operations panel choose "Create a database":
- Select "General Purpose or transaction Processing" on the Database Templates panel:
- On Database Identification Panel put a Global Database Name "demo.home.dev" and Oracle System Identifier (SID) "demo". NOTE: on this example, I used "demo.home.dev" as the global database name and "demo" for the SID, but I recommend to let it as simple as possible and choose "demo" for both:
- On Management Options panel check "Configure Enterprise Manager" and "Configure Database Control for local management"
- On Database Credentials panel I choose "Use the Same Administrative Password for All Accounts" but you can make a different choice and set each password individually:
- On the Storage Options panel I choose "File System":
- I let the Database File Locations with the defaults:
- Also the default settings on Recovery Configuration:
- On database content I didn't touch anything:
- You can tweak the database Initialization Parameters according to your system configuration and usage scenario:
- On Security Settings panel I recommend to use the enhanced 11g default security as well:
- I also enabled the Automatic Maintenance Tasks at certain schedule:
- I used defaults Database Storage options:
- On Creation Options panel don't forget to check the Create Database and optionally check Save as Database Template if you want to reuse this settings further:
- You should be able to see an install progress like this:
- An finally a summary screen like this: Once finished you should had a fresh empty database.
- Finnally add the ORACLE_SID environment variable to oracle's ~/.bash_profile. Login to the server as oracle user and edit:
- DON'T FORGET to set the recently created database in autostart mode at /etc/oratab. Edit with oracle user:
- One final thing to do is to test the 3 main components installed: listener, database and enterprise manager. Login as oracle user and issue:
- To verify if you can connect to the database, on the server issue the following command and enter the password supplied on the Database Credentials panel:
- To check if the listener, database and enterprise manager are running, open a browser at the URL: https://SERVERNAME:1158/em/console/aboutApplication. NOTE: Remember to open this port on iptables if you want remote database access, otherwise you won't be able to use it.
$ ssh -Y oracle@SERVER
$ dbca
then append:$ nano ~/.bash_profile
at the end the ~/.bash_profile archive should look like:export ORACLE_SID=demo
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH umask 022 export TMPDIR=$TMP export ORACLE_BASE=/opt/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export PATH=$ORACLE_HOME/bin:$PATH export ORACLE_SID=demo export ORACLE_HOME_LISTNER=LISTENER
and it should look like. Notice the red Y:$ nano /etc/oratab
# This file is used by ORACLE utilities. It is created by root.sh # and updated by the Database Configuration Assistant when creating # a database. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # fresh:/opt/app/oracle/product/11.2.0/db_1:Y
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 08-FEB-2012 16:44:03
...
The command completed successfully
then run. (NOTE: you must have the autostart mode for the database. See previous step):
and finally the Enterprise Manager:$ dbstart $ORACLE_HOME Processing Database instance "fresh": log file /opt/app/oracle/product/11.2.0/db_1/startup.log ...
$ emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. https://SERVERNAME:1158/em/console/aboutApplication Starting Oracle Enterprise Manager 11g Database Control ......... started. ...
then issue the following query:$ sqlplus sys@demo AS SYSDBA SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 6 17:36:28 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>
SQL> select * from dual; D - X
What to do next?
Subscribe to:
Posts (Atom)





















