當前位置:首頁 » 編程軟體 » oraclesh腳本

oraclesh腳本

發布時間: 2023-01-26 06:01:36

『壹』 請高人指點安裝ORACLE 11G RAC最後在兩節點執行 root.sh腳本時報錯解決方法,如解決高分回報,感激不盡

集群的cluster 沒有安裝成功!
ora.crsd 組件沒有啟動起來!

安裝的時候你注意一下你的分區

仲裁分區 數據分區 備份分區 重裝後 一定要 重新格式化!

否者安裝失敗 grid 組件 會出現更重各樣的問題.

很明顯你的集群安裝失敗了

打命令
tail -500 /u01/app/11.2.0/grid/cfgtoollogs/crsconfig/rootcrs_rac1.log

把信息貼出來

『貳』 請教如何在oracle的存儲過程中執行一個shell腳本

你可以把執行過程和執行shell腳本寫在一個shell里

例如

你的shell邏輯
執行存儲過程
繼續你的shell邏輯,執行腳本。

『叄』 Oracle資料庫RMAN的自動備份腳本簡介

Oracle資料庫RMAN的自動備份腳本簡介

各位同學知道Oracle資料庫RMAN如何自動備份腳本嘛?下面我為大家整理了關於Oracle資料庫RMAN的自動備份腳本文章,希望能為你提供幫助:

1、資料庫設置為歸檔方式

2、資料庫的備份腳本

db_full_backup.sh :資料庫全備腳本

db_l0_backup.sh :資料庫0級備份腳本

db_l1_backup.sh :資料庫1級備份腳本

ftp.sh :數據FTP上傳腳本

ftp_del.sh :數據FTP清理腳本

rman_bak.sh :數據備份主程序

3、備份原理

每周1、3、6進行0級備份

每周日、2、4、5進行1級備份

備份文件上傳到FTP伺服器

FTP伺服器每周清理一次,但是清理後將周六和周日的備份進行保留(6.bak和0.bak)

所有工作防暑crontab中自動執行備份

4、備份目錄含義

arc :資料庫歸檔目錄

rmanbak :資料庫備份文件的保存目錄

rmanscripts :資料庫腳本存放路徑

5、FTP目錄

ftp上必須手動建立目錄

L0:

---1

---3

---6

---6.bak

L1:

---2

---4

---5

---0

---0.bak

rman_bak.sh腳本主程序

#!/bin/bash

#--------------------------------------------

# Oracle auto backup using rman

#

# author:songrh

# week:1,3,6 Level 0 backup

# 2,4,5,0 Level 1 backup

# Copyright by ChenLong Tec

#--------------------------------------------

#

#

export ORACLE_BASE=/u02/oracle

export ORACLE_HOME=/u02/oracle/proct/9.2.4

export ORACLE_SID=PROD

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

export NLS_LANG=american_america.ZHS16GBK

export TNS_ADMIN=$ORACLE_HOME/network/admin

export ORA_NL33=$ORACLE_HOME/ocommon/nls/admin/data

export PATH=/bin:/usr/bin:/usr/sbin:$ORACLE_HOME/bin:$PATH

export PATH=$PATH:/opt/local/bin

#

SH_PATH=/u02/rmanscripts

ARC_PATH=/u02/arch

RMAN_BAK_PATH=/u02/rmanbak

#

#FULL_PATH=$RMAN_BAK_PATH/full

L0_PATH=$RMAN_BAK_PATH/L0

L1_PATH=$RMAN_BAK_PATH/L1

#

#DAY_TAG=`date "%Y-%m-%d"`

LOG_TAG=`date "%Y-%m-%d"`

#FIRST_DAY=`date %e`

WEEK=`date %w`

#WEEK=1

#

# FTP configure

IP="122.120.150.155"

FTPUSER="ftpbak"

FTPPASS="******"

FTPROOT0="L0"

FTPROOT1="L1"

#

DISK_USE=`df -k |sed -n '/u02/'p | awk '{print $5}' |sed 's/%//'`

####check path function

############

if [[ $DISK_USE -ge 90 ]]; then

