Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of troubleshooting of Database principle

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you an example analysis of the troubleshooting of database principles, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

1. How does Interbase connect with Access?

A: first set up the database in ACCESS and specify the alias and username and password for this database, then establish an external database connection in Interbase (note that you use the database alias you specified), specify the username and password at the username and password as previously set, and use a database object in the programming language Set the relevant properties of this object (including database alias, user name, password, etc.) so that you can access the Access database through this object.

2. Can Access be used to build a website message board?

Answer: it should be possible, but generally speaking, it is not used as the background database of the message board, because the object of Access is the database management of small and medium-sized enterprises, and the general website message board should use a larger database as the platform, so it is recommended to use SQL or Oracle and so on.

3. Which is more suitable for use in UNIX, MYSQL or SQL.

A: of course it should be MYSQL, because MYSQL is more compatible with UNIX.

4. Which is more compatible with SQL2000, Interdev or Ultradev?

A: I think Interdev is better, because there are many places in SQL2000 and Interdev that are compatible, and they can work together to develop applications, but it's just easier to use for Ultradev.

5. How to put the data in the database into EXECL

Answer: in the WIN9X operating system, you must first have the driver of the corresponding database, if not, install it first, and then you can directly open the relevant database file in EXECL. In some databases, it can only be achieved by dragging and dropping data from two programs, such as ACCESS and so on.

6. How to design the database?

A: database design consists of two components: logical design and physical design. Logical database design involves modeling business requirements and data using database components such as tables and constraints, regardless of how or where the data is physically stored. Physical database design includes mapping logical designs to physical media, using available hardware and software features to enable physical access and maintenance of data as quickly as possible, and generating indexes.

It is difficult to change these components after design, so it is important to properly design the database, model it for business requirements, and take advantage of hardware and software capabilities in the early stages of database application development.

7. our computer is very slow in querying data. what factors may cause it?

A:

A. the speed of network communication is slow.

B. insufficient memory on the server computer or insufficient memory available in Microsoft SQL Server 2000.

C, lack of useful statistical data.

D, the statistical data is out of date.

E, lack of useful index.

F, lack of useful data striping.

8. How to realize the factorial of numbers by recursive method in VFP?

A: the procedure is as follows:

Recursive subroutine:

Func abc (n)

If n > = 1 then s=n*abc (nmur1)

Else

Retu

Endfunc

Call the main program

Set talk off

@ 13 say 13 "" get n

Read

Abc (n)

9. What foundation do you need to learn SQL?

A: learning SQL requires some basic database knowledge, for example, you can learn FOXBASE, VFP and ACCESS.

10. How to handle the transaction log of SQL Server?

A: related logs can be processed through SQL Server's Enterprise Manager or through SQL's log viewer.

11. How to convert SQL 7 data into SQL 2000 data?

Answer: you can move or replicate databases from Microsoft SQL Server 7.0 to an instance of Microsoft SQL Server 2000 using the replication Database Wizard, which is based on detach and attach features that allow user databases to be moved or replicated from the source server to the destination server. The data Transformation Service (DTS) package performs actual move or copy operations. You can schedule the package to run at a specified time or rerun if necessary.

Database administrators can move or copy one or more databases from an instance of SQL Server 7.0to the default instance of SQL Server 2000 on your local computer, or to a default or named instance on a remote computer. This upgrade feature does not support the SQL Server 6.5 database.

12. How to configure log shipping?

Answer: use the Database maintenance Plan Wizard to configure log shipping.

Before you configure log shipping, you must create a share on the primary database to make the transaction log available. This is a share created from the transaction log dump directory. For example, if you dump logs to the directory e:\ data\ tlogs\, you can create a\\ logshipping\ tlogs share from that directory.

1. On the Select Database screen, select the following databases check box, and then select the database to which you want to log shipping. If more than one database is selected, log shipping is not performed and the log shipping option is not available. Selecting a database that has been configured for log shipping is not allowed.

