linux_db_script ---014
DT2PRDB
#!/bin/bash
#shutdown_db.sh
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=umlaut; export ORACLE_SID
/u01/product/oracle/bin/sqlplus /nolog <
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
shutdown immediate;
exit
EOF
/u01/product/oracle/bin/lsnrctl <
exit
EOF
DT2PRDB
#!/bin/bash
#startup_db.sh
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=umlaut; export ORACLE_SID
/u01/product/oracle/bin/sqlplus /nolog <
startup
exit
EOF
/u01/product/oracle/bin/lsnrctl <
exit
EOF
cat /etc/rc.local
#set oracle environment
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=nbewind; export ORACLE_SID=nbewind
su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <
startup
exit
EOF"
su oracle -c "/u01/product/oracle/bin/lsnrctl <
exit
EOF"
DT2PRDB
#!/bin/sh
# autocheck
export ORACLE_SID=umlaut
sqlplus "/as sysdba" @/data/run/tbs.sql
exit
DT2PRDB
set linesize 131
col object format a40
col type format a10
col tsname format a10
select a.owner||'.'||a.segment_name object,
a.segment_type type ,
a.bytes/1024/1024 NG ,
a.next_extent/1024/1024 Next ,
a.tablespace_name ts_name
from sys.dba_segments a
where a. next_extent * &num > (
select max(b.bytes)
from dba_free_space b
where a.tablespace_name = b.tablespace_name)
order by 3 desc
/
DT2PRDB
ps -ef |grep delll10 |wc
#!/bin/sh
# autochecksession
export ORACLE_SID=umlaut
sqlplus "/as sysdba" @/data/run/session.sql
exit
DT2PRDB
set wrap off
set linesize 80
col resource_name for a15
select count(*) session_all from gv$resource_limit where resource_name = 'sessions';
select * from gv$resource_limit where resource_name = 'sessions';
col owner for a15
col object_name for a20
select count(*) invalid_object from dba_objects where status='INVALID' and object_type <> 'SYNONYM';
select owner,object_name,created,last_ddl_time,status from dba_objects where status='INVALID' and object_type <> 'SYNONYM';
select round(sum(a.bytes_alloc)/1024/1024/1024,2) "Tablespace_all_size(G)",
round( (sum(a.bytes_alloc)-sum(nvl(b.bytes_free, 0)))/1024/1024/1024,3) "Tablespace_used_size(G)"
from ( select f.tablespace_name,
sum(f.bytes) bytes_alloc
from dba_data_files f
group by tablespace_name) a,
( select f.tablespace_name,
sum(f.bytes) bytes_free
from dba_free_space f
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name (+) ;
col job for 99
col schema_user for a15
select job,schema_user,last_date,next_date,failures,what from dba_jobs order by schema_user;
exit
DT2PRDBDG
#!/bin/sh
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=umlaut;export ORACLE_SID
/u01/product/oracle/bin/sqlplus /nolog <
set autorecovery on;
recover standby database;
EOF
DT2PRDBDG
#!/bin/bash
pid=`/sbin/pidof rsync |wc | awk '{print $1}' `
#echo $pid
if [ "$pid" -gt "1" ]
then
echo "Rsync is already running...."
else
echo "Starting rsync `date`"
rsync -e ssh -avoracle@10.153.32.80:/data/umlaut/arch//data/umlaut/arch/
echo "Completed rsync `date`"
fi
exit 0
DT2PRDBDG
#!/bin/sh
find /data/umlaut/arch/1_*.arc -mmin +4320 -exec rm -f {} \;
DT2PRDBDG
#!/bin/sh
#oracle_sid=delll6
find /u01/product/admin/umlaut/adump/ora_*.aud -mmin +1440 -exec rm -f {} \;
find /u01/product/admin/umlaut/bdump/umlaut_*.trc -mmin +1440 -exec rm -f {} \;
find /u01/product/admin/umlaut/udump/umlaut_ora_*.trc -mmin +1440 -exec rm -f {} \;
DT2PRDBDG
#!/bin/bash
#shutdown_db.sh
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=umlaut; export ORACLE_SID
/u01/product/oracle/bin/sqlplus /nolog <
shutdown immediate
exit
EOF
/u01/product/oracle/bin/lsnrctl <
exit
EOF
DT2PRDBDG
#!/bin/bash
#startup_dg.sh
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=umlaut; export ORACLE_SID
/u01/product/oracle/bin/sqlplus /nolog <
startup nomount;
alter database mount standby database;
exit
EOF
/u01/product/oracle/bin/lsnrctl <
exit
EOF
cat /etc/rc.local
#set oracle environment
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=nbewind; export ORACLE_SID=nbewind
su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <
startup nomunt
alter database mount standby database
recover managed standby database disconnect from session
exit
EOF"
su oracle -c "/u01/product/oracle/bin/lsnrctl <
exit
EOF"
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25850100/viewspace-703912/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 052-014題解析
- 014.Nginx跨域配置Nginx跨域
- LeetCode 014&053LeetCode
- 軟體工程日報014軟體工程
- [MySQL光速入門]014 試題答案MySql
- ENSP Demo 014 VRRP & MSTP & DHCP RelayVR
- L2-014 列車排程
- 014 Rust 非同步程式設計,遞迴Rust非同步程式設計遞迴
- rust-quiz:014-trait-autoref.rsRustUIAI
- 【學習】SQL基礎-014-約束SQL
- LeetCode Longest Common Prefix(014)解法總結LeetCode
- 014 Rust死靈書之顯式型別轉換Rust型別
- 014 | 從微觀到巨集觀理解區塊鏈區塊鏈
- 014 Rust 網路程式設計,郵件傳送的示例Rust程式設計
- LeetCode - 014 - 最長公共字首(longest-common-prefix)LeetCode
- 「HTML+CSS」--自定義載入動畫【014】【疑問未解決】HTMLCSS動畫
- 014-活該你爬蟲被封之Scrapy Ip代理中介軟體爬蟲
- 014、映象的快取特性(2019-01-03 週四)快取
- ccnp學習014--路由與交換(05路由更新與控制)路由
- 014.Vue3入門,style屬性的幾種繫結方法Vue
- 【Bioinfo Blog 014】【Shell】——亂七八糟各種各樣的命令記錄
- 【成功智慧】014.一日復一日的度過難關
- Rust 程式設計影片教程(進階)——014RefCell 和內部可變性Rust程式設計
- 014 通過連結串列學習Rust之持久化連結串列的DropRust持久化
- 014 透過連結串列學習Rust之持久化連結串列的DropRust持久化
- 【火爐煉AI】機器學習014-用SVM構建非線性分類模型AI機器學習模型
- G014-ORACLE-ASK O SQL*PLUS / 達夢DiSQL / 高斯ZSQL 命令列翻頁OracleSQL命令列
- 學習筆記CB014:TensorFlow seq2seq模型步步進階筆記模型
- Rust 程式設計視訊教程(進階)——014RefCell 和內部可變性Rust程式設計
- 面試每日一題014:對於設計世界觀你有什麼好的想法(文案向)面試每日一題
- M7093 Fld selectn for mvmt type 501 / acct 14030201 differs for Vendor goods movement (014)Go
- 014 Linux 線上高頻使用以及面試高頻問題——如何查詢大檔案並安全的清除?Linux面試
- 014、Vue3+TypeScript基礎,computed計算屬性中使用get和set方法來讀取和修改VueTypeScript
- 手把手教你做閱讀理解題-初中中考閱讀理解解題技巧014-A Fun Plant Experiment to Try at Home
- 傑裡之AC696X SDK014-p1 對耳連蘋果手機開 SIRI 有時藍芽會斷連問題處理【篇】蘋果藍芽
- 中考英語首字母快速突破014-2021上海徐匯英語二模-The Glamorous Life of TV Journalists-電視記者的風光生活
- 中考英語首字母快速突破014-2021上海徐匯英語二模-Future Changes: Predictions and Perspectives-未來變遷:預測與視角
- 【雲星資料---Apache Flink實戰系列(精品版)】:Apache Flink高階特性與高階應用014-Flink在批處理中常見的sink和source002Apache