Understanding the CREATE DATABASE Statement (69)

When you execute a CREATE DATABASE statement, Oracle Database performs (at least)
a number of operations. The actual operations performed depend on the clauses that
you specify in the CREATE DATABASE statement and the initialization parameters that
you have set. Oracle Database performs at least these operations:
■ Creates the datafiles for the database
■ Creates the control files for the database
■ Creates the redo log files for the database and establishes the ARCHIVELOG mode.
■ Creates the SYSTEM tablespace
■ Creates the SYSAUX tablespace
■ Creates the data dictionary
■ Sets the character set that stores data in the database
■ Sets the database time zone
■ Mounts and opens the database for use[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-995630/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10599713/viewspace-995630/

The SQL block has the following properties: Property Description Data source The source from which the report obtains data. To select or change the data source, click Change. This opens the SQL Data Source dialog box, from which you can select from a list of data sources (such as ODBC, JDBC, and Oracle database connections) configured in the apf.xml file for use with APF. You can use the All users option to set an SQL username/password for all users on the system (allowing services that are run as the SYSTEM user to access them). Important Before using the All users option, ensure that you have administrative privilege on the system to write to the registry, HKEY_LOCAL_MACHINE\SOFTWARE\Applied Materials\APF Common\ODBC. Note If necessary, you can log in to the database by clicking Login in the SQL Data Source dialog box. Tip You can also configure SQL database access for all APF clients using the SQL Password Administrator utility, accessible from the Windows Start menu in Programs > APF Vx.x.x > SQL Password Admin. This allows you to easily update database credentials from a single source (rather than needing to update credentials in individual blocks). Folder The database table or folder from which you want to extract attribute values. The tables are displayed in a combo tree structure. Notes If you are using an ODBC connection, accessing a Teradata database source for the first time might log some errors in the ODBC Server log file. This is because the schemas are accessed along with the table data, and these two could not be distinguished. The error is due to the schemas not containing data, and does not affect the data in the folders. The errors do not appear on subsequent selections. If you do not have the required permission to access a table directly, the available columns of the selected table are not displayed in the Columns list. In this case, you must select the schema.table (that is, qualify the table with its schema). Attributes Lists all attributes in the selected folder. Columns Lists the attributes whose values you want to extract for use in the report or rule. Drag attributes here from the Attributes list. The SQL block automatically creates an SQL query to extract the attribute values that you select. Note If you want to use duplicated column names in the SQL query, ensure that you use alias names for the duplicated columns. Bind Variables Click this option to create, update, or delete bind variables. Using bind variables can improve database performance, by limiting the number of hard parses performed by the database during rule or report execution. A hard parse occurs when the database must allocate CPU and memory to execute a unique SQL query that has not previously been executed. Using bind variables allows you to write a common SQL query that differs in execution only by its variable values; in this case, the database executes the query from its shared pool (cache), with improved performance. Important Bind variables are index-based (rather than name-based) and, therefore, the order in which the Bind Variables appear in the Add/Remove Bind Variables window must match the order they appear in the Manual SQL query value. Also, any bind variable defined must be referenced in the Manual SQL expression. That is, you cannot define two bind variables and use only one in the expression. The properties in the Add/Remove Bind Variables window are: Bind Variables - The list of bind variables. Name – The name of the bind variable. Type – The APF data type of the variable. Value – The value you want to assign to the bind variable. A sample query using bind variables for a database connection that is using an OCI driver is shown below: SELECT Name from Equipment where EqpType = :EqType where EqType is the name of the bind variable. Note To use bind variables, you must enable the Manual SQL option in the SQL block's properties window, and then define an SQL query that uses the appropriate variables. To edit a bind variable, select the variable from the Bind Variables list, modify the values in the Edit group box and then click Update. Notes Bind variables are not supported when using ODBC and JDBC connections. When using date type bind variables, specify the date in ISO format. For example, in US based regional setting, specify date in the MM-DD-YYYY format. Manual SQL Select this option to customize the block's default SQL query or define your own query; clear this option to use a system-defined SQL query based on the properties you have defined for the SQL block. Note If you want to use bind variables to improve query performance (as described in the property description above), you must select Manual SQL, and then define a query that includes the appropriate variables. (In this case, the order in which bind variables appear in the SQL query must match the order they are defined in the Add/Remove Bind Variables window). When this check box is selected, you can choose attributes from a different table and later change them in the manual query. The attributes listed in the Columns list remain unchanged. Warning Defining a manual query that selects all columns in a table (for example, SELECT * FROM MYTABLE) can significantly slow the runtime performance of the report or rule (depending on the size of the target table). To improve performance, define a SELECT statement that selects specific columns (for example, SELECT COLUMN1,COLUMN2 FROM MYTABLE). Notes You can use system- or user-defined constants to represent field values. For more information, see Using constants in SQL queries. When defining manual SQL queries, functions must be represented by an alias. For example, the following SQL query creates a table column named LotNoCnt that represents the result of the Count(LOT_NO) function call: SELECT Count (LOT_NO) LotNoCnt, ...FROM...WHERE... Escape SQL Allows you to enable or disable the use of escape characters to represent table or column names when running the SQL query. By default this option is selected. When you select the Escape SQL option, you must enter the table and column names in the same case as they are created in the Oracle database. For example, if a table named LOT_TABLE contains the columns ID and QTY in the Oracle database, and if you have selected the Escape SQL option, the SQL query should be of the form: SELECT ID,QTY FROM LOT_TABLE; The following SQL query would not work, because the table and column names are specified in lowercase. SELECT id,qty FROM lot_table; Note If you use multiple tables in the SQL query, do not select the Escape SQL check box. In general, when using a manual SQL query, it is recommended to clear the Escape SQL checkbox. No optimize Select this option if you do not want the expression in the next block to be pushed to the SQL query when using the Manual SQL option. By default, this option is cleared. SQL Query Displays the SQL query that will be executed. When you select the Manual SQL option, you can type a custom SQL query in this field. To add in-line comments to your query, either use the /* and */ combination or double hyphen (--). The following example shows both the usages. SELECT lot, /* select the name */ oper, -- select the operation qtyout FROM ALLFORMAT Notes If you use downstream Filter, Function, or Compress blocks to operate on data returned from an SQL block, in some cases, the compiler performs automatic optimization of your SQL query to improve performance when running the report or rule. For more information, see Understanding automatic SQL optimization. If you use a manual SELECT statement such as "select * from <table_name>" in the SQL block query, and later change the table schema, you must recompile the report. Some SQL functions, including SUM() and AVG(), return an incorrect data type when used with OCI or JDBC data sources. For details, click here. A problem in the OCI and JDBC drivers results in return values of the wrong data type for some SQL functions including SUM() and AVG(). The following expression returns an INTEGER instead of the expected REAL value: SELECT SUM(ints)/4 AS RESULT FROM MYTABLE A workaround is available by embedding the problematic function within a CAST expression to convert the result to the desired type, as follows: SELECT CAST(SUM(ints)/4 AS REAL) AS RESULT FROM MYTABLE This workaround is valid for Oracle 10g without any additional steps. However, using Oracle 9.2, 9.2.0.6, or 9i, this workaround requires that you run the following commands in SQLPLUS to configure a database-level event: sql>alter system set event='10507 trace name context forever,level 1' scope=spfile: sql>shutdown immediate; sql>startup Once the database has been restarted, the CAST function will work as needed in Oracle 9.2, 9.2.0.6, or 9i. When using an SQL block to connect to an Oracle database containing a synonym for a defined view (for example, MYVIEW_SYN), the synonym does not appear in the block's properties. The SQL block does not support using case-sensitive table names when accessing columns though a database link that points to another database. If you include native functions in your SQL statements, the return data type (when using an OCI connection) is determined by Oracle, and a similar data type is created in APF. If you want to use a specific data type for a column, use the native Oracle function, CAST(column, oracle_data_type). The SQL block does not support comments in the SQL statement using the "—" format; instead enclose the comments between /* and */. The incorrect and correct usages are given below. Incorrect usage: SELECT TABLE1.NAME AS "NEW_NAME" --comments Correct usage: SELECT TABLE1.NAME AS "NEW_NAME" /*comments*/ Important The keyword OVER is not supported in the SQL statement inside an SQL block. For example, SELECT COL1, COL2 AVG(COL2) OVER (PARTITION BY COL3) AS RES FROM TABLE1. If you use Oracle versions prior to 10g and include multiple APF user-defined constants in the SQL query, the call to JDBC API fails. This is because, an SQL query like the one given below: SELECT * FROM EMPLOYEE WHERE NAME=$CONSTANT1 AND AGE=$CONSTANT2; is converted to a internal format when making an OCI or JNI native call. The JNI native calls do not support this internal format if the Oracle version is less than 10g and may return the following error, because the integer type AGE is passed internally as string: ORA-01722: invalid number However, you can include multiple user-defined constants in the SQL query when using an OCI connection. 翻译
12-16
### 书籍内容概述 《Understanding the Linux Kernel》第三版是一本深入探讨Linux内核内部工作机制的权威书籍[^1]。该书由Daniel P. Bovet和Marco Cesati撰写,出版于2005年11月。书中详细描述了Linux内核的关键组成部分,包括进程管理、内存管理、文件系统、I/O子系统以及中断处理等。此书适用于希望深入了解Linux操作系统内部原理的读者,尤其是对内核开发感兴趣的开发者和技术人员。 以下是该书的主要章节及其涵盖的内容: - **进程管理**:介绍进程的创建、调度、同步以及信号处理机制。 - **内存管理**:讲解虚拟内存的实现、页表结构、交换机制以及内存映射。 - **文件系统**:分析Linux文件系统的架构,包括VFS层、块设备管理和具体文件系统的实现。 - **I/O子系统**:描述字符设备和块设备的驱动程序模型,以及与硬件交互的方式。 - **中断和异常处理**:解释中断控制器的工作原理、中断处理程序的设计以及异常处理流程。 ### 获取书籍或学习资料的方法 对于希望获取《Understanding the Linux Kernel》第三版的用户,可以通过以下途径寻找书籍或相关资源: 1. **在线书店**:亚马逊(Amazon)、京东、当当网等大型在线书店通常提供纸质版或电子版的购买选项。 2. **图书馆**:许多大学或公共图书馆可能收藏了该书,可以借阅以节省成本。 3. **数字资源平台**:如Google Books或Safari Books Online可能提供部分章节预览或完整电子版订阅服务。 4. **开源社区**:Linux内核源代码目录下的`Documentation`文件夹中包含大量技术文档[^1],这些文档可以作为辅助学习材料,帮助理解内核设计。 5. **在线学习网站**:例如LWN.net或Kernel.org提供了丰富的内核开发教程和文章,能够补充书籍中的知识点。 ### 示例代码片段 以下是一个简单的内核模块示例,展示了如何编写一个基本的Linux内核模块并打印日志信息: ```c #include <linux/module.h> #include <linux/kernel.h> static int __init hello_init(void) { printk(KERN_INFO "Hello, this is a basic kernel module!\n"); return 0; } static void __exit hello_exit(void) { printk(KERN_INFO "Goodbye, removing the kernel module.\n"); } module_init(hello_init); module_exit(hello_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Example Author"); MODULE_DESCRIPTION("A Simple Hello World Kernel Module"); ``` 上述代码可用于实践书中关于内核模块加载和卸载的知识点。 ###
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值