oracle ¸´ÖÆ
[root@localhost bin]# pwd
/usr/local/bin
[root@localhost bin]# ls
coraenv dbhome oraenv
[root@localhost bin]#
[root@localhost etc]# ls -la ora*
-rw-r--r-- 1 root root 60 2008-09-19 oraInst.loc
-rw-rw-r-- 1 oracle oinstall 731 2008-09-19 oratab
[root@localhost etc]# pwd
/etc
#!/bin/sh
if [ -d "/etc" ]; then
chmod 755 /etc;
else
mkdir -p /etc;
fi
if [ -f "/u01/app/oraInventory/oraInst.loc" ]; then
cp /u01/app/oraInventory/oraInst.loc /etc/oraInst.loc;
chmod 644 /etc/oraInst.loc
else
INVPTR=/etc/oraInst.loc
INVLOC=/u01/app/oraInventory
GRP=oinstall
PTRDIR="`dirname $INVPTR`";
# Create the software inventory location pointer file
if [ ! -d "$PTRDIR" ]; then
mkdir -p $PTRDIR;
fi
echo "Creating the Oracle inventory pointer file ($INVPTR)";
echo inventory_loc=$INVLOC > $INVPTR
echo inst_group=$GRP >> $INVPTR
chmod 644 $INVPTR
# Create the inventory directory if it doesn't exist
if [ ! -d "$INVLOC" ];then
echo "Creating the Oracle inventory directory ($INVLOC)";
mkdir -p $INVLOC;
fi
fi
echo "Changing permissions of /u01/app/oraInventory to 770.";
chmod -R g+rw,o-rwx /u01/app/oraInventory;
if [ $? != 0 ]; then
echo "OUI-35086:WARNING: chmod of /u01/app/oraInventory to 770 failed!";
fi
echo "Changing groupname of /u01/app/oraInventory to oinstall.";
chgrp -R oinstall /u01/app/oraInventory;
if [ $? != 0 ]; then
echo "OUI-10057:WARNING: chgrp of /u01/app/oraInventory to oinstall failed!";
fi
echo "The execution of the script is complete"
-------------------------
#!/bin/sh
#!/bin/sh
#
# $Id: rootmacro.sbs 15-may-2007.20:34:21 dchriste Exp $
# Copyright (c) 2004, 2007, Oracle. All rights reserved.
#
# root.sh
#
# This script is intended to be run by root. The script contains
# all the product installation actions that require root privileges.
#
# IMPORTANT NOTES - READ BEFORE RUN
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
¹ý³Ì¡¢º¯Êý¡¢³ÌÐò°ü¡¢´¥·¢Æ÷
1 ¹ý³Ì
£¨1£©¶¨ÒåÓï·¨
create [or replace ] procedure ¹ý³ÌÃû
[(²ÎÊý1 [in | out | in out] ²ÎÊýÀàÐÍ£¬
²ÎÊý2 [in | out | in out] ²ÎÊýÀàÐÍ£¬
……)]
is | as
begin
Ö´Ðв¿·Ö
exception
Òì³£´¦Àí²¿·Ö
end [¹ý³ÌÃû];
¹ý³ÌÖÐûÓÐdeclare²¿·Ö£¬ÉùÃ÷²¿ ......
Ë÷Òý
1 ¸ÅÊö
Ë÷ÒýÊÇÒ»ÖÖÊ÷×´½á¹¹¡£
Ë÷Òý·ÖΪÂß¼Éè¼ÆºÍÎïÀíʵÏÖ¡£
Âß¼Éè¼Æ·ÖΪ£ºµ¥ÁÐË÷Òý¡¢¸´ºÏË÷Òý¡¢Î¨Ò»ÐÔË÷ÒýºÍ·ÇΨһÐÔË÷Òý¡¢»ùÓÚº¯ÊýµÄË÷Òý¡£
ÎïÀíʵÏÖ·ÖΪ£º·ÖÇøË÷Òý¡¢·Ç·ÖÇøË÷Òý¡¢BÊ÷Ë÷Òý¡¢ÕýÏòË÷Òý¡¢·´ÏòË÷Òý¡¢Î»Í¼Ë÷Òý¡£
ΩһË÷ÒýÊÇË÷ÒýÁÐÖµ²»ÄÜÖØ¸´µÄË÷Òý£¬·ÇΩһË÷Òý ......
¶Ô×óÁ¬½Ó¡¢ÓÒÁ¬½ÓµÄÒÉ»óµÃµ½½â¾ö¡£
ÔÚOracle PL-SQLÖУ¬×óÁ¬½ÓºÍÓÒÁ¬½ÓÒÔÈçÏ·½Ê½À´ÊµÏÖ
²é¿´ÈçÏÂÓï¾ä£º
SELECT emp_name, dept_name
FORM Employee, Department
WHERE Employee.emp_deptid(+) = Department.deptid
´ËSQLʹÓÃÁËÓÒÁ¬½Ó£¬¼´“(+)”ËùÔÚλÖõÄÁíÒ»²àΪÁ¬½Óµ ......
select f.tablespace_name,a.total,u.used,f.free,round((u.used/a.total)*100) "% used", round((f.free/a.total)*100) "% Free"
from
(select tablespace_name, sum(bytes/(1024*1024)) total
from dba_data_files group by tablespace_name) a,
(select tabl ......