tailieunhanh - Hướng dẫn học Microsoft SQL Server 2008 part 21
Các kịch bản tải đầu tiên tất cả các file DLL cần thiết cho SMO và các snap-in (mã và các lệnh mở rộng khả năng của PowerShell), và sau đó nó sẽ load các snap-in. Một khi điều này được thực hiện, tất cả các chức năng SQL Server nhà cung cấp có sẵn, và kịch bản này có thể chạy với PowerShell hoặc PowerShell 2,0 khi nó có sẵn. | Part I Laying the Foundation The script first loads all of the DLLs needed for SMO and the snap-ins code and commands that extend PowerShell s capabilities and then it loads the snap-ins. Once this is done all of the SQL Server provider functionality is available and this script can be run against PowerShell or PowerShell when it is available. The SQL PSDrive - SQLSERVER Native PowerShell provides the ability to navigate not only the disk file system but also the system registry as though it were a file system. This is expected behavior for a shell environment as Unix shell systems treat most everything as a file system as well. The SQL Server provider adds a new PowerShell drive also referred to as a PSDrive called SQLSERVER . The Set-Location cmdlet usually aliased as cd is used to change to the SQLSERVER drive and then SQL Server can be navigated like the file system. There are four main directories under SQLSERVER SQL SQLPolicy SQLRegistration and DataCol-lection The SQL folder provides access to the database engine SQL Server Agent Service Broker and Database Mail all using the various SMO DLLs. The SQLPolicy folder provides access to policy-based management using the DMF and Facets DLLs. The SQLRegistration folder enables access to the Registered Servers and the new Central Management Server feature of SQL Server 2008 . The DataCollection folder enables access to the Data Collector objects provided with the Management Data Warehouse feature of SQL Server 2008. You can browse the SQLSERVER file system just like a disk file system. Issuing the command cd SQL or Set-Location SQL and running the Get-ChildItem cmdlet returns the local server and any other servers that may have been recently accessed from the PowerShell session. Changing to the local server and running Get-ChildItem returns the names of the SQL Server instances installed on that server. Changing to one of the instances and running Get-ChildItem returns the collections of objects available .
đang nạp các trang xem trước