Haiyanliang’s Weblog

Clean up Windows 7 winsxs folder

Posted in Uncategorized by haiyanliang on November 30, 2012

Ten SQL server indexes quick points

Posted in Uncategorized by haiyanliang on November 12, 2012

Index type

Description

Clustered

A clustered index sorts and stores the data rows of the table or view in order based on the clustered index key. The clustered index is implemented as a B-tree index structure that supports fast retrieval of the rows, based on their clustered index key values.

Nonclustered

A nonclustered index can be defined on a table or view with a clustered index or on a heap. Each index row in the nonclustered index contains the nonclustered key value and a row locator. This locator points to the data row in the clustered index or heap having the key value. The rows in the index are stored in the order of the index key values, but the data rows are not guaranteed to be in any particular order unless a clustered index is created on the table.

Unique

A unique index ensures that the index key contains no duplicate values and therefore every row in the table or view is in some way unique.

Uniqueness can be a property of both clustered and nonclustered indexes.

Columnstore

An xVelocity memory optimized columnstore index based on vertical partitioning of the data by columns, stored as large objects (LOB).

Index with included columns

A nonclustered index that is extended to include nonkey columns in addition to the key columns.

Index on computed columns

An index on a column that is derived from the value of one or more other columns, or certain deterministic inputs.

Filtered

An optimized nonclustered index, especially suited to cover queries that select from a well-defined subset of data. It uses a filter predicate to index a portion of rows in the table. A well-designed filtered index can improve query performance, reduce index maintenance costs, and reduce index storage costs compared with full-table indexes.

Spatial

A spatial index provides the ability to perform certain operations more efficiently on spatial objects (spatial data) in a column of the geometry data type. The spatial index reduces the number of objects on which relatively costly spatial operations need to be applied.

XML

A shredded, and persisted, representation of the XML binary large objects (BLOBs) in thexml data type column.

Full-text

A special type of token-based functional index that is built and maintained by the Microsoft Full-Text Engine for SQL Server. It provides efficient support for sophisticated word searches in character string data.

Address info

Posted in Uncategorized by haiyanliang on November 1, 2012

Do expdp as sysdba remotely and locally

Posted in Uncategorized by haiyanliang on November 1, 2012

$ expdp \”sys@XXXXX as sysdba\” directory=DPDIR COMPRESSION=ALL dumpfile=xxxxxxxx_`date +%m%d%y`.dpdmp logfile=xxxxxxx_`date +%m%d%y`.dpdmp.log schemas=xxxxxxx

 

expdp \”/ as sysdba\” directory=DPDIR COMPRESSION=ALL dumpfile=${SCHEMANAME}_`date +%m%d%y`.dpdmp logfile=${SCHEMANAME}_`date +%m%d%y`.dpdmp.log schemas=${SCHEMANAME}

~

Tagged with:

70-432 认证考试题库分享-3

Posted in Uncategorized by haiyanliang on April 1, 2011

TS:MS SQL Server@ 2008,Implementation and Maintenance
科目编号:70-432
科目名称:TS:MS SQL Server@ 2008,Implementation and Maintenance
考题数目:171 Q&As
更新日期:2009-11-24

TS:MS SQL Server@ 2008,Implementation and Maintenance 认证作为全球IT领域专家 Microsoft 热门认证之一,是许多大中IT企业选择人才标准的必备条件。 如果你正在准备 70-432 考试,为 Microsoft TS:MS SQL Server@ 2008,Implementation and Maintenance认证做最后冲刺,又苦于没有绝对权威的考试真题模拟,Pass4side 希望能助你成功。

70-432 认证考试题库分享
1. You work in a company which is named Wiikigo Corp. The company uses SQL Server 200 You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. Now your company CIO assigns a task to you. The company CIO wants you to configure FILESTREAM data and the two requirements below must be met: you must enable FILESTREAM for file I/O streaming access; remote client computers must be able to have streaming access to FILESTREAM data. You must make sure that FILESTREAM data is enabled. Which service should you configure?
A. You should configure SQL Server VSS Writer
B. You should configure Distributed File System
C. You should configure SQL Server
D. You should configure SQL Server Full Text
Answer: C

2. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is an Internet Information Services application. This application will use anonymous access to access the SSAS instance. You must make sure that the application can access the SSAS instance. What should you do?
A. The SecurityRequireClientAuthentication server configuration should be set to False
B. The SecurityRequireClientAuthentication server configuration should be set to True.
C. The NTLM Security Support Provider Interface (SSPI) provider should be added to the SecuritySecurityPackageList server configuration.
D. The Kerberos Security Support Provider Interface (SSPI) provider should be added to the SecuritySecurityPackageList server configuration
Answer: A

3. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now for a new application, a SQL Server 2008 instance has to be installed on an existing server. The server contains a default SQL Server 2005 instance. Your company CIO wants their corresponding certified third-party applications can access to both database instances. The company assigns this task to you. You must achieve this by using as little database administrative effort as possible, and never change the existing application environments. What should you do?
A. You should install SQL Server 2008 as the default instance, and configure the new application to use the default instance
B. You should upgrade the SQL Server 2005 application to use SQL Server 2008
C. You should upgrade the SQL Server 2005 instance to a SQL Server 2008 instance
D. You should install SQL Server 2008 as a named instance, and make the new application use the new instance.
Answer: D

4. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. According to the company requirement, the names of all user-defined stored procedures must contain the prefix usp_ on all instances. Besides this, you must make sure that stored procedures that do not contain this prefix cannot be created by you. What should you do?
A. A policy should be created. The policy targets the name of the stored procedure that is evaluated on demand.
B. A policy should be created. The policy targets the name of the stored procedure that is evaluated on change.
C. A condition should be created. The condition targets the name of the stored procedure that is evaluated on change
D. A condition should be created. The condition targets the name of stored procedure that is evaluated on demand.
Answer: B

5. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. You configure the SQL Server instance to use the -T1222 and -T1204 trace flags during startup. You must make sure that your failure recovery plan performs backup of the use of the trace flags. So what action should you perform to achieve this goal?
A. You should backup the master database
B. You should backup the default.trc file
C. You should backup the SQL Server registry hive.
D. You should backup the resource database
Answer: C

最新 testpassport MCITP 70-432题库 -2

Posted in Uncategorized by haiyanliang on April 1, 2011

1. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a computer which hosts several applications in your company. The instance runs on the computer. A job named DiliveryList is created by you. This job requires a file to be written to a file server. But because the job cannot access the file server, it fails to run. You intend to configure the SQL Server Agent service so that only the SQL Server Agent service has read and write access to the file server. Which account type should you use?

A. You should use local Service account

B. You should use network Service account

C. You should use domain account

D. You should use local System account

Answer: C

2. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named DB1 in the instance. On DB1, quite few logged operations are performed. Now according to the requirement of the company CIO, you must validate that the database can be restored to a specific point in time. So what action should you perform to achieve this goal?

A. You should verify that the simple recovery model is used by the database

B. You should verify that the full recovery model is used by the database.

C. You should verify that the checksum page verify option is used by the database

D. You should verify that the bulk-logged recovery model is used by the database

Answer: B

3. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a SQL Server 7.0 database. You upgrade the database to the SQL Server instance. According to the company requirement, you must make sure that suspect pages can be detected in the database. So what action should you perform to achieve this goal?

A. For the database, you should turn on the TRUSTWORTHY database option

B. For the database, the PAGE_VERIFY database option should be set to CHECKSUM

C. For the database, the database compatibility level option should be set to 10.

D. For the model database, the PAGE_VERIFY database option should be set to

TORN_PAGE_DETECTION.

Answer: B

4. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. You configure the SQL Server instance to use the -T1222 and -T1204 trace flags during startup. You must make sure that your failure recovery plan performs backup of the use of the trace flags. So what action should you perform to achieve this goal?

A. You should backup the master database

B. You should backup the default.trc file

C. You should backup the SQL Server registry hive.

D. You should backup the resource database

Answer: C

Microsoft 70-432认证题库-1

Posted in Uncategorized by haiyanliang on April 1, 2011

Title    :  TS:MS SQL Server@ 2008,Implementation and Maintenance
Version :  Demo

1. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database.Now you are in charge of a SQL Server 2008 instance. There is a computer which hosts several applications in your company. The instance runs on the computer. A job named DiliveryList is created by you. This job requires a file to be written to a file server. But because the job cannot access the file server, it fails to run. You intend to configure the SQL Server Agent service so that only the SQL Server Agent service has read and write access to the file server. Which account type should you use?
A. You should use local Service account
B. You should use network Service account
C. You should use domain account
D. You should use local System account
Answer: C

2. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. According to the company requirement, the names of all user-defined stored procedures must contain the prefix usp_ on all instances. Besides this, you must make sure that stored procedures that do not contain this prefix cannot be created by you. What should you do?
A. A policy should be created. The policy targets the name of the stored procedure that is evaluated on demand.
B. A policy should be created. The policy targets the name of the stored procedure that is evaluated on change.
C. A condition should be created. The condition targets the name of the stored procedure that is evaluated on change
D. A condition should be created. The condition targets the name of stored procedure that is evaluated on demand.
Answer: B

3. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. Now your company CIO assigns a task to you. The company CIO wants you to configure FILESTREAM data and the two requirements below must be met: you must enable FILESTREAM for file I/O streaming access; remote client computers must be able to have streaming access to FILESTREAM data. You must make sure that FILESTREAM data is enabled. Which service should you configure?
A. You should configure SQL Server VSS Writer
B. You should configure Distributed File System
C. You should configure SQL Server
D. You should configure SQL Server Full Text
Answer: C

4. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of two instances both of which run on the same computer. One is a SQL Server 2008 instance; another is a SQL Server 2005 instance. There is a database named DB1 in the SQL Server 2008 instance. DB1 uses the Fulltext indexes. Several records that include the word “root” are added to DB1. An empty resultset is returned when the Fulltext index is queried for the word “root.” You must make sure the query can return records that contain the word “root”. What should you do?
A. You should terminate and restart the MSFTESQL service
B. You should rebuild the full-text index
C. The word “root” should be added to the stop list
D. The word “root” should be added to the thesaurus file
Answer: B

5. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named Dworks in the instance. Now you get a report from users saying that DB1 meets deadlock problems. As the technical support, you have to capture the deadlock information to the SQL Server error log. What should you do?
A. For the AdventureWorks database, enable Server Auditing
B. First you should set the appropriate trace flags as a startup parameter, and then restart the SQL Server instance
C. You should configure the data collector and make it capture the deadlock graphs
D. You should configure a SQL Profiler trace, and make it capture the deadlock graphs
Answer: B

6. You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named Dworks in the instance. The Dworks database has a table named Orderthings. According to the company requirement, you have to export all data from the Orderthings table to a file. During the export, you must make sure that the data export process is saved for reuse and a Microsoft Office Open XML document format is used. What should you do?
A. You should run the bulk copy program utility along with an output file and no format file
B. You should run the SQLCmd utility and save the output to a file
C. You should run the SQL Import and Export Data Wizard and save the output to a file.
D. You should run the bulk copy program utility along with a format file and an output file.
Answer: C

How do I ‘lock Computer’, on Windows 2000, with a single key stroke?

Posted in Uncategorized by haiyanliang on September 24, 2010

01. Start / Settings / Taskbar & Start Menu / Advanced / Add.

02. Type rundll32.exe user32.dll,LockWorkStation and press Next.

03. Select the Location of this shortcut. I chose Start Menu.

04. Enter a Name. I chose Lock Workstation.

05. Press Finish.

06. Navigate to the shortcut by right-clicking the Start button and clicking Explore.

07. Right click the Lock Workstation shortcut and press Properties.

08 Set it to run Minimized.

09. Click in Shortcut Key and press the key you want to use to lock Computer.

10. Press OK.

Tagged with:

How to maximize window in flex?

Posted in Uncategorized by haiyanliang on August 1, 2010
this.maximize(); 

---

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    applicationComplete="onApplicationComplete();">
    
    <mx:Script>
        <![CDATA[
            
            private function onApplicationComplete():void {
                stage.nativeWindow.maximize();            
            }
            
        ]]>
    </mx:Script>
    
</mx:WindowedApplication>
Tagged with:

Drop USER CASCADE TOO SLOW

Posted in Uncategorized by haiyanliang on January 26, 2010

Problem:  The command “drop user hrtest cascade; ” is slow and probably dropping 10 objects per second.

Tried:

alter session set optimizer_mode = CHOOSE; — no good

exec dbms_stats.gather_database_stats;   — take too long to complete

Solution from Tom Kyte

http://www.oracle.com/technology/oramag/oracle/06-jul/o46asktom.html

We have an application that creates users and places private synonyms in users’ accounts. On occasion a security administrator drops multiple users who no longer need access to the database. It can take about two minutes to drop a user that contains about a thousand synonyms. I’m getting complaints that it takes too long to remove the obsolete accounts. Apart from transitioning the system to using public synonyms, do you have any suggestions on improving the performance of the DROP USER command?

It is all about perception. Whenever I have a long-running process, I think about how I can “background” it so an unlucky end user never has to wait for it to complete. If the end user doesn’t have to wait for it, it will seem instantaneous.

So, move long-running processes into the background, and the end users think, “Wow, this is really fast!” What I recommend is to turn the process of DROP USER USERNAME CASCADE into the following:

1. ALTER USER USERNAME LOCK; (The account is disabled, so the “secure goal” is achieved.)
2. dbms_job.submit( l_job, 'execute immediate ''drop user a cascade'';' );
3. commit;

And give the user a message immediately that says “OK.” The locking of the account will achieve the “goal” of dropping the user (by removing access), and the actual dropping of the user schema—which might take a bit of time—will happen shortly after the COMMIT, in the background, without making the end user wait. As far as the end user is concerned, the act of dropping the user is instantaneous and the response time is always the same. Consistency is important to end users.

I do this with lots of apparently slow things—hide the real work in the background and let the end users continue, and they think the application is much faster than it is.

So,

1.

declare
l_job binary_integer;
begin
dbms_job.submit( l_job, ‘execute immediate ”drop user hrtest cascade”;’ );
commit;
dbms_output.put_line(l_job);
end;
/

Execution result:

SYS@SPRT> declare
2  l_job binary_integer;
3  begin
4  dbms_job.submit( l_job, ‘execute immediate ”drop user hrtest cascade”;’ );
5  commit;
6  dbms_output.put_line(l_job);
7  end;
8  /
179824

PL/SQL procedure successfully completed.

SYS@SPRT>

2. select TOTAL_TIME, failures from dba_jobs where job = 179824;

Execution result:

SYSTEM@SPRT> select TOTAL_TIME, failures from dba_jobs where job = 179824;

TOTAL_TIME   FAILURES
———- ———-
54

SYSTEM@SPRT>