DBA script

Dear all
I remember there are a set of "DBA SCRIPT" on this sit, I can't find it ,Does anybody give me a link of it ?

Hi,
What kind of DBA Scripts you require? What kind of works you are going to perform, for which you require these scripts?
-MAK

Similar Messages

  • FILE번호/BLOCK번호와 DBA 사이의 변환 SCRIPT

    제품 : ORACLE SERVER
    작성날짜 : 1999-02-24
    File 번호/Block 번호와 DBA 사이의 변환 script
    block dump나 block corruption 등의 해결을 위해 file 번호와
    block 번호를 DBA로 변환하거나 그 반대의 경우가 필요한 경우가 종종 있다.
    여기에서는 이를 수행하기 위한 간단한 script를 제공한다.
    아래의 script를 각각 별도의 file로 save한 후 file을 실행하여
    procedure를 생성시킨 후 usage에 적힌대로 수행하면 된다.
    usage 내의 procedure의 input 값은 단지 예이므로 실제 사용 시에는
    적당한 값을 사용하도록 한다.
    (주의)여기에서 dba값은 십진수이므로, 0x로 시작하는 값은 십진수로 변환한 후
    작업하여야 한다.
    1. DBA를 이용하여 file#, block# 를 찾아내는 procedure
    rem *************************************************************
    rem * *
    rem * usage : 1. procedure 생성 *
    rem * 2. SQL> set serveroutput on *
    rem * 3. SQL> exec dba_to_file(123456789) *
    rem * *
    rem *************************************************************
    create or replace procedure dba_to_file(in_dba number) is
    file_num integer;
    block_num integer;
    begin
    file_num := dbms_utility.data_block_address_file(in_dba);
    block_num := dbms_utility.data_block_address_block(in_dba);
    dbms_output.put_line('--------------------------------');
    dbms_output.put_line('File number => '|| file_num);
    dbms_output.put_line('Block number => '|| block_num);
    dbms_output.put_line('--------------------------------');
    dbms_output.put_line('Good luck to you');
    end;
    2. file#, block#를 가지고 DBA를 계산해 내는 procedure
    rem ************************************************************
    rem * *
    rem * usage : 1. procedure 생성 *
    rem * 2. SQL>set serveroutput on *
    rem * 3. SQL>exec file_to_dba(10, 100) *
    rem * *
    rem ************************************************************
    create or replace procedure file_to_dba(file_num number,
    block_num number) is
    dba number;
    begin
    dba := dbms_utility.make_data_block_address(file_num, block_num);
    dbms_output.put_line('--------------------------------');
    dbms_output.put_line('DBA => '|| dba);
    dbms_output.put_line('--------------------------------');
    end;
    3. file#, block#를 이용하여 해당 object를 알아내기 위한 script
    select owner, segment_name, segment_type, blocks, block_id
    from dba_extents
    where file_id = &file_number and
    &block between block_id and (block_id + (blocks - 1));

  • More DBA Scripts

    Hi everysoul,
    on http://linux-dba.gutzmann.com please find some more DBA
    scripts, namely:
    show_invalid_objects (D. Mwrk)
    compile_objects (D. Mwrk)
    index (D. Mwrk)
    free_space (D. Mwrk)
    extents (D. Mwrk)
    constraints (D. Mwrk)
    Filesystem Cleanup (T. Gutzmann)
    Previous entries were:
    OWAS slow (M. Thomas)
    Installation help (Link to T. Bissett)
    Database Statistics (D. Mwrk)
    Check DB Files - Step 1 (T. Gutzmann)
    Check DB Files - Step 2 (T. Gutzmann)
    Database Backup to Compressed Files (Rev 1) (T. Gutzmann)
    Automatic Startup/Shutdown (T. Gutzmann)
    Basic Tuning Steps (T. Gutzmann)
    Tablespaces - Summary View (T. Gutzmann)
    You are invited to add any useful script and any piece of related
    pertinent information (even if it's a link). Most contributions
    to discussion boards like this get lost some time; the linux-dba
    document database is aimed to complement these forums (fora, to
    be exact), and it lives on your input. So please ...
    Cheers
    Thomas
    null

    Hello BelMan,
    Thank you for pointing me to the pdf document. I don’t want to use the supplied script. Further, my own scritp does work (if I execute it manually).
    The pdf says:
    To schedule automatic backups, use any operating system or third party task scheduling software to run the supplied backup script for your platform.
    I would like to understand why the script that work just fine when executed manually does absolutely nothing when executed via scheduled job (cron)? If a task scheduling software can be used to run Oracle supplied backup sh script, I should be able to use my own sh script as well? Or is it an XE database limitation?
    Thank you for your time.
    Daniel

  • Looking for some DBA scripts.

    I am a DBA. Can any off u send me few sql scripts which would help me in monitoring the DBA activities, Like
    a) Monitoring the Disk Usage for a particular Database.
    b) How to check the rollback segment is increasing or not.
    c)In NT where the datafiles stored (i.e. in which table)
    and if any more u come across.
    My email add is [email protected]

    Did you ever get any info about this question? I am also a new DBA and trying to set up some monitoring scripts that will monitor the disk usage of our table spaces. Any help will be appreciated.
    Thanks,
    Susan Williams

  • Strange DBA script switchlog

    Hi guys,
    I'm a system admin and one of my production system, that running oracle, is a bit strange for me and I would like your input. I'm not an oracle expert but my limited knowledge show me that it is not setup correctly. This is a 200GB Database
    1. All redo log are in 1 file system /u02, only 8 log file, no grouping... Is it the right setup ?! No multiplexiing
    I will, at least, do a 2 redo grouping into 2 different file system.
    2. They defined 3 control files, all in the /u01 (where is the dbf file) directory (there is only 1 x 200GB oradata file system)
    I will try to put the 3 control file in different location, 1 in the archive log, 1 in the each fs
    3. My RPO for that database (Recovery Point Objective) is 60 minutes. So DBA use a script, in a crontab, to force a switch log every 60 minutes and they have a complex script to ensure the archivelog is close (fssync in OS) before sending it over WAN to a DR box using scp.
    Now on this one... I have a huge problem and I don't understand. First, I will switch the log every 15 to 20 minutes and let oracle do it (not the cron). They put the checkpoint_timeout to 0. I will replace scp by rsync and sync the archivelog directory over wan every 5 mintues and put another cleanup script in cron to remove any archive older than 7 days.
    Now, btw, I looking in the script that force Oracle to switch the log every 60 minutes and here is the command that do it... It look pretty strange to me
    1. get the log sequence number : (select sequence# from v$log where status in ('ACTIVE','CURRENT');)
    2. do a switch log file and archive all : (alter system switch logfile; alter system archive log all;)
    3. Sleep 10 second ?! because it takes 10 second for Oracle to dump in archive log ?!
    4. For each seqNo found in step 1:
    4.1 select archived,sequence# from v$log where sequence# in ( ${seqNo} ); > file1
    4.2 select sequence#,first_time from v$log_history where sequence# in ( ${seqNo} ); > file2
    4.3 check if, for each (and there is only one BTW), is ARCHIVED = YES in v$log and present in v$log_history
    4.4.Check, using fuser, if the file is written in UNIX : fuser ${archlogpath}/*${1}*${seqNo}*arc | cut -d: -f2 to be sure the file is close
    4.5 scp the file over wan
    Do I'm crazy or it's completely overkill ?!
    Thanks

    834010 wrote:
    Hi guys,
    I'm a system admin and one of my production system, that running oracle, is a bit strange for me and I would like your input. I'm not an oracle expert but my limited knowledge show me that it is not setup correctly. This is a 200GB Database
    1. All redo log are in 1 file system /u02, only 8 log file, no grouping... Is it the right setup ?! No multiplexiing
    I will, at least, do a 2 redo grouping into 2 different file system.
    2. They defined 3 control files, all in the /u01 (where is the dbf file) directory (there is only 1 x 200GB oradata file system)
    I will try to put the 3 control file in different location, 1 in the archive log, 1 in the each fs
    3. My RPO for that database (Recovery Point Objective) is 60 minutes. So DBA use a script, in a crontab, to force a switch log every 60 minutes and they have a complex script to ensure the archivelog is close (fssync in OS) before sending it over WAN to a DR box using scp.
    Now on this one... I have a huge problem and I don't understand. First, I will switch the log every 15 to 20 minutes and let oracle do it (not the cron). They put the checkpoint_timeout to 0. I will replace scp by rsync and sync the archivelog directory over wan every 5 mintues and put another cleanup script in cron to remove any archive older than 7 days.
    Now, btw, I looking in the script that force Oracle to switch the log every 60 minutes and here is the command that do it... It look pretty strange to me
    1. get the log sequence number : (select sequence# from v$log where status in ('ACTIVE','CURRENT');)
    2. do a switch log file and archive all : (alter system switch logfile; alter system archive log all;)
    3. Sleep 10 second ?! because it takes 10 second for Oracle to dump in archive log ?!
    4. For each seqNo found in step 1:
    4.1 select archived,sequence# from v$log where sequence# in ( ${seqNo} ); > file1
    4.2 select sequence#,first_time from v$log_history where sequence# in ( ${seqNo} ); > file2
    4.3 check if, for each (and there is only one BTW), is ARCHIVED = YES in v$log and present in v$log_history
    4.4.Check, using fuser, if the file is written in UNIX : fuser ${archlogpath}/*${1}*${seqNo}*arc | cut -d: -f2 to be sure the file is close
    4.5 scp the file over wan
    Do I'm crazy or it's completely overkill ?!
    ThanksI think you have a better understanding of oracle than the dBA who configured this!
    On redo, yes your online redo logs should be multiplexed, with each member on a different mount point.
    Likewise, your multiplexed control files should be on different mount points.
    The script you describe sounds pretty bizzare. Does anyone have an explanation on why the archivelogs are being manually scp'd over the lan? Is that for simple backup purposes or is someone trying to re-invent DataGuard?

  • Apps DBA Scripts

    Hi ,
    Does anybody have scripts that monitor concurrent managers, Database etc and send a mail about the daily performance to all the DBAs in a team? Can somebody tell me where to find some very rare scripts that monitor the performance of apps?
    Thanks.

    Here are some links you may find useful ..
    http://www.appsdba.com/scripts_apps.htm
    http://www.sap-img.com/oracle-database/oracle-application-hints-and-tips.htm
    http://teachmeoracle.com/scripts.html
    http://teachmeoracle.com/scriptspatch.html
    http://www.orafaq.com/scripts/index.htm#APPS
    Others are welcome to share

  • DBA scripts run by cron job

    We've got a development database on which we're working every day. We intend to set up a cron job to run about once a week to help in the maintainance & performance of the database.... analyzing tables, stuff like that. Does anybody have any suggestions as to what scripts it's useful to run to help keep things running smoothly?
    We're using 9.0.1
    Cheers
    RT

    We've got a development database on which we're working every day. We intend to set up a cron job to run about once a week to help in the maintainance & performance of the database.... analyzing tables, stuff like that. Does anybody have any suggestions as to what scripts it's useful to run to help keep things running smoothly?
    We're using 9.0.1
    Cheers
    RT i'd suggest you try out oracle enterprise manager and look at the list of events you can test for. You can use this list to implement in cron or let OEM do it for you. You'll find test like, is the listener up, is the db up, is the server up, what tablespaces will not be able to extend, if a disk is getting fulletc and stuff like that . Those items should help you frame your scripts for cron if you like.

  • DBA Scripts management

    Friends
    Over couple of years I have accumulated a lot of sql/unix/windows scripts for monitoring, managing and trouble shooting Oracle databases.
    I am looking for a good tool to manage these scripts efficiently where I can find relevant script using some kewords.
    Any idea if anyone knows about such tool.
    If there is no tool, I would appriciate if senior people can advice what is the best way to manage these scripts.
    Thanks
    Vishal V.

    Hi,
    >>I am looking for a good tool to manage these scripts efficiently where I can find relevant script using some kewords.
    Well, in my computer, for example, I have a lot of script files and others manuals and documents like you, then I put the .sql and .txt (script files) in a different directory separated from the others files like .doc and .pdf. Then, I use the Google Desktop in order to index all those my files ... (doc, txt, sql, etc...)
    Maybe is interesting to you. Did you already try to use the Google Desktop ?
    http://desktop.google.com/
    Cheers

  • Where is the new location of the OLAP option DBA sample scripts?

    Hello,
    OLAP option DBA sample scripts was used to be available on http://wiki.oracle.com/page/OLAP+option+-DBASample+Scripts
    Thanks,
    Lajos

    I see now OLAP DBA Scripts http://www.oracle.com/technetwork/database/options/olap/olap-dba-scripts-393636.zip under the Download section of OLAP otn home http://www.oracle.com/technetwork/database/options/olap/index.html

  • Canned DBA Admin script difficulties

    I am trying to run some of the canned dba scripts available at the Metalink (Tech Lib, Database Administration, Scripts) and I'm getting the following type of error when attempting to run from a command prompt:
    SQL> @tbsp_usage.sql
    DROP TABLE TABLESPACETEMP
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Table created.
    Commit complete.
    Input truncated to 33 characters
    52
    It justs sits at the 52 without ever going anywhere.
    This script is the one featured in Note:1039289.6 (Analyzing tablespace usage with o/s-independent sql script). I am running it against an 8.1.7 database. I have tried running the script from the command prompt with sqlplus user/password @scriptname and also within sql using @scriptname.
    Can someone tell me what I'm doing wrong??
    Thnaks:)

    I think the script is missing a ';' at the end of the last statement. If it's PL/SQL code, end it with '/'.
    null

  • Shell scripts maintenance tasks for DBA

    Most of companies use shell scripts to monitor DB activities, i just want to make myself familier with the main scripts, and how to manage them. If someone can send me some help material.

    Sorry, I should have been more explicit and not only point to the initial page but directly, where the script library is. And I should have made clear it is not a final product, but the base to build your own library.
    First link (orasnap) refers to the work made by Stewart McGlaughlin, who created a comprehensive collection of frequently used dba scripts. He compiled those scripts into an utility named orasnap. This you can download it from his yahoo site, if you take enough time to follow the links. Out from this collection of scripts I have personally taken several to tailor them into specific Unix/Dos shell maintenance scripts. I mean the homework is not finished, Out from his work I have taken a good base to build my own most frequently used Shell Maintenance Library.
    The second link belongs to Tim Hall (http://www.oracle.com/technology/community/oracle_ace/ace1.html#hall) whose remarkable work has greatly contributed to the Oracle technical community daily job. Once again, this site doesn't have finished shell scripts for you simply to cut and paste, but the dba scripts I pointed plus a little effort and several interesting concepts and tips you can find navigating through his site turn this site into a first hand reference.

  • I need a script to invert the page order of selected pages for cs5.

    Hello,
    I am a graphic designer and i am trying to create a easier way to make multiple page folders, By using the multiple page size feature in inDesign CS5. But my problem is that i can create the front side of the folder easier than before, the backside is my problem I need to inverse the page order manual, this creates a lot of mistakes and errors along the way. Thats why I need a script to invert the page order of the pages I select. I hope to hear from someone soon.
    My best regards,
    Gijs van Roij

    In /gateprd/ARCHIVE/*.arc
    This is the script to remove the archives after it has been backup by the netbackup policy named Archive. This policy removes the archives that have been backed up.
    /home/oracle/dba/scripts> more rmovarch.sh
    #!/bin/ksh
    # compress /gateprd/ARCHIVE/*.arc
    find /gateprd/ARCHIVE/*.arc -type f ! -exec echo {} > /home/oracl
    e/dba/lists/ARCHIVElist \;
    if test $(cat /home/oracle/dba/lists/ARCHIVElist|wc -l) -gt 0
    then
    echo "Hay archives. Se corre script de borrar"
    /home/oracle/dba/scripts/ARCHIVE_BACKUP.sh ARCHIVE
    else
    echo "No archives!!"
    fi

  • I need a script to reduce the size of the Fra which has used 34 gb in space

    I need an rman script to reduce the size of the Fra:
    SQL> select * from v$flash_recovery_area_usage;
    FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
    CONTROL FILE 0 0 0
    REDO LOG 0 0 0
    ARCHIVED LOG 0 0 0
    BACKUP PIECE 0 0 0
    IMAGE COPY 0 0 0
    FLASHBACK LOG 69.99 19.33 2357
    FOREIGN ARCHIVED LOG 0 0 0
    7 rows selected.
    SQL> SELECT
    2 ROUND((A.SPACE_LIMIT / 1024 / 1024 / 1024), 2) AS FLASH_IN_GB,
    3 ROUND((A.SPACE_USED / 1024 / 1024 / 1024), 2) AS FLASH_USED_IN_GB,
    4 ROUND((A.SPACE_RECLAIMABLE / 1024 / 1024 / 1024), 2) AS FLASH_RECLAIMABLE_GB,
    5 SUM(B.PERCENT_SPACE_USED) AS PERCENT_OF_SPACE_USED FROM
    6 V$RECOVERY_FILE_DEST A,
    7 V$FLASH_RECOVERY_AREA_USAGE B
    8 GROUP BY
    9 SPACE_LIMIT,
    10 SPACE_USED ,
    11 SPACE_RECLAIMABLE ;
    FLASH_IN_GB FLASH_USED_IN_GB FLASH_RECLAIMABLE_GB PERCENT_OF_SPACE_USED
    50 34.99 11.14 69.99

    In /gateprd/ARCHIVE/*.arc
    This is the script to remove the archives after it has been backup by the netbackup policy named Archive. This policy removes the archives that have been backed up.
    /home/oracle/dba/scripts> more rmovarch.sh
    #!/bin/ksh
    # compress /gateprd/ARCHIVE/*.arc
    find /gateprd/ARCHIVE/*.arc -type f ! -exec echo {} > /home/oracl
    e/dba/lists/ARCHIVElist \;
    if test $(cat /home/oracle/dba/lists/ARCHIVElist|wc -l) -gt 0
    then
    echo "Hay archives. Se corre script de borrar"
    /home/oracle/dba/scripts/ARCHIVE_BACKUP.sh ARCHIVE
    else
    echo "No archives!!"
    fi

  • PL/SQL scripts to capture real time performance usage

    Looking for a PL/SQL script to gather real time accurate information on memory, CPU, I/O stats for users accessing tables in Oracle 10g database on Red Hat Linux.

    Google Search - DBA Scripts
    1) http://www.oracle-base.com/dba/DBACategories.php
    2) http://www.dbazine.com/oracle/or-articles/liu2
    3) http://www.pro-dba.com/oracle_scripts.html

  • Script help -- to change the path of some script

    hi
    is it possible to make a script(perl or shell) which will change the location of sql script those are called from different shell script?
    i have some shell script which is calling some sql scripts.now i need one script which will ask for the path of those script once and set the path of those sql script in those shell script.these shell script only containing a line
    "sqlplus / as sysdba @<path of the sql script>/script.sql" now i need one script which will change <path of the sql script> .is it possible to do ??
    i need some help from gurus ...
    rgrds
    Edited by: new2appsdba on Aug 20, 2010 7:16 PM

    Hi
    can you say how to pass this mpath to n number of shell script??
    i need to update n number of script.ie. i need to pass $mpath variable to n number of script.
    example:
    profile_chk.sh contain only :
    sqlplus apps/<pass> @/u02/uatdb/.DBA-Scripts/profile_chk.sqlprofile_chk.sql contain:
    SELECT A.PROFILE_OPTION_ID,A.LEVEL_ID,A.LEVEL_VALUE,A.PROFILE_OPTION_VALUE,V.USER_PROFILE_OPTION_NAME
    FROM APPS.FND_PROFILE_OPTION_VALUES A, APPS.FND_PROFILE_OPTIONS_VL V
    WHERE A.PROFILE_OPTION_ID =V.PROFILE_OPTION_ID
    AND V.USER_PROFILE_OPTION_NAME like '%Debug Log%';
    select t.user_profile_option_name, profile_option_value
    from apps.fnd_profile_options o
    ,apps.fnd_profile_option_values v
    ,apps.fnd_profile_options_tl t
    where o.profile_option_id = v.profile_option_id
    and o.application_id = v.application_id
    and profile_option_value = 'Y'
    and start_date_active = SYSDATE
    and o.profile_option_name = t.profile_option_name
    and level_id=10001
    and (upper(t.user_profile_option_name) like '%PERSONALIZ%'
    and upper(t.user_profile_option_name) not like '%PERSONALIZ%WYSIWYG%'
    order by user_profile_option_name;
    select t.user_profile_option_name, profile_option_value, application_name
    from apps.fnd_profile_options o
    ,apps.fnd_profile_option_values v
    ,apps.fnd_profile_options_tl t
    ,apps.fnd_application_tl a
    where o.profile_option_id = v.profile_option_id
    and o.application_id = v.application_id
    and profile_option_value = 'Y'
    and start_date_active = SYSDATE
    and o.profile_option_name = t.profile_option_name
    and a.application_id = level_value
    and level_id=10002
    and t.language = a.language
    and upper(t.user_profile_option_name) like '%PERSONALIZ%'
    order by user_profile_option_name, application_name;now i need a script say install.sh
    which will update the location of profile_chk.sql in the profile_chk.sh.
    this install.sh will contain n numbers of
    install -c profile_chk.sh /usr/bin so that all user can access this shell script as a command.
    whenever the testing goes one server contains two instance so each everytime i need to monitor locks and invalid objects and etc so i need to use this scripts as a commands.for that reason i need this install -c for each scripts.and i need to visit different places also.so ineed this install.sh.my idea is basically work properly once and enjoy times lazily :-) so whenever i move to new place i shall only run this install.sh once and use those scripts lazily.
    rgrds

Maybe you are looking for