rm -rf $L0_PATH/*

rm -rf $L1_PATH/*

fi

if [ "$WEEK" = "6" -o "$WEEK" = "3" -o "$WEEK" = "1" ]; then

if [ ! -d $L0_PATH ]; then

mkdir $L0_PATH

fi

if [ "$WEEK" = "1" ]; then

rm -rf $L0_PATH/*

rm -rf $L1_PATH/*

mkdir $L0_PATH/$WEEK

$SH_PATH/db_l0_backup.sh $L0_PATH/$WEEK

cd $L0_PATH/$WEEK

$SH_PATH/ftp_del.sh $IP $FTPUSER $FTPPASS $FTPROOT0 $WEEK $WEEK_$LOG_TAG.log

else

if [ ! -d $L0_PATH/$WEEK ]; then

mkdir $L0_PATH/$WEEK

$SH_PATH/db_l0_backup.sh $L0_PATH/$WEEK

cd $L0_PATH/$WEEK

$SH_PATH/ftp.sh $IP $FTPUSER $FTPPASS $FTPROOT0 $WEEK $WEEK_$LOG_TAG.log

else


;

『肆』 怎麼樣用shell做一個連接oracle資料庫的腳本

shell中直接調用sqlplus即可
sqlplus -s 用戶名/口令@實例名<<EOF

『伍』 oracle 11g r2 的rac,執行root.sh腳本時報錯,求教

剛好前兩天安裝Oracle grid也碰到這個問題,給你解答一下!
在執行root.sh時 會報錯誤:
Addingdaemon to inittab
CRS-4124:Oracle High Availability Services startup failed.
CRS-4000:Command Start failed, or completed with errors.
ohasdfailed to start: Inappropriate ioctl for device
ohasd failed to start: Inappropriate ioctl for device /u01/app/grid/proct/11.2.0/grid/crs/install/roothas.plline 296

解決方法:
#cd $GRID_HOME/crs/install
---出錯清除crs
./roothas.pl -deconfig -verbose -force
./rootcrs.pl -deconfig -verbose -force
執行root.sh腳本後到/var/tmp/.oracle中候著,當出現文件npohasd後執行如下命令:
dd if= /var/tmp/.oracle/npohasd f=/dev/null bs=1024 count=1

『陸』 如何在oracle中執行shell腳本

要在sql下面執行shell語句,用!符號,不過功能有限;有的時候打不到我們想要的效果!先給你兩個實例;
要在後台登陸;plsql中測試不行
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Proction
With the Partitioning, Data Mining and Real Application Testing options
SQL> !echo 123;
123

SQL> !/billing/user/xufc/ftp.sh
Local directory now /billing/Balance/SP/REALINCOME/FTRANS
Interactive mode off.
-rw-r--r-- 1 500 500 823038 Feb 17 06:27 .gz
-rw-r--r-- 1 500 500 33 Feb 17 06:27 .md5
其中ftp.sh需要用絕對路徑;該腳本裡面的內容只是ls一下;就這樣了

『柒』 安裝oracle rac時執行root.sh腳本報錯,求助!

您好~ 希望您能有一個更詳細的介紹\r\n\r\n不過我以前也遇到這個報錯,當時是由於安裝clusterware時,跑完兩個腳本之後沒有運行vipca就直接點擊\「ok\」了,然後就報這個錯了。\r\n\r\n不知道跟你的情況一樣否?

『捌』 oracle 11g r2 的rac,執行root.sh腳本時報錯,求教

是這個錯誤嗎?
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
這是11.2.0.1的BUG
原因:/var/tmp/.oracle/npohasd管道文件的許可權不正確。
解決辦法:

刪除配置:/u01/app/11.2.0/grid/crs/install/roothas.pl -deconfig -force-verbose


/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
如果出現
/bin/dd: opening`/var/tmp/.oracle/npohasd': No such file or directory

的時候文件還沒生成就繼續執行,直到能執行為止,一般出現Adding daemon to inittab這條信息的時候執行dd命令。

執行root.sh

『玖』 Oracle資料庫備份腳本怎麼寫

沒必要用root許可權執行,oracle用戶同樣可以執行crontab計劃任務
1、su - oracle
crontab -e
0 4 * * 0 /home/oracle/exp.sh 2>&1 >>/home/oracle/script_exp.log;
0~59 表示分
0~23 表示小時
1~31 表示日
1~12 表示月份
0~6 表示星期(其中0表示星期日)
2、cat /home/oracle/exp.sh
. ~/.bash_profile
bakdir=/opt/dbbak
logdir=/home/oracle/dbbak
rq=$(date +%Y%m%d)
exp system/***** owner=jysh file=${bakdir}/jysh_${rq}.dmp log=${logdir}/jysh_${rq}.log;
find ${bakdir} -type f -mtime +30 -exec rm -rf {} \;

『拾』 oracle runcluvfy.sh腳本在哪

runcluvfy.sh腳本使用
oracle 官方建議在安裝oracle grid前運行此腳本,來檢查各個節點是否滿足grid安裝的官方要求:
如果是自己的測試環境,部分『unpassed』可以忽略。
[[email protected] grid]$ sh runcluvfy.sh stage -pre crsinst -n vrh5,vrh6Performing pre-checks for cluster services setupChecking node reachability...
Node reachability check passed from node "vrh5"Checking user equivalence...
User equivalence check passed for user "grid"Checking node connectivity...
Checking hosts config file...
Verification of the hosts config file successfulNode connectivity passed for subnet "192.168.1.0" with node(s) vrh6,vrh5TCP connectivity check passed for subnet "192.168.1.0"Node connectivity passed for subnet "172.168.1.0" with node(s) vrh6,vrh5TCP connectivity check passed for subnet "172.168.1.0"Node connectivity passed for subnet "10.0.4.0" with node(s) vrh6,vrh5TCP connectivity check failed for subnet "10.0.4.0"Interfaces found on subnet "172.168.1.0" that are likely candidates for VIP are:
vrh6 eth1:172.168.1.182
vrh5 eth1:172.168.1.181
Interfaces found on subnet "10.0.4.0" that are likely candidates for VIP are:
vrh6 eth2:10.0.4.15
vrh5 eth2:10.0.4.15
Interfaces found on subnet "192.168.1.0" that are likely candidates for a private interconnect are:
vrh6 eth0:192.168.1.183
vrh5 eth0:192.168.1.181
Node connectivity check passed
Total memory check failed
Check failed on nodes:
vrh6,vrh5
Available memory check passed
Swap space check failed
Free disk space check passed for "vrh6:/tmp"Free disk space check passed for "vrh5:/tmp"User existence check passed for "grid"
Group existence check passed for "oinstall"Group existence check passed for "dba"
Membership check for user "grid" in group "oinstall" [as Primary] passedMembership check for user "grid" in group "dba" failedCheck failed on nodes:
vrh6,vrh5
Run level check passed
Hard limits check passed for "maximum open file descriptors"Soft limits check passed for "maximum open file descriptors"Hard limits check passed for "maximum user processes"Soft limits check passed for "maximum user processes"System architecture check passed
Kernel version check passed
Kernel parameter check passed for "semmsl"Kernel parameter check passed for "semmns"Kernel parameter check passed for "semopm"Kernel parameter check passed for "semmni"Kernel parameter check passed for "shmmax"Kernel parameter check passed for "shmmni"Kernel parameter check passed for "shmall"Kernel parameter check passed for "file-max"Kernel parameter check passed for "ip_local_port_range"Kernel parameter check passed for "rmem_default"Kernel parameter check passed for "rmem_max"Kernel parameter check passed for "wmem_default"Kernel parameter check passed for "wmem_max"Kernel parameter check passed for "aio-max-nr"Package existence check passed for "make-3.81"Package existence check passed for "binutils-2.17.50.0.6"Package existence check passed for "gcc-4.1.2"Package existence check passed for "lio-0.3.106 (i386)"Package existence check passed for "lio-0.3.106 (x86_64)"Package existence check passed for "glibc-2.5-24 (i686)"Package existence check passed for "glibc-2.5-24 (x86_64)"Package existence check passed for "compat-libstdc++-33-3.2.3 (i386)"Package existence check passed for "compat-libstdc++-33-3.2.3 (x86_64)"Package existence check passed for "elfutils-libelf-0.125 (x86_64)"Package existence check passed for "elfutils-libelf-devel-0.125"Package existence check passed for "glibc-common-2.5"Package existence check passed for "glibc-devel-2.5 (i386)"Package existence check passed for "glibc-devel-2.5 (x86_64)"Package existence check passed for "glibc-headers-2.5"Package existence check passed for "gcc-c++-4.1.2"Package existence check passed for "lio-devel-0.3.106 (i386)"Package existence check passed for "lio-devel-0.3.106 (x86_64)"Package existence check passed for "libgcc-4.1.2 (i386)"Package existence check passed for "libgcc-4.1.2 (x86_64)"Package existence check passed for "libstdc++-4.1.2 (i386)"Package existence check passed for "libstdc++-4.1.2 (x86_64)"Package existence check passed for "libstdc++-devel-4.1.2 (x86_64)"Package existence check passed for "sysstat-7.0.2"Package existence check passed for "unixODBC-2.2.11 (i386)"Package existence check passed for "unixODBC-2.2.11 (x86_64)"Package existence check passed for "unixODBC-devel-2.2.11 (i386)"Package existence check passed for "unixODBC-devel-2.2.11 (x86_64)"Package existence check passed for "ksh-20060214"Check for multiple users with UID value 0 passedCurrent group ID check passed
Core file name pattern consistency check passed.
User "grid" is not part of "root" group. Check passedDefault user file creation mask check passedStarting Clock synchronization checks using Network Time Protocol(NTP)...
NTP Configuration file check started...
NTP Configuration file check passed
Checking daemon liveness...
Liveness check failed for "ntpd"
Check failed on nodes:
vrh6,vrh5
PRVF-5415 : Check to see if NTP daemon is running failedClock synchronization check using Network Time Protocol(NTP) failedPre-check for cluster services setup was unsuccessful on all the nodes.
從以上檢查,也可以看出oracle 需要對os環境有哪些具體的要求,比如rpm包,內核參數,tmp,用戶組。。。。。。

熱點內容
歐藍德買哪個配置合適 發布:2023-01-30 23:40:59 瀏覽:484
谷歌伺服器的地址是多少 發布:2023-01-30 23:40:40 瀏覽:920
android圓形菜單 發布:2023-01-30 23:40:04 瀏覽:198
linuxphp安裝包 發布:2023-01-30 23:38:50 瀏覽:383
php開源erp 發布:2023-01-30 23:37:35 瀏覽:473
android推送服務 發布:2023-01-30 23:37:35 瀏覽:847
如何優化銀行理財產品配置 發布:2023-01-30 23:36:44 瀏覽:507
搭建C語言伺服器 發布:2023-01-30 23:35:43 瀏覽:158
struts2資料庫 發布:2023-01-30 23:35:35 瀏覽:598
螢石c6t如何配置 發布:2023-01-30 23:34:38 瀏覽:623