160 likes | 173 Views
make.sql Ahbaid Gaffoor Amazon.com/A9.com. Overview. Section 1: Scripts Section 2: SQL*Plus Section 3: make.sql Section 4: Demo. Section 1 Scripts. Section 1 : Scripts. Benefits Better Scripts. 1.1 Scripts – Benefits. No Adhoc DDL/DML Reviewable Repeatable Trackable Versionable
E N D
Overview • Section 1: Scripts • Section 2: SQL*Plus • Section 3: make.sql • Section 4: Demo make.sql, NoCOUG Feb 11th 2010
Section 1 Scripts make.sql, NoCOUG Feb 11th 2010
Section 1: Scripts • Benefits • Better Scripts make.sql, NoCOUG Feb 11th 2010
1.1 Scripts – Benefits • No Adhoc DDL/DML • Reviewable • Repeatable • Trackable • Versionable • Maintainable make.sql, NoCOUG Feb 11th 2010
1.2 Scripts – Better Scripts • Dynamic Variables • Ordering • Multi Directional • Modular • Instrumented make.sql, NoCOUG Feb 11th 2010
Section 2 SQL*Plus make.sql, NoCOUG Feb 11th 2010
Section 2: SQL*Plus • Parameters • Variables • Wallet make.sql, NoCOUG Feb 11th 2010
2.1 SQL*Plus - Parameters • sqlplus -H | -V • H : Help, V : Version • sqlplus [-C <version>] Compatibility to “x.y[.z]” [-L] Attempt one logon [-M “<options>”] HTML Markup [-R <level>] Restrictions 1, 2 or 3 [-S] Silent Mode [-F] Failover mode for RAC make.sql, NoCOUG Feb 11th 2010
2.2 SQL*Plus - Variables • var[iable] Bind variables • define User variables • & Temporary substitution variable • && Permanent substitution variable • @ Run script in current location • @@ Run script in caller’s location make.sql, NoCOUG Feb 11th 2010
2.3 SQL*Plus – Wallet 1 of 2 • Passwordless Client Connectivity • Easily distributed and Encrypted • Example: # Create a wallet mkstore -wrl /home/oracle/admin/fsfodb/wallet –create # Create an entry in the wallet for a default username mkstore -wrl /home/oracle/admin/fsfodb/wallet –createEntry \ oracle.security.client.default_username SCOTT # Create an entry in the wallet for a default user password mkstore -wrl /home/oracle/admin/fsfodb/wallet -createEntry \ oracle.security.client.default_password TIGER • Use: sqlplus /@TNSALIAS make.sql, NoCOUG Feb 11th 2010
2.3 SQL*Plus – Wallet 2 of 2 • sqlnet.ora references wallet • Example: # sqlnet.ora wallet reference WALLET_LOCATION = (SOURCE = (METHOD = FILE) (METHOD_DATA =(DIRECTORY = /home/oracle/admin/fsfodb/wallet)) ) SQLNET.WALLET_OVERRIDE = TRUE make.sql, NoCOUG Feb 11th 2010
Section 3 make.sql make.sql, NoCOUG Feb 11th 2010
Section 3: make.sql • Analagous to “make” • Driven by definitions file • make.sql <options> - all - tables - packages - metadata • clean make.sql, NoCOUG Feb 11th 2010
Section 4 DEMO make.sql, NoCOUG Feb 11th 2010
Thank Youahbaid@{amazon.com|a9.com|att.net}http://redoblog.wordpress.comhttp://ocpdba.net