two。 Select the Shipping transaction logs to other SQL Server (log shipping) check box.

3. Continue with the wizard and specify the remaining database maintenance options until you reach the specify Log Shipping destination screen.

4. Click the add button to add the destination database. For this option to be available, you must have selected to use log shipping in the previous steps of the wizard.

5. In the add destination Database screen, select a server name.

The server must be registered and running Microsoft SQL Server 2000 Enterprise Edition for it to appear in the drop-down list. If you want to make this destination available as a source destination, you must select the allow database to take the primary role check box. If the check box is not selected, the destination database will not be able to adopt the role of the source destination in the future. If you have selected the allow database to take the primary role check box, you must also specify the transaction log backup directory in the destination database where the log will be backed up.

6. To change the transaction log destination database from the default location, enter a location in the Directory box.

7. If you want to use another database name on the destination server, specify a new name. If you have chosen to allow the destination database to assume the source role, you cannot change the name of the database from the default value.

8.

9. If the source database already exists on the destination database, select the use existing database check box. If the database name on the destination server is different, enter that name in the Database name box. The database must be restored using the WITH STANDBY option in order to accept logs correctly.

10. On the initialize destination database screen, do one of the following:

Click extract full database backup now.

-or-Click use latest backup File to initialize the destination database.

11. On the Log Shipping scheduling screen, view the default log shipping schedule. If you want to change the schedule, click change.

twelve。

13. In the load delay box, set the delay (in minutes) that you want the destination database to wait before restoring transaction logs from the source server. The default value of this box is 0 minutes, which means that the destination database should restore all transaction log backups immediately.

14. In the File retention period box, specify the length of time that the transaction log should remain before it is deleted.

15. From the Log Shipping threshold dialog box, set the backup Alert threshold.

This is the maximum period since the last transaction log backup on the source server. Once the time exceeds this specified threshold, the monitoring server generates an alert.

16. Once the time exceeds this specified threshold, the monitoring server generates an alert.

17. In the specify Log Shipping Monitor Information screen, type the name of the server that will monitor log shipping.

Click use Windows Authentication or use SQL Server Authentication to connect to the monitoring server. The log_shipping_monitor_probe login is fixed and must be used to connect to the monitoring server. If this is a new account, select a new password. If the account already exists on the monitoring server, you must specify an existing password.

Description: using the Database maintenance Wizard to set up log shipping, you can only send logs to disk, not the backup to Tape option.

How do I manage or view SQL Server messages (Enterprise Manager)?

Answer: manage or view SQL Server messages

⑴, expand a server group, and then right-click a server.

⑵, point to all tasks, and then click the manage SQL Server messages command.

⑶, to specify search options, do one or more of the following:

In the message body contains box, type the text you want to search.

In the error number box, type the error number you want to search.

Under severity, select the severity level you want to search for.

⑷, to specify the message to include, do one of the following:

Select the include only logged messages check box.

-or-Select the include only user-defined messages check box.

⑸, click find to find all messages that meet the search criteria

14. What knowledge should be mastered first to learn SQL2000?

Answer: if you want to learn SQL2000, you can first learn some basic knowledge of database, such as FOX, ACCESS, etc., and then learn the knowledge of SQL2000 operation, and then learn SQL2000 SERVER.

15. What aspects should be considered for student management software?

Secondly: considering the modules and algorithms of program development, the developed software should be divided into several modules, each of which realizes part of the function, so that the structure of the developed program is clear. In addition, there is the algorithm, the algorithm is the key to solve the problem, there is no good algorithm, the efficiency of our program is not high.

The third is the establishment of the database, a good data collection is twice the result with half the effort for us developers, otherwise it will be futile, the other aspect is the data platform, the quality of the platform is very critical to the transplantation and versatility of the program.

16. Why can the database I built be opened on some machines and not on some machines?

A: the possible reasons are:

⑴, the database platform used is different, for example, the database of SQL cannot be opened on ACCESS, and vice versa.

