SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Oracle Solaris Day 2013 (26.6.2013)
Oracle DB a OS Solaris
### zony - vytvoreni
#zonecfg -z ozone "create; set zonepath=/rpool/zones/ozone; export"
#zoneadm list -icv
#sysconfig create-profile -o /root/prof.xml
#zoneadm -z ozone install -c /root/prof.xml
zoneadm list -icv
zoneadm -z ozone boot
zoneadm list -icv
zoneadm -z ozone
#pkg install x11/clients library/motif solaris-large-server
### zony - rizeni zdroju v zone
psrinfo
zlogin ozone psrinfo
zonecfg -z ozone "set max-shm-memory=2g; add dedicated-cpu; set ncpus=1; end; export"
zoneadm -z ozone reboot
prctl $$
zlogin ozone psrinfo
### zony - priprava oracle + install oracle binary
zlogin ozone
groupadd -g 200 oinstall
groupadd -g 201 dba
useradd -u 200 -g oinstall -G dba -c "oracle database user" -d /export/home/oracle -m oracle
projadd -K 'project.max-shm-memory=(privileged,2048m,deny)' user.oracle
passwd oracle
mkdir /opt/oracle
chown -R oracle:oinstall /opt/oracle
mkdir -p /var/opt/oracle 2>/dev/null
cat > /var/opt/oracle/oraInst.loc <<EOF
inventory_loc=/opt/oracle/oraInventory
inst_group=oinstall
EOF
chown oracle:oinstall /var/opt/oracle/oraInst.loc
chmod 664 /var/opt/oracle/oraInst.loc
cat >> /export/home/oracle/.profile <<'EOF'
ORACLE_BASE=/opt/oracle
ORACLE_HOME=${ORACLE_BASE}/product/11.2.0/db_1
PATH=$PATH:${ORACLE_HOME}/bin
LD_LIBRARY_PATH=/lib:/usr/lib:$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib
ORACLE_SID=DB
DB_NAME=DB
ORA_NLS10=${ORACLE_HOME}/nls/data
TNS_ADMIN=${ORACLE_HOME}/network/admin
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15
CLASSPATH=$ORACLE_HOME/jdk:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH DB_NAME ORA_NLS10 TNS_ADMIN NLS_LANG CLASSPATH
EOF
. /export/home/oracle/.profile
su - oracle -c "/ORACLE/database/runInstaller -responseFile /ORACLE/ora112_db_install.rsp -silent"
sleep 60
while ! grep -q 'Shutdown Oracle Database 11g.*Installer' /opt/oracle/oraInventory/logs/installActions*.log 2>/dev/null;
do
sleep 10
done
$ORACLE_HOME/root.sh
### ZFS - pro data do zony s delagaci rizeni pro "oracle"
#zfs create -o zoned=on -o mountpoint=/oradata -o quota=10g rpool/oradata
zfs get all rpool/oradata
zonecfg -z ozone "add dataset; set name=rpool/oradata; end"
zoneadm -z ozone reboot
zlogin ozone
zfs list
zfs allow oracle clone,create,destroy,mount,snapshot,promote,rollback,recordsize oradata
chown oracle:dba /oradata
su - oracle
zfs snapshot oradata@test
zfs list
zfs destroy oradata@test
# data oracleDB vytvorena pomoci "dbca"
#zfs snapshot oradata@datatest
sqlplus '/ as sysdba'
startup
select * from test;
drop table test;
select * from test;
shutdown
zfs rollback oradata@datatest
sqlplus '/ as sysdba'
startup
select * from test;
zfs get all oradata
zfs set recordsize=8k oradata
# SQL: select value from v$parameter where name = 'db_block_size';
### site - virtualizace (interni switch0) a rizeni toku na sitovce a na tcp portu
#netadm enable -p ncp DefaultFixed
dladm help
dladm show-link
dladm create-etherstub switch0
dladm create-vnic -l switch0 vnic0
dladm show-link
ipadm create-ip vnic0
ipadm create-addr -T static -a 192.168.99.1/24 vnic0/v4
ipadm show-addr
zonecfg -z ozone "select anet linkname=net0; set lower-link=switch0; end"
zonecfg -z ozone set
zonecfg -z ozone "select anet linkname=net0; set maxbw=100m; end"
zonecfg -z ozone "set limitpriv=default,dtrace_proc,dtrace_user"
dladm show-linkprop ozone/net0
zoneadm -z ozone reboot
dladm show-linkprop ozone/net0
ping 192.168.99.2
zlogin ozone
dladm show-link
ipadm show-addr
ping 192.168.99.1
mkfile 100m /tmp/file
scp /tmp/file oracle@192.168.99.2:/tmp
#~8sec -> 100Mbit/sec
zlogin ozone
flowadm add-flow -l net0 -a transport=TCP,local_port=22 ssh-flow
flowadm set-flowprop -p maxbw=50M ssh-flow
flowadm show-flowprop
flowadm show-flow
scp /tmp/file oracle@192.168.99.2:/tmp
#~16sec -> 50Mbit/sec
zlogin ozone flowstat
### role - privilegia
zlogin ozone
su - oracle
ps -ef
ppriv -l
usermod -K 'defaultpriv=basic,!proc_info' oracle
su - oracle
ps -ef
### role - profily
zlogin ozone
profiles -a
profiles -p "Process Management" info
roleadd -m -d /export/home/killer -P "Process Management" killer
passwd killer
usermod -R killer user
sleep 1000 &
su - user
/usr/bin/kill
roles
su - killer
profiles -l
/usr/bin/kill
### SMF
svcs -x
svcs
svcs apache22
svcadm enable apache22
svcs -d apache22
svcs -D apache22
svcs -p apache22
pkill httpd
svcs -p apache22
svcadm disable apache22
### SMF - Oracle DB
zlogin ozone
cat > oracle.xml <<'EOF'
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="oracle-database-service">
<service name="site/oracle" type="service" version="1">
<dependency name="multi-user" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/milestone/multi-user:default"/>
</dependency>
<instance name="DB" enabled="false">
<exec_method name="start" type="method"
exec="sh -c '. /export/home/oracle/.profile; echo startup|$ORACLE_HOME/bin/sqlplus / as sysdba'"
timeout_seconds="500">
<method_context>
<method_credential
user="oracle"
group="oinstall"
privileges="basic,!proc_info"/>
</method_context>
</exec_method>
<exec_method name="stop" type="method"
exec="sh -c '. /export/home/oracle/.profile; echo shutdown immediate|$ORACLE_HOME/bin/sqlplus / as sysdba'"
timeout_seconds="900">
<method_context>
<method_credential
user="oracle"
group="oinstall"
privileges="basic,!proc_info"/>
</method_context>
</exec_method>
<property_group name="general" type="framework">
<propval name="action_authorization" type="astring" value="solaris.smf.manage.oracle.database"/>
<propval name="value_authorization" type="astring" value="solaris.smf.manage.oracle.database"/>
</property_group>
</instance>
</service>
</service_bundle>
EOF
svccfg import oracle.xml
su - user
svcadm enable oracle
cat > /etc/security/auth_attr.d/oracle <<EOF
solaris.smf.manage.oracle.database::::::
solaris.smf.manage.oracle.listener::::::
EOF
cat /etc/security/auth_attr.d/oracle
usermod -A solaris.smf.manage.oracle.database user
su - user
auths
svcadm enable oracle
### dtrace v zone a dtrace na Oracle DB
su - mysql -c "/usr/mysql/bin/mysqld_safe &"
dtrace -l | awk '{print $2}' | sort | uniq -c | sort -n
dtrace -l -n 'mysql*:::' | tail +2 | awk '{print $5}' | sort | uniq -c
#zonecfg -z ozone "set limitpriv=default,dtrace_proc,dtrace_user"
zlogin ozone
#pkg install dtrace
dtrace -l
dtrace -l | awk '{print $2}' | sort | uniq -c | sort -n
su - oracle
sqlplus '/ as sysdba'
select count(*) from dba_users;
select plan_table_output from table(dbms_xplan.display_cursor(null,null,'basic'));
@spid
#select s.inst_id, s.sid, s.serial#, p.spid, s.username, s.program from gv$session s join gv$process p on p.addr =
s.paddr and p.inst_id = s.inst_id where s.type != 'BACKGROUND';
export PID=
dtrace -p $PID -Fn 'pid$target:oracle:qer*Fetch*:entry pid$target:oracle:qer*Fetch*:return' | tee out.txt
select count(*) from dba_users;
sed -f os_explain.sed out.txt
set timing on
create table t1(a int) tablespace USERS;
create table t2(a int) tablespace SYSTEM;
commit;
alter system checkpoint;
exec for i in 1..100000 loop insert into t2 values(i); end loop;
commit;
alter system checkpoint;
exec for i in 1..100000 loop insert into t1 values(i); end loop;
commit;
alter system checkpoint;
cat dstackprof.sh
./dstackprof.sh $PID 10
exec for i in 1..100000 loop insert into t2 values(i); end loop;
commit;
alter system checkpoint;
./dstackprof.sh $PID 10
exec for i in 1..100000 loop insert into t1 values(i); end loop;
commit;
alter system checkpoint;
show parameter
show parameter db_block_checking
SET LINESIZE 140
COLUMN KSPPINM FORMAT A40
COLUMN KSPPDESC FORMAT A80
COLUMN KSPPSTVL FORMAT A5
COLUMN KSPPSTDVL FORMAT A5
COLUMN KSPPSTDF FORMAT A5
select KSPPINM,KSPPDESC,KSPPSTVL,KSPPSTDVL,KSPPSTDF from X$KSPPSV a,x$ksppi b where a.indx=b.indx and KSPPINM like
'_%' ESCAPE '';
show parameter "_db_always_check_system_ts"
alter system set "_db_always_check_system_ts" = FALSE;
commit;
alter system checkpoint;
exec for i in 1..100000 loop insert into t2 values(i); end loop;
commit;
alter system checkpoint;
exec for i in 1..100000 loop insert into t1 values(i); end loop;
commit;
alter system checkpoint;
### kernel softwarovy audit
auditconfig -setpolicy +perzone
zlogin ozone
auditconfig -lspolicy
auditconfig -setpolicy +zonename
auditconfig -setpolicy +argv
usermod -K 'audit_flags=lo,ex,ua,as:no' oracle
cat /etc/security/audit_class
grep EXEC /etc/security/audit_event
profiles -p "Audit Review" info
roleadd -m -d /export/home/auditor -P "Audit Review" auditor
passwd auditor
usermod -R auditor,killer user
svcadm enable auditd
su - oracle
sqlplus
rm x
su - user
roles
su - auditor
auditreduce | praudit -l

