Spiceworks SQL disks vs disk_partitions vs physical_disks

I am attempting to write a custom SQL query to display all of the disk related information for a client of mine.  They have one server that has multiple iSCSI LUNs connected to the server.  I would like to show from iSCSI LUN all the way down to Windows drive letter/location for all storage on the device. 
However, when I look into the SQL database, I find three tables that relate to storage: disks, disk_partitions, and physical_disks.  However, there does not appear to be a relationship between disks and the other two tables.  The name field in the disks table has the drive letter/drive name of the Windows Volume which would be pretty critical to my report.  Does anyone know how to relate these tables in a SQL query?
This topic first appeared in the Spiceworks Community

user1987306 wrote:
Hello everyone! I hope you are fine.
I'm studying and practicing Oracle 11g R1. My PC features are:
Processor: Intel Pentium 4 HT 3.00 Ghz.
RAM Memory: 2 GB.
Hard Disk: 250 GB
O.S.: Windows XP Professional Edition SP 2.
I know! is old, but it is enough to study and practice... slowly, but functional.
HI,
Welcome to Oracle Forum :)
>
This is my scenario:
Same way, I want to know if I need to create a partition for Oracle base directory, another one for ASM, two more for Online Redo Log and so on... please Oracle experts help me!!! Oracle is exciting!!! Please let me know how do you set the hard disk partitions... if you can, please also explain to me the reason of each partition. This is only to study and practice! and maybe, when good enough I'll look for a job using Oracle Technology.
Thanks a million in advance!
Have a nice weekend!
In real world experience normally Oracle base installation will be installed on local disk on server, ASM or database files will be stored on SAN.
you don't have to separate partition for redo logs as these files will be stored in ASM if you're using ASM. ASM will store controlfile, datafile, temp file, redofile, archivelog and any backup files.
Feel free to ask again any questions
Cheers