⑶, the database is corrupted during relocation.

17. How long will it take to learn SQL Server?

A: this question cannot be answered positively, because its own factors are very important. if you study hard and time can be guaranteed, you will certainly be able to get started in a month at the most, but you may not be proficient if you are proficient in it. however, many experiments are of great help to familiarity. people who are familiar with this question may not dare to say they are proficient.

What is the function of SQL?

Answer: SQL in a common sense refers to the database query language, which is mainly used for database operation, management and query.

19. How to write database reports?

A: the writing of database reports can be considered from the following aspects:

⑴, the environment and necessity of database establishment

The platform established by ⑵ and database

Details of ⑶ and database establishment

⑷, methods and skills of operation

⑸, security and stability

⑹, portability and compatibility

⑺, other

20. Why can't the SQL statements written in the book be executed in Visual Foxpro?

Answer: there are some slight differences between the SQL statement in Visual Foxpro and the standard SQL statement written in the book, according to the syntax of the SQL sentence in Visual Foxpro. Similarly, the SQL statement written in SQL Server should conform to the syntax of SQL sentence in SQL Server.

21. Under what circumstances do you use CLUSTERED INDEX and under what circumstances do you use nonclustered index?

Answer: the clustered index sorts and stores data rows within the table based on their key values. Because data rows are stored in a sort order based on clustered index keys, clustered indexes are effective for finding rows. There can be only one clustered index per table because the rows themselves can only be stored in one order. The data rows themselves constitute the lowest level of the clustered index.

When a clustered index is included, the rows of data in the table are stored in sort order. If the table does not have a clustered index, its data rows are stored as a heap.

A nonclustered index has a structure that is completely independent of data rows. The lowest row of a nonclustered index contains the key value of the nonclustered index, and each key value item has a pointer to the data row that contains the key value. Data rows are not stored in an order based on non-clustered keys.

Within an index, a pointer from an index row to a data row is called a row locator. The structure of the row locator depends on whether the data pages are stored in a stack or aggregate. For a heap, a row locator is a pointer to a row. For tables with clustered indexes, the row locator is the clustered index key.

When a clustered index is created, the rows within the table are stored in a specific order. These rows are stored sequentially based on the clustered index key. If a table has only nonclustered indexes, its data rows are stored in an unordered heap.

In addition, clustered indexes work well if most queries that reference emp_sample have equations or range comparisons about emp_id in their WHERE clauses. If the WHERE clause of most queries references emp_name instead of emp_id, performance can be improved by setting the index on emp_name as a clustered index.

22. How can you display all the control code like VB in VFP?

Answer: use the Class designer in VFP.

23. In multi-CPU machines, does the network card always use the CPU with high serial number?

Answer: not necessarily, in the network operating system, multiple CPU,CPU can be used for collaborative work rather than division of labor, so the network card may not always use the CPU with high serial number.

24. Do you think SQL2000 SERVER is difficult to learn in management or programming?

25. What kind of database is best to learn now?

A: this question has been asked by many students. In fact, each kind of database has its storage value, otherwise it has been eliminated. Therefore, there is no best, only the most suitable, it should be said that the most suitable for learning or using which kind of database. In fact, several kinds of databases are very good. ACCESS is mainly used for the management of small and medium-sized enterprises as their database platform, VFP is mainly used to develop database applications, and MCDBA is mainly aimed at MC certification, which involves the management and application design of SQL2000. This is mainly the database platform and development tools used by most large and medium-sized enterprises and websites. Therefore, as to which is the best, it should be said that what suits you is the best.

Q: what's the difference between ACCESS, VFP and SQL? What is the difference in adapting to the environment?

Answer: ACCESS, VFP and SQL are all three softwares developed for database management, but when in use, ACCESS is mainly used in database management systems of small and medium-sized enterprises, VFP is mainly suitable for developing due development software of database management systems, and SQL is mainly aimed at database platforms of large and medium-sized enterprises.

