This document discusses various topics related to using the UNIX shell for database administration tasks. It provides examples of common shell commands and techniques including piping, redirection, checking file attributes, conditional statements, loops, reading user input, finding open ports, common UNIX tools like grep, awk, and kill processes. It also discusses setting up aliases and choosing the right shell based on features.
php[world] 2016 - You Don’t Need Node.js - Async Programming in PHPAdam Englander
Asynchronous frameworks allow developers to build stateful protocols and Internet of Things applications without threading and forking. Python, Ruby, and Node.js have had asynchronous frameworks for over ten years. PHP is now starting to catch up with Icicle.io. Learn the basics concepts of event based programming, and how the event loop allows a single thread to process all the requests for your application.
Presentation done at Kamailio World 2013, Berlin, Germany - several options for scalability of SIP routing with Kamailio, from configuration file tricks to stateless and stateful load balancing with dispatcher module.
php[world] 2016 - You Don’t Need Node.js - Async Programming in PHPAdam Englander
Asynchronous frameworks allow developers to build stateful protocols and Internet of Things applications without threading and forking. Python, Ruby, and Node.js have had asynchronous frameworks for over ten years. PHP is now starting to catch up with Icicle.io. Learn the basics concepts of event based programming, and how the event loop allows a single thread to process all the requests for your application.
Presentation done at Kamailio World 2013, Berlin, Germany - several options for scalability of SIP routing with Kamailio, from configuration file tricks to stateless and stateful load balancing with dispatcher module.
This is the sixth set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Introduction to source{d} Engine and source{d} Lookout source{d}
Join us for a presentation and demo of source{d} Engine and source{d} Lookout. Combining code retrieval, language agnostic parsing, and git management tools with familiar APIs parsing, source{d} Engine simplifies code analysis. source{d} Lookout, a service for assisted code review that enables running custom code analyzers on GitHub pull requests.
This is the sixth set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Introduction to source{d} Engine and source{d} Lookout source{d}
Join us for a presentation and demo of source{d} Engine and source{d} Lookout. Combining code retrieval, language agnostic parsing, and git management tools with familiar APIs parsing, source{d} Engine simplifies code analysis. source{d} Lookout, a service for assisted code review that enables running custom code analyzers on GitHub pull requests.
When performing an investigation it is helpful to be reminded of the powerful options available to the investigator. This document is aimed to be a reference to the tools that could be used.
This course provides you with knowledge and skills in the areas of:
1. Sorting numbers
2. Sorting strings
3. Sorting arrays
4. Sorting hashes
This course does not cover sorting algorithms. Instead, it is about sorting various types of data in Perl.
This lecture discusses the concept of Regular Expressions along with its usage in different tools such as grep, sed, and awk
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
Oracle Cloud ERP - where is My Data?
All about Oracle integration products and Cloud ERP:
* What are the ways to deliver it - all 3 options and obvious choice for our project
- File Based Data Import
- Web Services
* Can I trust the ERP statuses?
- Custom reporting using BI Publisher
- Security implications
* Lessons learned
- What works out of the box (provision SOA CS and, patch it)
- Security challenges
Tēmas : Trace File analyzer, live demo.
Valoda: Latviešu
Ar katru jaunu versiju Oracle ģenerē vairāk un vairāk diagnostiskās informācijas un bieži ir grūti sekot, kur tiek ierakstīta atbilstoša informācija. Vēlāk arī parādās jautājums, kā šo visu uzkopt, lai visa pieejamā vieta neaizietu nevajadzīgām lietām. Parādīšu un pastāstīšu par savu pieredzi ar TFA rīku trace/log failu pavaldīšanā, konfigurēšanā, kā arī par citām tā iespējām un zemūdens akmeņiem.
Aleksejs Nemirovskis - Manage your data using oracle BDAAndrejs Vorobjovs
Manage Your Data, Using Oracle Big Data Appliance - Tips & Tricksngest, process and manage the data, using Oracle Big Data Appliance (end-to-end BigData solution from Oracle):
- Oracle BDA architecture and componets overview - Oracle platform, Cloudera CDH, Clodera Manager and specific Oracle components;
- Advantages and additional value of an Oracle BDA;
- Challenges, faced inside whole stack (BDA, Cloudera);
- Challenges, which came from original Hadoop EcoSystem;
- Customer case (anonymized): how to utilize a power of an Oracle BDA, including external Informatica Big Data Management tool.
in LATVIAN language: Viens no galvenajiem datubāzes administratora uzdevumiem ir veikt datubāzes backup un prast no tā atjaunot datubāzi. Mysql bezmaksas versija nepiedāvā datubāzes administratoram ļoti daudz izvēles. Sava prezentācija es pastāstīšu par šādiem rīkiem:
-- MySQLdump
-- Percona XtraBackup
-- Mysql enterprise backup (MEB)
--Un citiem rīkiem kas palīdz man veikt db backup
Latvian Oracle User Group (LVOUG) ir neatkarīga organizācija, kas apvieno Oracle lietotājus, profesionāļus un citus interesantus Latvijā. Tās mērķis ir veicināt informācijas, zināšanu un pieredzes apmaiņu starp grupas dalībniekiem, informēt par Oracle produktu uzlabojumiem un jauninājumiem kā arī nodrošināt atgriezenisko saiti ar Oracle.
Par grupas dalībnieku var kļūt jebkurš interesents.
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories. Andrejs Vorobjovs
Tēmas apraksts: Middleware atjaunināšana līdz FMW 12c. Reālu projektu pieredze. Salīdzinoši nesen tika publicēta Oracle FMW 12c produktu līnija. Šoreiz gribu padalīties ar atjaunināšanas līdz Oracle FWM 12c pieredzi. Pamatu pamati, zemūdens akmeņi un tehniskie triki, kas var palīdzēt jums ietaupīt laiku un var būt arī saglabāt nervus.
Тема (РУ): Обновление Middleware до FMW 12c. Опыт реальных проектов.Описание: Относительно недавно вышла в свет линейка продуктов Oracle FMW 12c. В этот раз я хочу поделиться своим опытом обновления до Oracle FWM 12c.
Прописные истины, подводные камни и технические хитрости, которые помогут сберечь ваше время и, возможно и нервы.
Description(ENG): Relatively recently Orcale FMW 12c product line has been published.Today I would like to share my experience of middleware upgrade to Oracle FWM 12c.
Basics, pitfalls and technical tricks, that can save your time and nerves, may be.
Mysql ir populārākā atvērta koda datubāze un tajā ir vairāk nekā 400 parametri, bet nepieciešams uzstādīt /izmainīt tikai dažus no tiem, lai jūs nesaskartos ar problēmām jau pirmajā dienā. Šajā prezentācijā stāstīšu par parametriem, kuri ietekme datu drošību, datu atjaunošanu un datu konsistenci.
Izmantojiet iespēju piedalīties plašākajā IT nozares konferencē Baltijā Riga Dev Day 2016, kas jau otro gadu no 2. līdz 4. martam norisināsies Rīgā.
Ko iegūsiet?
Praktiski pielietojamu informāciju par IT nozares aktuālākajām un jaunākajām tēmām – mobilo ierīču aplikāciju izstrādi, Java/JVM, JavaScript jaununiem, Oracle datu bāzes risinājumiem un modernākajām tehnoloģijām.
OTN tour 2015 – это семинар с участием авторитетных международных спикеров, направленный на привлечение участников с целью обмена знаниями и опытом в области применения передовых технологий. Конференция прошла 27 ноября в конференц-зале ресторана Stargorod и стала первой из серии мероприятий такого рода.
How Oracle Certification helped to advance my career" - in that presentation I will talk about how Oracle Certification helped me to archive where I am now and give hints on how the best to use it.
-- We can do an expert panel with Alex on
How Social Media can help to advance your professional career.
And motivation from Jury Velikanov
"How Oracle Certification helped to advance my career" - in that presentation I will talk about how Oracle Certification helped me to archive where I am now and give hints on how the best to use it.
OTN tour 2015 benchmarking oracle io performance with Orion by Alex GorbachevAndrejs Vorobjovs
Every time Alex demonstrates charts he produces during IO benchmarks with ORION tool (Oracle I/O Numbers), he hears "Wow! How do you build these?" In this session Alex will teach how to benchmark your storage subsystem and capacity and how to stress test it to the limits. You will learn how easy it is to setup ORION benchmark and collect I/O performance characteristics of your platform and assess scalability of small random I/Os, impact of writes on I/Operformance, impact of different RAID levels, how backups can affect your OTLP traffic, performance of outer areas of disks vs inner areas, and compare SSD with HDD performance. ORION tests are very repeatable so it's a great measuring tool in your Measure, Analyze, Change, Measure cycle.
OTN tour 2015 Oracle Enterprise Manager 12c – Proof of ConceptAndrejs Vorobjovs
Why we are talking about this
How – minimal survival kit
Database provisioning:
Database provisioning
Pluggable database provisioning
Schema provisioning
Middleware provisioning:
New instance installation
Instance cloning
Integration provisioning
Restrictions
Conclusion
Q&A
Peteris Arajs
Technology Architecture Associate Manager at Accenture
More than 15 years experience in IT industry with main focus to:
- DB design, analysis, development and performance tuning
- Oracle eBusiness Suite
- Oracle Middleware
Also experienced in all stages of software development life cycle (SDLC) from business requirements and technical definitions to development, testing and production support.
Alex Nemirovskis
Technology Architecture Associate Manager at Accenture
More than 19 years experience in IT industry with main focus to:
- DB design, analysis, development and performance tuning
- DWH / ETL / BI / Analytics
- Oracle ADF
Also experienced in all stages of software development life cycle (SDLC) from business requirements and technical definitions to development, testing and production support.
This is an introduction to the modern cloud technology landscape and what it takes to migrate Oracle databases to the cloud and operate them there. The attendees will learn about cloud concepts and what are the various options of running databases in the cloud Infrastructure as a Service (IaaS) or Platform as a Service (PaaS).
OTN tour 2015 Experience in implementing SSL between oracle db and oracle cli...Andrejs Vorobjovs
Experience in implementing SSL between Oracle DB and Oracle Clients" - presentation will explain how to configure implement SSL between Oracle DB/Client
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
3. DO NOT DANCE
•
examples is not tested on production
•
one size does not fits all
•
before copy and paste, check manual
•
afterwards check manual
4. UNIX SHELL IN DBA
EVERYDAY
• how
to get shell
• echo $SHELL
• how to roll shell
• examples
• real life
• resources
5. SHELL IS SEXY!
#
who | grep -i blonde | date; cd ~; unzip; touch;
strip; finger; mount; gasp; yes; uptime; umount;
sleep
6. SHELL IS SEXY!
•
•
•
•
•
•
•
•
•
#
who - show who is logged on
grep - print lines matching a pattern
mount - mount a filesystem
touch - change file timestamps
strip - discard symbols from object files
finger - user information lookup program
umount - unmount a filesystem
gasp - a preprocessor for assembly programs
yes - output a string repeatedly until killed
who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp;
yes; uptime; umount; sleep
11. WHY ME?
•
read founded and existing scripts
•
automate systems or databases
•
manual or scheduled tasks from shell side
•
monitoring
•
backups
•
multiple databases tasks
15. SHELL
•
sh - Bourne shell
•
ksh - Korn shell
•
bash - Bourne-Again shell
•
csh - C shell
•
tcsh, zsh, rc, es (10+)
http://en.wikipedia.org/wiki/Unix_shell
16. SHELL
Job control
Aliases
Shell functions
Command history
Command line editing
Vi Command line editing
Emacs Command line editing
User name look up
Login/Logout watching
Filename completion
Username completion
Hostname completion
History completion
Builtin artithmetic evaluation
Can follow symbolic links invisibly
Periodic command execution
Custom Prompt (easily)
Underlying Syntax
Freely Available
Can cope with large argument lists
Has non-interactive startup file
Has non-login startup file
Has anonymous functions
List Variables
Full signal trap handling
Local variables
Exceptions
sh
N
N
Y(1)
N
N
N
N
N
N
N
N
N
N
N
N
N
N
sh
N
Y
N
N
N
N
Y
N
N
csh
Y
Y
N
Y
N
N
N
Y
N
Y(1)
Y(2)
Y(2)
N
Y
N
N
N
csh
N
N
Y
Y
N
Y
N
N
N
ksh
Y
Y
Y
Y
Y
Y
Y
Y
N
Y
Y
Y
N
Y
Y
N
Y
sh
N(4)
Y
Y(5)
Y(5)
N
Y
Y
Y
N
bash
Y
Y
Y
Y
Y
Y
Y
Y
N
Y
Y
Y
Y
Y
Y
N
Y
sh
Y
Y
Y(5)
Y
N
N
Y
Y
N
tcsh
Y
Y
N
Y
Y
Y(3)
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
csh
Y
Y
Y
Y
N
Y
N
N
N
zsh
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
sh
Y
Y
Y
Y
N
Y
Y
Y
N
rc
N
N
Y
L
L
L
L
L
F
L
L
L
L
N
N
N
Y
rc
Y
Y
N
N
Y
Y
Y
Y
N
es
N
N
Y
L
L
L
L
L
F
L
L
L
L
N
N
N
Y
rc
Y
Y
N
N
Y
Y
Y
Y
Y
20. KSH vs. BASH
•
•
•
•
•
•
•
bash is much easier to set a prompt that displays the current directory
ksh has associative arrays and bash doesn’t
ksh handles loop syntax a bit better
bash handles getting exit codes from pipes in a cleaner way
ksh has the print command which is way better than the echo command
bash has tab completions
ksh has the syntax cd old new which replaces old with new in your
directory and cd over there
!
pwd - /foo/bar/barfoo/one/bar/bar/foo/bar
cd to /foo/bar/barfoo/two/bar/bar/foo/bar
ksh - cd one two
bash - cd ../../../../../two/bar/bar/foo/bar
23. PROCESS RUN
•
cmd1 && cmd2 - run cmd1; if it returns 0 (success), run cmd2
•
cmd1 || cmd2 - run cmd1; if it returns non-zero, run cmd2
•
cmd1 & cmd2 - run cmd1 and also cmd2
•
(ls -1) - run the command "ls -1" in a sub shell
•
cmd1 | cmd2 - run cmd1 and output as input to cmd2
25. REDIRECTION
•
command > outfile - redirect output to file
•
command >> outfile - redirect output and append to file
•
command 2> outfile - redirect STDERR
•
command &> outfile - redirect STDOUT and STDERR
•
tee - redirect STDOUT to file and STDOUT
26. REDIRECTION
#
ls
#
ls > file
#
ls | tee file
#
ls | tee –a file
#
ls | tee file1 file2 file3
mailx –s ‘alert.log errors’ dba@seb.lv <
tail -10 alert_$ORACLE_SID.log | grep ORA-|
tee error.log
28. IF
•
•
•
•
•
•
•
•
•
•
[ -a FILE ]
True if FILE exists.
[ -d FILE ]
True if FILE exists and is a directory.
[ -h FILE ]
True if FILE exists and is a symbolic link.
[ -s FILE ]
True if FILE exists and has a size greater than zero.
[ -r FILE ]
True if FILE exists and is readable.
[ -w FILE ]
True if FILE exists and is writable.
[ -x FILE ]
True if FILE exists and is executable.
[ -O FILE ]
True if FILE exists and is owned by the effective user ID.
[ -G FILE ]
True if FILE exists and is owned by the effective group ID.
[ -L FILE ]
True if FILE exists and is a symbolic link.
29. IF
•
•
•
•
•
•
•
[ -z STRING ]
True of the length if "STRING" is zero.
[ -n STRING ]
True if the length of "STRING" is non-zero.
[ STRING1 == STRING2 ]
True if the strings are equal.
[ STRING1 != STRING2 ]
True if the strings are not equal.
[ STRING1 < STRING2 ]
True if "STRING1" sorts before
"STRING2" lexicographically in the current locale.
[ STRING1 > STRING2 ]
True if "STRING1" sorts after
"STRING2" lexicographically in the current locale.
[ ARG1 OP ARG2 ]
"OP" is one of -eq, -ne, -lt, -le, -gt or -ge.
30. IF
•
[ ! EXPR ]
True if EXPR is false.
•
[ EXPR1 -a EXPR2 ]
True if both EXPR1 and
EXPR2 are true.
•
[ EXPR1 -o EXPR2 ]
True if either EXPR1 or
EXPR2 is true.
31. IF
if [ -f alert_ORCL.log ]; then
echo "alert_ORCL.log exists."
fi
if [ "$STATUS" == "PRIMARY" ]; then
echo "Database status - ${STATUS}"
else
echo "Database not in correct mode (${STATUS})"
exit 0;
fi
if [ "$num_of_beer" -gt "3" -a "$num_of_beer" -lt "5" ]; then
echo "You've worked hard enough for today."
fi
32. FOR WHILE
•
for loop
for FILE in udump/*.trc
do
tkprof $FILE $FILE.out sort=exeela,fchela,prsela
done
•
while loop
COUNTER=0
while [ $COUNTER -lt 10 ]; do
echo The counter is $COUNTER
let COUNTER=COUNTER+1
done
33. INPUT
•
get data from user
stty -echo
echo -n “Please enter sys password: "
read pw
stty echo
cont=n
echo -n "Do you really want to continue? (y/n) "
read cont
if [ "$cont" != "y" ]; then
echo "Quitting..."
exit
fi
34. OPEN PORTS
echo "Scanning TCP ports..."
for p in {1..1023}
do
(echo >/dev/tcp/localhost/$p) >/dev/null 2>&1 && echo "$p open"
done
35. TOOLSET
•
grep - searching for text pattern
•
awk - script language for text-processing
•
ps - information on running processes
•
find - searching for files
•
sed - stream editor for filtering and transforming text
•
watch - execute a program periodically
•
wc - counting lines/chars
•
cat - join files
http://en.wikipedia.org/wiki/List_of_Unix_programs
38. ONE LINERS
•
http://www.pement.org/awk/awk1line.txt
# delete trailing whitespace (spaces, tabs) from end of each line
awk '{sub(/[ t]+$/, "")};1'
!!
# change "scarlet" or "ruby" or "puce" to "red"
awk '{gsub(/scarlet|ruby|puce/, "red")}; 1'
!
! # print any line where field #5 is equal to "abc123"
awk '$5 == "abc123"'
•
http://sed.sourceforge.net/sed1line.txt
44. ALIAS
•
alias mount='mount |column -t’
/dev/sda1
proc
sysfs
none
none
none
udev
devpts
!
!
•
on
on
on
on
on
on
on
on
/
/proc
/sys
/sys/fs/fuse/connections
/sys/kernel/debug
/sys/kernel/security
/dev
/dev/pts
type
type
type
type
type
type
type
type
ext4
proc
sysfs
fusectl
debugfs
securityfs
devtmpfs
devpts
(rw,errors=remount-ro)
(rw,noexec,nosuid,nodev)
(rw,noexec,nosuid,nodev)
(rw)
(rw)
(rw)
(rw,mode=0755)
(rw,noexec,nosuid,gid=5,mode=0620)
alias path='echo -e ${PATH//:/n}'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
64. say() {
echo $1 | tee -a oraup_stat.txt
}
!
up_db() {
say ">>>>>>>> ORACLE_SID=$ORACLE_SID, celju augshaa..."
sqlplus "/ as sysdba" <<EOF | tee -a oraup_stat.txt
startup
exit
EOF
}
!
if [ ! -f $ORACLE_HOME/bin/oracle ]; then
say "Nav uzstadita ORACLE_HOME."
exit
else
say "ORACLE_HOME=$ORACLE_HOME"
fi
!
if [ $# -eq 0 ]; then
say ">>> Nav noraditi parametri"
die()
fi
!
while [ $# -ne 0 ]; do
export ORACLE_SID=$1
up_db
done
65. TEST ENV
Ir paceltas sekojoshas datubaazes:
======================================================================================================================
DB SID
Memory
ORACLE_HOME and Product Version
Actual Database Version
---------------------------------------------------------------------------------------------------------------------APVDIG
1029 M /export/home/oracle/product/10.2.0
10.2.0.4.0 64-bit
10.2.0.4.0 64-bit
ARHTEST
545 M /export/home/oracle/product/8.1.7
8.1.7.4.0 32-bit
8.1.7.4.0 32-bit
EBRTEST
1895 M /export/home/oracle/product/11.2.0.
11.2.0.2.0 64-bit
11.2.0.2.0 64-bit
ECRMUAT
1496 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
IDM
856 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
MBPTEST
1736 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
PRO11
515 M /export/home/oracle/product/11.2.0.
11.2.0.2.0 64-bit
11.2.0.2.0 64-bit
RMSTEST
429 M /export/home/oracle/product/10.2.0
10.2.0.4.0 64-bit
10.2.0.4.0 64-bit
ROSMET11
856 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
SMTEST
183 M /export/home/oracle/product/9.2.0.1
9.2.0.8.0 64-bit
9.2.0.8.0 64-bit
SYMDW
1511 M /export/home/oracle/product/9.2.0.1
9.2.0.8.0 64-bit
9.2.0.8.0 64-bit
SYMIBM
4903 M /export/home/oracle/product/9.2.0.1
9.2.0.8.0 64-bit
9.2.0.8.0 64-bit
SYMUAT
6503 M /export/home/oracle/product/9.2.0.1
9.2.0.8.0 64-bit
9.2.0.8.0 64-bit
TPENS11
828 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
TPENSNEW
588 M /export/home/oracle/product/11.1.0
11.1.0.7.0 64-bit
11.1.0.7.0 64-bit
TRISD
960 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
UFTEST
381 M /export/home/oracle/product/10.2.0
10.2.0.4.0 64-bit
10.2.0.4.0 64-bit
VOIS11T
884 M /export/home/oracle/product/11.2.0.
11.2.0.3.0 64-bit
11.2.0.3.0 64-bit
======================================================================================================================
Kopaa DB: 19
26472 M
66. _run_sql() {
selekts=`sqlplus "/ as sysdba"<<endsql
set head off;
set serveroutput on;
declare
x number;
i number;
n number;
comp varchar2(255);
vers varchar2(255);
c varchar2(1000);
begin
select count(*) into x from dba_views where view_name = 'DBA_REGISTRY' and rownum = 1;
if x = 0 then -- versijas zem 9.0.0.0.0
c := 'select product, version from product_component_version where product
like ''Oracle%Enterprise Edition%'' or product like ''Oracle%Server%''';
else -- versijas virs 9.0.0.0.0
c := 'select comp_name, version from dba_registry where comp_name
like ''Oracle%Catalog Views%''';
end if;
i := dbms_sql.open_cursor;
dbms_sql.parse(i, c, dbms_sql.native);
dbms_sql.define_column(i, 1, comp, 255);
dbms_sql.define_column(i, 2, vers, 255);
n := dbms_sql.execute(i);
if dbms_sql.fetch_rows(i) > 0 then
dbms_sql.column_value(i, 1, comp);
dbms_sql.column_value(i, 2, vers);
dbms_output.put_line('>>>'||comp||' '||vers||'<<<');
end if;
dbms_sql.close_cursor(i);
end;
/
select '>>>'||length(addr)*4||'<<<' from v$process where ROWNUM = 1;
exit
endsql`
echo $selekts
}
75. # datu bazes statusa noskaidrosana
STATUS_SQL="select DATABASE_ROLE FROM v$database;nexitn"
STATUS=`echo $STATUS_SQL | sqlplus -S / as sysdba | tail -2| head -1`
!
echo $STATUS
!
if [ "$STATUS" == "PRIMARY" ]; then
echo "Database status - ${STATUS}"
else
echo "Database not in correct mode (${STATUS})"
exit 0;
fi
77. # check for business backup required
PAPILDUS_BACKUP=`cat ${BACKUP_CFG} | grep -v "#" | grep "PAPILDUS_BACKUP.${D_DATE}" | awk
'BEGIN {FS="="} {print $2} '`
IKDIENAS_BACKUP=`cat ${BACKUP_CFG} | grep -v "#" | grep "IKDIENAS_BACKUP.${D_WEEK_DAY}" |
awk 'BEGIN {FS="="} {print $2} '`
!
BACKUP_TIME=28;
!
if [ "${PAPILDUS_BACKUP}" = "MONTH" ] ; then
# start business backup
BACKUP_TIME=120;
BACKUP_TAPE=tdpo_monthly.opt
BACKUP_LEVEL=0;
BACKUP_TAG=${PAPILDUS_BACKUP}` date '+%Y%m' `
#
elif [ "${IKDIENAS_BACKUP}" = "INCR" ] ; then
BACKUP_TIME=28;
BACKUP_TAPE=tdpo.opt
PAPILDUS_BACKUP=INCR
BACKUP_LEVEL=1;
BACKUP_TAG=${PAPILDUS_BACKUP}` date '+%Y%m%d' `
#
elif [ "${IKDIENAS_BACKUP}" = "FULL" ] ; then
BACKUP_TIME=28;
BACKUP_TAPE=tdpo.opt
PAPILDUS_BACKUP=FULL
BACKUP_LEVEL=0;
BACKUP_TAG=${PAPILDUS_BACKUP}` date '+%Y%m%d' `
#
fi
78. cat > $RUNCMD <<!
connect target /;
!
# Parameters set section
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 28 DAYS;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE 'sbt_tape' TO 'online_ctl_
%F.ctl';
CONFIGURE CHANNEL DEVICE TYPE 'sbt_tape' PARMS 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/
client/oracle/bin64/${BACKUP_TAPE})' FORMAT 'backup_df_%t_%s_%p_%c' MAXPIECESIZE 100G;
CONFIGURE DEVICE TYPE 'sbt_tape' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
CONFIGURE DEFAULT DEVICE TYPE TO SBT;
CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO ALL STANDBY;
!
run {
set duplex 1;
backup incremental level ${BACKUP_LEVEL} database tag '${BACKUP_TAG}' KEEP UNTIL TIME
'sysdate + ${BACKUP_TIME}' LOGS;
backup current controlfile;
backup spfile format 'spfile_%d_%s_%T_dbid%I.ora' tag 'spfile ${BACKUP_TAG}';
backup as compressed backupset archivelog all delete input filesperset=20;
}
!
!
#
${ORACLE_HOME}/bin/rman msgno cmdfile=${RUNCMD} log=${RMANLOG} 1>>${RUNLOG} 2>&1
81. HA WORKAROUND
!
•
database is PHYSICAL STANDBY (RULE_1)
•
if dgmgrl show configuration hang (RULE_2)
•
has errors "DMON: Database ora is still
working on the task." (RULE_3)
•
manual failover
95. HAVE YOURSELF A MERRY
LITTLE CHRISTMAS
SQL> set pagesize 0
SQL> set head off
SQL> with Mx as (select 60 as MaxWidth from dual)
select decode
( sign(floor(MaxWidth /2)-rownum)
, 1
, lpad( ' ', floor(MaxWidth /2)(rownum-1)) || rpad( '*', 2*(rownum-1)+1, ' *')
, lpad( '* * *', floor(MaxWidth/2)+3)
)
from all_tables ,Mx
where rownum < floor(MaxWidth /2) + 6;