Similar Messages

  • Email when High SQL Disk IO

    Hi,
    Is there anyway I can setup an alert/email on my SQL server to fire email as it detect high DiskIO. we are having disk latency more often now and I can't narrow it down, as soon as tech team inform me and I jump on to server, everything comes back to normal.
    Thanks
    I am using SQL Server 2008 R2 Standard Edition with SP2 on widows 2008 R2 Standard

    Looking at last Latency issue timmings, I don't see any I/O request taking longer than 15 sec been recorded in log file. I been told by Tech team that it is SQL Server which is causing the problem.
    Is there any other way I can narrow it down
    In team there are lot of people you who point fingers. Just because someone says that it is SQL Server causing problem it does not means it is SQL Server issue. Yes you can see disk performance ask Storage team to check the disk performance or you yourself
    can fire disk related counters
    Following blog will help you
    High Disk I/O from sql server or is High disk I/O slowing sql server?
    Is Your Physical Disk I/O Affecting SQL Server Performance
    Troubleshooting slow disk I/O in SQL server
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • SQL 2012 Cluster- How to or Steps to Move Tempdb Files from Local drive to Shared volume

    Hi..
     I did Installation of SQL Server 2012 Cluster. During this setup I installed Tempdb Files on Local drive. Now I want to move this tempdb files from local drive to Shared Drive . When I am trying to move I am getting below error.
    Does any one can help me or provide the steps to move this tempdb files from local drive to Shared Drive ?
    Msg 5184, Level 16, State 1, Line 1
    Cannot use file 'Z:\Tempdb\tempdb.mdf' for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource
    of the Sql Server does not have a dependency on it.
    Thanks 
    Regards..
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Hi,
    The error message may be thrown out when you attempt to create a database on another shared cluster drive when the SQL Server resource is not dependent on that disk.
    Check if you are in the scenario which mentioned in the following article:
    How to create databases or change disk file locations on a shared cluster drive on which SQL Server was not originally installed
    http://support.microsoft.com/kb/295732/en-nz
    Here is a thread with similar issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c9f80af7-5b51-4c43-a2a0-f9c7d97aa41d/sql-disk-dependency-problem-on-sql-2008-cluster-including-errors
    Hope it helps.
    Tracy Cai
    TechNet Community Support

  • STATSPACK 수행방법 ( STATSPACK SNAPSHOT 수집 )

    제품 : ORACLE SERVER
    작성날짜 : 2002-10-10
    STATSPACK 수행방법 ( STATSPACK SNAPSHOT 수집 )
    ==============================================
    PURPOSE
    이 자료는 oracle 8.1.6부터 새로이 제공되는 성능 진단도구인 statspack의
    수행 방법에 대해 기술한다.
    Explanation
    1. StatsPack snapshot 수집
    snapshot 수집을 위한 가장 단순한 방법은 SQL*Plus에 PERFSTAT 사용자로
    login한 후, statspack.snap 프로시져를 수행시키는 것이다.
    예.
    SQL> connect perfstat/perfstat
    SQL> execute statspack.snap;
    참고사항 : OPS 환경에서는 데이터를 수집하고자 하는 대상 instance에
    접속하여 수행하여야 한다. snapshot은 모든 인스턴스에서 수집되어야만
    비교를 해 볼 수 있다. 하나의 인스턴스에서 수집된 snapshot 은 동일한
    인스턴스에서 수집된 또 다른 snapshot과 비교가 된다.
    성능 분석을 용이하게 하기 위해 initSID.ora 파라미터 파일에서
    timed_statistics 값을 true로 지정하는 것이 좋다. timed_statistics
    파라미터는 alter system 명령으로, 동적으로 변경 가능한 값이다. 시간
    정보는 그 자체로도 중요할 뿐더러 Oracle 기술 지원에 성능관련 문제 분석
    을 요청할 때에도 필요하다.
    statspack.snap 및 statspack.modify_statspack_parameter 프로시져에는
    필요한 파라미터를 지정할 수 있다.
    =============================================================================
    Parameter Name Valid Values Value Meaning
    =============================================================================
    i_snap_level 0, 5, 10 5 Snapshot 레벨
    i_ucomment Text Blank Snapshot과 함께 저장할 설명문구
    i_executions_th Integer >=0 100 SQL 관련 임계치: 실행된 횟수
    i_disk_reads_th Integer >=0 1,000 SQL 관련 임계치: 디스크 READ 횟수
    i_parse_calls_th Integer >=0 1,000 SQL 관련 임계치: parse call 횟수
    i_buffer_gets_th Integer >=0 10,000 SQL 관련 임계치: buffer get 횟수
    i_session_id Valid sid 0 (no 세션단위의 성능 정보를 수집하기
    from session) 위한 대상 session id
    v$session
    i_modify_parameter True, False False 파라미터를 앞으로의 snapshot에서도
    계속 사용하기 위해 저장할 지 여부
    =============================================================================
    2. 수집되는 데이터의 양을 지정하는 방법
    1) Snapshot 레벨
    패키지에 의해 수집되는 데이터 양은 snapshot 레벨에 따라 조정된다.
    다시 말해 지정된 레벨은 수집될 데이터의 양을 결정한다.
    Level >= 0     일반적인 성능 통계
         수집되는 통계 정보:
         0 이상의 모든 레벨에서는 일반적인 성능 관련 통계 정보가
         수집된다. 여기에는 wait statistics, system event,
         system statistics, rollback segment 데이터, row cache, SGA,
    background event, session event, lock statistics,
         buffer pool statistics, parent latch statistics 등이 포함된다.
    Level >= 5     추가적인 데이터 : SQL 문자
         이 레벨에서는 하위 레벨에서 수집되는 모든 데이터 이외에도
         추가적으로, 자원을 많이 사용하는 SQL 문장과 관련된 성능
         정보를 수집한다.
         SQL 관련 '임계치'
         statspack에 의해 수집되는 SQL 문장은 미리 지정된 다음
         조건 중 하나라도 넘을 경우 수집된다.
         - SQL 실행 횟수                (기본값 100 )
         - SQL 처리시 발생하는 disk read      (기본값 1,000 )
         - SQL parse call 횟수           (기본값 1,000 )
         - SQL 처리시 발생하는 buffer gets      (기본값 10,000)
         위에 나열된 각각의 임계치는 어떤 SQL 관련 정보를 수집할
         것인지를 결정하는 데 사용된다. 위에 언급된 임계치 가운데
         하나라도 넘는 SQL 문장과 관련된 정보가 snapshot을 처리
         하는 동안 수집된다.
         SQL 임계치 레벨 각각은 stats$statspack_parameter 테이블에
         저장되어 있거나, snapshot 수집 당시 파라미터에 의해 지정
    가능하다.
    2) snapshot SQL 임계치
    레벨 이외에도 추가적으로 구성 가능한 파라미터가 있다. 이 파라미터들은
    SQL 수집 시 사용되는 임계치들로, 임계치를 넘어서는 모든 SQL 문장들이
    수집된다.
    snapshot level 및 패키지에 의해 사용되는 임계치 관련 정보는
    stats$statspack_parameter 테이블에 저장된다.
    3) snapshot level과 SQL 관련 임계치 값을 변경하는 방법
    snapshot 수집 작업 시 사용되는 기본 파라미터 값은 조정 가능하며,
    이 값을 조정함으로써 인스턴스에 미치는 부하를 줄이면서, 원하는
    수준의 정보를 수집할 수 있다.
    * snapshot을 받아내변서, 새로운 값을 데이터베이스에 저장
    ( statspack.snap 호출 시, i_modify_parameter 변수 값을 지정 )
    SQL> execute statspack.snap -
    (i_snap_level=>10, i_modify_parameter=>'true');
    i_modify_parameter 를 true로 지정하면, 이 값이 stats$statspack_parameter
    테이블에 저장되며; 이 값이 이후 실행되는 snapshot에 사용된다.
    i_modify_parameter 값을 false로 지정하거나 생략하면, 해당
    snapshot 작업에만 지정된 정보가 사용되며, 이후 작업에는
    stats$statspack_parameter 에 지정된 값을 사용하여 작업이 수행된다.
    * snapshot 수행을 하지 않고 기본값을 바꾸기 위해서는
    statspack.modify_statspack_parameter 프로시져를 사용한다.
    예를 들어 snapshot level을 10으로 변경하고, SQL 관련 임계치 가운데
    buffer_gets, disk_reads 값을 변경하고자 할 때 다음과 같이 한다.
    SQL> execute statspack.modify_statspack_parameter -
    (i_snap_level=>10, i_buffer_gets_th=>10000, i_disk_reads_th=>1000);
    이 프로시져를 수행시키면, snapshot 수행 없이, 변경 사항이
    계속해서 남게 된다.
    modify_statspack_parameter 프로시져에 지정 가능한 전체 파라미터의
    전체 목록은 snap 프로스져와 동일하다.
    4) Session ID 지정
    특정 세션과 관련된 정보를 수집하고자 할 경우, StatsPack 호출 시
    세션 id 지정이 가능하다. 세션과 관련해서 수집되는 정보에는
    세션 통계, 세션 이벤트, lock activity 등이 있다. 기본적으로는
    세션 레벨의 통계는 수집하지 않게 되어 있다.
    SQL> execute statspack.snap(i_session_id=>3);
    3. StatsPack snapshot 수집의 자동화
    일중, 주간, 년간 정보를 비교하기 위해서는, 일정 기간 동안 수집된
    여러 개의 snapshot 정보가 필요하다. 애플리케이션이나 데이터베이스의
    성능 관련 특성을 파악하기 위해서는 최소한 두 개의 snapshot 정보가 필요
    하다.
    snapshot을 수집하는 최선의 방법은, 일정 주기로 snapshot 수집을
    자동화시키는 것이다. 이를 위해 2가지 방법을 사용할 수 있다.
    - 데이터베이스가 제공하는 dbms_job 프로시져를 사용하여 snapshot
    수집 작업을 스케쥴러에 등록한다.
    - OS 시스템 유틸리티( unix의 cron 이나 NT 의 at 명령 )를 사용하여
    snapshot을 스케쥴러에 등록한다.
    1) DBMS_JOB 패키지를 사용한 StatsPack snapshot 작업의 자동화
    오라클 내부적으로 통계정보 수집을 자동화하고자 한다면, dbms_job
    패키지를 사용하면 된다. 샘플은 oracle 8.1.6의 경우 $ORACLE_HOME/rdbms/admin/statsuato.sql
    ( 8.1.7이상은 $ORACLE_HOME/rdbms/admin/spauto.sql) 에 들어 있으며,
    매 시간 마다 snapshot을 등록하는 예제이다.
    dbms_job을 사용하여 snapshot을 자동화시키기 위해서는, init 파일의
    job_queue_processes 파라미터가 0 이상이어야만 한다.
    init<SID>.ora 예제:
    # Set to enable the job queue process to start. This allows dbms_job
    # to schedule automatic statistics collection using STATSPACK
    job_queue_processes=1
    OPS 환경에서 statsauto.sql 을 사용한다면, statsauto.sql 스크립트는
    클러스터 내의 모든 인스턴스에서 한번 씩 수행되도록 하여야 한다.
    마찬가지로 job_queue_processes 파라미터 값도 모든 인스턴스에서
    0 이상의 값으로 지정되어 있어야 한다.
    dbms_job에 대한 자세한 사용방법은 <bulletin:10707> 를 참조한다.
    2) OS 시스템 유틸리티를 사용한 StatsPack snapshot 작업의 자동화.
    unix의 cron에 등록하는 방법은 <bulletin:10906>을, NT 의 at 명령을 사
    용하는 방법은 <bulletin: 11618> 을 참조한다.
    4. 통계정보 수집 주기의 변경 방법
    통계정보 수집 주기를 변경하기 위해서는 dbms_job.interval 프로시져를
    사용한다.
    예.
    execute dbms_job.interval(1,'SYSDATE+(1/48)');
    위에서 SYSDATE+(1/48) 는 통계정보가 1/48 일에 한번씩 ( 매 30분 마다)
    수집되도록 지정한 예이다.
    job이 즉시 실행되도록 하기 위해서는
    execute dbms_job.run(<job number>);
    job을 스케쥴러에서 제거하기 위해서는
    execute dbms_job.remove(<job number>);
    5. STATSPACK의 삭제 및 snapshot 데이타 제거 방법.
    1) Statspack 삭제
    Statspack 환경 삭제를 위해서는 oracle 8.1.6의 경우는 statsdrp.sql을
    oracle 8.1.7 이상의 경우는 spdrop.sql을 수행한다.
    cd $ORACLE_HOME/rdbms/admin
    SQL> connect / as sysdba
    SQL> @statsdrp
    2) Snapshot 데이타 제거
    불필요한 snapshot 데이타를 제거하기 위해서 oracle 8.1.7부터는
    sppurge.sql과 sptrunc.sql을 제공한다.
    특정 구간 사이의 snapshot정보를 제거하려면 sppurge.sql을 수행한다.
    이 script를 수행하면 삭제할 시작과 끝의 snapshot id를 지정하게 되며 지정
    된 구간의 snapshot 데이타가 제거된다.
    모든 snapshot 정보를 삭제하려면 sptrunc.sql을 수행한다.
    cd $ORACLE_HOME/rdbms/admin
    sqlplus perfstat/perfstat
    SQL> @sptrunc
    Example
    none
    Reference Documents
    <Note:94224.1>
    <Note:149121.1>

    제품 : ORACLE SERVER
    작성날짜 : 2002-10-10
    STATSPACK 수행방법 ( STATSPACK SNAPSHOT 수집 )
    ==============================================
    PURPOSE
    이 자료는 oracle 8.1.6부터 새로이 제공되는 성능 진단도구인 statspack의
    수행 방법에 대해 기술한다.
    Explanation
    1. StatsPack snapshot 수집
    snapshot 수집을 위한 가장 단순한 방법은 SQL*Plus에 PERFSTAT 사용자로
    login한 후, statspack.snap 프로시져를 수행시키는 것이다.
    예.
    SQL> connect perfstat/perfstat
    SQL> execute statspack.snap;
    참고사항 : OPS 환경에서는 데이터를 수집하고자 하는 대상 instance에
    접속하여 수행하여야 한다. snapshot은 모든 인스턴스에서 수집되어야만
    비교를 해 볼 수 있다. 하나의 인스턴스에서 수집된 snapshot 은 동일한
    인스턴스에서 수집된 또 다른 snapshot과 비교가 된다.
    성능 분석을 용이하게 하기 위해 initSID.ora 파라미터 파일에서
    timed_statistics 값을 true로 지정하는 것이 좋다. timed_statistics
    파라미터는 alter system 명령으로, 동적으로 변경 가능한 값이다. 시간
    정보는 그 자체로도 중요할 뿐더러 Oracle 기술 지원에 성능관련 문제 분석
    을 요청할 때에도 필요하다.
    statspack.snap 및 statspack.modify_statspack_parameter 프로시져에는
    필요한 파라미터를 지정할 수 있다.
    =============================================================================
    Parameter Name Valid Values Value Meaning
    =============================================================================
    i_snap_level 0, 5, 10 5 Snapshot 레벨
    i_ucomment Text Blank Snapshot과 함께 저장할 설명문구
    i_executions_th Integer >=0 100 SQL 관련 임계치: 실행된 횟수
    i_disk_reads_th Integer >=0 1,000 SQL 관련 임계치: 디스크 READ 횟수
    i_parse_calls_th Integer >=0 1,000 SQL 관련 임계치: parse call 횟수
    i_buffer_gets_th Integer >=0 10,000 SQL 관련 임계치: buffer get 횟수
    i_session_id Valid sid 0 (no 세션단위의 성능 정보를 수집하기
    from session) 위한 대상 session id
    v$session
    i_modify_parameter True, False False 파라미터를 앞으로의 snapshot에서도
    계속 사용하기 위해 저장할 지 여부
    =============================================================================
    2. 수집되는 데이터의 양을 지정하는 방법
    1) Snapshot 레벨
    패키지에 의해 수집되는 데이터 양은 snapshot 레벨에 따라 조정된다.
    다시 말해 지정된 레벨은 수집될 데이터의 양을 결정한다.
    Level >= 0     일반적인 성능 통계
         수집되는 통계 정보:
         0 이상의 모든 레벨에서는 일반적인 성능 관련 통계 정보가
         수집된다. 여기에는 wait statistics, system event,
         system statistics, rollback segment 데이터, row cache, SGA,
    background event, session event, lock statistics,
         buffer pool statistics, parent latch statistics 등이 포함된다.
    Level >= 5     추가적인 데이터 : SQL 문자
         이 레벨에서는 하위 레벨에서 수집되는 모든 데이터 이외에도
         추가적으로, 자원을 많이 사용하는 SQL 문장과 관련된 성능
         정보를 수집한다.
         SQL 관련 '임계치'
         statspack에 의해 수집되는 SQL 문장은 미리 지정된 다음
         조건 중 하나라도 넘을 경우 수집된다.
         - SQL 실행 횟수                (기본값 100 )
         - SQL 처리시 발생하는 disk read      (기본값 1,000 )
         - SQL parse call 횟수           (기본값 1,000 )
         - SQL 처리시 발생하는 buffer gets      (기본값 10,000)
         위에 나열된 각각의 임계치는 어떤 SQL 관련 정보를 수집할
         것인지를 결정하는 데 사용된다. 위에 언급된 임계치 가운데
         하나라도 넘는 SQL 문장과 관련된 정보가 snapshot을 처리
         하는 동안 수집된다.
         SQL 임계치 레벨 각각은 stats$statspack_parameter 테이블에
         저장되어 있거나, snapshot 수집 당시 파라미터에 의해 지정
    가능하다.
    2) snapshot SQL 임계치
    레벨 이외에도 추가적으로 구성 가능한 파라미터가 있다. 이 파라미터들은
    SQL 수집 시 사용되는 임계치들로, 임계치를 넘어서는 모든 SQL 문장들이
    수집된다.
    snapshot level 및 패키지에 의해 사용되는 임계치 관련 정보는
    stats$statspack_parameter 테이블에 저장된다.
    3) snapshot level과 SQL 관련 임계치 값을 변경하는 방법
    snapshot 수집 작업 시 사용되는 기본 파라미터 값은 조정 가능하며,
    이 값을 조정함으로써 인스턴스에 미치는 부하를 줄이면서, 원하는
    수준의 정보를 수집할 수 있다.
    * snapshot을 받아내변서, 새로운 값을 데이터베이스에 저장
    ( statspack.snap 호출 시, i_modify_parameter 변수 값을 지정 )
    SQL> execute statspack.snap -
    (i_snap_level=>10, i_modify_parameter=>'true');
    i_modify_parameter 를 true로 지정하면, 이 값이 stats$statspack_parameter
    테이블에 저장되며; 이 값이 이후 실행되는 snapshot에 사용된다.
    i_modify_parameter 값을 false로 지정하거나 생략하면, 해당
    snapshot 작업에만 지정된 정보가 사용되며, 이후 작업에는
    stats$statspack_parameter 에 지정된 값을 사용하여 작업이 수행된다.
    * snapshot 수행을 하지 않고 기본값을 바꾸기 위해서는
    statspack.modify_statspack_parameter 프로시져를 사용한다.
    예를 들어 snapshot level을 10으로 변경하고, SQL 관련 임계치 가운데
    buffer_gets, disk_reads 값을 변경하고자 할 때 다음과 같이 한다.
    SQL> execute statspack.modify_statspack_parameter -
    (i_snap_level=>10, i_buffer_gets_th=>10000, i_disk_reads_th=>1000);
    이 프로시져를 수행시키면, snapshot 수행 없이, 변경 사항이
    계속해서 남게 된다.
    modify_statspack_parameter 프로시져에 지정 가능한 전체 파라미터의
    전체 목록은 snap 프로스져와 동일하다.
    4) Session ID 지정
    특정 세션과 관련된 정보를 수집하고자 할 경우, StatsPack 호출 시
    세션 id 지정이 가능하다. 세션과 관련해서 수집되는 정보에는
    세션 통계, 세션 이벤트, lock activity 등이 있다. 기본적으로는
    세션 레벨의 통계는 수집하지 않게 되어 있다.
    SQL> execute statspack.snap(i_session_id=>3);
    3. StatsPack snapshot 수집의 자동화
    일중, 주간, 년간 정보를 비교하기 위해서는, 일정 기간 동안 수집된
    여러 개의 snapshot 정보가 필요하다. 애플리케이션이나 데이터베이스의
    성능 관련 특성을 파악하기 위해서는 최소한 두 개의 snapshot 정보가 필요
    하다.
    snapshot을 수집하는 최선의 방법은, 일정 주기로 snapshot 수집을
    자동화시키는 것이다. 이를 위해 2가지 방법을 사용할 수 있다.
    - 데이터베이스가 제공하는 dbms_job 프로시져를 사용하여 snapshot
    수집 작업을 스케쥴러에 등록한다.
    - OS 시스템 유틸리티( unix의 cron 이나 NT 의 at 명령 )를 사용하여
    snapshot을 스케쥴러에 등록한다.
    1) DBMS_JOB 패키지를 사용한 StatsPack snapshot 작업의 자동화
    오라클 내부적으로 통계정보 수집을 자동화하고자 한다면, dbms_job
    패키지를 사용하면 된다. 샘플은 oracle 8.1.6의 경우 $ORACLE_HOME/rdbms/admin/statsuato.sql
    ( 8.1.7이상은 $ORACLE_HOME/rdbms/admin/spauto.sql) 에 들어 있으며,
    매 시간 마다 snapshot을 등록하는 예제이다.
    dbms_job을 사용하여 snapshot을 자동화시키기 위해서는, init 파일의
    job_queue_processes 파라미터가 0 이상이어야만 한다.
    init<SID>.ora 예제:
    # Set to enable the job queue process to start. This allows dbms_job
    # to schedule automatic statistics collection using STATSPACK
    job_queue_processes=1
    OPS 환경에서 statsauto.sql 을 사용한다면, statsauto.sql 스크립트는
    클러스터 내의 모든 인스턴스에서 한번 씩 수행되도록 하여야 한다.
    마찬가지로 job_queue_processes 파라미터 값도 모든 인스턴스에서
    0 이상의 값으로 지정되어 있어야 한다.
    dbms_job에 대한 자세한 사용방법은 <bulletin:10707> 를 참조한다.
    2) OS 시스템 유틸리티를 사용한 StatsPack snapshot 작업의 자동화.
    unix의 cron에 등록하는 방법은 <bulletin:10906>을, NT 의 at 명령을 사
    용하는 방법은 <bulletin: 11618> 을 참조한다.
    4. 통계정보 수집 주기의 변경 방법
    통계정보 수집 주기를 변경하기 위해서는 dbms_job.interval 프로시져를
    사용한다.
    예.
    execute dbms_job.interval(1,'SYSDATE+(1/48)');
    위에서 SYSDATE+(1/48) 는 통계정보가 1/48 일에 한번씩 ( 매 30분 마다)
    수집되도록 지정한 예이다.
    job이 즉시 실행되도록 하기 위해서는
    execute dbms_job.run(<job number>);
    job을 스케쥴러에서 제거하기 위해서는
    execute dbms_job.remove(<job number>);
    5. STATSPACK의 삭제 및 snapshot 데이타 제거 방법.
    1) Statspack 삭제
    Statspack 환경 삭제를 위해서는 oracle 8.1.6의 경우는 statsdrp.sql을
    oracle 8.1.7 이상의 경우는 spdrop.sql을 수행한다.
    cd $ORACLE_HOME/rdbms/admin
    SQL> connect / as sysdba
    SQL> @statsdrp
    2) Snapshot 데이타 제거
    불필요한 snapshot 데이타를 제거하기 위해서 oracle 8.1.7부터는
    sppurge.sql과 sptrunc.sql을 제공한다.
    특정 구간 사이의 snapshot정보를 제거하려면 sppurge.sql을 수행한다.
    이 script를 수행하면 삭제할 시작과 끝의 snapshot id를 지정하게 되며 지정
    된 구간의 snapshot 데이타가 제거된다.
    모든 snapshot 정보를 삭제하려면 sptrunc.sql을 수행한다.
    cd $ORACLE_HOME/rdbms/admin
    sqlplus perfstat/perfstat
    SQL> @sptrunc
    Example
    none
    Reference Documents
    <Note:94224.1>
    <Note:149121.1>

  • After call commit sql , data can not flush to disk

    I use berkey db which support sql . It's version is db-5.1.19.
    1, Open a database.
    2. Create a table.
    3. exec "begin;" sql
    4. exec sql which is insert record into table
    5. exec "commit;" sql
    6. copy database file (SourceDB_912_1.db and SourceDB_912_1.db-journal) to Local Disk of D, then use a tool of dbsql to open the database.
    7. use select sql to check data, there is no record in table.
    1
    sqlite3 * m_pDB;
    int nRet = sqlite3_open_v2(strDBName.c_str(), & m_pDB,SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,NULL);
    2
    string strSQL="CREATE TABLE [TBLClientAccount] ( [ClientId] CHAR (36), [AccountId] CHAR (36) );";
    char * errors;
    nRet = sqlite3_exec(m_pDB, strSQL.c_str(), NULL, NULL, &errors);
    3
    nRet = sqlite3_exec(m_pDB, "begin;", NULL, NULL, &errors);
    4
    nRet = sqlite3_exec(m_pDB, "INSERT INTO TBLClientAccount (ClientId,AccountId) VALUES('dd','ddd'); ", NULL, NULL, &errors);
    5
    nRet = sqlite3_exec(m_pDB, "commit;", NULL, NULL, &errors);
    Edited by: 887973 on Sep 27, 2011 11:15 PM

    Hi,
    Here is a simple test case program I used based on your description:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include "sqlite3.h"
    int error_handler(sqlite3*);
    int main()
         sqlite3 *m_pDB;
         const char *strDBName = "C:/SRs/OTN Core 2290838 - after call commit sql , data can not flush to disk/SourceDB_912_1.db";
         char * errors;
         sqlite3_open_v2(strDBName, &m_pDB, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
         error_handler(m_pDB);
         sqlite3_exec(m_pDB, "CREATE TABLE [TBLClientAccount] ( [ClientId] CHAR (36), [AccountId] CHAR (36) );", NULL, NULL, &errors);
         error_handler(m_pDB);
         sqlite3_exec(m_pDB, "begin;", NULL, NULL, &errors);
         error_handler(m_pDB);
         sqlite3_exec(m_pDB, "INSERT INTO TBLClientAccount (ClientId,AccountId) VALUES('dd','ddd'); ", NULL, NULL, &errors);
         error_handler(m_pDB);
         sqlite3_exec(m_pDB, "commit;", NULL, NULL, &errors);
         error_handler(m_pDB);
         //sqlite3_close(m_pDB);
         //error_handler(m_pDB);
    int error_handler(sqlite3 *db)
         int err_code = sqlite3_errcode(db);
         switch(err_code) {
         case SQLITE_OK:
         case SQLITE_DONE:
         case SQLITE_ROW:
              break;
         default:
              fprintf(stderr, "ERROR: %s. ERRCODE: %d.\n", sqlite3_errmsg(db), err_code);
              exit(err_code);
         return err_code;
    }Than I copied the SourceDB_912_1.db database and the SourceDB_912_1.db-journal directory containing the environment files (region files, log files) to D:\, opened the database using the "dbsql" command line tool, and queried the table; the data is there:
    D:\bdbsql-dir>ls -al
    -rw-rw-rw-   1 acostach 0 32768 2011-10-12 12:51 SourceDB_912_1.db
    drw-rw-rw-   2 acostach 0     0 2011-10-12 12:51 SourceDB_912_1.db-journal
    D:\bdbsql-dir>C:\BerkeleyDB\db-5.1.19\build_windows\Win32\Debug\dbsql SourceDB_912_1.db
    Berkeley DB 11g Release 2, library version 11.2.5.1.19: (August 27, 2010)
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    dbsql> .tables
    TBLClientAccount
    dbsql> .schema TBLClientAccount
    CREATE TABLE [TBLClientAccount] ( [ClientId] CHAR (36), [AccountId] CHAR (36) );
    dbsql> select * from TBLClientAccount;
    dd|dddI do not see where the issue is. The data can be successfully retrieved, it is present in the database.
    Could you try putting in the sqlite3_close() call and see if you still get the error?
    Did you remove the __db.* files from the SourceDB_912_1.db-journal directory?
    Did you use PRAGMA synchronous, and if so, what is the value you set?
    If this is still an issue for you, please describe in more detail the exact steps needed to get this reproduced and provide a simple stand-alone test case program that reproduces it.
    Regards,
    Andrei

  • Should I Install SQL Server 2008 R2 on a VHDX or Pass-through disk

    Hi,
    I am in going to be setting a virtual server running Windows Server 2008 R2 on my Hyper-V cluster and I will be also adding SQL Server 2008 R2 once the OS is configured. Can you please suggest whether I should setup a VHDX or a pass-through disk? I have
    read articles online suggesting to use a pass-through disk from my SAN but I also read that since Windows Server 2012, VHDX is as good as a pass-through disk, especially because it will allow to have snapshots taken, unlike the pass-through which will not.
    Please advise on whether I should chose a pass-through disk or a VHDX.
    Thanks in advance,

    Hi Aquila,
    There are three basic types of Virtual Hard Disks (VHDs) that you can use with VMs, such as dynamic VHD, fixed VHD, and differencing disks. Usually, the fixed VHD is almost always the best choice for virtualized SQL Server systems that run a production workload.
    You can use dynamic disks for noncritical production workloads, as well as for testing, training, and lab environments. Pass-through disks offer the highest level of performance for VM storage, however, Pass-through disks can't be moved without incurring downtime,
    and they don't support VM snapshots. For more information, see:http://sqlmag.com/sql-server/sql-server-virtualization-tips
    In addition, there is an article about how to setup boot from VHD for a SQL Server. You can review the following link.
    http://www.mssqltips.com/sqlservertip/2327/how-to-setup-boot-from-vhd-for-a-sql-server-test-or-development-environment/
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Without cd rom or hard disk could be install sql 8i or 9i

    Hi Guys,
    Please let me know that without cd rom or hard disk could be install sql 8i or 9i, we have no available any accessories only through the folder of sql 8i can be installed.

    1002966 wrote:
    Hi Guys,
    Please let me know that without cd rom or hard disk could be install sql 8i or 9i, we have no available any accessories only through the folder of sql 8i can be installed.USB Stick (a.k.a. Thumb Drive)?

  • Backing Up to disk in SQL Server 2005 - New Implementation

    Hi There,
    My company are implementing SAP with SQL Server 2005.  I have the responsibility of creating the backup strategy.  We will not be using Tape Media to back up - all our backups are carried out to DISK (SAN).
    Please can anyone state the recommended way to do this i.e. through the SAP DBA Calendar or through SQL Studio Manager.
    My experience is with SQL and i have been trying for the last few weeks to implement a strategy through the SAP DBA calendar.  However i am finding it very difficult to administer this way because there are limited options on the DBA calender i.e to overwrite files, delete old files, date name files etc.  From what i have seen the DBA calendar would only be successful usind backup tape media.
    Please can anyone recommend anything or give experience of how they have dealt with this situation before and weather you implemented through SAP DBA Calender or the Studio.
    Many Thanks
    Jamie Blake
    DBA

    HI,
    configure backup devices on MS SQL Server management Studio,
    logon to SQL server management Studio,
    under object explorer navigate through server object -> backup devices
    create new backup device -- destination file type.
    when you schedule backup using DB13  it's take the backup on this location ( disk )
    regards,
    kaushal

  • SQCRS_Exec: State:42000 Error:[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate a new page for database 'MEDICAL' because of insufficient disk space in filegroup 'PRIMARY'.

    I keep getting this error even though I have done all the suggestions. This was a restored database everything worked well for 2 days and now i am getting this error. I have autogrowth on and have shrunk the TransLog to 60mb the 2 table spaces that getr
    this error have been checked by several DBA's and they all say it is correct and to check with Microsoft. DBCC CHECKDB has also been run along with a native check for our Medical program. The DB is not abnormally large as I have others much larger. this is
    Server 2008r2 with SSMS 2008r2

    Add another file to the PRIMARY FILE GROUP on another drive.
    Above is a quick & dirty fix.
    You should makeup a disk space allocation plan keeping in mind the requirements 3 years from now.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Backup DB with dynamic sql - want to substitute in dbname and disk file path

    Re: Backup DB with dynamic sql - want to substitute in dbname and disk file path
    Hope I can explain this. Below is a small snippet of code. I want to set @SQLTemplate_TSQL once at the top of the script and then execute the SET @SQLCommand and sp_executesql in a loop that reads a list of databases. It all works, except for the
    BACKUP DATABASE. Right now it evaluates when the SET @SQLTemplate_TSQL is evaluated. I want it to evaluate when it is executed. I want the DB_NAME() of the USE @dbname.
    -- change @dbname and @dbbackuppath
    DECLARE @SQLCommand NVARCHAR(MAX)
    DECLARE @SQLTemplate_TSQL NVARCHAR(MAX)
    DECLARE @dbname varchar(128) = 'Bank04'
    -- one time setting of @SQLTemplate_TSQL
    set @SQLTemplate_TSQL =
    DECLARE @dbbackuppath varchar(128) = ''''d:\backups''''
    IF RIGHT(@dbbackuppath, 1) <> ''''\''''
    SET @dbbackuppath = @dbbackuppath + ''''\''''
    SET @dbbackuppath = @dbbackuppath + DB_Name() + ''''.bak''''
    PRINT @dbbackuppath
    BACKUP DATABASE ' + DB_NAME() + ' to DISK=''' + QUOTENAME(@dbbackuppath, CHAR(39)) + '''
    -- Execute this several times over different databases
    SET @SQLCommand = '
    USE ' + QUOTENAME(@dbname) + ';
    EXEC(''' + @SQLTemplate_TSQL + ''') '
    PRINT @SQLCommand
    EXECUTE sp_executesql @SQLCommand

    Here is a stripped down version of my code. Someone writes a script. I then take the script and seperate it by GO statement block. Each GO block gets its own row into the
    #SQLTemplate_TSQL. I then replace single quote with 4 quotes and run it. Then I run against my list of databases. I am unable to get the BACKUP DATA base to work with this model.
    Run scripts against multiple databases.sql
    Do a FIND on "CHANGE THIS" to see the databases returned from the SELECT statement
    DECLARE @DatabaseName varchar(128)
    DECLARE @SQLCommand NVARCHAR(MAX)
    DECLARE @SQLTemplate_Seq INT
    DECLARE @SQLTemplate_OperationDesc NVARCHAR(128)
    DECLARE @SQLTemplate_TSQL NVARCHAR(MAX)
    DECLARE @SQLTemplate_Diagnostics INT
    DECLARE @Note VARCHAR(500)
    IF OBJECT_ID('tempdb..#SQLTemplate_TSQL') IS NOT NULL
    DROP TABLE #SQLTemplate_TSQL
    CREATE TABLE [dbo].[#SQLTemplate_TSQL](
    [SQLTemplate_RecID] [int] Identity,
    [SQLTemplate_ID] [int] NOT NULL,
    [SQLTemplate_Seq] [int] NOT NULL,
    [SQLTemplate_OperationDesc] [varchar](128) NOT NULL,
    [SQLTemplate_TSQL] [varchar](max) NOT NULL,
    [SQLTemplate_Diagnostics] [int] NOT NULL,
    [SQLTemplate_Enabled] [int] NOT NULL)
    DELETE FROM #SQLTemplate_TSQL WHERE SQLTemplate_Seq = 65
    DECLARE @SeqID INT
    SELECT @SeqID = MAX(SQLTemplate_ID) FROM #SQLTemplate_TSQL
    SET @SeqID = ISNULL(@SeqID,0)
    SET @SeqID = @SeqID + 1
    INSERT INTO #SQLTemplate_TSQL VALUES(@SeqID ,65,@SeqID,'
    SELECT * FROM ifs_config
    ',1,1)
    SET @SeqID = @SeqID + 1
    INSERT INTO #SQLTemplate_TSQL VALUES(@SeqID ,65,@SeqID,'
    DECLARE @HistoryODS INT
    SET @HistoryODS = 1
    SELECT * FROM ifs_tablelist WHERE HistoryODS = @HistoryODS and Tablename like ''''%HIST%''''
    ',1,1)
    -- Setup Cursor to Loop through each of the Prior Period databases
    DECLARE db_cursor CURSOR FOR
    SELECT [Database Name] --<<<<<<<< CHANGE THIS SELECT statement to select DBs >>>>>>
    FROM v_ifs_PPODSDBInfo_Curr
    WHERE [Database Frequency] <> 'CURRENT'
    ORDER BY [Database Frequency], [Database Number]
    OPEN db_cursor
    FETCH NEXT FROM db_cursor INTO @DatabaseName
    -- Loop through each of the databases
    WHILE @@FETCH_STATUS = 0
    BEGIN
    -- Setup Cursor to Loop through each of the SQL Statements
    DECLARE #SQLTemplate_TSQL_cursor CURSOR FOR
    SELECT [SQLTemplate_TSQL], [SQLTemplate_OperationDesc], [SQLTemplate_Seq], [SQLTemplate_Diagnostics]
    FROM #SQLTemplate_TSQL
    WHERE [SQLTemplate_Enabled] = 1 AND SQLTemplate_Seq = 65
    ORDER BY SQLTemplate_ID
    OPEN #SQLTemplate_TSQL_cursor
    FETCH NEXT FROM #SQLTemplate_TSQL_cursor INTO @SQLTemplate_TSQL, @SQLTemplate_OperationDesc, @SQLTemplate_Seq, @SQLTemplate_Diagnostics
    -- Loop through each of the SQL statements
    WHILE @@FETCH_STATUS = 0
    BEGIN
    SET @SQLCommand = '
    USE ' + QUOTENAME(@Databasename) + ';
    EXEC(''' + @SQLTemplate_TSQL + ''') '
    EXECUTE sp_executesql @SQLCommand
    FETCH NEXT FROM #SQLTemplate_TSQL_cursor INTO @SQLTemplate_TSQL, @SQLTemplate_OperationDesc, @SQLTemplate_Seq, @SQLTemplate_Diagnostics
    END
    CLOSE #SQLTemplate_TSQL_cursor
    DEALLOCATE #SQLTemplate_TSQL_cursor
    FETCH NEXT FROM db_cursor INTO @DatabaseName
    END
    CLOSE db_cursor
    DEALLOCATE db_cursor

  • SQL Server backup on disk from DB13 in 6.20

    Hello,
    is it possible to perform database backups on disk (remote and local) in transaction DB13? Is the Enterprise Manager the only way to perform backups on disks?
    The only media type available in DB13 is 'Tape' and I can't change this option (maybe there is no option). SAP Library provides confusing information, as it states that bakcup on disk is possible in DB13, but also points to the documentation of MS SQL Server in order to achieve it.
    We have WAS 6.20 in 4.7 ES 1.10 with MS SQL Server 2000.
    Thank you.
    Antonio Sánchez.

    I think there is something called as virtual devices in enterprise manager which can be configured as TAPE device.
    This virtual TAPE could be a actual TAPE or a DISK.
    Try configuring it and see if it is visible in DB13.
    We had done this 2 years ago, don't remember it properly.
    good luck.
    regards,
    siddhesh

  • SQL Server 2008 R2 Disk Usage report showing incorrect data file

    When I go to ANY database (System, AdventureWorks*, user) in Managemant Studio, I right-click on the db, select Reports, select Standard Reports, and select Disk Usage.  The disk usage report shows the correct db on top, but always only shows AdventureWorks_Data.mdf
    when I expand Disk Space Used by Data Files section.  This happens to any db I try.  When I look at Database Properties/Files for that database, the logical and physical file names are correct.
    Since the correct files appear in Database Properties/Files, I'm hoping it's just a bug in the report.  Same thing happens if I run a Disk Usage by Table report for ANY database,  The tables for AdventureWorks always only appear,
    Thanks,  Mike

    Thanks Tibor!
    I looked at the Properties for my login under Security/Logins and it shows my default db to be master.  Not sure if this is correct, but it sounds plausible.  I'll see if I can report the problem.
    The only issue I can think of that was out of the ordinary for the install of 2008 R2 EE was this:
    I originally installed 2005 DE, since it wouldn't expire.  After the install of 2005 DE, I decided to uninstall it and install 2008 R2 EE.  In between the installs of 2005 DE and 2008 R2 EE, I installed/uninstalled stupid stuff like 2008
    Express, 2008 Express with Advanced Services (?), and 2008 EE.  After each uninstall I also did a system restore to be safe.
    Now each time I open Management Studio, i get a pop-up stating that there are SQL Server 2005 registered servers on my sytem and asks me if I want to add them into Management Studio.  I always say no.
    The AdventureWorks db is from 2005 and was installed automatically with 2005.  I installed the 2005, 2008, and 2008 R2 AdventureWorks databases to my R2 for class.  I'm not sure now if the Disk Usage report is showing me AdventureWorks_Data.mdf
    because of my install into 2008 R2 EE or my previous install of 2005 DE.
    Hope this kind of makes sense...
    -Mike

  • Why there is a huge difference between a row size on a disk based table and a row size in memoptimized table of SQL 2014?

    Hi All,
    I have two table with similar structure and data, one is on disk and the other is in memory. I somehow calculated the difference between a row size of on disk and in memory table and found that the row size of in memory is 700 Bytes more than the disk based
    tables.
    aa

    As others mentioned, memory optimized tables and disk based tables have different structures in SQL Server 2014.
    For memory optimized tables, the number of indexes on table also contribute to the size. You can calculate the exact size of rows and thus the table size using the formula given in the below articles
    Table and Row Size in Memory-Optimized Tables
    Estimate the Size of a Table
    Krishnakumar S

  • SQL 2008 R2 Cluster | change Cluster Disks

    Hello,
    We have a SQL cluster (for SharePoint 2010) consists of two nodes Windows server 2008 R2 & SQL 2008 r2.
    The SQL cluster have MSDTC (Clustered) & SQL services, with total four disks:
    Quorum Disk
    MSDTC Disk
    Databases disk
    Logs disk.
    Now the old SAN will be decommissioned and new LUNs have added to replace the our disks above. I managed to change Quorum & MSDTC. I used the below robocopy command to copy databases and logs with the same folder structure and permissions:
    robocopy t:\ l:\ /E /MIR /SEC /COPYALL /V
    I stopped SQL services then swapped drive letters , when I start SQL services it starts without problems (using the new Disks).
    But the issue is when I connect to SQL management studio, all databases are in suspect mode. I know there some SQL query to be run against each database , but this a production environment and I don't want to mess with it.
    Is there any other way to change cluster disks of SQL cluster? or use the above method without getting into suspect mode?
    Thanks, Shehatovich

    Hello, Shehatovich
    I you have copied the files while there were still online, that might have been the cause 'suspect' state of your databases.
    I would suggest you to follow the steps:
    Add the new disks to cluster, with validation in every single Cluster node (then cluster will be able to get the signature of the disks)
    Stop SQL Server service.
    Copy the MDF and LDF to the new disks,
    use the Detach and attach Method.  (http://msdn.microsoft.com/en-us/library/ms187858.aspx)
    After check tha your databases are online and consistent.
    Stop SQL Server service again and remove the disks
    Hope it may help you...
    Regards,
    Edvaldo Castro
    Edvaldo Castro http://edvaldocastro.com MCITP Database Administrator on SQL Server® 2008 MCITP Database Administrator on SQL Server® 2005 MCTS: SQL Server® 2008 MCTS: SQL Server® 2005 MCT: Microsoft Certified Trainer MTA: Microsoft Technology Associate
    MTAC – Microsoft Technical Audience Contributor CCSQLA – Cambridge Certified SQL Associate TOEIC – Test of English for International Communication

  • SQL 2014 cluster installation on mounting point disks error: Updating permission setting for file

    Dear all,
    I am attempting to install SQL 2014 fail over cluster under a physical windows 2012 R2 server which have mounting point disks.
    At the finish of setup I get the following error message.
    Could you please help me on this?
    Thanks
    The following error has occurred:
    Updating permission setting for file 'E:\Sysdata!System Volume Information\.....................................' failed. The file permission setting were supposed to be set to 'D:P(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;FA;;;CO)(A;OICI;FA;;;S-1-5-80-3880718306-3832830129-1677859214-2598158968-1052248003)'.
    Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup.
    For help, click: go.microsoft.com/fwlink
    I am using an administrator account which have all security rights (cheched on secpol.msc mmc) needed for installation.

    Hi Marco_Ben_IT,
    Do not install SQL Server to the root directory of a mount point, setup fails when the root of a mounted volume is chosen for the data file directory, we must always specify
    a subdirectory for all files. This has to do with how permissions are granted. If you must put files in the root of the mount point you must manually manage the ACLs/permissions. We need to create a subfolder under the root of the mount point, and install
    there.
    More related information:
    Using Mount Points with SQL Server
    http://blogs.msdn.com/b/cindygross/archive/2011/07/05/using-mount-points-with-sql-server.aspx
    I’m glad to be of help to you!
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for

  • Need assistance with a transport (TP)

    As information/background, I have been away from SAP and basis for about four years. Due to personnel changes here, I am now returning to it. While I was away, our SAP system was upgraded from version 4.0B to “SAP R/3 ENTERPRISE 47X110”. I was not a

  • Aperture won't load

    Have followed guidelines on Apple's support pages and uninstalled and reinstalled aperture from the app store two times but when I go to load Aperture it comes up with an error message saying it has a fault with the operating system and I need to rei

  • Abap fgs report

    hi guru's,      i have a problem with my code can anyone help me out with this,actually i am fetching invoice quantity from vbrp based on sales order (vbeln and posnr).actually i have 3 line items in sales order. but they invoce for this particular s

  • What code do i need to make my animation works in IE or other browsers other than Firefox?

    Hi, I am working on a website with animation.  It shows on Firefox but not IE.  Can anyone please advise what code I need to add?  Or something else I need to do? Thanks, mykw123

  • People screen personalize

    When the person enter his own record in enter& maintain, it should through error message and close the form. I am trying to achieve through form personalization using trigger event WHEN-VALIDATE-RECORD. Not sure which condition to put to get current