What is the specific meaning of the 27.ODBC data source and what are the operations related to it?

A: ODBC is a programming interface that enables applications to access database management systems that use structured query language (SQL) as the data access standard. The related operations are configuration number DNS and database access engine. In the application, we first configure the ODBC data source so that it can be specified to a specific database, and name the database an application access alias, so that we can access the relevant database by accessing this alias in the application.

28. In the web page, the "record form" needs to be formatted, and then Party A will fill in the form, Party B will check and supplement it, and then print and save it as a database and number it automatically. Can also automatically query the "record table" according to the format, in order to achieve this function, what technology can be implemented, I should learn which web page editing software or technology can be realized.

Answer: to achieve this kind of function, you can first learn some knowledge of database, in which you talk about related technologies, such as SQL, Oracle, and so on. In addition, you need to understand some configuration technologies of network database, such as SQL Server, ODBE, Inerbase and so on. As a web editing software, now a lot of software is feasible, I think it is easier to use is DREAMWEAVER and so on.

29. What is the meaning of "instance" in SQL2000 and how do you understand it?

A: a SQL instance is simply a SQL process, similar to a process in the operating system. It has two types, namely:

Default instance of SQL Server.

This instance is identified by the network name of the computer on which it is running. Applications that use previous versions of the SQL Server client software can connect to the default instance. The SQL Server version 6.5or SQL Server version 7.0server can be operated as the default instance. However, only one version can run as the default instance on a computer at a time.

Named instance of SQL Server.

The instance is identified by the computer's network name plus the instance name in\ format. The application must connect to a named instance using the SQL Server 2000 client component. The computer can run any number of named SQL Server instances at the same time. At the same time, named instances can also be installed and run as existing SQL Server version 6. 5 or SQL Server version 7. 0. The instance name cannot exceed 16 characters.

What is DTS in 30.SQL and what is its main function?

A: DTS is a data conversion service provided by SQL, which can be used to import and export SQL data.

31. I have a database that is set up on SQL Server2000. I want to transfer it back to SQL7.0, but the bak document of SQL2000 cannot be recovered in SQL7.0. Is there any way to transfer SQL2000 back to SQL7.0?

Answer: DTS packages created on an instance of SQL Server 2000 cannot be loaded or run on an instance of SQL Server version 7.0 (or earlier). If you try to do this, you may receive one of the following messages:

"invalid class string." "the parameter is incorrect."

Both messages indicate that the current server does not contain all the components necessary to load the package and cannot support objects (such as tasks and transformations) defined in the DTS package.

However, if you receive one of these two messages, you can still open and run the package on the SQL Server 2000 instance.

Of course, another way to migrate databases in SQL2000 to previous versions of SQL is the database replication wizard it provides.

32. How can I design a simple startup program for VF6.0? Can I use the form? I don't want to take off VF?

A: you can write a script to add a name to the registry of the system, or you can use the form.

33. What is the difference between the four data types of char, nchar, nvarchar and varchar in SQL? How to use it?

A: char is a fixed-length data type, and varchar becomes a data type. Nchar and nvarchar are the same, but for multi-byte nchar, nvarchar becomes longer.

34. What are the advantages and disadvantages of not breaking away from VF and leaving after programming?

A: there are no pros and cons.

What is the super user name and password of the ORACLE database?

A: system/manager.

36. How many bytes of content can be stored by char and nchar respectively?

A: it's all 4000 bytes.

37. Can the teacher recommend me the reference books about MSSQL7?

A: what kind of book you buy depends on what kind of information you need.

38. Can the data of VF be uploaded to the SQL server?

A: of course, if you can refer to Microsoft's materials.

39. Is it possible to use VF on the client and large databases on the server?

A: of course. I've done a lot of such projects before.

What is the null of 40 / dev/null?

A: represents a null value, or a value with a length of 0.

41. Which large databases are VF compatible with?

A: Oracle,DB2,SQL Server and so on are fine.