Weitere ähnliche Inhalte

Kürzlich hochgeladen

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Kürzlich hochgeladen (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Oracle Solaris Day 2013 - Oracle DB and OS Solaris - LABS

  • 1. Oracle Solaris Day 2013 (26.6.2013) Oracle DB a OS Solaris ### zony - vytvoreni #zonecfg -z ozone "create; set zonepath=/rpool/zones/ozone; export" #zoneadm list -icv #sysconfig create-profile -o /root/prof.xml #zoneadm -z ozone install -c /root/prof.xml zoneadm list -icv zoneadm -z ozone boot zoneadm list -icv zoneadm -z ozone #pkg install x11/clients library/motif solaris-large-server ### zony - rizeni zdroju v zone psrinfo zlogin ozone psrinfo zonecfg -z ozone "set max-shm-memory=2g; add dedicated-cpu; set ncpus=1; end; export" zoneadm -z ozone reboot prctl $$ zlogin ozone psrinfo ### zony - priprava oracle + install oracle binary zlogin ozone groupadd -g 200 oinstall groupadd -g 201 dba useradd -u 200 -g oinstall -G dba -c "oracle database user" -d /export/home/oracle -m oracle projadd -K 'project.max-shm-memory=(privileged,2048m,deny)' user.oracle passwd oracle mkdir /opt/oracle chown -R oracle:oinstall /opt/oracle mkdir -p /var/opt/oracle 2>/dev/null cat > /var/opt/oracle/oraInst.loc <<EOF inventory_loc=/opt/oracle/oraInventory inst_group=oinstall EOF chown oracle:oinstall /var/opt/oracle/oraInst.loc chmod 664 /var/opt/oracle/oraInst.loc cat >> /export/home/oracle/.profile <<'EOF' ORACLE_BASE=/opt/oracle ORACLE_HOME=${ORACLE_BASE}/product/11.2.0/db_1 PATH=$PATH:${ORACLE_HOME}/bin LD_LIBRARY_PATH=/lib:/usr/lib:$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib ORACLE_SID=DB DB_NAME=DB ORA_NLS10=${ORACLE_HOME}/nls/data TNS_ADMIN=${ORACLE_HOME}/network/admin NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15 CLASSPATH=$ORACLE_HOME/jdk:$ORACLE_HOME/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH DB_NAME ORA_NLS10 TNS_ADMIN NLS_LANG CLASSPATH EOF . /export/home/oracle/.profile su - oracle -c "/ORACLE/database/runInstaller -responseFile /ORACLE/ora112_db_install.rsp -silent" sleep 60 while ! grep -q 'Shutdown Oracle Database 11g.*Installer' /opt/oracle/oraInventory/logs/installActions*.log 2>/dev/null; do sleep 10 done $ORACLE_HOME/root.sh ### ZFS - pro data do zony s delagaci rizeni pro "oracle" #zfs create -o zoned=on -o mountpoint=/oradata -o quota=10g rpool/oradata zfs get all rpool/oradata zonecfg -z ozone "add dataset; set name=rpool/oradata; end" zoneadm -z ozone reboot zlogin ozone zfs list zfs allow oracle clone,create,destroy,mount,snapshot,promote,rollback,recordsize oradata chown oracle:dba /oradata su - oracle zfs snapshot oradata@test
  • 2. zfs list zfs destroy oradata@test # data oracleDB vytvorena pomoci "dbca" #zfs snapshot oradata@datatest sqlplus '/ as sysdba' startup select * from test; drop table test; select * from test; shutdown zfs rollback oradata@datatest sqlplus '/ as sysdba' startup select * from test; zfs get all oradata zfs set recordsize=8k oradata # SQL: select value from v$parameter where name = 'db_block_size'; ### site - virtualizace (interni switch0) a rizeni toku na sitovce a na tcp portu #netadm enable -p ncp DefaultFixed dladm help dladm show-link dladm create-etherstub switch0 dladm create-vnic -l switch0 vnic0 dladm show-link ipadm create-ip vnic0 ipadm create-addr -T static -a 192.168.99.1/24 vnic0/v4 ipadm show-addr zonecfg -z ozone "select anet linkname=net0; set lower-link=switch0; end" zonecfg -z ozone set zonecfg -z ozone "select anet linkname=net0; set maxbw=100m; end" zonecfg -z ozone "set limitpriv=default,dtrace_proc,dtrace_user" dladm show-linkprop ozone/net0 zoneadm -z ozone reboot dladm show-linkprop ozone/net0 ping 192.168.99.2 zlogin ozone dladm show-link ipadm show-addr ping 192.168.99.1 mkfile 100m /tmp/file scp /tmp/file oracle@192.168.99.2:/tmp #~8sec -> 100Mbit/sec zlogin ozone flowadm add-flow -l net0 -a transport=TCP,local_port=22 ssh-flow flowadm set-flowprop -p maxbw=50M ssh-flow flowadm show-flowprop flowadm show-flow scp /tmp/file oracle@192.168.99.2:/tmp #~16sec -> 50Mbit/sec zlogin ozone flowstat ### role - privilegia zlogin ozone su - oracle ps -ef ppriv -l usermod -K 'defaultpriv=basic,!proc_info' oracle su - oracle ps -ef ### role - profily zlogin ozone profiles -a profiles -p "Process Management" info roleadd -m -d /export/home/killer -P "Process Management" killer passwd killer usermod -R killer user sleep 1000 & su - user /usr/bin/kill roles su - killer profiles -l /usr/bin/kill ### SMF svcs -x
  • 3. svcs svcs apache22 svcadm enable apache22 svcs -d apache22 svcs -D apache22 svcs -p apache22 pkill httpd svcs -p apache22 svcadm disable apache22 ### SMF - Oracle DB zlogin ozone cat > oracle.xml <<'EOF' <?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="manifest" name="oracle-database-service"> <service name="site/oracle" type="service" version="1"> <dependency name="multi-user" grouping="require_all" restart_on="error" type="service"> <service_fmri value="svc:/milestone/multi-user:default"/> </dependency> <instance name="DB" enabled="false"> <exec_method name="start" type="method" exec="sh -c '. /export/home/oracle/.profile; echo startup|$ORACLE_HOME/bin/sqlplus / as sysdba'" timeout_seconds="500"> <method_context> <method_credential user="oracle" group="oinstall" privileges="basic,!proc_info"/> </method_context> </exec_method> <exec_method name="stop" type="method" exec="sh -c '. /export/home/oracle/.profile; echo shutdown immediate|$ORACLE_HOME/bin/sqlplus / as sysdba'" timeout_seconds="900"> <method_context> <method_credential user="oracle" group="oinstall" privileges="basic,!proc_info"/> </method_context> </exec_method> <property_group name="general" type="framework"> <propval name="action_authorization" type="astring" value="solaris.smf.manage.oracle.database"/> <propval name="value_authorization" type="astring" value="solaris.smf.manage.oracle.database"/> </property_group> </instance> </service> </service_bundle> EOF svccfg import oracle.xml su - user svcadm enable oracle cat > /etc/security/auth_attr.d/oracle <<EOF solaris.smf.manage.oracle.database:::::: solaris.smf.manage.oracle.listener:::::: EOF cat /etc/security/auth_attr.d/oracle usermod -A solaris.smf.manage.oracle.database user su - user auths svcadm enable oracle ### dtrace v zone a dtrace na Oracle DB su - mysql -c "/usr/mysql/bin/mysqld_safe &" dtrace -l | awk '{print $2}' | sort | uniq -c | sort -n dtrace -l -n 'mysql*:::' | tail +2 | awk '{print $5}' | sort | uniq -c #zonecfg -z ozone "set limitpriv=default,dtrace_proc,dtrace_user" zlogin ozone #pkg install dtrace dtrace -l dtrace -l | awk '{print $2}' | sort | uniq -c | sort -n su - oracle sqlplus '/ as sysdba' select count(*) from dba_users; select plan_table_output from table(dbms_xplan.display_cursor(null,null,'basic'));
  • 4. @spid #select s.inst_id, s.sid, s.serial#, p.spid, s.username, s.program from gv$session s join gv$process p on p.addr = s.paddr and p.inst_id = s.inst_id where s.type != 'BACKGROUND'; export PID= dtrace -p $PID -Fn 'pid$target:oracle:qer*Fetch*:entry pid$target:oracle:qer*Fetch*:return' | tee out.txt select count(*) from dba_users; sed -f os_explain.sed out.txt set timing on create table t1(a int) tablespace USERS; create table t2(a int) tablespace SYSTEM; commit; alter system checkpoint; exec for i in 1..100000 loop insert into t2 values(i); end loop; commit; alter system checkpoint; exec for i in 1..100000 loop insert into t1 values(i); end loop; commit; alter system checkpoint; cat dstackprof.sh ./dstackprof.sh $PID 10 exec for i in 1..100000 loop insert into t2 values(i); end loop; commit; alter system checkpoint; ./dstackprof.sh $PID 10 exec for i in 1..100000 loop insert into t1 values(i); end loop; commit; alter system checkpoint; show parameter show parameter db_block_checking SET LINESIZE 140 COLUMN KSPPINM FORMAT A40 COLUMN KSPPDESC FORMAT A80 COLUMN KSPPSTVL FORMAT A5 COLUMN KSPPSTDVL FORMAT A5 COLUMN KSPPSTDF FORMAT A5 select KSPPINM,KSPPDESC,KSPPSTVL,KSPPSTDVL,KSPPSTDF from X$KSPPSV a,x$ksppi b where a.indx=b.indx and KSPPINM like '_%' ESCAPE ''; show parameter "_db_always_check_system_ts" alter system set "_db_always_check_system_ts" = FALSE; commit; alter system checkpoint; exec for i in 1..100000 loop insert into t2 values(i); end loop; commit; alter system checkpoint; exec for i in 1..100000 loop insert into t1 values(i); end loop; commit; alter system checkpoint; ### kernel softwarovy audit auditconfig -setpolicy +perzone zlogin ozone auditconfig -lspolicy auditconfig -setpolicy +zonename auditconfig -setpolicy +argv usermod -K 'audit_flags=lo,ex,ua,as:no' oracle cat /etc/security/audit_class grep EXEC /etc/security/audit_event profiles -p "Audit Review" info roleadd -m -d /export/home/auditor -P "Audit Review" auditor passwd auditor usermod -R auditor,killer user svcadm enable auditd su - oracle sqlplus rm x su - user roles su - auditor auditreduce | praudit -l