42. What kind of large database is easy to learn and use?

Answer: SQL Server is easy to learn.

43. How to use unix shell to build a library in MYSQL?

Answer: first write a batch file with a script and then call it with shell (give execution authority and then execute).

44. Can the name of the primary key field in VF be renamed after the database is built?

A: it can be modified. Delete the existing competition and then rebuild.

45. What is competition?

Answer: primary key (primary keyword).

46. After removing the competition, the join between the tables is broken, what should I do?

A: it is more troublesome to add the association after deletion, but it can be restored.

47. / informix/bin/isql can be used in informix to call isql to build a library, but how to use it in MYSQL?

A: because MYSQL runs on the unix/linux platform, it is more difficult to use. Each database has its own characteristics, but one is easy after the other.

Why can't my program be packaged in mdb format? is it because there are macros?

A: macros can also be packaged into mdb format.

49. When accessing the variable name, m. What are the orders with m->? What does it do?

Answer: M. M is the parent class name, and m-> is mainly used to reference m's objects.

How can I share the database in the local area network?

Answer: in order to share the database in the local area network, you generally need a database server, and the front desk accesses it with a browser or other program.

Which is better, SQL Server or Oracle?

A: SQL Server is a medium-sized database, it is not as general as Oracle, but SQL Server and NT operating systems are closely integrated.

52. What is the full name of SQL?

A: SQL's full name is Structured Query Language (structured query language)

53. What are the other large databases besides SQL Server and Oracle?

A: Sysbase,DB2 and Informix are also common. AS400 integrates hardware, operating system and database.

54. How can I learn SQL database well?

A: I think many concepts of relational databases are the same. Whether you learn SQL Server or Access, you should first pay attention to establishing some basic concepts, such as tables, queries, keywords, and so on. Then familiar with the window environment of the database management system, master how to create a variety of objects, how to modify various settings or properties.

55. How do I choose which database to use?

Answer: that depends on the scale and conditions of the specific application. Generally, VFP and access belong to desktop databases, which are good for small applications. SQL Server and Oracle are commonly used in the network environment.

Oracle database is famous for its powerful function and stability, but at the same time, there are also many difficulties in development and management. This paper summarizes some common problems in the development and management of Oracle database, hoping to be helpful to you.

56. If a bad block is found in the table, how to retrieve other unbroken data?

Answer: first you need to find the ID of the bad block (you can run the dbverify implementation), assuming 1234. Run the following query statement to find the segment name:

Select segment_name, segment_type, block_id, blocks from dba_extents

Where (1234 between block_id and (block_id + blocks-1))

Once the bad segment name is found, if the segment is a table, it is best to create a temporary table to store the good data. If the segment is an index, delete it and rebuild it.

Create table good_table

As

Select? From bad_table where rowid not in

(select /? + index (bad_table, any_index)? / rowid

From bad_table where substr (rowid, 1,8) = 1234)

57. How do I close the small window when FORM calls REPORT?

Answer: in the process of designing and developing the interface using Develop 2000 of Oracle database, when FORM calls REPORT, a background window REPORT BACKGROUD ENGINE will be displayed, waiting for FORM to call REPORT. When FORM calls other REPORT, it also uses this background server. No matter how many REPORT is called, this background server exists and only has one. However, when both FORM and REPORT exit, the window is still waiting and will not be closed, so we need to close it manually.

We can use the following parameters not to display this small window when FORM calls REPORT:

Add_Parameter (pl_id, 'ORACLE_SHUTDOWN',TEXT_Parameter,' Yes')

It is important to note that this parameter must be added before all parameters, that is, it must be the first parameter.

58. How to dynamically display records in REPORT according to the query conditions?

A:

1. In REPORT, under "data Model", in "user parameters", create the user-defined parameter Whamclase is the query condition passed from FORM, the data type is character, and the default value is NULL.

two。 Modify the query Quan 1, change the SQL query statement to select? From dept & & w_clause.

3. When you run the report, the report automatically displays the query criteria records that meet & & w_clause.

If the w_clause passed from FORM is where dept=1, the SQL query for this report is automatically converted to:

Select from dept where dept=1, and show the records that meet the query criteria in the report run results. If the w_cluase passed from FORM is where to_char (annual, 'YYYY.MM') =' 2000.03 years, then the records of March 2000 are automatically displayed in the report running results.

59. In Oracle, how do we view the constraints on a table?

A: we can use the following statement to view the constraints on a table from the all_constraints view:

SELECT constraint_name, table_name, r_owner, r_constraint_name FROM all_constraints

WHERE table_name = 'table_name' and owner =' owner_name'

Another view, ALL_CONS_COLUMNS, also includes information that makes up the constraint columns on the table.

60. How to change the database from noarchivelog to archivelog?

Answer: first open the Init.ora file and make sure that the archive log target points to a valid directory.

Then start Server Manager

Svrmgrl > shutdown immediate

Svrmgrl > startup mount

Svrmgrl > alter database archivelog

Svrmgrl > alter database open

Svrmgrl > archive log list

Set the parameter archive_log_start=TRUE in init.ora, which sets the archive log to start automatically. Multiple archived log targets are supported in Oracle 8i, so the parameter is modified to log_archive_dest [n], where n is 1 to 5.

61. How do we increase the size of tablespaces in Oracle databases?

A: in developing an Oracle database, we have two ways to increase the size of the tablespace:

1. Add additional data files to the tablespace

For example: alter tablespace users add datafile'/ u01qqoradata size orclash users02.dbf' orthorax 25m

two。 Modify the current data file in the tablespace

For example: alter database datafile'/ u01 resize oradata resize 50m

62. How to set up a dynamic display field in REPORT?

Answer: the method to set the dynamic display field in REPORT is as follows:

1. In REPORT, under data Model, in user parameters, create user-defined parameters, such as RQ,RQ is a display date passed from FORM, and the data type is character.

two。 In the layout model, create a display field, Fidel1, and modify the source of the display field in the Properties palette to the user-defined parameter RQ, and set it to Invisible.

3. In the dynamic preview, create a text field called RQ 1, adjust the location and width of the text field, and enter & & Fidel1 in the contents of the field, and the field will dynamically display the value of the user-defined parameter Demp1.

63. The question of passwords.

I run Oracle8i 8.1.7 Enterprise Edition on the Solaris system. I created two databases: SUGAR and TestDb. Set the remote_login_passwordfile for both to exclusive. I tried to connect to TestDb as SYSDBA, but failed. Here's what I do:

$sqlplus / nolog

SQL > conn sys/change_on_install@testdb

Connected. (connected)

SQL > select * from v$pwfile_users

Username sysdb sysop

-

Internal true true

Sys true true

SQL > conn sys/change_on_install@testdb as

Sysdba

ERROR (error)

ORA-01017: invalid username/password; logon

Denied (invalid username / password, login denied)

Warning: You are on longer connected to

ORACLE (warning: you have been disconnected from ORACLE)

64. Why can't I connect to TestDb as SYSDBA?

Answer: usually the SYS password in Oracle is synchronized with the INTERNAL password, and the SYS password is stored in the password file. In the above case, you create a password file that contains a password instead of using the default "change_on_install," which is the problem.

I hope the following methods will be helpful to you. First, create a password file that contains a password that does not match the system password:

$orapwd file=orapw password=foobar

Entries=40

Then, go to the server and start the database:

$svrmgr

SVRMGR > connect internal

Connected. (connected)

SVRMGR > startup

ORACLE instance started. (ORACLE instance started)

Total System Global Area (system global zone size)

193073136 bytes

Fixed Size (fixed size)

69616 bytes

Variable Size (variable size)

141639680 bytes

Database Buffers (database buffer)

45056000 bytes

Redo Buffers (redo buffer)

6307840 bytes

Database mounted. (database loaded)

Database opened. The database is open.

Now connect as SYS using the password of the SYS user:

SVRMGR > connect sys/change_on_install@ora81

Connected. (connected)

Succeed. Now try to connect as SYSDBA:

SVRMGR > connect sys/change_on_install@ora81

As sysdba

ORA-01017: invalid username/password; logon

Denied (invalid username / password; login denied)

There is what you call a mistake. Your SYS password is change_on_install, but the password in the password file is foobar. SYS users are dedicated. Connecting as SYSDBA is like connecting with INTERNAL. You must use the password in the password file. Try this:

SVRMGR- connect sys/foobar@ora81 as sysdba

Connected. (connected)

Not everyone needs to use the password in the password file; users need to use their own password. You can understand this by authorizing SYSDBA to SCOTT:

SVRMGR > grant sysdba to scott

Statement processed. (processed)

This command adds SCOTT to the password file with the credentials of SCOTT. If you change the SCOTT password, the password file will automatically change synchronously. Now, you can try to connect to SCOTT as SYSDBA:

SVRMGR > connect scott/tiger@ora81 as sysdba

Connected. (connected)

Everything's fine. You can now use the ALTER USER command to change the password of the SYS user.

SVRMGR > alter user sys identified by

Change_on_install

Statement processed. (changed successfully)

SVRMGR≫ connect sys/change_on_install@ora81

As sysdba

Connected. (connected)

You can also use change_on_install, because changing the SYS password will also change the password in the password file. When you create the password file, the Oracle database puts two accounts in it: SYS and INTERNAL, and uses the password you provided on the command line as the password for both accounts. When you change the SYS password in the database, the database will flush out the SYS and INTERNAL passwords in the password file. The following action shows that the password foobar is no longer valid:

SVRMGR > connect sys/foobar@ora81 as sysdba

ORA-01017: invalid username/password; logon

Denied (invalid username / password, login denied)

65. Use QUERY option to output data.

I know that in Oracle8i, you can use QUERY to selectively output table data. I tried to do it with the EXP command, but it didn't work. Here are the commands I wrote and the error messages I got:

Exp ddd/ddd file=/dbf/u11/customer.dmp

Tables=AASC.AST_CUSTOMER_KEEP

Query=\ 'where CUA_TRANS_DTS\

< add_months\(sysdate, -6\)\' table_export[2]: CUA_TRANS_DTS: not found.(没有找到) 答:操作系统不同,用来指定QUERY=参数的方法也不同。WHERE 语句里面往往有很多特殊的字符,如=.>

.exp userid=tkyte/tkyte tables=t

Query= "" where object_id

< 5000""" 注意:在windows中,需要在WHERE语句的两端使用三个双引号。在UNIX中,必须这样做: $ exp userid=/ tables=t query=\"where object_id \< 5000\" exp userid=/ tables=t parfile=exp.par 如果使用包含query="where object_id < 5000"的PARFILE文件,我可以在两个系统中使用相同的一个命令: exp userid=/ tables=t parfile=exp.par 在两种操作系统中,完全相同。这相对于在不同的平台中使用不同的QUERY字符串容易多了。 66、DBMS_RANDOM。 您能否告诉我写一个能产生大于0小于1的随机数的随机数产生器的最好方法? 答:Oracle8 8.0版介绍了DBMS_RANDOM包,Oracle8i 8.1.6版介绍了DBMS_RANDOM包的新功能,但Oracle8i 文档中没有详细全面介绍其功能。幸运的是:有一个新的DBMS_RANDOM包函数能够返回0-1之间的随机数。这个新函数是: FUNCTION value RETURN NUMBER; FUNCTION value (low IN NUMBER, high IN NUMBER) RETURN NUMBER; FUNCTION normal RETURN NUMBER; FUNCTION string (opt char, len NUMBER) RETURN VARCHAR2; VALUE函数的第一种形式返回一个大于或等于0且小于1的随机数;第二种形式返回一个大于或等于LOW,小于HIGH的随机数。下面是其用法的一个示例: SQL>

Select dbms_random.value

Dbms_random.value (55100)

2 from dual

VALUE DBMS_RANDOM.VALUE (55100)

. 782821936 79.6367038

The NORMAL function returns an array of numbers that obey a normal distribution. The standard deviation of this normal distribution is 1 and the expected value is 0. 68% of the values returned by this function are between-1 and + 1, 95% between-2 and + 2, and 99% between-3 and + 3. In fact, this is what you see in listing 1.

Finally, there is the STRING function. It returns a random string up to 60 characters in length. The parameter OPT can be any single character of the values shown in listing 2.

Files about these functions and the DBMS_RANDOM package are included in SQLPlus:

Select text

From all_source

Where name = 'DBMS_RANDOM' and type =' PACKAGE' order by line

67. Connection order and predicate evaluation.

Which part of the WHERE statement executes first in the following query?

Select field names from emp, dept

Where emp.dept_num = dept.num and

Emp.name Like's% 'and dept.name='IT'

Answer: the order of execution varies with existing index, statistics, and session/init.ora parameters.

Assume that you already have an index built on DEPT (name) and EMP (dept_num). Assuming that the optimizer believes that DEPT is unique, it may operate in the following order:

Use the index built on DEPT (name) to find dept columns

Use the index built on EMP (dept_num) to find matching emp columns (that is, connect emp.dept_num = dept.num)

Filter based on emp.ename like'S%'

Now, let's assume that there are no indexes on EMP (dept_num), no indexes on DEPT (name), but indexes on EMP (name) and DEPT (num). The optimizer may operate in the following order:

Find the EMPS with S using the index built on EMP (name)

Use the index built on DEPT (num) to find a match

Filter results based on dept.name = 'IT'

The order in which predicates are evaluated is uncertain, can change over time, and is determined by the optimizer. Don't assume that anything will happen in a certain order. If you do that, your application may make some very strange-looking errors over time. Look at the following example: create a table and enter some data. The data "Y" in the second column is a numeric value in the case of Xcoded rooma', and "Y" is not a number in the case of Xroomroomb'.

SQL > create table t (x varchar2 (1), y varchar2 (1))

Table created.

SQL > insert into t values ('averse,' 1')

1 row created.

SQL > insert into t values ('baked,' x')

1 row created.

Now run a query against this table: find the row that satisfies xexamples.

SQL > select * from t where x ='a 'and

Y = 1

ERROR:

ORA-01722: invalid number

No rows selected (error, invalid number, no row selected)

Yo, it didn't work. In this case, the database first executes Yroom1, and when it finds the row of'X', it is clear that it cannot convert'X'to a number, so it fails. The following program will give different results:

SQL > analyze table t compute statistics

Table analyzed. (the table has been analyzed)

SQL > select * from t where x ='a 'and

Y = 1

X Y

--

A 1

Using different optimizer modes, it worked! Why? The optimizer said, "Hey, it's faster to check x ='a 'than to check for yroom1, because there is a conversion in yroom1 that changes y from characters to numbers. So, I check x =' a1 first, and then I check yroom1."

This example shows that the order in which predicates are executed may be uncertain, and you cannot expect to have a specific order of execution. In other words, you have to be very careful when you rely on an implicit transformation.

Display SGA--fixed size (fixed size) and variable size (variable size).

What do fixed size and variable size mean when running "show SGA" at the svrmgr prompt?

A: fixed size is the size of the fixed component in SGA, which is fixed in the oracle database itself when it is compiled. It is a fixed size of memory used to point to other parts of the SGA. The size of this part of the SGA cannot be changed.

Variable size means that the allocated memory blocks are of variable size. The variable blocks of SGA are divided into shared pools, large pools, JAVA pools, cursor areas, and other structures.

The above is a sample analysis of troubleshooting problems with database principles. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report